fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
379 B15 linesraw
1// run-rustfix
2fn takes_str(_x: &str) {}
3
4fn takes_type_parameter<T>(_x: T) where T: SomeTrait {}
5
6trait SomeTrait {}
7impl SomeTrait for &'_ str {}
8impl SomeTrait for char {}
9
10fn main() {
11    let string = String::new();
12    takes_str(&string);             // Ok
13    takes_type_parameter(&*string);  // Error
14    //~^ ERROR the trait bound `&String: SomeTrait` is not satisfied
15}