1
Fork 0

Rollup merge of #94686 - ChayimFriedman2:issue-94629, r=jackh726

Do not allow `#[rustc_legacy_const_generics]` on methods

It caused an ICE since `item` was `None`.

Fixes #94629.
This commit is contained in:
Dylan DPC 2022-03-09 06:38:51 +01:00 committed by GitHub
commit 3ce01f71ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 4 deletions

View file

@ -1345,7 +1345,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