1 // Confusing diagnostic when using variable as a type:
3 // Previous warnings indicate Foo is not used, when in fact it is
4 // used improperly as a variable or constant. New warning points
5 // out user may be trying to use variable as a type. Test demonstrates
6 // cases for both local variable and const.
11 println!("{}", Baz::Bar); //~ ERROR: failed to resolve: use of undeclared type `Baz`
14 #[allow(non_upper_case_globals)]
15 pub const Foo: &str = "";
20 println!("{}", Foo::Bar); //~ ERROR: failed to resolve: use of undeclared type `Foo`