summaryrefslogtreecommitdiffstats
path: root/src/test/ui/parser/trait-object-lifetime-parens.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/parser/trait-object-lifetime-parens.rs')
-rw-r--r--src/test/ui/parser/trait-object-lifetime-parens.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/parser/trait-object-lifetime-parens.rs b/src/test/ui/parser/trait-object-lifetime-parens.rs
new file mode 100644
index 000000000..f44ebe5ba
--- /dev/null
+++ b/src/test/ui/parser/trait-object-lifetime-parens.rs
@@ -0,0 +1,13 @@
+#![allow(bare_trait_objects)]
+
+trait Trait {}
+
+fn f<'a, T: Trait + ('a)>() {} //~ ERROR parenthesized lifetime bounds are not supported
+
+fn check<'a>() {
+ let _: Box<Trait + ('a)>; //~ ERROR parenthesized lifetime bounds are not supported
+ // FIXME: It'd be great if we could add suggestion to the following case.
+ let _: Box<('a) + Trait>; //~ ERROR lifetime in trait object type must be followed by `+`
+}
+
+fn main() {}