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