diff options
Diffstat (limited to 'src/test/compile-fail/cross-borrow-trait.rs')
| -rw-r--r-- | src/test/compile-fail/cross-borrow-trait.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/test/compile-fail/cross-borrow-trait.rs b/src/test/compile-fail/cross-borrow-trait.rs index 6bd21101a60..871f52cbebd 100644 --- a/src/test/compile-fail/cross-borrow-trait.rs +++ b/src/test/compile-fail/cross-borrow-trait.rs @@ -11,14 +11,13 @@ // Test that cross-borrowing (implicitly converting from `Box<T>` to `&T`) is // forbidden when `T` is a trait. -#![feature(box_syntax)] - struct Foo; trait Trait { fn foo(&self) {} } impl Trait for Foo {} pub fn main() { - let x: Box<Trait> = box Foo; + // FIXME (#22405): Replace `Box::new` with `box` here when/if possible. + let x: Box<Trait> = Box::new(Foo); let _y: &Trait = x; //~ ERROR mismatched types //~| expected `&Trait` //~| found `Box<Trait>` |
