summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-32995.rs
blob: 0d07a76939f2a214aa4f44d942bd4afc7f763660 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
fn main() {
    let x: usize() = 1;
    //~^ ERROR parenthesized type parameters may only be used with a `Fn` trait

    let b: ::std::boxed()::Box<_> = Box::new(1);
    //~^ ERROR parenthesized type parameters may only be used with a `Fn` trait

    let p = ::std::str::()::from_utf8(b"foo").unwrap();
    //~^ ERROR parenthesized type parameters may only be used with a `Fn` trait

    let p = ::std::str::from_utf8::()(b"foo").unwrap();
    //~^ ERROR parenthesized type parameters may only be used with a `Fn` trait

    let o : Box<dyn (::std::marker()::Send)> = Box::new(1);
    //~^ ERROR parenthesized type parameters may only be used with a `Fn` trait

    let o : Box<dyn Send + ::std::marker()::Sync> = Box::new(1);
    //~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
}

fn foo<X:Default>() {
    let d : X() = Default::default();
    //~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
}