Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_errors/src/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2412,7 +2412,7 @@ impl HumanEmitter {
// too bad to begin with, so we side-step that issue here.
for (i, line) in snippet.lines().enumerate() {
let line = normalize_whitespace(line);
let row = row_num - 2 - (newlines - i - 1);
let row = (row_num - 2 - (newlines - i - 1)).max(2);
// On the first line, we highlight between the start of the part
// span, and the end of that line.
// On the last line, we highlight between the start of the line, and
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//@ only-linux
//@ compile-flags: --error-format=human --color=always

// The hightlight span should be correct. See #147070
struct Thingie;

impl Thingie {
pub(crate) fn new(
_a: String,
_b: String,
_c: String,
_d: String,
_e: String,
_f: String,
) -> Self {
unimplemented!()
}
}

fn main() {
let foo = Thingie::new(
String::from(""),
String::from(""),
String::from(""),
String::from(""),
String::from(""),
String::from(""),
String::from(""),
);
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading