hack to avoid incorrect suggestion
This commit is contained in:
parent
d201e278ba
commit
3ea0d10979
@ -1055,6 +1055,13 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||
.filter(|c| !c.is_whitespace())
|
||||
.take_while(|c| *c == '&')
|
||||
.count();
|
||||
if let Some('\'') = snippet.chars()
|
||||
.filter(|c| !c.is_whitespace())
|
||||
.skip(refs_number)
|
||||
.next()
|
||||
{ // Do not suggest removal of borrow from type arguments.
|
||||
return;
|
||||
}
|
||||
|
||||
let mut trait_type = trait_ref.self_ty();
|
||||
|
||||
|
@ -5,10 +5,7 @@ LL | fn assert_copy<T:Copy>() { }
|
||||
| ----------- ---- required by this bound in `assert_copy`
|
||||
...
|
||||
LL | assert_copy::<&'static mut isize>();
|
||||
| -^^^^^^^^^^^^^^^^^
|
||||
| |
|
||||
| the trait `std::marker::Copy` is not implemented for `&'static mut isize`
|
||||
| help: consider removing 1 leading `&`-references
|
||||
| ^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `&'static mut isize`
|
||||
|
|
||||
= help: the following implementations were found:
|
||||
<isize as std::marker::Copy>
|
||||
@ -20,10 +17,7 @@ LL | fn assert_copy<T:Copy>() { }
|
||||
| ----------- ---- required by this bound in `assert_copy`
|
||||
...
|
||||
LL | assert_copy::<&'a mut isize>();
|
||||
| -^^^^^^^^^^^^
|
||||
| |
|
||||
| the trait `std::marker::Copy` is not implemented for `&'a mut isize`
|
||||
| help: consider removing 1 leading `&`-references
|
||||
| ^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `&'a mut isize`
|
||||
|
|
||||
= help: the following implementations were found:
|
||||
<isize as std::marker::Copy>
|
||||
|
Loading…
Reference in New Issue
Block a user