2021-09-26 12:21:44 -07:00
|
|
|
//@ edition:2018
|
2024-02-22 14:59:52 +01:00
|
|
|
//
|
2021-09-26 12:21:44 -07:00
|
|
|
// This is a regression test for #83564.
|
|
|
|
// For some reason, Rust 2018 or higher is required to reproduce the bug.
|
2024-06-12 23:51:31 +00:00
|
|
|
//@ run-rustfix
|
|
|
|
//@ revisions: no_std std
|
|
|
|
//@ [no_std]compile-flags: --cfg=no_std -C panic=abort
|
|
|
|
#![cfg_attr(no_std, no_std)]
|
2021-09-26 12:21:44 -07:00
|
|
|
|
|
|
|
fn main() {
|
2024-06-12 23:51:31 +00:00
|
|
|
//~^ HELP consider importing this struct
|
2024-02-22 14:59:52 +01:00
|
|
|
let _x = NonZero::new(5u32).unwrap();
|
|
|
|
//~^ ERROR failed to resolve: use of undeclared type `NonZero`
|
2021-09-26 12:21:44 -07:00
|
|
|
}
|
2024-06-12 23:51:31 +00:00
|
|
|
|
|
|
|
#[allow(dead_code)]
|
|
|
|
#[cfg_attr(no_std, panic_handler)]
|
|
|
|
fn panic(_info: &core::panic::PanicInfo) -> ! {
|
|
|
|
loop {}
|
|
|
|
}
|