about summary refs log tree commit diff
path: root/tests/ui/traits/fully-qualified-syntax-cast.rs
blob: 740220a074b331bafc4e57fde6e5407db5170bd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// 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() {}