diff options
| author | bors <bors@rust-lang.org> | 2016-09-27 07:30:34 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-09-27 07:30:34 -0700 |
| commit | ea65ab6c7e96bf38c291ed7192137e6b96772687 (patch) | |
| tree | 44d9d4bee967c7ba3bb0f13e270af8b39df2bb6b /src/librustc_resolve | |
| parent | 8467e8d24a48027d3d328c6135c0a55cfc9a4cf9 (diff) | |
| parent | c0f29fdd58666df69352c66ecbc3be68b500da27 (diff) | |
| download | rust-ea65ab6c7e96bf38c291ed7192137e6b96772687.tar.gz rust-ea65ab6c7e96bf38c291ed7192137e6b96772687.zip | |
Auto merge of #36761 - jonathandturner:E0425_E0446_E0449, r=nrc
Update E0425, E0446, E0449 This addresses https://github.com/rust-lang/rust/issues/35343, https://github.com/rust-lang/rust/issues/35923, and https://github.com/rust-lang/rust/issues/35924. Part of https://github.com/rust-lang/rust/issues/35233 Specifically, this adds labels to these error messages following the suggestions in the attached bugs. r? @nrc
Diffstat (limited to 'src/librustc_resolve')
| -rw-r--r-- | src/librustc_resolve/lib.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index fb9819b72ab..38b31db6781 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -366,9 +366,14 @@ fn resolve_struct_error<'b, 'a: 'b, 'c>(resolver: &'b Resolver<'a>, let mut err = struct_span_err!(resolver.session, span, E0425, - "unresolved name `{}`{}", - path, - msg); + "unresolved name `{}`", + path); + if msg != "" { + err.span_label(span, &msg); + } else { + err.span_label(span, &format!("unresolved name")); + } + match context { UnresolvedNameContext::Other => { if msg.is_empty() && is_static_method && is_field { @@ -2941,7 +2946,7 @@ impl<'a> Resolver<'a> { let mut context = UnresolvedNameContext::Other; let mut def = Def::Err; if !msg.is_empty() { - msg = format!(". Did you mean {}?", msg); + msg = format!("did you mean {}?", msg); } else { // we display a help message if this is a module let name_path = path.segments.iter() |
