mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
A cycle error on a diverging function is now a const stack overflow again
This commit is contained in:
parent
2e66f85111
commit
7d5f36a1e5
@ -5,15 +5,15 @@ pub const unsafe fn fake_type<T>() -> T {
|
||||
}
|
||||
|
||||
pub const unsafe fn hint_unreachable() -> ! {
|
||||
fake_type() //~ ERROR cycle detected when const-evaluating `hint_unreachable` [E0391]
|
||||
fake_type() //~ ERROR evaluation of constant value failed
|
||||
}
|
||||
|
||||
trait Const {
|
||||
const CONSTANT: i32 = unsafe { fake_type() };
|
||||
const CONSTANT: i32 = unsafe { fake_type() }; //~ ERROR any use of this value will cause an err
|
||||
}
|
||||
|
||||
impl <T> Const for T {}
|
||||
impl<T> Const for T {}
|
||||
|
||||
pub fn main() -> () {
|
||||
dbg!(i32::CONSTANT);
|
||||
dbg!(i32::CONSTANT); //~ ERROR erroneous constant used
|
||||
}
|
||||
|
@ -1,21 +1,96 @@
|
||||
error[E0391]: cycle detected when const-evaluating `hint_unreachable`
|
||||
error[E0080]: evaluation of constant value failed
|
||||
--> $DIR/uninhabited-const-issue-61744.rs:8:5
|
||||
|
|
||||
LL | hint_unreachable()
|
||||
| ------------------
|
||||
| |
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
| inside call to `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
...
|
||||
LL | fake_type()
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
note: ...which requires const-evaluating `fake_type`...
|
||||
--> $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
|
|
||||
LL | hint_unreachable()
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
= note: ...which again requires const-evaluating `hint_unreachable`, completing the cycle
|
||||
note: cycle used when const-evaluating `fake_type`
|
||||
--> $DIR/uninhabited-const-issue-61744.rs:4:5
|
||||
|
|
||||
LL | hint_unreachable()
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
| |
|
||||
| reached the configured maximum number of stack frames
|
||||
| inside call to `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:8:5
|
||||
|
||||
error: aborting due to previous error
|
||||
error: any use of this value will cause an error
|
||||
--> $DIR/uninhabited-const-issue-61744.rs:12:36
|
||||
|
|
||||
LL | const CONSTANT: i32 = unsafe { fake_type() };
|
||||
| -------------------------------^^^^^^^^^^^---
|
||||
| |
|
||||
| referenced constant has errors
|
||||
|
|
||||
= note: `#[deny(const_err)]` on by default
|
||||
|
||||
For more information about this error, try `rustc --explain E0391`.
|
||||
error[E0080]: erroneous constant used
|
||||
--> $DIR/uninhabited-const-issue-61744.rs:18:10
|
||||
|
|
||||
LL | dbg!(i32::CONSTANT);
|
||||
| ^^^^^^^^^^^^^ referenced constant has errors
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0080`.
|
||||
|
Loading…
Reference in New Issue
Block a user