mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 11:48:30 +00:00
Improve error message for E0659
if the source is not available
This commit is contained in:
parent
5fd3a5c7c1
commit
6dfed31c43
@ -1178,7 +1178,7 @@ impl<'a> Resolver<'a> {
|
|||||||
|
|
||||||
fn binding_description(&self, b: &NameBinding<'_>, ident: Ident, from_prelude: bool) -> String {
|
fn binding_description(&self, b: &NameBinding<'_>, ident: Ident, from_prelude: bool) -> String {
|
||||||
let res = b.res();
|
let res = b.res();
|
||||||
if b.span.is_dummy() {
|
if b.span.is_dummy() || self.session.source_map().span_to_snippet(b.span).is_err() {
|
||||||
// These already contain the "built-in" prefix or look bad with it.
|
// These already contain the "built-in" prefix or look bad with it.
|
||||||
let add_built_in =
|
let add_built_in =
|
||||||
!matches!(b.res(), Res::NonMacroAttr(..) | Res::PrimTy(..) | Res::ToolMod);
|
!matches!(b.res(), Res::NonMacroAttr(..) | Res::PrimTy(..) | Res::ToolMod);
|
||||||
|
Loading…
Reference in New Issue
Block a user