2019-09-24 23:02:21 +08:00
|
|
|
fn foo1(s: &str) {
|
|
|
|
s.as_str();
|
2020-01-08 08:05:31 -08:00
|
|
|
//~^ ERROR no method named `as_str` found
|
2019-09-24 23:02:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
fn foo2<'a>(s: &'a str) {
|
|
|
|
s.as_str();
|
2020-01-08 08:05:31 -08:00
|
|
|
//~^ ERROR no method named `as_str` found
|
2019-09-24 23:02:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
fn foo3(s: &mut str) {
|
|
|
|
s.as_str();
|
2020-01-08 08:05:31 -08:00
|
|
|
//~^ ERROR no method named `as_str` found
|
2019-09-24 23:02:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
fn foo4(s: &&str) {
|
|
|
|
s.as_str();
|
2020-01-08 08:05:31 -08:00
|
|
|
//~^ ERROR no method named `as_str` found
|
2019-09-24 23:02:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|