[missing_const_for_fn]: fix FP when arg ty is impl trait alias ty#13045
[missing_const_for_fn]: fix FP when arg ty is impl trait alias ty#13045bors merged 1 commit intorust-lang:masterfrom
missing_const_for_fn]: fix FP when arg ty is impl trait alias ty#13045Conversation
| inputs.iter().any(|input| { | ||
| // NB: Other alias ty kind might missing default. | ||
| // For example, an associate type alias declared as `type T: Fn();` | ||
| // would cause ICE when `type_of` is called with it. |
There was a problem hiding this comment.
I'm not sure what this comment means, I've tested if changing test's Foo to that piece of code caused an ICE (that would be quite the blocker) and it doesn't cause one.
There was a problem hiding this comment.
Oh, what I meant was:
When matching the input.kind() on the next line, if the alias ty is something else, i.e. AliasTyKind::Projection would cause ICE in that scenario. You can verify it by changing the ty::AliasTyKind::Weak to _ as well.
(It seems that it only happens with AliasTyKind::Projection atm, but I wasn't too sure, so I put the comment there trying to give a head's up for others)
I'll make some adjustments on this, along with the test case~
blyxyas
left a comment
There was a problem hiding this comment.
Just a question, and this should be ready! Thanks for the contribution.
70c8010 to
1bc298a
Compare
1bc298a to
08992d0
Compare
|
@bors r+ |
|
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
closes: #13009
changelog: [
missing_const_for_fn]: fix FP when arg ty is impl trait alias ty