-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
diverging function with wrapped diverging tail expression regression #35849
Comments
I assume this is related to the recent changes to how we treat /cc @rust-lang/compiler |
@canndrew Did you remove some sort of codepath that assumed a call with diverging arguments is also diverging? |
Nothing to do with fn _assert_pointers_are_64bits() -> ! {
[panic!()]
}
fn main() {}
|
Ah well. The issue here is that now, because The older check was liveness's more general check that diverging functions don't return (see e.g. #31617), which observes that As a fix, we can pass |
Note that adding a semicolon to the expression also makes things compile on all versions (as it goes straight to the liveness check at https://github.com/rust-lang/rust/blob/4901896/src/librustc/middle/liveness.rs#L1503), even if the function returns something other than fn _assert_pointers_are_64bits() -> String {
[panic!()];
} Maybe we should just let this one slip? |
Using |
Talked to @eddyb on IRC, I will try to fix this (he told me exactly what to write so hopefully it will be straightforward :D). |
This fixes rust-lang#35849, a regression introduced by the typeck refactoring around TyNever/!.
typeck: use NoExpectation to check return type of diverging fn Fixes rust-lang#35849. Thanks @eddyb.
This fixes rust-lang#35849, a regression introduced by the typeck refactoring around TyNever/!.
typeck: use NoExpectation to check return type of diverging fn Fixes rust-lang#35849. Thanks @eddyb.
typeck: use NoExpectation to check return type of diverging fn Fixes rust-lang#35849. Thanks @eddyb.
This fixes rust-lang#35849, a regression introduced by the typeck refactoring around TyNever/!.
This fixes rust-lang#35849, a regression introduced by the typeck refactoring around TyNever/!.
This was added to cover up a lazy extra semicolon in rust-lang#35849, but does not actually make sense. This is removed as a part of the stabilization of `never_type`.
[needs crater] make coercions to `!` in unreachable code a hard error This was added to cover up a lazy extra semicolon in #35849, but does not actually make sense. This is removed as a part of the stabilization of `never_type`.
This was added to cover up a lazy extra semicolon in rust-lang#35849, but does not actually make sense. This is removed as a part of the stabilization of `never_type`.
make coercions to `!` in unreachable code a hard error This was added to cover up a lazy extra semicolon in rust-lang#35849, but does not actually make sense. This is removed as a part of the stabilization of `never_type`.
This was added to cover up a lazy extra semicolon in rust-lang#35849, but does not actually make sense. This is removed as a part of the stabilization of `never_type`.
make coercions to `!` in unreachable code a hard error This was added to cover up a lazy extra semicolon in rust-lang#35849, but does not actually make sense. This is removed as a part of the stabilization of `never_type`.
make coercions to `!` in unreachable code a hard error This was added to cover up a lazy extra semicolon in rust-lang#35849, but does not actually make sense. This is removed as a part of the stabilization of `never_type`.
make coercions to `!` in unreachable code a hard error This was added to cover up a lazy extra semicolon in rust-lang#35849, but does not actually make sense. This is removed as a part of the stabilization of `never_type`.
make coercions to `!` in unreachable code a hard error This was added to cover up a lazy extra semicolon in rust-lang#35849, but does not actually make sense. This is removed as a part of the stabilization of `never_type`.
Such code:
compiled just fine with stable(1.11.0 (9b21dcd 2016-08-15)),
but failed with beta(rustc 1.12.0-beta.1 (822166b 2016-08-16)) and
nightly(rustc 1.13.0-nightly (499484f 2016-08-18)) with such error:
The text was updated successfully, but these errors were encountered: