]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/trait-object-bad-parens.rs
Rollup merge of #60850 - SimonSapin:unguarded, r=alexcrichton
[rust.git] / src / test / ui / parser / trait-object-bad-parens.rs
1 // compile-flags: -Z continue-parse-after-error
2
3 #![feature(optin_builtin_traits)]
4 #![allow(bare_trait_objects)]
5
6 auto trait Auto {}
7
8 fn main() {
9     let _: Box<((Auto)) + Auto>;
10     //~^ ERROR expected a path on the left-hand side of `+`, not `((Auto))`
11     let _: Box<(Auto + Auto) + Auto>;
12     //~^ ERROR expected a path on the left-hand side of `+`, not `(Auto + Auto)`
13     let _: Box<(Auto +) + Auto>;
14     //~^ ERROR expected a path on the left-hand side of `+`, not `(Auto)`
15     let _: Box<(dyn Auto) + Auto>;
16     //~^ ERROR expected a path on the left-hand side of `+`, not `(dyn Auto)`
17 }