Do not ICE on trait aliases with missing obligations#66392
Do not ICE on trait aliases with missing obligations#66392bors merged 3 commits intorust-lang:masterfrom
Conversation
|
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
src/librustc_typeck/astconv.rs
Outdated
There was a problem hiding this comment.
I don't think this is the correct fix - the caller shouldn't pass in a bad TraitRef in the first place.
There was a problem hiding this comment.
@eddyb Isn't this a reasonable as a way to paper over the issue while the underlying cause is being researched?
There was a problem hiding this comment.
Oh I thought this code was in librustc.
Looking closer at the code, I don't think trait_ref_to_existential should exist as a method.
It should be a closure defined just before its two callsites, and it could refer to the dummy_self variable in scope directly.
Also, this definitely needs a FIXME. The overall bug appears to be a missing filter on top of expand_trait_aliases, which picks up non-supertraits where clauses - but also, the object safety completely ignores trait aliases, which could be object safety hazards.
So trait aliases aren't fully implemented yet, I'm guessing?
There was a problem hiding this comment.
cc @alexreg
If you want to paper over something, please file a new issue for that FIXME and label it with F-trait_alias so we won't miss it.
There was a problem hiding this comment.
Created #66420 and added FIXME to the code.
There was a problem hiding this comment.
Yeah, this seems like a reasonable temporary fix, but ideally we want something proper in the medium term.
|
The feature requires nightly so I don't know why it was beta/stable-nominated. |
|
@Centril the feature requires nightly, but you can trigger the ice even if the feature is disabled. |
|
Ah! I see; my bad :) |
|
The fix seems reasonable as a temporary crutch. I'm not sure we need to backport it, but it's also not harmful to do so. |
3f25273 to
b3aa427
Compare
This comment has been minimized.
This comment has been minimized.
review comment
b3aa427 to
0ff7353
Compare
|
@bors r+ |
|
📌 Commit 0ff7353 has been approved by |
|
⌛ Testing commit 0ff7353 with merge 4df6cb564e881c51abafdd610c1b4e5269ad8780... |
This comment has been minimized.
This comment has been minimized.
|
💔 Test failed - checks-azure |
|
@bors retry |
Do not ICE on trait aliases with missing obligations Fix #65673.
|
☀️ Test successful - checks-azure |
|
beta-accepted (last week, sorry for delay!) |
[beta] backports This pull request backports the following pull requests, which have all been beta-accepted by the compiler team. * Handle non_exhaustive in borrow checking #66722 * Do not ICE on trait aliases with missing obligations #66392 * Do not ICE in `if` without `else` in `async fn` #66391 * Fix ICE when trying to suggest `Type<>` instead of `Type()` #66390 * Do not ICE on recovery from unmet associated type bound obligation #66388 * find_deprecation: deprecation attr may be ill-formed meta. #66381 * parser: don't use `unreachable!()` in `fn unexpected`. #66361 * Undo an assert causing an ICE until we fix the underlying problem #66250 * Do not ICE with a precision flag in formatting str and no format arguments #66093 * Fix two OOM issues related to `ConstProp` #66394
[beta] backports This pull request backports the following pull requests, which have all been beta-accepted by the compiler team. * Handle non_exhaustive in borrow checking #66722 * Do not ICE on trait aliases with missing obligations #66392 * Do not ICE in `if` without `else` in `async fn` #66391 * Fix ICE when trying to suggest `Type<>` instead of `Type()` #66390 * Do not ICE on recovery from unmet associated type bound obligation #66388 * find_deprecation: deprecation attr may be ill-formed meta. #66381 * parser: don't use `unreachable!()` in `fn unexpected`. #66361 * Undo an assert causing an ICE until we fix the underlying problem #66250 * Do not ICE with a precision flag in formatting str and no format arguments #66093 * Fix two OOM issues related to `ConstProp` #66394
Fix #65673.