]> git.proxmox.com Git - rustc.git/blame - src/test/ui/consts/uninhabited-const-issue-61744.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / consts / uninhabited-const-issue-61744.rs
CommitLineData
dc9dc135
XL
1// compile-fail
2
3pub const unsafe fn fake_type<T>() -> T {
60c5eb7d 4 hint_unreachable()
dc9dc135
XL
5}
6
7pub const unsafe fn hint_unreachable() -> ! {
60c5eb7d 8 fake_type() //~ ERROR cycle detected when const-evaluating `hint_unreachable` [E0391]
dc9dc135
XL
9}
10
11trait Const {
12 const CONSTANT: i32 = unsafe { fake_type() };
13}
14
15impl <T> Const for T {}
16
17pub fn main() -> () {
60c5eb7d 18 dbg!(i32::CONSTANT);
dc9dc135 19}