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
3 changes: 1 addition & 2 deletions compiler/rustc_errors/src/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2698,8 +2698,7 @@ impl HumanEmitter {
[SubstitutionHighlight { start: 0, end }] if *end == line_to_add.len() => {
buffer.puts(*row_num, max_line_num_len + 1, "+ ", Style::Addition);
}
[] => {
// FIXME: needed? Doesn't get exercised in any test.
[] | [SubstitutionHighlight { start: 0, end: 0 }] => {
self.draw_col_separator_no_space(buffer, *row_num, max_line_num_len + 1);
}
_ => {
Expand Down
22 changes: 11 additions & 11 deletions src/tools/clippy/tests/ui/derivable_impls.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ LL | | }
help: replace the manual implementation with a derive attribute
|
LL + #[derive(Default)]
LL ~ struct FooDefault<'a> {
LL | struct FooDefault<'a> {
|

error: this `impl` can be derived
Expand All @@ -31,7 +31,7 @@ LL | | }
help: replace the manual implementation with a derive attribute
|
LL + #[derive(Default)]
LL ~ struct TupleDefault(bool, i32, u64);
LL | struct TupleDefault(bool, i32, u64);
|

error: this `impl` can be derived
Expand All @@ -48,7 +48,7 @@ LL | | }
help: replace the manual implementation with a derive attribute
|
LL + #[derive(Default)]
LL ~ struct StrDefault<'a>(&'a str);
LL | struct StrDefault<'a>(&'a str);
|

error: this `impl` can be derived
Expand All @@ -65,7 +65,7 @@ LL | | }
help: replace the manual implementation with a derive attribute
|
LL + #[derive(Default)]
LL ~ struct Y(u32);
LL | struct Y(u32);
|

