2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2018-02-24 18:02:33 -08:00
|
|
|
|
2017-10-10 17:33:19 +03:00
|
|
|
use std::fmt::Display;
|
|
|
|
|
|
|
|
static BYTE: u8 = 33;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x: &(dyn 'static + Display) = &BYTE;
|
|
|
|
let y: Box<dyn Display + 'static> = Box::new(BYTE);
|
2018-02-23 12:45:10 -08:00
|
|
|
let _: &dyn (Display) = &BYTE;
|
|
|
|
let _: &dyn (::std::fmt::Display) = &BYTE;
|
2017-10-10 17:33:19 +03:00
|
|
|
let xstr = format!("{}", x);
|
|
|
|
let ystr = format!("{}", y);
|
|
|
|
assert_eq!(xstr, "33");
|
|
|
|
assert_eq!(ystr, "33");
|
|
|
|
}
|