]> git.lizzy.rs Git - rust.git/blob - tests/ui/traits/dyn-trait.rs
Rollup merge of #105795 - nicholasbishop:bishop-stabilize-efiapi, r=joshtriplett
[rust.git] / tests / ui / traits / dyn-trait.rs
1 // run-pass
2 // ignore-pretty `dyn ::foo` parses differently in the current edition
3
4 use std::fmt::Display;
5
6 static BYTE: u8 = 33;
7
8 fn main() {
9     let x: &(dyn 'static + Display) = &BYTE;
10     let y: Box<dyn Display + 'static> = Box::new(BYTE);
11     let _: &dyn (Display) = &BYTE;
12     let _: &dyn (::std::fmt::Display) = &BYTE;
13     let xstr = format!("{}", x);
14     let ystr = format!("{}", y);
15     assert_eq!(xstr, "33");
16     assert_eq!(ystr, "33");
17 }