error: this `impl` can be derived
Expand All @@ -82,7 +82,7 @@ LL | | }
help: replace the manual implementation with a derive attribute
|
LL + #[derive(Default)]
LL ~ struct WithoutSelfCurly {
LL | struct WithoutSelfCurly {
|

error: this `impl` can be derived
Expand All @@ -99,7 +99,7 @@ LL | | }
help: replace the manual implementation with a derive attribute
|
LL + #[derive(Default)]
LL ~ struct WithoutSelfParan(bool);
LL | struct WithoutSelfParan(bool);
|

error: this `impl` can be derived
Expand All @@ -115,7 +115,7 @@ LL | | }
help: replace the manual implementation with a derive attribute
|
LL + #[derive(Default)]
LL ~ pub struct DirectDefaultDefaultCall {
LL | pub struct DirectDefaultDefaultCall {
|

error: this `impl` can be derived
Expand All @@ -131,7 +131,7 @@ LL | | }
help: replace the manual implementation with a derive attribute
|
LL + #[derive(Default)]
LL ~ pub struct EquivalentToDefaultDefaultCallVec {
LL | pub struct EquivalentToDefaultDefaultCallVec {
|

error: this `impl` can be derived
Expand All @@ -147,7 +147,7 @@ LL | | }
help: replace the manual implementation with a derive attribute
|
LL + #[derive(Default)]
LL ~ pub struct EquivalentToDefaultDefaultCallLocal {
LL | pub struct EquivalentToDefaultDefaultCallLocal {
|

error: this `impl` can be derived
Expand All @@ -164,7 +164,7 @@ LL | | }
help: replace the manual implementation with a derive attribute
|
LL + #[derive(Default)]
LL ~ pub struct RepeatDefault1 {
LL | pub struct RepeatDefault1 {
|

error: this `impl` can be derived
Expand All @@ -181,7 +181,7 @@ LL | | }
help: replace the manual implementation with a derive attribute and mark the default variant
|
LL + #[derive(Default)]
LL ~ pub enum SimpleEnum {
LL | pub enum SimpleEnum {
LL | Foo,
LL ~ #[default]
LL ~ Bar,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LL | 0..5+1 => errors_only.push(x),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = 5+1;
LL ~ match x as i32 {
LL | match x as i32 {
LL ~ 0..VAL => errors_only.push(x),
|

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/parser/issues/issue-24375.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ LL + val if val == tmp[0] => {}
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = tmp[0];
LL ~ match z {
LL | match z {
LL ~ VAL => {}
|

Expand Down
58 changes: 29 additions & 29 deletions tests/ui/parser/recover/recover-pat-exprs.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ LL + val if val == x.y => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x.y;
LL ~ match 0 {
LL | match 0 {
LL | x => (),
LL ~ VAL => (),
|
Expand All @@ -33,7 +33,7 @@ LL + val if val == x.0 => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x.0;
LL ~ match 0 {
LL | match 0 {
LL | x => (),
LL | x.y => (),
LL ~ VAL => (),
Expand All @@ -54,7 +54,7 @@ LL + val if val == x._0 => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x._0;
LL ~ match 0 {
LL | match 0 {
LL | x => (),
LL | x.y => (),
LL | x.0 => (),
Expand All @@ -76,7 +76,7 @@ LL + val if val == x.0.1 => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x.0.1;
LL ~ match 0 {
LL | match 0 {
LL | x => (),
...
LL | x._0 => (),
Expand All @@ -98,7 +98,7 @@ LL + val if val == x.4.y.17.__z => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x.4.y.17.__z;
LL ~ match 0 {
LL | match 0 {
LL | x => (),
...
LL | x.0.1 => (),
Expand Down Expand Up @@ -150,7 +150,7 @@ LL + val if val == x[0] => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x[0];
LL ~ match 0 {
LL | match 0 {
LL ~ VAL => (),
|

Expand All @@ -169,7 +169,7 @@ LL + val if val == x[..] => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x[..];
LL ~ match 0 {
LL | match 0 {
LL | x[0] => (),
LL ~ VAL => (),
|
Expand Down Expand Up @@ -216,7 +216,7 @@ LL + val if val == x.f() => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x.f();
LL ~ match 0 {
LL | match 0 {
LL ~ VAL => (),
|

Expand All @@ -235,7 +235,7 @@ LL + val if val == x._f() => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x._f();
LL ~ match 0 {
LL | match 0 {
LL | x.f() => (),
LL ~ VAL => (),
|
Expand All @@ -255,7 +255,7 @@ LL + val if val == x? => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x?;
LL ~ match 0 {
LL | match 0 {
LL | x.f() => (),
LL | x._f() => (),
LL ~ VAL => (),
Expand All @@ -276,7 +276,7 @@ LL + val if val == ().f() => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = ().f();
LL ~ match 0 {
LL | match 0 {
LL | x.f() => (),
LL | x._f() => (),
LL | x? => (),
Expand All @@ -298,7 +298,7 @@ LL + val if val == (0, x)?.f() => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = (0, x)?.f();
LL ~ match 0 {
LL | match 0 {
LL | x.f() => (),
...
LL | ().f() => (),
Expand All @@ -320,7 +320,7 @@ LL + val if val == x.f().g() => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x.f().g();
LL ~ match 0 {
LL | match 0 {
LL | x.f() => (),
...
LL | (0, x)?.f() => (),
Expand All @@ -342,7 +342,7 @@ LL + val if val == 0.f()?.g()?? => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = 0.f()?.g()??;
LL ~ match 0 {
LL | match 0 {
LL | x.f() => (),
...
LL | x.f().g() => (),
Expand All @@ -364,7 +364,7 @@ LL + val if val == x as usize => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x as usize;
LL ~ match 0 {
LL | match 0 {
LL ~ VAL => (),
|

Expand All @@ -383,7 +383,7 @@ LL + val if val == 0 as usize => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = 0 as usize;
LL ~ match 0 {
LL | match 0 {
LL | x as usize => (),
LL ~ VAL => (),
|
Expand All @@ -403,7 +403,7 @@ LL + val if val == x.f().0.4 as f32 => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x.f().0.4 as f32;
LL ~ match 0 {
LL | match 0 {
LL | x as usize => (),
LL | 0 as usize => (),
LL ~ VAL => (),
Expand All @@ -424,7 +424,7 @@ LL + val if val == 1 + 1 => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = 1 + 1;
LL ~ match 0 {
LL | match 0 {
LL ~ VAL => (),
|

Expand All @@ -443,7 +443,7 @@ LL + val if val == (1 + 2) * 3 => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = (1 + 2) * 3;
LL ~ match 0 {
LL | match 0 {
LL | 1 + 1 => (),
LL ~ VAL => (),
|
Expand All @@ -463,7 +463,7 @@ LL + val if val == (x.0 > 2) => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x.0 > 2;
LL ~ match 0 {
LL | match 0 {
LL | 1 + 1 => (),
...
LL |
Expand All @@ -485,7 +485,7 @@ LL + val if val == (x.0 == 2) => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x.0 == 2;
LL ~ match 0 {
LL | match 0 {
LL | 1 + 1 => (),
...
LL | x.0 > 2 => (),
Expand All @@ -507,7 +507,7 @@ LL + (x, val) if x != 0 && val == (y.0 > 2) => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = y.0 > 2;
LL ~ match (0, 0) {
LL | match (0, 0) {
LL ~ (x, VAL) if x != 0 => (),
|

Expand All @@ -526,7 +526,7 @@ LL + (x, val) if (x != 0 || x != 1) && val == (y.0 > 2) => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = y.0 > 2;
LL ~ match (0, 0) {
LL | match (0, 0) {
LL | (x, y.0 > 2) if x != 0 => (),
LL ~ (x, VAL) if x != 0 || x != 1 => (),
|
Expand Down Expand Up @@ -563,7 +563,7 @@ LL + val if val == u8::MAX.abs() => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = u8::MAX.abs();
LL ~ match u8::MAX {
LL | match u8::MAX {
LL ~ VAL => (),
|

Expand All @@ -582,7 +582,7 @@ LL + z @ w @ val if val == v.u() => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = v.u();
LL ~ match u8::MAX {
LL | match u8::MAX {
LL | u8::MAX.abs() => (),
...
LL |
Expand All @@ -604,7 +604,7 @@ LL + val if val == y.ilog(3) => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = y.ilog(3);
LL ~ match u8::MAX {
LL | match u8::MAX {
LL | u8::MAX.abs() => (),
...
LL |
Expand All @@ -626,7 +626,7 @@ LL + val if val == n + 1 => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = n + 1;
LL ~ match u8::MAX {
LL | match u8::MAX {
LL | u8::MAX.abs() => (),
...
LL |
Expand All @@ -648,7 +648,7 @@ LL + (val) if val == "".f() + 14 * 8 => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = "".f() + 14 * 8;
LL ~ match u8::MAX {
LL | match u8::MAX {
LL | u8::MAX.abs() => (),
...
LL |
Expand All @@ -670,7 +670,7 @@ LL + val if val == f?() => (),
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = f?();
LL ~ match u8::MAX {
LL | match u8::MAX {
LL | u8::MAX.abs() => (),
...
LL | 0 | ((1) | 2) | 3 => (),
Expand Down
Loading
Loading