diff options
| author | Boxy <supbscripter@gmail.com> | 2023-05-05 21:31:00 +0100 |
|---|---|---|
| committer | Boxy <supbscripter@gmail.com> | 2023-05-05 21:31:35 +0100 |
| commit | 442617c0468018aa88bcee8a8b12da8525352708 (patch) | |
| tree | f1d0ef1c03a1fd3b502378f796d91c11382e078e /compiler/rustc_resolve/src/ident.rs | |
| parent | 4a18324a4df6bc98bec0b54d35908d7a9cdc7c32 (diff) | |
| download | rust-442617c0468018aa88bcee8a8b12da8525352708.tar.gz rust-442617c0468018aa88bcee8a8b12da8525352708.zip | |
misc nameres changes for anon consts
Diffstat (limited to 'compiler/rustc_resolve/src/ident.rs')
| -rw-r--r-- | compiler/rustc_resolve/src/ident.rs | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/compiler/rustc_resolve/src/ident.rs b/compiler/rustc_resolve/src/ident.rs index 2db1d83d4fd..4e1d49c12a7 100644 --- a/compiler/rustc_resolve/src/ident.rs +++ b/compiler/rustc_resolve/src/ident.rs @@ -1188,11 +1188,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { } RibKind::ConstantItem(trivial, _) => { - let features = self.tcx.sess.features_untracked(); - // HACK(min_const_generics): We currently only allow `N` or `{ N }`. - if !(trivial == ConstantHasGenerics::Yes - || features.generic_const_exprs) - { + if let ConstantHasGenerics::No(cause) = trivial { // HACK(min_const_generics): If we encounter `Self` in an anonymous // constant we can't easily tell if it's generic at this stage, so // we instead remember this and then enforce the self type to be @@ -1264,11 +1260,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { | RibKind::ForwardGenericParamBan => continue, RibKind::ConstantItem(trivial, _) => { - let features = self.tcx.sess.features_untracked(); - // HACK(min_const_generics): We currently only allow `N` or `{ N }`. - if !(trivial == ConstantHasGenerics::Yes - || features.generic_const_exprs) - { + if let ConstantHasGenerics::No(cause) = trivial { if let Some(span) = finalize { self.report_error( span, |
