Skip to content

Invalid help message #33876

Closed
Closed
@GuillaumeGomez

Description

@GuillaumeGomez
#![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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions