Skip to content

Commit 6ffac62

Browse files
rustc_errors compiles
`name.name()` seems a bit awkward, but it follows the semantics from the old code.
1 parent c2dc7aa commit 6ffac62

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/librustc_errors/emitter.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@ impl EmitterWriter {
12991299
&format!(
13001300
"{}:{}:{}",
13011301
loc.file.name,
1302-
sm.doctest_offset_line(&loc.file.name, loc.line),
1302+
sm.doctest_offset_line(&loc.file.name.name(), loc.line),
13031303
loc.col.0 + 1,
13041304
),
13051305
Style::LineAndColumn,
@@ -1313,7 +1313,7 @@ impl EmitterWriter {
13131313
&format!(
13141314
"{}:{}:{}: ",
13151315
loc.file.name,
1316-
sm.doctest_offset_line(&loc.file.name, loc.line),
1316+
sm.doctest_offset_line(&loc.file.name.name(), loc.line),
13171317
loc.col.0 + 1,
13181318
),
13191319
Style::LineAndColumn,
@@ -1337,7 +1337,10 @@ impl EmitterWriter {
13371337
format!(
13381338
"{}:{}{}",
13391339
annotated_file.file.name,
1340-
sm.doctest_offset_line(&annotated_file.file.name, first_line.line_index),
1340+
sm.doctest_offset_line(
1341+
&annotated_file.file.name.name(),
1342+
first_line.line_index
1343+
),
13411344
col
13421345
)
13431346
} else {

src/librustc_span/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ impl SourceFileHash {
10741074
}
10751075
}
10761076

1077-
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd)]
1077+
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
10781078
pub struct SourceFileName {
10791079
/// The name of the file that the source came from. Source that doesn't
10801080
/// originate from files has names between angle brackets by convention

0 commit comments

Comments
 (0)