Auto merge of #97892 - klensy:fix-spaces, r=oli-obk
diagnostics: remove trailing spaces Remove few occurrences of trailing spaces and drive by fix of needless alloc of const string.
This commit is contained in:
commit
0cb9899e78
@ -771,8 +771,12 @@ impl EmitterWriter {
|
||||
self
|
||||
}
|
||||
|
||||
fn maybe_anonymized(&self, line_num: usize) -> String {
|
||||
if self.ui_testing { ANONYMIZED_LINE_NUM.to_string() } else { line_num.to_string() }
|
||||
fn maybe_anonymized(&self, line_num: usize) -> Cow<'static, str> {
|
||||
if self.ui_testing {
|
||||
Cow::Borrowed(ANONYMIZED_LINE_NUM)
|
||||
} else {
|
||||
Cow::Owned(line_num.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
fn draw_line(
|
||||
@ -819,7 +823,7 @@ impl EmitterWriter {
|
||||
}
|
||||
buffer.puts(line_offset, 0, &self.maybe_anonymized(line_index), Style::LineNumber);
|
||||
|
||||
draw_col_separator(buffer, line_offset, width_offset - 2);
|
||||
draw_col_separator_no_space(buffer, line_offset, width_offset - 2);
|
||||
}
|
||||
|
||||
fn render_source_line(
|
||||
@ -1929,7 +1933,7 @@ impl EmitterWriter {
|
||||
// Only show an underline in the suggestions if the suggestion is not the
|
||||
// entirety of the code being shown and the displayed code is not multiline.
|
||||
if let DisplaySuggestion::Diff | DisplaySuggestion::Underline = show_code_change {
|
||||
draw_col_separator(&mut buffer, row_num, max_line_num_len + 1);
|
||||
draw_col_separator_no_space(&mut buffer, row_num, max_line_num_len + 1);
|
||||
for part in parts {
|
||||
let span_start_pos = sm.lookup_char_pos(part.span.lo()).col_display;
|
||||
let span_end_pos = sm.lookup_char_pos(part.span.hi()).col_display;
|
||||
|
@ -68,7 +68,7 @@ help: to link to the macro, add an exclamation mark
|
||||
|
|
||||
LL - /// Link to [derive@m]
|
||||
LL + /// Link to [m!]
|
||||
|
|
||||
|
|
||||
|
||||
error: unresolved link to `m`
|
||||
--> $DIR/disambiguator-mismatch.rs:46:14
|
||||
@ -124,7 +124,7 @@ help: to link to the constant, prefix with `const@`
|
||||
|
|
||||
LL - /// Link to [c()]
|
||||
LL + /// Link to [const@c]
|
||||
|
|
||||
|
|
||||
|
||||
error: incompatible link kind for `f`
|
||||
--> $DIR/disambiguator-mismatch.rs:72:14
|
||||
@ -136,7 +136,7 @@ help: to link to the function, add parentheses
|
||||
|
|
||||
LL - /// Link to [const@f]
|
||||
LL + /// Link to [f()]
|
||||
|
|
||||
|
|
||||
|
||||
error: unresolved link to `std`
|
||||
--> $DIR/disambiguator-mismatch.rs:77:14
|
||||
|
@ -98,7 +98,7 @@ help: to link to the associated function, add parentheses
|
||||
|
|
||||
LL - /// [type@Vec::into_iter]
|
||||
LL + /// [Vec::into_iter()]
|
||||
|
|
||||
|
|
||||
|
||||
error: unresolved link to `S`
|
||||
--> $DIR/errors.rs:68:6
|
||||
@ -110,7 +110,7 @@ help: to link to the struct, prefix with `struct@`
|
||||
|
|
||||
LL - /// [S!]
|
||||
LL + /// [struct@S]
|
||||
|
|
||||
|
|
||||
|
||||
error: unresolved link to `S::h`
|
||||
--> $DIR/errors.rs:78:6
|
||||
@ -122,7 +122,7 @@ help: to link to the associated function, add parentheses
|
||||
|
|
||||
LL - /// [type@S::h]
|
||||
LL + /// [S::h()]
|
||||
|
|
||||
|
|
||||
|
||||
error: unresolved link to `T::g`
|
||||
--> $DIR/errors.rs:86:6
|
||||
@ -134,7 +134,7 @@ help: to link to the associated function, add parentheses
|
||||
|
|
||||
LL - /// [type@T::g]
|
||||
LL + /// [T::g()]
|
||||
|
|
||||
|
|
||||
|
||||
error: unresolved link to `T::h`
|
||||
--> $DIR/errors.rs:91:6
|
||||
|
@ -3,7 +3,7 @@ error[E0428]: the name `f` is defined multiple times
|
||||
|
|
||||
6 | pub fn f() {}
|
||||
| ---------- previous definition of the value `f` here
|
||||
7 |
|
||||
7 |
|
||||
8 | pub fn f() {}
|
||||
| ^^^^^^^^^^ `f` redefined here
|
||||
|
|
||||
|
@ -16,7 +16,7 @@ help: consider removing the ``
|
||||
|
|
||||
LL - foo(&&A, B, C, D, E, F, G);
|
||||
LL + foo(&&A, B, C, D, E, F, G);
|
||||
|
|
||||
|
|
||||
help: remove the extra arguments
|
||||
|
|
||||
LL | foo(&&A, D, {&E}, G);
|
||||
|
@ -58,7 +58,7 @@ help: consider removing the borrow
|
||||
|
|
||||
LL - asm!("{}", const &0);
|
||||
LL + asm!("{}", const 0);
|
||||
|
|
||||
|
|
||||
|
||||
error: invalid asm output
|
||||
--> $DIR/type-check-1.rs:15:29
|
||||
|
@ -9,7 +9,7 @@ help: the clause will not be checked when the type alias is used, and should be
|
||||
|
|
||||
LL - type _TaWhere1<T> where T: Iterator<Item: Copy> = T;
|
||||
LL + type _TaWhere1<T> = T;
|
||||
|
|
||||
|
|
||||
|
||||
warning: where clauses are not enforced in type aliases
|
||||
--> $DIR/type-alias.rs:6:25
|
||||
@ -21,7 +21,7 @@ help: the clause will not be checked when the type alias is used, and should be
|
||||
|
|
||||
LL - type _TaWhere2<T> where T: Iterator<Item: 'static> = T;
|
||||
LL + type _TaWhere2<T> = T;
|
||||
|
|
||||
|
|
||||
|
||||
warning: where clauses are not enforced in type aliases
|
||||
--> $DIR/type-alias.rs:7:25
|
||||
@ -33,7 +33,7 @@ help: the clause will not be checked when the type alias is used, and should be
|
||||
|
|
||||
LL - type _TaWhere3<T> where T: Iterator<Item: 'static> = T;
|
||||
LL + type _TaWhere3<T> = T;
|
||||
|
|
||||
|
|
||||
|
||||
warning: where clauses are not enforced in type aliases
|
||||
--> $DIR/type-alias.rs:8:25
|
||||
@ -45,7 +45,7 @@ help: the clause will not be checked when the type alias is used, and should be
|
||||
|
|
||||
LL - type _TaWhere4<T> where T: Iterator<Item: 'static + Copy + Send> = T;
|
||||
LL + type _TaWhere4<T> = T;
|
||||
|
|
||||
|
|
||||
|
||||
warning: where clauses are not enforced in type aliases
|
||||
--> $DIR/type-alias.rs:9:25
|
||||
@ -57,7 +57,7 @@ help: the clause will not be checked when the type alias is used, and should be
|
||||
|
|
||||
LL - type _TaWhere5<T> where T: Iterator<Item: for<'a> Into<&'a u8>> = T;
|
||||
LL + type _TaWhere5<T> = T;
|
||||
|
|
||||
|
|
||||
|
||||
warning: where clauses are not enforced in type aliases
|
||||
--> $DIR/type-alias.rs:10:25
|
||||
@ -69,7 +69,7 @@ help: the clause will not be checked when the type alias is used, and should be
|
||||
|
|
||||
LL - type _TaWhere6<T> where T: Iterator<Item: Iterator<Item: Copy>> = T;
|
||||
LL + type _TaWhere6<T> = T;
|
||||
|
|
||||
|
|
||||
|
||||
warning: bounds on generic parameters are not enforced in type aliases
|
||||
--> $DIR/type-alias.rs:12:20
|
||||
@ -81,7 +81,7 @@ help: the bound will not be checked when the type alias is used, and should be r
|
||||
|
|
||||
LL - type _TaInline1<T: Iterator<Item: Copy>> = T;
|
||||
LL + type _TaInline1<T> = T;
|
||||
|
|
||||
|
|
||||
|
||||
warning: bounds on generic parameters are not enforced in type aliases
|
||||
--> $DIR/type-alias.rs:13:20
|
||||
@ -93,7 +93,7 @@ help: the bound will not be checked when the type alias is used, and should be r
|
||||
|
|
||||
LL - type _TaInline2<T: Iterator<Item: 'static>> = T;
|
||||
LL + type _TaInline2<T> = T;
|
||||
|
|
||||
|
|
||||
|
||||
warning: bounds on generic parameters are not enforced in type aliases
|
||||
--> $DIR/type-alias.rs:14:20
|
||||
@ -105,7 +105,7 @@ help: the bound will not be checked when the type alias is used, and should be r
|
||||
|
|
||||
LL - type _TaInline3<T: Iterator<Item: 'static>> = T;
|
||||
LL + type _TaInline3<T> = T;
|
||||
|
|
||||
|
|
||||
|
||||
warning: bounds on generic parameters are not enforced in type aliases
|
||||
--> $DIR/type-alias.rs:15:20
|
||||
@ -117,7 +117,7 @@ help: the bound will not be checked when the type alias is used, and should be r
|
||||
|
|
||||
LL - type _TaInline4<T: Iterator<Item: 'static + Copy + Send>> = T;
|
||||
LL + type _TaInline4<T> = T;
|
||||
|
|
||||
|
|
||||
|
||||
warning: bounds on generic parameters are not enforced in type aliases
|
||||
--> $DIR/type-alias.rs:16:20
|
||||
@ -129,7 +129,7 @@ help: the bound will not be checked when the type alias is used, and should be r
|
||||
|
|
||||
LL - type _TaInline5<T: Iterator<Item: for<'a> Into<&'a u8>>> = T;
|
||||
LL + type _TaInline5<T> = T;
|
||||
|
|
||||
|
|
||||
|
||||
warning: bounds on generic parameters are not enforced in type aliases
|
||||
--> $DIR/type-alias.rs:17:20
|
||||
@ -141,7 +141,7 @@ help: the bound will not be checked when the type alias is used, and should be r
|
||||
|
|
||||
LL - type _TaInline6<T: Iterator<Item: Iterator<Item: Copy>>> = T;
|
||||
LL + type _TaInline6<T> = T;
|
||||
|
|
||||
|
|
||||
|
||||
warning: 12 warnings emitted
|
||||
|
||||
|
@ -30,7 +30,7 @@ error[E0053]: method `make` has an incompatible type for trait
|
||||
|
|
||||
LL | default type Ty = bool;
|
||||
| ----------------------- expected this associated type
|
||||
LL |
|
||||
LL |
|
||||
LL | fn make() -> bool { true }
|
||||
| ^^^^
|
||||
| |
|
||||
@ -50,7 +50,7 @@ error[E0308]: mismatched types
|
||||
|
|
||||
LL | type Ty = u8;
|
||||
| ------------- associated type defaults can't be assumed inside the trait defining them
|
||||
LL |
|
||||
LL |
|
||||
LL | fn make() -> Self::Ty {
|
||||
| -------- expected `<Self as Tr>::Ty` because of return type
|
||||
LL | 0u8
|
||||
@ -77,7 +77,7 @@ error[E0308]: mismatched types
|
||||
|
|
||||
LL | default type Ty = bool;
|
||||
| ----------------------- expected this associated type
|
||||
LL |
|
||||
LL |
|
||||
LL | fn make() -> Self::Ty { true }
|
||||
| -------- ^^^^ expected associated type, found `bool`
|
||||
| |
|
||||
|
@ -5,7 +5,7 @@ LL | / trait Sub<Rhs=Self> {
|
||||
LL | | type Output;
|
||||
LL | | }
|
||||
| |_- type parameter `Rhs` must be specified for this
|
||||
LL |
|
||||
LL |
|
||||
LL | type Test = dyn Add + Sub;
|
||||
| ^^^ help: set the type parameter to the desired type: `Sub<Rhs>`
|
||||
|
|
||||
|
@ -8,7 +8,7 @@ help: try removing the `+`
|
||||
|
|
||||
LL - 2 + +2;
|
||||
LL + 2 + 2;
|
||||
|
|
||||
|
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -3,7 +3,7 @@ error[E0515]: cannot return value referencing local variable `s`
|
||||
|
|
||||
LL | let b = &s[..];
|
||||
| - `s` is borrowed here
|
||||
LL |
|
||||
LL |
|
||||
LL | Err(b)?;
|
||||
| ^^^^^^^ returns a value referencing data owned by the current function
|
||||
|
||||
|
@ -31,7 +31,7 @@ help: remove the `.await`
|
||||
|
|
||||
LL - [1; ().await];
|
||||
LL + [1; ()];
|
||||
|
|
||||
|
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
@ -9,7 +9,7 @@ help: remove these parentheses
|
||||
|
|
||||
LL - fn main() { let _a = (async { }); }
|
||||
LL + fn main() { let _a = async { }; }
|
||||
|
|
||||
|
|
||||
|
||||
warning: 1 warning emitted
|
||||
|
||||
|
@ -37,7 +37,7 @@ help: remove the `.await`
|
||||
|
|
||||
LL - (|_| 2333).await;
|
||||
LL + (|_| 2333);
|
||||
|
|
||||
|
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
@ -13,7 +13,7 @@ help: remove the `.await`
|
||||
|
|
||||
LL - boo().await;
|
||||
LL + boo();
|
||||
|
|
||||
|
|
||||
help: alternatively, consider making `fn boo` asynchronous
|
||||
|
|
||||
LL | async fn boo() {}
|
||||
|
@ -3,7 +3,7 @@ error[E0255]: the name `foo` is defined multiple times
|
||||
|
|
||||
LL | mod foo { pub mod foo { } }
|
||||
| ------- previous definition of the module `foo` here
|
||||
LL |
|
||||
LL |
|
||||
LL | use foo::foo;
|
||||
| ^^^^^^^^ `foo` reimported here
|
||||
|
|
||||
|
@ -12,7 +12,7 @@ help: consider removing the borrow
|
||||
|
|
||||
LL - &panic!()
|
||||
LL + panic!()
|
||||
|
|
||||
|
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -3,10 +3,10 @@ error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immuta
|
||||
|
|
||||
LL | let y = &x;
|
||||
| -- immutable borrow occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | let q = &raw mut x;
|
||||
| ^^^^^^^^^^ mutable borrow occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | drop(y);
|
||||
| - immutable borrow later used here
|
||||
|
||||
@ -15,7 +15,7 @@ error[E0502]: cannot borrow `x` as immutable because it is also borrowed as muta
|
||||
|
|
||||
LL | let y = &mut x;
|
||||
| ------ mutable borrow occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | let p = &raw const x;
|
||||
| ^^^^^^^^^^^^ immutable borrow occurs here
|
||||
...
|
||||
@ -30,7 +30,7 @@ LL | let y = &mut x;
|
||||
...
|
||||
LL | let q = &raw mut x;
|
||||
| ^^^^^^^^^^ second mutable borrow occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | drop(y);
|
||||
| - first borrow later used here
|
||||
|
||||
|
@ -3,7 +3,7 @@ error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
|
||||
|
|
||||
LL | let x = &0;
|
||||
| -- help: consider changing this to be a mutable reference: `&mut 0`
|
||||
LL |
|
||||
LL |
|
||||
LL | let q = &raw mut *x;
|
||||
| ^^^^^^^^^^^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
||||
|
||||
@ -12,7 +12,7 @@ error[E0596]: cannot borrow `*x` as mutable, as it is behind a `*const` pointer
|
||||
|
|
||||
LL | let x = &0 as *const i32;
|
||||
| -- help: consider changing this to be a mutable pointer: `&mut 0`
|
||||
LL |
|
||||
LL |
|
||||
LL | let q = &raw mut *x;
|
||||
| ^^^^^^^^^^^ `x` is a `*const` pointer, so the data it refers to cannot be borrowed as mutable
|
||||
|
||||
|
@ -5,7 +5,7 @@ LL | let r = &x.0;
|
||||
| ---- borrow of `x.0` occurs here
|
||||
LL | let y = x;
|
||||
| ^ move out of `x` occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | r.use_ref();
|
||||
| ----------- borrow later used here
|
||||
|
||||
|
@ -3,10 +3,10 @@ error[E0502]: cannot borrow `p` as mutable because it is also borrowed as immuta
|
||||
|
|
||||
LL | let q: &isize = &p[0];
|
||||
| - immutable borrow occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | p[0] = 5;
|
||||
| ^ mutable borrow occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | println!("{}", *q);
|
||||
| -- immutable borrow later used here
|
||||
|
||||
|
@ -3,7 +3,7 @@ error[E0503]: cannot use `p` because it was mutably borrowed
|
||||
|
|
||||
LL | let q = &mut p;
|
||||
| ------ borrow of `p` occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | p + 3;
|
||||
| ^ use of borrowed `p`
|
||||
...
|
||||
@ -18,7 +18,7 @@ LL | let q = &mut p;
|
||||
...
|
||||
LL | p.times(3);
|
||||
| ^^^^^^^^^^ immutable borrow occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | *q + 3; // OK to use the new alias `q`
|
||||
| -- mutable borrow later used here
|
||||
|
||||
|
@ -18,7 +18,7 @@ LL | let l = &mut p;
|
||||
| ------ mutable borrow occurs here
|
||||
LL | p.impurem();
|
||||
| ^^^^^^^^^^^ immutable borrow occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | l.x += 1;
|
||||
| -------- mutable borrow later used here
|
||||
|
||||
|
@ -3,7 +3,7 @@ error[E0505]: cannot move out of `*a` because it is borrowed
|
||||
|
|
||||
LL | let b = &a;
|
||||
| -- borrow of `a` occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | let z = *a;
|
||||
| ^^ move out of `*a` occurs here
|
||||
LL | b.use_ref();
|
||||
|
@ -3,7 +3,7 @@ error[E0382]: use of moved value: `t`
|
||||
|
|
||||
LL | let t: Box<_> = Box::new(3);
|
||||
| - move occurs because `t` has type `Box<isize>`, which does not implement the `Copy` trait
|
||||
LL |
|
||||
LL |
|
||||
LL | call_f(move|| { *t + 1 });
|
||||
| ------ -- variable moved due to use in closure
|
||||
| |
|
||||
|
@ -3,7 +3,7 @@ error[E0505]: cannot move out of `s` because it is borrowed
|
||||
|
|
||||
LL | let rs = &mut s;
|
||||
| ------ borrow of `s` occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | println!("{}", f[s]);
|
||||
| ^ move out of `s` occurs here
|
||||
...
|
||||
|
@ -23,7 +23,7 @@ error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as im
|
||||
|
|
||||
LL | let [.., _, ref from_end4, ref from_end3, _, ref from_end1] = *s;
|
||||
| ------------- immutable borrow occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | let [_, _, ref mut from_begin2, ..] = *s;
|
||||
| ^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here
|
||||
LL | nop(&[from_begin2, from_end1, from_end3, from_end4]);
|
||||
@ -45,7 +45,7 @@ error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as im
|
||||
|
|
||||
LL | let [ref from_begin0, ref from_begin1, _, ref from_begin3, _, ..] = *s;
|
||||
| --------------- immutable borrow occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | let [.., ref mut from_end3, _, _] = *s;
|
||||
| ^^^^^^^^^^^^^^^^^ mutable borrow occurs here
|
||||
LL | nop(&[from_begin0, from_begin1, from_begin3, from_end3]);
|
||||
|
@ -99,7 +99,7 @@ LL | let ra = &mut u.a;
|
||||
| -------- borrow of `u.a` occurs here
|
||||
LL | let b = u.b;
|
||||
| ^^^ use of borrowed `u.a`
|
||||
LL |
|
||||
LL |
|
||||
LL | drop(ra);
|
||||
| -- borrow later used here
|
||||
|
||||
|
@ -3,7 +3,7 @@ error[E0382]: borrow of moved value: `helpers`
|
||||
|
|
||||
LL | let helpers = [vec![], vec![]];
|
||||
| ------- move occurs because `helpers` has type `[Vec<&i64>; 2]`, which does not implement the `Copy` trait
|
||||
LL |
|
||||
LL |
|
||||
LL | HelperStruct { helpers, is_empty: helpers[0].is_empty() }
|
||||
| ------- ^^^^^^^^^^^^^^^^^^^^^ value borrowed here after move
|
||||
| |
|
||||
|
@ -5,7 +5,7 @@ LL | let res = (|| (|| &greeting)())();
|
||||
| -- -------- borrow occurs due to use in closure
|
||||
| |
|
||||
| borrow of `greeting` occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | greeting = "DEALLOCATED".to_string();
|
||||
| ^^^^^^^^ assignment to borrowed `greeting` occurs here
|
||||
...
|
||||
|
@ -13,7 +13,7 @@ help: try removing `&mut` here
|
||||
|
|
||||
LL - h(&mut b);
|
||||
LL + h(b);
|
||||
|
|
||||
|
|
||||
|
||||
error[E0596]: cannot borrow `b` as mutable, as it is not declared as mutable
|
||||
--> $DIR/mut-borrow-of-mut-ref.rs:11:12
|
||||
@ -30,7 +30,7 @@ help: try removing `&mut` here
|
||||
|
|
||||
LL - g(&mut &mut b);
|
||||
LL + g(&mut b);
|
||||
|
|
||||
|
|
||||
|
||||
error[E0596]: cannot borrow `b` as mutable, as it is not declared as mutable
|
||||
--> $DIR/mut-borrow-of-mut-ref.rs:18:12
|
||||
@ -47,7 +47,7 @@ help: try removing `&mut` here
|
||||
|
|
||||
LL - h(&mut &mut b);
|
||||
LL + h(&mut b);
|
||||
|
|
||||
|
|
||||
|
||||
error[E0596]: cannot borrow `f` as mutable, as it is not declared as mutable
|
||||
--> $DIR/mut-borrow-of-mut-ref.rs:35:5
|
||||
|
@ -3,7 +3,7 @@ error[E0503]: cannot use `i` because it was mutably borrowed
|
||||
|
|
||||
LL | /*1*/ let p = &mut i; // (reservation of `i` starts here)
|
||||
| ------ borrow of `i` occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | /*2*/ let j = i; // OK: `i` is only reserved here
|
||||
| ^ use of borrowed `i`
|
||||
...
|
||||
|
@ -3,7 +3,7 @@ error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immuta
|
||||
|
|
||||
LL | let shared = &v;
|
||||
| -- immutable borrow occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | v.extend(shared);
|
||||
| ^^------^^^^^^^^
|
||||
| | |
|
||||
|
@ -5,7 +5,7 @@ LL | v[0].push_str({
|
||||
| - -------- first borrow later used by call
|
||||
| |
|
||||
| first mutable borrow occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | v.push(format!("foo"));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
|
||||
|
||||
|
@ -8,7 +8,7 @@ help: consider borrowing the value
|
||||
|
|
||||
LL - let _reference: &'static i32 = unsafe { pointer as *const i32 as &'static i32 };
|
||||
LL + let _reference: &'static i32 = unsafe { &*(pointer as *const i32) };
|
||||
|
|
||||
|
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -3,7 +3,7 @@ error[E0596]: cannot borrow `**ref_mref_x` as mutable, as it is behind a `&` ref
|
||||
|
|
||||
LL | let ref_mref_x = &mref_x;
|
||||
| ------- help: consider changing this to be a mutable reference: `&mut mref_x`
|
||||
LL |
|
||||
LL |
|
||||
LL | let c = || {
|
||||
| ^^ `ref_mref_x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
||||
LL |
|
||||
|
@ -5,7 +5,7 @@ LL | let sq = || { *x * *x };
|
||||
| -- -- borrow occurs due to use in closure
|
||||
| |
|
||||
| borrow of `x` occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | twice(x);
|
||||
| ^ move out of `x` occurs here
|
||||
LL | invoke(sq);
|
||||
|
@ -3,7 +3,7 @@ error[E0596]: cannot borrow `c` as mutable, as it is not declared as mutable
|
||||
|
|
||||
LL | let c = |a, b, c, d| {};
|
||||
| - help: consider changing this to be mutable: `mut c`
|
||||
LL |
|
||||
LL |
|
||||
LL | A.f(participant_name, &mut c);
|
||||
| ^^^^^^ cannot borrow as mutable
|
||||
|
||||
|
@ -3,7 +3,7 @@ error[E0751]: found both positive and negative implementation of trait `std::mar
|
||||
|
|
||||
LL | unsafe impl<T: MyTrait + 'static> Send for TestType<T> {}
|
||||
| ------------------------------------------------------ positive implementation here
|
||||
LL |
|
||||
LL |
|
||||
LL | impl<T: MyTrait> !Send for TestType<T> {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ negative implementation here
|
||||
|
||||
|
@ -3,7 +3,7 @@ error: conflicting implementations of trait `Trait` for type `for<'a, 'b> fn(&'a
|
||||
|
|
||||
LL | impl Trait for for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32 {}
|
||||
| ------------------------------------------------------------------ first implementation here
|
||||
LL |
|
||||
LL |
|
||||
LL | impl Trait for for<'c> fn(&'c &'c u32, &'c &'c u32) -> &'c u32 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32`
|
||||
|
|
||||
|
@ -3,7 +3,7 @@ error: conflicting implementations of trait `TheTrait` for type `fn(&u8)`
|
||||
|
|
||||
LL | impl<'a> TheTrait for fn(&'a u8) {}
|
||||
| -------------------------------- first implementation here
|
||||
LL |
|
||||
LL |
|
||||
LL | impl TheTrait for fn(&u8) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `fn(&u8)`
|
||||
|
|
||||
|
@ -3,7 +3,7 @@ error[E0119]: conflicting implementations of trait `Foo<i32>` for type `i32`
|
||||
|
|
||||
LL | impl Foo<i32> for i32 { }
|
||||
| --------------------- first implementation here
|
||||
LL |
|
||||
LL |
|
||||
LL | impl<A:Iterator> Foo<A::Item> for A { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32`
|
||||
|
|
||||
|
@ -3,7 +3,7 @@ error[E0119]: conflicting implementations of trait `Foo<_>` for type `std::optio
|
||||
|
|
||||
LL | impl <P, T: Foo<P>> Foo<P> for Option<T> {}
|
||||
| ---------------------------------------- first implementation here
|
||||
LL |
|
||||
LL |
|
||||
LL | impl<T, U> Foo<T> for Option<U> { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::option::Option<_>`
|
||||
|
||||
|
@ -3,7 +3,7 @@ error[E0119]: conflicting implementations of trait `Foo<i32>` for type `i32`
|
||||
|
|
||||
LL | impl Foo<i32> for i32 { }
|
||||
| --------------------- first implementation here
|
||||
LL |
|
||||
LL |
|
||||
LL | impl<A:Bar> Foo<A::Output> for A { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32`
|
||||
|
||||
|
@ -3,7 +3,7 @@ warning: conflicting implementations of trait `TheTrait` for type `for<'a, 'b> f
|
||||
|
|
||||
LL | impl TheTrait for for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8 {}
|
||||
| ---------------------------------------------------------- first implementation here
|
||||
LL |
|
||||
LL |
|
||||
LL | impl TheTrait for for<'a> fn(&'a u8, &'a u8) -> &'a u8 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`
|
||||
|
|
||||
|
@ -12,7 +12,7 @@ help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
||||
|
|
||||
LL - pub struct AtLeastByte<T: ?Sized> {
|
||||
LL + pub struct AtLeastByte<T> {
|
||||
|
|
||||
|
|
||||
help: borrowed types always have a statically known size
|
||||
|
|
||||
LL | value: &T,
|
||||
|
@ -21,7 +21,7 @@ help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
||||
|
|
||||
LL - pub struct AtLeastByte<T: ?Sized> {
|
||||
LL + pub struct AtLeastByte<T> {
|
||||
|
|
||||
|
|
||||
help: borrowed types always have a statically known size
|
||||
|
|
||||
LL | value: &T,
|
||||
|
@ -8,7 +8,7 @@ help: the `const` keyword is only needed in the definition of the type
|
||||
|
|
||||
LL - impl Foo<const 3> for Bar {
|
||||
LL + impl Foo<3> for Bar {
|
||||
|
|
||||
|
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -8,7 +8,7 @@ help: the `const` keyword is only needed in the definition of the type
|
||||
|
|
||||
LL - impl Foo<N = const 3> for Bar {
|
||||
LL + impl Foo<N = 3> for Bar {
|
||||
|
|
||||
|
|
||||
|
||||
error[E0658]: associated const equality is incomplete
|
||||
--> $DIR/issue-89013.rs:9:10
|
||||
|
@ -13,7 +13,7 @@ help: remove these braces
|
||||
|
|
||||
LL - let _: A<{ 7 }>;
|
||||
LL + let _: A<7>;
|
||||
|
|
||||
|
|
||||
|
||||
warning: 1 warning emitted
|
||||
|
||||
|
@ -21,7 +21,7 @@ help: you can use the `?` operator instead
|
||||
|
|
||||
LL - Ok(try!(Ok(())))
|
||||
LL + Ok(Ok(())?)
|
||||
|
|
||||
|
|
||||
help: alternatively, you can still access the deprecated `try!()` macro using the "raw identifier" syntax
|
||||
|
|
||||
LL | Ok(r#try!(Ok(())))
|
||||
|
@ -23,7 +23,7 @@ error[E0599]: the method `use_eq` exists for struct `Object<NoDerives>`, but its
|
||||
|
|
||||
LL | pub struct NoDerives;
|
||||
| --------------------- doesn't satisfy `NoDerives: Eq`
|
||||
LL |
|
||||
LL |
|
||||
LL | struct Object<T>(T);
|
||||
| -------------------- method `use_eq` not found for this
|
||||
...
|
||||
@ -42,7 +42,7 @@ error[E0599]: the method `use_ord` exists for struct `Object<NoDerives>`, but it
|
||||
|
|
||||
LL | pub struct NoDerives;
|
||||
| --------------------- doesn't satisfy `NoDerives: Ord`
|
||||
LL |
|
||||
LL |
|
||||
LL | struct Object<T>(T);
|
||||
| -------------------- method `use_ord` not found for this
|
||||
...
|
||||
@ -64,7 +64,7 @@ LL | pub struct NoDerives;
|
||||
| |
|
||||
| doesn't satisfy `NoDerives: Ord`
|
||||
| doesn't satisfy `NoDerives: PartialOrd`
|
||||
LL |
|
||||
LL |
|
||||
LL | struct Object<T>(T);
|
||||
| -------------------- method `use_ord_and_partial_ord` not found for this
|
||||
...
|
||||
|
@ -30,7 +30,7 @@ help: consider removing `&` from the pattern
|
||||
|
|
||||
LL - let &&x = &1isize as &dyn T;
|
||||
LL + let &x = &1isize as &dyn T;
|
||||
|
|
||||
|
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/destructure-trait-ref.rs:36:11
|
||||
@ -46,7 +46,7 @@ help: consider removing `&` from the pattern
|
||||
|
|
||||
LL - let &&&x = &(&1isize as &dyn T);
|
||||
LL + let &&x = &(&1isize as &dyn T);
|
||||
|
|
||||
|
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/destructure-trait-ref.rs:40:13
|
||||
|
@ -71,7 +71,7 @@ help: try removing this `?`
|
||||
|
|
||||
LL - c()?
|
||||
LL + c()
|
||||
|
|
||||
|
|
||||
help: try adding an expression at the end of the block
|
||||
|
|
||||
LL ~ c()?;
|
||||
|
@ -13,7 +13,7 @@ help: try removing `&mut` here
|
||||
|
|
||||
LL - self.run(&mut self);
|
||||
LL + self.run(self);
|
||||
|
|
||||
|
|
||||
|
||||
error[E0502]: cannot borrow `self` as mutable because it is also borrowed as immutable
|
||||
--> $DIR/issue-34126.rs:6:18
|
||||
|
@ -11,7 +11,7 @@ help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
||||
|
|
||||
LL - fn test1<T: ?Sized + Foo>(t: &T) {
|
||||
LL + fn test1<T: Foo>(t: &T) {
|
||||
|
|
||||
|
|
||||
|
||||
error[E0277]: the size for values of type `T` cannot be known at compilation time
|
||||
--> $DIR/dst-object-from-unsized-type.rs:13:23
|
||||
@ -26,7 +26,7 @@ help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
||||
|
|
||||
LL - fn test2<T: ?Sized + Foo>(t: &T) {
|
||||
LL + fn test2<T: Foo>(t: &T) {
|
||||
|
|
||||
|
|
||||
|
||||
error[E0277]: the size for values of type `str` cannot be known at compilation time
|
||||
--> $DIR/dst-object-from-unsized-type.rs:18:28
|
||||
|
@ -15,7 +15,7 @@ help: use `dyn`
|
||||
|
|
||||
LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
|
||||
LL + fn function(x: &dyn SomeTrait, y: Box<SomeTrait>) {
|
||||
|
|
||||
|
|
||||
|
||||
error: trait objects without an explicit `dyn` are deprecated
|
||||
--> $DIR/dyn-2018-edition-lint.rs:4:35
|
||||
@ -29,7 +29,7 @@ help: use `dyn`
|
||||
|
|
||||
LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
|
||||
LL + fn function(x: &SomeTrait, y: Box<dyn SomeTrait>) {
|
||||
|
|
||||
|
|
||||
|
||||
error: trait objects without an explicit `dyn` are deprecated
|
||||
--> $DIR/dyn-2018-edition-lint.rs:17:14
|
||||
@ -43,7 +43,7 @@ help: use `dyn`
|
||||
|
|
||||
LL - let _x: &SomeTrait = todo!();
|
||||
LL + let _x: &dyn SomeTrait = todo!();
|
||||
|
|
||||
|
|
||||
|
||||
error: trait objects without an explicit `dyn` are deprecated
|
||||
--> $DIR/dyn-2018-edition-lint.rs:4:17
|
||||
@ -57,7 +57,7 @@ help: use `dyn`
|
||||
|
|
||||
LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
|
||||
LL + fn function(x: &dyn SomeTrait, y: Box<SomeTrait>) {
|
||||
|
|
||||
|
|
||||
|
||||
error: trait objects without an explicit `dyn` are deprecated
|
||||
--> $DIR/dyn-2018-edition-lint.rs:4:17
|
||||
@ -71,7 +71,7 @@ help: use `dyn`
|
||||
|
|
||||
LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
|
||||
LL + fn function(x: &dyn SomeTrait, y: Box<SomeTrait>) {
|
||||
|
|
||||
|
|
||||
|
||||
error: trait objects without an explicit `dyn` are deprecated
|
||||
--> $DIR/dyn-2018-edition-lint.rs:4:35
|
||||
@ -85,7 +85,7 @@ help: use `dyn`
|
||||
|
|
||||
LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
|
||||
LL + fn function(x: &SomeTrait, y: Box<dyn SomeTrait>) {
|
||||
|
|
||||
|
|
||||
|
||||
error: trait objects without an explicit `dyn` are deprecated
|
||||
--> $DIR/dyn-2018-edition-lint.rs:4:35
|
||||
@ -99,7 +99,7 @@ help: use `dyn`
|
||||
|
|
||||
LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
|
||||
LL + fn function(x: &SomeTrait, y: Box<dyn SomeTrait>) {
|
||||
|
|
||||
|
|
||||
|
||||
error: aborting due to 7 previous errors
|
||||
|
||||
|
@ -8,7 +8,7 @@ help: add `dyn` keyword before this trait
|
||||
|
|
||||
LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
|
||||
LL + fn function(x: &dyn SomeTrait, y: Box<SomeTrait>) {
|
||||
|
|
||||
|
|
||||
|
||||
error[E0782]: trait objects must include the `dyn` keyword
|
||||
--> $DIR/dyn-2021-edition-error.rs:3:35
|
||||
@ -20,7 +20,7 @@ help: add `dyn` keyword before this trait
|
||||
|
|
||||
LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
|
||||
LL + fn function(x: &SomeTrait, y: Box<dyn SomeTrait>) {
|
||||
|
|
||||
|
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
@ -15,7 +15,7 @@ help: use `dyn`
|
||||
|
|
||||
LL - <fmt::Debug>::fmt(self, f)
|
||||
LL + <dyn fmt::Debug>::fmt(self, f)
|
||||
|
|
||||
|
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -24,7 +24,7 @@ help: `E::Empty4` is a unit variant, you need to write it without the parenthese
|
||||
|
|
||||
LL - let e4 = E::Empty4();
|
||||
LL + let e4 = E::Empty4;
|
||||
|
|
||||
|
|
||||
|
||||
error[E0618]: expected function, found `empty_struct::XEmpty2`
|
||||
--> $DIR/empty-struct-unit-expr.rs:18:15
|
||||
@ -46,7 +46,7 @@ help: `XE::XEmpty4` is a unit variant, you need to write it without the parenthe
|
||||
|
|
||||
LL - let xe4 = XE::XEmpty4();
|
||||
LL + let xe4 = XE::XEmpty4;
|
||||
|
|
||||
|
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
@ -10,7 +10,7 @@ help: primitive type `u32` doesn't have generic parameters
|
||||
|
|
||||
LL - type X = u32<i32>;
|
||||
LL + type X = u32;
|
||||
|
|
||||
|
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -10,7 +10,7 @@ help: primitive type `u32` doesn't have generic parameters
|
||||
|
|
||||
LL - type X = u32<'static>;
|
||||
LL + type X = u32;
|
||||
|
|
||||
|
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -3,7 +3,7 @@ error[E0255]: the name `foo` is defined multiple times
|
||||
|
|
||||
LL | use bar::foo;
|
||||
| -------- previous import of the value `foo` here
|
||||
LL |
|
||||
LL |
|
||||
LL | fn foo() {}
|
||||
| ^^^^^^^^ `foo` redefined here
|
||||
|
|
||||
|
@ -3,7 +3,7 @@ error[E0259]: the name `alloc` is defined multiple times
|
||||
|
|
||||
LL | extern crate alloc;
|
||||
| ------------------- previous import of the extern crate `alloc` here
|
||||
LL |
|
||||
LL |
|
||||
LL | extern crate libc as alloc;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `alloc` reimported here
|
||||
|
|
||||
|
@ -3,7 +3,7 @@ error[E0260]: the name `alloc` is defined multiple times
|
||||
|
|
||||
LL | extern crate alloc;
|
||||
| ------------------- previous import of the extern crate `alloc` here
|
||||
LL |
|
||||
LL |
|
||||
LL | mod alloc {
|
||||
| ^^^^^^^^^ `alloc` redefined here
|
||||
|
|
||||
|
@ -3,7 +3,7 @@ error[E0393]: the type parameter `T` must be explicitly specified
|
||||
|
|
||||
LL | trait A<T=Self> {}
|
||||
| ------------------ type parameter `T` must be specified for this
|
||||
LL |
|
||||
LL |
|
||||
LL | fn together_we_will_rule_the_galaxy(son: &dyn A) {}
|
||||
| ^ help: set the type parameter to the desired type: `A<T>`
|
||||
|
|
||||
|
@ -31,7 +31,7 @@ error[E0423]: expected function, tuple struct or tuple variant, found struct `Fo
|
||||
|
|
||||
LL | struct Foo { a: bool };
|
||||
| ---------------------- `Foo` defined here
|
||||
LL |
|
||||
LL |
|
||||
LL | let f = Foo();
|
||||
| ^^^^^
|
||||
...
|
||||
|
@ -8,7 +8,7 @@ help: consider importing the module directly
|
||||
|
|
||||
LL - use std::fmt::self;
|
||||
LL + use std::fmt;
|
||||
|
|
||||
|
|
||||
help: alternatively, use the multi-path `use` syntax to import `self`
|
||||
|
|
||||
LL | use std::fmt::{self};
|
||||
|
@ -3,7 +3,7 @@ error[E0446]: private type `Bar` in public interface
|
||||
|
|
||||
LL | struct Bar(u32);
|
||||
| ---------------- `Bar` declared as private
|
||||
LL |
|
||||
LL |
|
||||
LL | pub fn bar() -> Bar {
|
||||
| ^^^^^^^^^^^^^^^^^^^ can't leak private type
|
||||
|
||||
|
@ -3,7 +3,7 @@ error[E0453]: allow(non_snake_case) incompatible with previous forbid
|
||||
|
|
||||
LL | #![forbid(non_snake_case)]
|
||||
| -------------- `forbid` level set here
|
||||
LL |
|
||||
LL |
|
||||
LL | #[allow(non_snake_case)]
|
||||
| ^^^^^^^^^^^^^^ overruled by previous forbid
|
||||
|
||||
@ -12,7 +12,7 @@ error[E0453]: allow(non_snake_case) incompatible with previous forbid
|
||||
|
|
||||
LL | #![forbid(non_snake_case)]
|
||||
| -------------- `forbid` level set here
|
||||
LL |
|
||||
LL |
|
||||
LL | #[allow(non_snake_case)]
|
||||
| ^^^^^^^^^^^^^^ overruled by previous forbid
|
||||
|
||||
|
@ -3,7 +3,7 @@ error[E0505]: cannot move out of `fancy_num` because it is borrowed
|
||||
|
|
||||
LL | let fancy_ref = &fancy_num;
|
||||
| ---------- borrow of `fancy_num` occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | let x = move || {
|
||||
| ^^^^^^^ move out of `fancy_num` occurs here
|
||||
LL | println!("child function: {}", fancy_num.num);
|
||||
|
@ -5,7 +5,7 @@ LL | let fancy_ref = &fancy_num;
|
||||
| ---------- borrow of `fancy_num` occurs here
|
||||
LL | fancy_num = FancyNum { num: 6 };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | println!("Num: {}, Ref: {}", fancy_num.num, fancy_ref.num);
|
||||
| ------------- borrow later used here
|
||||
|
||||
|
@ -14,7 +14,7 @@ help: consider borrowing the value
|
||||
|
|
||||
LL - v as &u8;
|
||||
LL + &*v;
|
||||
|
|
||||
|
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
@ -13,7 +13,7 @@ help: `X::Entry` is a unit variant, you need to write it without the parentheses
|
||||
|
|
||||
LL - X::Entry();
|
||||
LL + X::Entry;
|
||||
|
|
||||
|
|
||||
|
||||
error[E0618]: expected function, found `i32`
|
||||
--> $DIR/E0618.rs:9:5
|
||||
|
@ -30,7 +30,7 @@ help: consider removing the borrow
|
||||
|
|
||||
LL - if &true {}
|
||||
LL + if true {}
|
||||
|
|
||||
|
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/if-no-match-bindings.rs:21:8
|
||||
@ -42,7 +42,7 @@ help: consider removing the borrow
|
||||
|
|
||||
LL - if &mut true {}
|
||||
LL + if true {}
|
||||
|
|
||||
|
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/if-no-match-bindings.rs:24:11
|
||||
@ -76,7 +76,7 @@ help: consider removing the borrow
|
||||
|
|
||||
LL - while &true {}
|
||||
LL + while true {}
|
||||
|
|
||||
|
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/if-no-match-bindings.rs:27:11
|
||||
@ -88,7 +88,7 @@ help: consider removing the borrow
|
||||
|
|
||||
LL - while &mut true {}
|
||||
LL + while true {}
|
||||
|
|
||||
|
|
||||
|
||||
error: aborting due to 8 previous errors
|
||||
|
||||
|
@ -3,7 +3,7 @@ error[E0119]: conflicting implementations of trait `Foo` for type `&_`
|
||||
|
|
||||
LL | impl<T: std::ops::DerefMut> Foo for T { }
|
||||
| ------------------------------------- first implementation here
|
||||
LL |
|
||||
LL |
|
||||
LL | impl<T> Foo for &T { }
|
||||
| ^^^^^^^^^^^^^^^^^^ conflicting implementation for `&_`
|
||||
|
||||
|
@ -93,7 +93,7 @@ error: invalid format string: expected `'}'` but string was terminated
|
||||
|
|
||||
LL | {
|
||||
| - because of this opening brace
|
||||
LL |
|
||||
LL |
|
||||
LL | "###);
|
||||
| ^ expected `'}'` in format string
|
||||
|
|
||||
|
@ -9,7 +9,7 @@ help: if `Iterator::Item` is an associated type you're trying to set, use the as
|
||||
|
|
||||
LL - fn sum<I: Iterator<Item = ()>>(i: I) -> i32 where I::Item = i32 {
|
||||
LL + fn sum<I: Iterator<Item = (), Item = i32>>(i: I) -> i32 where {
|
||||
|
|
||||
|
|
||||
|
||||
error: equality constraints are not yet supported in `where` clauses
|
||||
--> $DIR/equality-bound.rs:5:41
|
||||
@ -22,7 +22,7 @@ help: if `Iterator::Item` is an associated type you're trying to set, use the as
|
||||
|
|
||||
LL - fn sum2<I: Iterator>(i: I) -> i32 where I::Item = i32 {
|
||||
LL + fn sum2<I: Iterator<Item = i32>>(i: I) -> i32 where {
|
||||
|
|
||||
|
|
||||
|
||||
error: equality constraints are not yet supported in `where` clauses
|
||||
--> $DIR/equality-bound.rs:9:41
|
||||
|
@ -3,10 +3,10 @@ error[E0502]: cannot borrow `my_stuff` as mutable because it is also borrowed as
|
||||
|
|
||||
LL | let (_, thing) = my_stuff.iter().next().unwrap();
|
||||
| --------------- immutable borrow occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | my_stuff.clear();
|
||||
| ^^^^^^^^^^^^^^^^ mutable borrow occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | println!("{}", *thing);
|
||||
| ------ immutable borrow later used here
|
||||
|
||||
|
@ -11,7 +11,7 @@ help: try removing the generic parameter and using `impl Trait` instead
|
||||
|
|
||||
LL - fn foo<U: Debug>(&self, _: &U) { }
|
||||
LL + fn foo(&self, _: &impl Debug) { }
|
||||
|
|
||||
|
|
||||
|
||||
error[E0643]: method `bar` has incompatible signature for trait
|
||||
--> $DIR/impl-generic-mismatch.rs:17:23
|
||||
|
@ -3,7 +3,7 @@ error[E0720]: cannot resolve opaque type
|
||||
|
|
||||
LL | fn id<T>(t: T) -> impl Sized { t }
|
||||
| ---------- returning this opaque type `impl Sized`
|
||||
LL |
|
||||
LL |
|
||||
LL | fn recursive_id() -> impl Sized {
|
||||
| ^^^^^^^^^^ recursive opaque type
|
||||
LL | id(recursive_id2())
|
||||
@ -25,7 +25,7 @@ error[E0720]: cannot resolve opaque type
|
||||
|
|
||||
LL | fn wrap<T>(t: T) -> impl Sized { (t,) }
|
||||
| ---------- returning this opaque type `impl Sized`
|
||||
LL |
|
||||
LL |
|
||||
LL | fn recursive_wrap() -> impl Sized {
|
||||
| ^^^^^^^^^^ recursive opaque type
|
||||
LL | wrap(recursive_wrap2())
|
||||
|
@ -14,7 +14,7 @@ help: consider importing the module directly
|
||||
|
|
||||
LL - use foo::self;
|
||||
LL + use foo;
|
||||
|
|
||||
|
|
||||
help: alternatively, use the multi-path `use` syntax to import `self`
|
||||
|
|
||||
LL | use foo::{self};
|
||||
|
@ -9,7 +9,7 @@ help: a macro with this name exists at the root of the crate
|
||||
|
|
||||
LL - use issue_59764::foo::{baz, makro};
|
||||
LL + use issue_59764::{makro, foo::{baz}};
|
||||
|
|
||||
|
|
||||
|
||||
error[E0432]: unresolved import `issue_59764::foo::makro`
|
||||
--> $DIR/issue-59764.rs:21:9
|
||||
@ -52,7 +52,7 @@ help: a macro with this name exists at the root of the crate
|
||||
|
|
||||
LL - use issue_59764::foo::{baz, makro, foobar};
|
||||
LL + use issue_59764::{makro, foo::{baz, foobar}};
|
||||
|
|
||||
|
|
||||
|
||||
error[E0432]: unresolved import `issue_59764::foo::makro`
|
||||
--> $DIR/issue-59764.rs:40:9
|
||||
@ -97,7 +97,7 @@ help: a macro with this name exists at the root of the crate
|
||||
|
|
||||
LL - use issue_59764::{foobaz, foo::makro};
|
||||
LL + use issue_59764::{makro, foobaz};
|
||||
|
|
||||
|
|
||||
|
||||
error[E0432]: unresolved import `issue_59764::foo::makro`
|
||||
--> $DIR/issue-59764.rs:59:42
|
||||
@ -110,7 +110,7 @@ help: a macro with this name exists at the root of the crate
|
||||
|
|
||||
LL - use issue_59764::{foobaz, foo::{baz, makro}};
|
||||
LL + use issue_59764::{makro, foobaz, foo::{baz}};
|
||||
|
|
||||
|
|
||||
|
||||
error[E0432]: unresolved import `issue_59764::foo::makro`
|
||||
--> $DIR/issue-59764.rs:68:13
|
||||
@ -155,7 +155,7 @@ help: a macro with this name exists at the root of the crate
|
||||
|
|
||||
LL - use issue_59764::{foobaz, foo::{baz, makro, barbaz::{barfoo}}};
|
||||
LL + use issue_59764::{makro, foobaz, foo::{baz, barbaz::{barfoo}}};
|
||||
|
|
||||
|
|
||||
|
||||
error[E0432]: unresolved import `issue_59764::foo::makro`
|
||||
--> $DIR/issue-59764.rs:93:13
|
||||
@ -196,7 +196,7 @@ help: a macro with this name exists at the root of the crate
|
||||
|
|
||||
LL - use issue_59764::foo::{baz, makro as foobar};
|
||||
LL + use issue_59764::{makro as foobar, foo::{baz}};
|
||||
|
|
||||
|
|
||||
|
||||
error[E0432]: unresolved import `issue_59764::foo::makro`
|
||||
--> $DIR/issue-59764.rs:120:17
|
||||
|
@ -48,7 +48,7 @@ help: consider removing the borrow
|
||||
|
|
||||
LL - foo(&"aaa".to_owned());
|
||||
LL + foo("aaa".to_owned());
|
||||
|
|
||||
|
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/deref-suggestion.rs:32:9
|
||||
@ -67,7 +67,7 @@ help: consider removing the borrow
|
||||
|
|
||||
LL - foo(&mut "aaa".to_owned());
|
||||
LL + foo("aaa".to_owned());
|
||||
|
|
||||
|
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/deref-suggestion.rs:2:20
|
||||
|
@ -7,7 +7,7 @@ LL | let mut f = || v.push(2);
|
||||
| borrow of `v` occurs here
|
||||
LL | let _w = v;
|
||||
| ^ move out of `v` occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | f();
|
||||
| - borrow later used here
|
||||
|
||||
|
@ -3,7 +3,7 @@ error[E0393]: the type parameter `T` must be explicitly specified
|
||||
|
|
||||
LL | trait A<T=Self> {}
|
||||
| ------------------ type parameter `T` must be specified for this
|
||||
LL |
|
||||
LL |
|
||||
LL | fn f(a: &dyn A) {}
|
||||
| ^ help: set the type parameter to the desired type: `A<T>`
|
||||
|
|
||||
|
@ -3,7 +3,7 @@ error[E0428]: the name `foo` is defined multiple times
|
||||
|
|
||||
LL | fn foo();
|
||||
| --------- previous definition of the value `foo` here
|
||||
LL |
|
||||
LL |
|
||||
LL | / pub
|
||||
LL | | fn foo();
|
||||
| |___________^ `foo` redefined here
|
||||
|
@ -8,7 +8,7 @@ help: consider borrowing the value
|
||||
|
|
||||
LL - let _q: &isize = p as &isize;
|
||||
LL + let _q: &isize = &*p;
|
||||
|
|
||||
|
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -3,7 +3,7 @@ error[E0428]: the name `A` is defined multiple times
|
||||
|
|
||||
LL | enum A { B, C }
|
||||
| ------ previous definition of the type `A` here
|
||||
LL |
|
||||
LL |
|
||||
LL | enum A { D, E }
|
||||
| ^^^^^^ `A` redefined here
|
||||
|
|
||||
|
@ -3,7 +3,7 @@ error[E0428]: the name `a` is defined multiple times
|
||||
|
|
||||
LL | pub mod a {}
|
||||
| --------- previous definition of the module `a` here
|
||||
LL |
|
||||
LL |
|
||||
LL | pub mod a {}
|
||||
| ^^^^^^^^^ `a` redefined here
|
||||
|
|
||||
|
@ -3,7 +3,7 @@ error[E0308]: mismatched types
|
||||
|
|
||||
LL | struct Foo(u32);
|
||||
| ---------------- fn(u32) -> Foo {Foo} defined here
|
||||
LL |
|
||||
LL |
|
||||
LL | fn test() -> Foo { Foo }
|
||||
| --- ^^^ expected struct `Foo`, found fn item
|
||||
| |
|
||||
|
@ -3,7 +3,7 @@ error: captured variable cannot escape `FnMut` closure body
|
||||
|
|
||||
LL | let mut x: Box<()> = Box::new(());
|
||||
| ----- variable defined here
|
||||
LL |
|
||||
LL |
|
||||
LL | || {
|
||||
| - inferred to be a `FnMut` closure
|
||||
LL | &mut x
|
||||
|
@ -3,7 +3,7 @@ error: captured variable cannot escape `FnMut` closure body
|
||||
|
|
||||
LL | let mut x: Vec<()> = Vec::new();
|
||||
| ----- variable defined here
|
||||
LL |
|
||||
LL |
|
||||
LL | || {
|
||||
| - inferred to be a `FnMut` closure
|
||||
LL | / || {
|
||||
|
@ -5,7 +5,7 @@ LL | / fn bar() {
|
||||
LL | | Foo { baz: 0 }.bar();
|
||||
LL | | }
|
||||
| |_____- previous definition of `bar` here
|
||||
LL |
|
||||
LL |
|
||||
LL | / fn bar() {
|
||||
LL | | }
|
||||
| |_____^ duplicate definition
|
||||
|
@ -3,7 +3,7 @@ error[E0502]: cannot borrow `heap` as immutable because it is also borrowed as m
|
||||
|
|
||||
LL | let borrow = heap.peek_mut();
|
||||
| --------------- mutable borrow occurs here
|
||||
LL |
|
||||
LL |
|
||||
LL | match (borrow, ()) {
|
||||
| ------------ a temporary with access to the mutable borrow is created here ...
|
||||
LL | (Some(_), ()) => {
|
||||
|
@ -11,7 +11,7 @@ help: move the `..` to the end of the field list
|
||||
|
|
||||
LL - let Point { .., y, } = p;
|
||||
LL + let Point { y, .. } = p;
|
||||
|
|
||||
|
|
||||
|
||||
error: expected `}`, found `,`
|
||||
--> $DIR/issue-49257.rs:11:19
|
||||
@ -26,7 +26,7 @@ help: move the `..` to the end of the field list
|
||||
|
|
||||
LL - let Point { .., y } = p;
|
||||
LL + let Point { y , .. } = p;
|
||||
|
|
||||
|
|
||||
|
||||
error: expected `}`, found `,`
|
||||
--> $DIR/issue-49257.rs:12:19
|
||||
|
@ -11,7 +11,7 @@ help: try removing this `?`
|
||||
|
|
||||
LL - missing_discourses()?
|
||||
LL + missing_discourses()
|
||||
|
|
||||
|
|
||||
help: try wrapping the expression in `Ok`
|
||||
|
|
||||
LL | Ok(missing_discourses()?)
|
||||
|
@ -3,7 +3,7 @@ error[E0423]: expected function, tuple struct or tuple variant, found struct `X`
|
||||
|
|
||||
LL | struct X {}
|
||||
| ----------- `X` defined here
|
||||
LL |
|
||||
LL |
|
||||
LL | const Y: X = X("ö");
|
||||
| ^^^^^^ help: use struct literal syntax instead: `X {}`
|
||||
|
||||
|
@ -27,7 +27,7 @@ help: use `dyn`
|
||||
|
|
||||
LL - eq::<dyn, Foo>
|
||||
LL + eq::<dyn, dyn Foo>
|
||||
|
|
||||
|
|
||||
|
||||
error[E0107]: missing generics for trait `Foo`
|
||||
--> $DIR/issue-86756.rs:5:15
|
||||
|
@ -59,7 +59,7 @@ help: or remove `.into_iter()` to iterate by value
|
||||
|
|
||||
LL - for _ in [1, 2, 3].into_iter() {}
|
||||
LL + for _ in [1, 2, 3] {}
|
||||
|
|
||||
|
|
||||
|
||||
warning: 5 warnings emitted
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user