Skip to content

Commit 4c73f82

Browse files
committed
Add test
1 parent bdccbcf commit 4c73f82

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/test/compile-fail/dyn-trait-compatibility.rs

-5
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,5 @@ type A3 = dyn<<dyn as dyn>::dyn>;
2020
//~^ ERROR cannot find type `dyn` in this scope
2121
//~| ERROR cannot find type `dyn` in this scope
2222
//~| ERROR Use of undeclared type or module `dyn`
23-
type A4 = dyn(dyn, dyn) -> dyn;
24-
//~^ ERROR cannot find type `dyn` in this scope
25-
//~| ERROR cannot find type `dyn` in this scope
26-
//~| ERROR cannot find type `dyn` in this scope
27-
//~| ERROR cannot find type `dyn` in this scope
2823

2924
fn main() {}

src/test/run-pass/dyn-trait.rs

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ static BYTE: u8 = 33;
1717
fn main() {
1818
let x: &(dyn 'static + Display) = &BYTE;
1919
let y: Box<dyn Display + 'static> = Box::new(BYTE);
20+
let _: &dyn (Display) = &BYTE;
21+
let _: &dyn (::std::fmt::Display) = &BYTE;
2022
let xstr = format!("{}", x);
2123
let ystr = format!("{}", y);
2224
assert_eq!(xstr, "33");

0 commit comments

Comments
 (0)