]> git.lizzy.rs Git - rust.git/commit - src/tools/rustfmt
Rollup merge of #75984 - kornelski:typeormodule, r=matthewjasper
authorTyler Mandry <tmandry@gmail.com>
Wed, 9 Sep 2020 22:05:45 +0000 (15:05 -0700)
committerGitHub <noreply@github.com>
Wed, 9 Sep 2020 22:05:45 +0000 (15:05 -0700)
commit5ea55518bcd168517d7e5b526e94e0d09470cb11
tree70929ada84a46d1f37df6d1b0eb817cda91d3f12
parent07dbe49ce9239c5caefe8556566cab0b36c60faf
parent7ec1de062a1aadef0293bb65e71fbcc7cc24ebfd
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.
compiler/rustc_resolve/src/lib.rs
src/test/ui/impl-trait/issue-72911.stderr