-
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
ICE: Unexpected type for constructor
#119493
Comments
Bisected to #117611 cc @Nadrieril |
You always find the best edge-cases :D |
Reduced to: fn foo() {
#[derive(Copy, Clone)]
struct Foo(NonExistent);
type U = impl Copy;
let foo: U = Foo(());
let Foo(()) = foo;
} What happens is that when we get to checking exhaustiveness of the Another angle is that without the TAIT, exhaustiveness is simply not run on the |
https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/visit/trait.TypeVisitableExt.html#method.references_error can be invoked on any TypeVisitable (so |
Welcome back oli! Hm now that you say it, I expect rust-analyzer will have similar situations; adding a bit of error-handling feels reasonable. |
Rollup merge of rust-lang#119715 - Nadrieril:graceful-type-error, r=compiler-errors Exhaustiveness: abort on type error This adds an error path to exhaustiveness checking so that we abort instead of ICEing when encountering a stray `ty::Error`. Fixes rust-lang#119493 Fixes rust-lang#119778 r? `@compiler-errors`
…rrors Exhaustiveness: abort on type error This adds an error path to exhaustiveness checking so that we abort instead of ICEing when encountering a stray `ty::Error`. Fixes rust-lang/rust#119493 Fixes rust-lang/rust#119778 r? `@compiler-errors`
auto-reduced (treereduce-rust):
original code
original:
Version information
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc
Program output
The text was updated successfully, but these errors were encountered: