mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
14 lines
227 B
Rust
14 lines
227 B
Rust
// compile-flags: -Ztrait-solver=next
|
|
// check-pass
|
|
|
|
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);
|
|
}
|
|
}
|