Rollup merge of #80538 - JulianKnodt:err_usize, r=lcnr

Add check for `[T;N]`/`usize` mismatch in astconv

Helps clarify the issue in #80506
by adding a specific check for mismatches between [T;N] and usize.

r? `@lcnr`
This commit is contained in:
Yuki Okushi 2021-01-05 09:52:37 +09:00 committed by GitHub
commit be2a3f8642
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 95 additions and 41 deletions

View file

@ -290,6 +290,14 @@ impl GenericArg<'_> {
GenericArg::Const(_) => "const",
}
}
pub fn to_ord(&self, feats: &rustc_feature::Features) -> ast::ParamKindOrd {
match self {
GenericArg::Lifetime(_) => ast::ParamKindOrd::Lifetime,
GenericArg::Type(_) => ast::ParamKindOrd::Type,
GenericArg::Const(_) => ast::ParamKindOrd::Const { unordered: feats.const_generics },
}
}
}
#[derive(Debug, HashStable_Generic)]