Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Feb 23, 2018
1 parent bdccbcf commit 4c73f82
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/test/compile-fail/dyn-trait-compatibility.rs
Expand Up @@ -20,10 +20,5 @@ type A3 = dyn<<dyn as dyn>::dyn>;
//~^ ERROR cannot find type `dyn` in this scope
//~| ERROR cannot find type `dyn` in this scope
//~| ERROR Use of undeclared type or module `dyn`
type A4 = dyn(dyn, dyn) -> dyn;
//~^ ERROR cannot find type `dyn` in this scope
//~| ERROR cannot find type `dyn` in this scope
//~| ERROR cannot find type `dyn` in this scope
//~| ERROR cannot find type `dyn` in this scope

fn main() {}
2 changes: 2 additions & 0 deletions src/test/run-pass/dyn-trait.rs
Expand Up @@ -17,6 +17,8 @@ static BYTE: u8 = 33;
fn main() {
let x: &(dyn 'static + Display) = &BYTE;
let y: Box<dyn Display + 'static> = Box::new(BYTE);
let _: &dyn (Display) = &BYTE;
let _: &dyn (::std::fmt::Display) = &BYTE;
let xstr = format!("{}", x);
let ystr = format!("{}", y);
assert_eq!(xstr, "33");
Expand Down

0 comments on commit 4c73f82

Please sign in to comment.