diff options
Diffstat (limited to 'tests/ui/traits/new-solver/dyn-any-dont-prefer-impl.rs')
-rw-r--r-- | tests/ui/traits/new-solver/dyn-any-dont-prefer-impl.rs | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/tests/ui/traits/new-solver/dyn-any-dont-prefer-impl.rs b/tests/ui/traits/new-solver/dyn-any-dont-prefer-impl.rs deleted file mode 100644 index af35a6195..000000000 --- a/tests/ui/traits/new-solver/dyn-any-dont-prefer-impl.rs +++ /dev/null @@ -1,17 +0,0 @@ -// compile-flags: -Ztrait-solver=next -// check-pass - -// Test that selection prefers the builtin trait object impl for `Any` -// instead of the user defined impl. Both impls apply to the trait -// object. - -use std::any::Any; - -fn needs_usize(_: &usize) {} - -fn main() { - let x: &dyn Any = &1usize; - if let Some(x) = x.downcast_ref::<usize>() { - needs_usize(x); - } -} |