Closed
Description
#![feature(reflect_marker)]
use std::marker::Reflect;
use std::any::Any;
struct Foo;
trait Bar {}
impl Bar for Foo {}
fn main() {
let any: &Any = &Bar;
if any.is::<u32>() { println!("u32"); }
}
The output is:
t.rs:12:22: 12:25 error: unresolved name `Bar` [E0425]
t.rs:12 let any: &Any = &Bar;
^~~
t.rs:12:22: 12:25 help: run `rustc --explain E0425` to see a detailed explanation
t.rs:12:22: 12:25 help: Module `Bar` cannot be used as an expression
In here, Bar
is a trait, not a module.