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