mirror of
https://git.proxmox.com/git/rustc
synced 2025-08-17 05:00:17 +00:00
16 lines
328 B
Rust
16 lines
328 B
Rust
// Regression test for #98565: Provide diagnostics when the user uses
|
|
// the built-in type `str` in a cast where a trait is expected.
|
|
|
|
trait Foo {
|
|
fn foo(&self);
|
|
}
|
|
|
|
impl Foo for String {
|
|
fn foo(&self) {
|
|
<Self as str>::trim(self);
|
|
//~^ ERROR expected trait, found builtin type `str`
|
|
}
|
|
}
|
|
|
|
fn main() {}
|