diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2018-02-23 12:45:10 -0800 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2018-02-23 13:30:26 -0800 |
| commit | 4c73f82614ad846d41be3c0dd1e7e179c493ff8a (patch) | |
| tree | 71f3d0bf0287ef4c11c6d66e5e436720143443bb | |
| parent | bdccbcf41bd881806d5370b8c7fe05e90143a076 (diff) | |
| download | rust-4c73f82614ad846d41be3c0dd1e7e179c493ff8a.tar.gz rust-4c73f82614ad846d41be3c0dd1e7e179c493ff8a.zip | |
Add test
| -rw-r--r-- | src/test/compile-fail/dyn-trait-compatibility.rs | 5 | ||||
| -rw-r--r-- | src/test/run-pass/dyn-trait.rs | 2 |
2 files changed, 2 insertions, 5 deletions
diff --git a/src/test/compile-fail/dyn-trait-compatibility.rs b/src/test/compile-fail/dyn-trait-compatibility.rs index a7cfda504c7..454b6d2f566 100644 --- a/src/test/compile-fail/dyn-trait-compatibility.rs +++ b/src/test/compile-fail/dyn-trait-compatibility.rs @@ -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() {} diff --git a/src/test/run-pass/dyn-trait.rs b/src/test/run-pass/dyn-trait.rs index 91930852a57..d6ddb9b6008 100644 --- a/src/test/run-pass/dyn-trait.rs +++ b/src/test/run-pass/dyn-trait.rs @@ -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"); |
