2017-05-26 22:20:53 +09:00
|
|
|
fn main() {
|
2017-05-09 22:32:29 +09:00
|
|
|
let x: usize() = 1;
|
2019-01-20 02:45:38 -08:00
|
|
|
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
2017-05-09 22:32:29 +09:00
|
|
|
|
|
|
|
let b: ::std::boxed()::Box<_> = Box::new(1);
|
2019-01-20 02:45:38 -08:00
|
|
|
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
2017-05-15 15:21:01 +09:00
|
|
|
|
2017-07-29 04:47:12 +03:00
|
|
|
let p = ::std::str::()::from_utf8(b"foo").unwrap();
|
2019-01-20 02:45:38 -08:00
|
|
|
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
2017-05-15 15:21:01 +09:00
|
|
|
|
2017-07-29 04:47:12 +03:00
|
|
|
let p = ::std::str::from_utf8::()(b"foo").unwrap();
|
2019-01-20 02:45:38 -08:00
|
|
|
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
2017-05-15 15:21:01 +09:00
|
|
|
|
2019-05-28 14:46:13 -04:00
|
|
|
let o : Box<dyn (::std::marker()::Send)> = Box::new(1);
|
2019-01-20 02:45:38 -08:00
|
|
|
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
2017-05-15 15:21:01 +09:00
|
|
|
|
2019-05-28 14:46:13 -04:00
|
|
|
let o : Box<dyn Send + ::std::marker()::Sync> = Box::new(1);
|
2019-01-20 02:45:38 -08:00
|
|
|
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
2017-05-09 22:32:29 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
fn foo<X:Default>() {
|
|
|
|
let d : X() = Default::default();
|
2019-01-20 02:45:38 -08:00
|
|
|
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
|
2017-05-09 22:32:29 +09:00
|
|
|
}
|