rust/tests/ui/resolve/issue-33876.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
200 B
Rust
Raw Normal View History

2016-05-26 13:29:17 +00:00
use std::any::Any;
struct Foo;
trait Bar {}
impl Bar for Foo {}
fn main() {
2019-05-28 18:46:13 +00:00
let any: &dyn Any = &Bar; //~ ERROR expected value, found trait `Bar`
2016-05-26 13:29:17 +00:00
if any.is::<u32>() { println!("u32"); }
}