-
Notifications
You must be signed in to change notification settings - Fork 14k
Remove context dependant ! fallback
#148871
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
base: main
Are you sure you want to change the base?
Changes from 8 commits
55621a1
a75c857
7735e5a
a137c21
60ade21
9bf596b
a7b102a
6b36e86
31281eb
39ac890
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,8 @@ | ||
| //@ revisions: nofallback fallback | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. want to rename the revisions to "unit_fallback never_fallback"?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In a follow up |
||
| //@[fallback] edition: 2024 | ||
| //@[fallback] check-pass | ||
|
|
||
| #![feature(never_type)] | ||
| #![cfg_attr(fallback, feature(never_type_fallback))] | ||
| #![allow(unreachable_code)] | ||
|
|
||
| use std::error::Error; | ||
| use std::mem; | ||
|
|
||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| error[E0277]: the trait bound `!: UnitReturn` is not satisfied | ||
| --> $DIR/diverging-fallback-unconstrained-return.rs:37:23 | ||
| | | ||
| LL | let _ = if true { unconstrained_return() } else { panic!() }; | ||
| | ^^^^^^^^^^^^^^^^^^^^^^ the trait `UnitReturn` is not implemented for `!` | ||
| | | ||
| help: the following other types implement trait `UnitReturn` | ||
| --> $DIR/diverging-fallback-unconstrained-return.rs:15:1 | ||
| | | ||
| LL | impl UnitReturn for i32 {} | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^ `i32` | ||
| LL | impl UnitReturn for () {} | ||
| | ^^^^^^^^^^^^^^^^^^^^^^ `()` | ||
| = note: this error might have been caused by changes to Rust's type-inference algorithm (see issue #48950 <https://github.com/rust-lang/rust/issues/48950> for more information) | ||
| = help: you might have intended to use the type `()` here instead | ||
| note: required by a bound in `unconstrained_return` | ||
| --> $DIR/diverging-fallback-unconstrained-return.rs:18:28 | ||
| | | ||
| LL | fn unconstrained_return<T: UnitReturn>() -> T { | ||
| | ^^^^^^^^^^ required by this bound in `unconstrained_return` | ||
|
|
||
| error: aborting due to 1 previous error | ||
|
|
||
| For more information about this error, try `rustc --explain E0277`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate on that FIXME? it feels unactionable for anyone who isn't you right now... or maybe just do that if you can xd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I opened #148922 and linked it from here. I tried my best to write a good explanation, but it's just confusing :(