]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-32995.rs
Auto merge of #57108 - Mark-Simulacrum:license-remove, r=pietroalbini
[rust.git] / src / test / ui / issues / issue-32995.rs
1 #![allow(unused)]
2
3 fn main() {
4     let x: usize() = 1;
5     //~^ ERROR parenthesized parameters may only be used with a trait
6     //~| WARN previously accepted
7
8     let b: ::std::boxed()::Box<_> = Box::new(1);
9     //~^ ERROR parenthesized parameters may only be used with a trait
10     //~| WARN previously accepted
11
12     let p = ::std::str::()::from_utf8(b"foo").unwrap();
13     //~^ ERROR parenthesized parameters may only be used with a trait
14     //~| WARN previously accepted
15
16     let p = ::std::str::from_utf8::()(b"foo").unwrap();
17     //~^ ERROR parenthesized parameters may only be used with a trait
18     //~| WARN previously accepted
19
20     let o : Box<::std::marker()::Send> = Box::new(1);
21     //~^ ERROR parenthesized parameters may only be used with a trait
22     //~| WARN previously accepted
23
24     let o : Box<Send + ::std::marker()::Sync> = Box::new(1);
25     //~^ ERROR parenthesized parameters may only be used with a trait
26     //~| WARN previously accepted
27 }
28
29 fn foo<X:Default>() {
30     let d : X() = Default::default();
31     //~^ ERROR parenthesized parameters may only be used with a trait
32     //~| WARN previously accepted
33 }