-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICE when referencing ill-formed associated type in ItemCtxts (self type impls trait but own bounds don't hold) #138970
Comments
Being allowed to omit certain associated items in the trait impl is a new feature not a bug, see #135480. |
cc @oli-obk |
Seems like it only ICEs in ItemCtxts (as opposed to FnCtxts). Put it in a fn body, you rightfully get an error for |
Even more concerningly, we need to be able to treat these projections as rigid (at least) in environments where their w.c. are trivial:
|
I'll see if I can tweak projection to handle these (rightfully) missing items correctly 🤔 |
Oh, cool! |
Rigidly project missing item due to guaranteed impossible sized predicate This is a somewhat involved change, but it amounts to treating missing impl items due to guaranteed impossible where clauses (dyn/str/slice sized, cc rust-lang#135480) as *rigid projections* rather than projecting to an error term, since that was preventing either reporting a proper error (in an empty param env) *or* successfully type checking the code (in the presence of trivially false where clauses). Fixes rust-lang#138970 r? `@lcnr` `@oli-obk`
…r=<try> Rigidly project missing item due to guaranteed impossible sized predicate This is a somewhat involved change, but it amounts to treating missing impl items due to guaranteed impossible where clauses (dyn/str/slice sized, cc rust-lang#135480) as *rigid projections* rather than projecting to an error term, since that was preventing either reporting a proper error (in an empty param env) *or* successfully type checking the code (in the presence of trivially false where clauses). Fixes rust-lang#138970 r? `@lcnr` `@oli-obk`
Associated items with unsatisfied bounds can be left unimplemented. This works with types and functions. It will only ice if the implementation is used, and will otherwise compile without errors. This only affects nightly,
as stable and beta both correctly complain about the unimplemented items.Code
Playground.
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: