diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-32995.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-32995.rs b/src/test/ui/issues/issue-32995.rs new file mode 100644 index 000000000..0d07a7693 --- /dev/null +++ b/src/test/ui/issues/issue-32995.rs @@ -0,0 +1,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 +} |