rust/src/test/ui/bad
Tyler Mandry 5ea55518bc
Rollup merge of #75984 - kornelski:typeormodule, r=matthewjasper
Improve unresolved use error message

"use of undeclared type or module `foo`" doesn't mention that it could be a crate.

This error can happen when users forget to add a dependency to `Cargo.toml`, so I think it's important to mention that it could be a missing crate.

I've used a heuristic based on Rust's naming conventions. It complains about an unknown type if the ident starts with an upper-case letter, and crate or module otherwise. It seems to work very well. The expanded error help covers both an unknown type and a missing crate case.
2020-09-09 15:05:45 -07:00
..
bad-const-type.rs
bad-const-type.stderr
bad-crate-name.rs
bad-crate-name.stderr
bad-env-capture2.rs
bad-env-capture2.stderr
bad-env-capture3.rs
bad-env-capture3.stderr
bad-env-capture.rs
bad-env-capture.stderr
bad-expr-lhs.rs
bad-expr-lhs.stderr
bad-expr-path2.rs
bad-expr-path2.stderr
bad-expr-path.rs
bad-expr-path.stderr
bad-extern-link-attrs.rs
bad-extern-link-attrs.stderr
bad-intrinsic-monomorphization.rs
bad-intrinsic-monomorphization.stderr
bad-lint-cap2.rs
bad-lint-cap2.stderr
bad-lint-cap3.rs
bad-lint-cap3.stderr
bad-lint-cap.rs
bad-lint-cap.stderr
bad-main.rs
bad-main.stderr
bad-method-typaram-kind.rs
bad-method-typaram-kind.stderr
bad-mid-path-type-params.rs
bad-mid-path-type-params.stderr
bad-module.rs
bad-module.stderr
bad-sized.rs
bad-sized.stderr
bad-type-env-capture.rs
bad-type-env-capture.stderr