about summary refs log tree commit diff
path: root/tests/ui/suggestions/core-std-import-order-issue-83564.rs
blob: 4cfc9a6bf74251ea67acae12b30bab02056ddb1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//@ edition:2018
//
// This is a regression test for #83564.
// For some reason, Rust 2018 or higher is required to reproduce the bug.
//@ run-rustfix
//@ revisions: no_std std
//@ [no_std]compile-flags: -C panic=abort
#![cfg_attr(no_std, no_std)]

fn main() {
    //~^ HELP consider importing this struct
    let _x = NonZero::new(5u32).unwrap();
    //~^ ERROR failed to resolve: use of undeclared type `NonZero`
}

#[allow(dead_code)]
#[cfg_attr(no_std, panic_handler)]
fn panic(_info: &core::panic::PanicInfo) -> ! {
    loop {}
}