Skip to content
Open
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: 2 additions & 0 deletions compiler/rustc_errors/src/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2152,6 +2152,7 @@ impl HumanEmitter {

let line_start = sm.lookup_char_pos(parts[0].original_span.lo()).line;
let mut lines = complete.lines();
let lines_len = lines.clone().count();
if lines.clone().next().is_none() {
// Account for a suggestion to completely remove a line(s) with whitespace (#94192).
let line_end = sm.lookup_char_pos(parts[0].original_span.hi()).line;
Expand Down Expand Up @@ -2192,6 +2193,7 @@ impl HumanEmitter {
if highlight_parts.len() == 1
&& line.trim().starts_with("#[")
&& line.trim().ends_with(']')
&& lines_len == 1
{
is_item_attribute = true;
}
Expand Down
3 changes: 0 additions & 3 deletions src/tools/clippy/tests/ui/new_without_default.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ LL + fn default() -> Self {
LL + Self::new()
LL + }
LL + }
LL | impl NewWithCfg {
|

error: you should consider adding a `Default` implementation for `NewWith2Cfgs`
Expand All @@ -212,7 +211,6 @@ LL + fn default() -> Self {
LL + Self::new()
LL + }
LL + }
LL | impl NewWith2Cfgs {
|

error: you should consider adding a `Default` implementation for `NewWithExtraneous`
Expand Down Expand Up @@ -250,7 +248,6 @@ LL + fn default() -> Self {
LL + Self::new()
LL + }
LL + }
LL | impl NewWithCfgAndExtraneous {
|

error: aborting due to 13 previous errors
Expand Down
Loading