-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
only suppress coercion error if type is definitely unsized #112215
Conversation
r? @cjgillot (rustbot has picked a reviewer for you, use r? to override) |
is it worth beta-nominating this? |
@matthiaskrgr: i don't know how wide-spread it is, tbh. you kinda have to write weird code to get it to trigger ( |
I agree. This can only happen because of trivially false bounds that users are unlikely to write. The only reports are those from your fuzzing. |
…, r=cjgillot only suppress coercion error if type is definitely unsized we previously suppressed coercion errors when the return type was `dyn Trait` because we expect a far more descriptive `Sized` trait error to be emitted instead, however the code that does this suppression does not consider where-clause predicates since it just looked at the HIR. let's do that instead by creating an obligation and checking if it may hold. fixes rust-lang#110683 fixes rust-lang#112208
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#111659 (suggest `Option::as_deref(_mut)` on type mismatch in option combinator if it passes typeck) - rust-lang#111702 (Option::map_or_else: Show an example of integrating with Result) - rust-lang#111878 (Fix codegen test suite for bare-metal-like targets) - rust-lang#111969 (bootstrap: Make `clean` respect `dry-run`) - rust-lang#111998 (Add other workspaces to `linkedProjects` in rust_analyzer_settings) - rust-lang#112215 (only suppress coercion error if type is definitely unsized) - rust-lang#112231 (Make sure the build.rustc version is either the same or 1 apart (revised)) r? `@ghost` `@rustbot` modify labels: rollup
we previously suppressed coercion errors when the return type was
dyn Trait
because we expect a far more descriptiveSized
trait error to be emitted instead, however the code that does this suppression does not consider where-clause predicates since it just looked at the HIR. let's do that instead by creating an obligation and checking if it may hold.fixes #110683
fixes #112208