rust/tests/ui/issues/issue-32995.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
952 B
Rust
Raw Normal View History

2017-05-26 13:20:53 +00:00
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
2017-07-29 01:47:12 +00:00
let p = ::std::str::()::from_utf8(b"foo").unwrap();
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
2017-07-29 01:47:12 +00:00
let p = ::std::str::from_utf8::()(b"foo").unwrap();
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
2019-05-28 18:46:13 +00:00
let o : Box<dyn (::std::marker()::Send)> = Box::new(1);
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
2019-05-28 18:46:13 +00:00
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
}