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
4 changes: 4 additions & 0 deletions tests/ui/traits/suggest-remove-reference-in-where-clause.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
use std::borrow::Borrow;
pub const F: for<'a> fn(&'a &'static String) -> &'a str = <&'static String as Borrow<str>>::borrow;
//~^ ERROR E0277
fn main() {}
15 changes: 15 additions & 0 deletions tests/ui/traits/suggest-remove-reference-in-where-clause.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
error[E0277]: the trait bound `&'static String: Borrow<str>` is not satisfied
--> $DIR/suggest-remove-reference-in-where-clause.rs:2:60
|
LL | pub const F: for<'a> fn(&'a &'static String) -> &'a str = <&'static String as Borrow<str>>::borrow;
| ^^^^^^^^^^^^^^^ the trait `Borrow<str>` is not implemented for `&'static String`
|
help: consider removing the leading `&`-reference
|
LL - pub const F: for<'a> fn(&'a &'static String) -> &'a str = <&'static String as Borrow<str>>::borrow;
LL + pub const F: for<'a> fn(&'a &'static String) -> &'a str = <String as Borrow<str>>::borrow;
|

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0277`.
Loading