]> git.proxmox.com Git - rustc.git/blame - src/test/ui/consts/underscore_const_names.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / consts / underscore_const_names.rs
CommitLineData
416331ca 1// build-pass (FIXME(62277): could be check-pass?)
0bf4aa26 2
dc9dc135 3#![deny(unused)]
0bf4aa26
XL
4
5trait Trt {}
dc9dc135 6pub struct Str {}
0bf4aa26
XL
7impl Trt for Str {}
8
9macro_rules! check_impl {
10 ($struct:ident,$trait:ident) => {
11 const _ : () = {
12 use std::marker::PhantomData;
13 struct ImplementsTrait<T: $trait>(PhantomData<T>);
14 let _ = ImplementsTrait::<$struct>(PhantomData);
15 ()
16 };
17 }
18}
19
0bf4aa26
XL
20const _ : () = ();
21
22const _ : i32 = 42;
23const _ : Str = Str{};
24
25check_impl!(Str, Trt);
26check_impl!(Str, Trt);
27
28fn main() {
29 check_impl!(Str, Trt);
30 check_impl!(Str, Trt);
31}