Files
rust/tests/ui/nll/user-annotations/dump-adt-brace-struct.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
506 B
Rust
Raw Normal View History

2018-08-09 11:56:53 -04:00
// Unit test for the "user substitutions" that are annotated on each
// node.
2023-12-19 12:39:58 -05:00
//@ compile-flags:-Zverbose-internals
2018-08-09 11:56:53 -04:00
#![allow(warnings)]
#![feature(rustc_attrs)]
2024-03-12 15:53:35 +00:00
struct SomeStruct<T> {
t: T,
}
2018-08-09 11:56:53 -04:00
#[rustc_dump_user_args]
2018-08-09 11:56:53 -04:00
fn main() {
SomeStruct { t: 22 }; // Nothing given, no annotation.
SomeStruct::<_> { t: 22 }; // Nothing interesting given, no annotation.
SomeStruct::<u32> { t: 22 }; // No lifetime bounds given.
2024-03-12 15:53:35 +00:00
SomeStruct::<&'static u32> { t: &22 }; //~ ERROR [&'static u32]
2018-08-09 11:56:53 -04:00
}