rust/src/test/ui/suggestions/remove-as_str.rs

22 lines
517 B
Rust
Raw Normal View History

2019-09-24 10:02:21 -05:00
fn foo1(s: &str) {
s.as_str();
//~^ ERROR no method named `as_str` found for type `&str` in the current scope
}
fn foo2<'a>(s: &'a str) {
s.as_str();
//~^ ERROR no method named `as_str` found for type `&'a str` in the current scope
}
fn foo3(s: &mut str) {
s.as_str();
//~^ ERROR no method named `as_str` found for type `&mut str` in the current scope
}
fn foo4(s: &&str) {
s.as_str();
//~^ ERROR no method named `as_str` found for type `&&str` in the current scope
}
fn main() {}