1
Fork 0

Do not allow #[rustc_legacy_const_generics] on methods

It caused an ICE since `item` was `None`.
This commit is contained in:
Chayim Refael Friedman 2022-03-07 16:31:03 +00:00 committed by GitHub
parent 38a0b81b1c
commit 96515f421a
3 changed files with 17 additions and 4 deletions

View file

@ -1372,7 +1372,7 @@ impl CheckAttrVisitor<'_> {
target: Target,
item: Option<ItemLike<'_>>,
) -> bool {
let is_function = matches!(target, Target::Fn | Target::Method(..));
let is_function = matches!(target, Target::Fn);
if !is_function {
self.tcx
.sess