mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-02 18:27:37 +00:00
fix: Emit suggestion filename if primary diagnostic span is dummy
This commit is contained in:
parent
f26e580230
commit
c8fac7779e
@ -2078,7 +2078,9 @@ impl HumanEmitter {
|
||||
// file name, saving in verbosity, but if it *isn't* we do need it, otherwise we're
|
||||
// telling users to make a change but not clarifying *where*.
|
||||
let loc = sm.lookup_char_pos(parts[0].span.lo());
|
||||
if loc.file.name != sm.span_to_filename(span) && loc.file.name.is_real() {
|
||||
if (span.is_dummy() || loc.file.name != sm.span_to_filename(span))
|
||||
&& loc.file.name.is_real()
|
||||
{
|
||||
// --> file.rs:line:col
|
||||
// |
|
||||
let arrow = self.file_start();
|
||||
|
@ -2,6 +2,7 @@ error[E0259]: the name `std` is defined multiple times
|
||||
|
|
||||
= note: `std` must be defined only once in the type namespace of this module
|
||||
help: you can use `as` to change the binding name of the import
|
||||
--> $DIR/resolve-conflict-extern-crate-vs-extern-crate.rs:1:17
|
||||
|
|
||||
LL | extern crate std as other_std;
|
||||
| ++++++++++++
|
||||
|
Loading…
x
Reference in New Issue
Block a user