]> git.lizzy.rs Git - rust.git/commitdiff
Continune parsing after encountering Trait with paren args
authorEsteban Küber <esteban@kuber.com.ar>
Sat, 19 Jan 2019 22:48:43 +0000 (14:48 -0800)
committerEsteban Küber <esteban@kuber.com.ar>
Sun, 20 Jan 2019 02:44:26 +0000 (18:44 -0800)
src/librustc/hir/lowering.rs
src/test/ui/error-codes/E0214.stderr
src/test/ui/issues/issue-23589.stderr
src/test/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct-1.stderr
src/test/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct-3.stderr
src/test/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct.stderr

index 2f7d8f0984e6f439d2c5d72b2c98e60da1dac999..b8aeb6032ba65d7afab0e4fdeda66c945d0ffdc9 100644 (file)
@@ -1826,7 +1826,7 @@ fn lower_path_segment(
                         struct_span_err!(self.sess, data.span, E0214, "{}", msg)
                             .span_label(data.span, "only traits may use parentheses")
                             .emit();
-                        (hir::GenericArgs::none(), true)
+                        (hir::GenericArgs::none(), false)
                     }
                 },
             }
index 08a98b1c3bf3def31cf86e50a32aa7b02939e5e3..f87502efe1b10ac3b40faed202af61ae45d1e7d2 100644 (file)
@@ -4,6 +4,13 @@ error[E0214]: parenthesized parameters may only be used with a trait
 LL |     let v: Vec(&str) = vec!["foo"];
    |               ^^^^^^ only traits may use parentheses
 
-error: aborting due to previous error
+error[E0107]: wrong number of type arguments: expected 1, found 0
+  --> $DIR/E0214.rs:2:12
+   |
+LL |     let v: Vec(&str) = vec!["foo"];
+   |            ^^^^^^^^^ expected 1 type argument
+
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0214`.
+Some errors occurred: E0107, E0214.
+For more information about an error, try `rustc --explain E0107`.
index e6e07c167f349c5c06a621447c7d3eb8c5c7cff7..15f2c524a7a9f25aedf9f15a0366723fdf268bdc 100644 (file)
@@ -4,6 +4,13 @@ error[E0214]: parenthesized parameters may only be used with a trait
 LL |     let v: Vec(&str) = vec!['1', '2'];
    |               ^^^^^^ only traits may use parentheses
 
-error: aborting due to previous error
+error[E0107]: wrong number of type arguments: expected 1, found 0
+  --> $DIR/issue-23589.rs:2:12
+   |
+LL |     let v: Vec(&str) = vec!['1', '2'];
+   |            ^^^^^^^^^ expected 1 type argument
+
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0214`.
+Some errors occurred: E0107, E0214.
+For more information about an error, try `rustc --explain E0107`.
index 3f1b37c282b7c53f7ddc339b2d58d01ac4a78280..ab2a6f03cf7e7c79576443dc3d5a54e93f9be117 100644 (file)
@@ -4,6 +4,13 @@ error[E0214]: parenthesized parameters may only be used with a trait
 LL |     let x: Box<Bar()> = panic!();
    |                   ^^ only traits may use parentheses
 
-error: aborting due to previous error
+error[E0107]: wrong number of type arguments: expected 1, found 0
+  --> $DIR/unboxed-closure-sugar-used-on-struct-1.rs:8:16
+   |
+LL |     let x: Box<Bar()> = panic!();
+   |                ^^^^^ expected 1 type argument
+
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0214`.
+Some errors occurred: E0107, E0214.
+For more information about an error, try `rustc --explain E0107`.
index 395f6596cfd838987fb9757950c3b2a511876864..b4f7a97c3e5fb8213927e9887e1298a8a374ec1a 100644 (file)
@@ -4,6 +4,13 @@ error[E0214]: parenthesized parameters may only be used with a trait
 LL |     let b = Bar::(isize, usize)::new(); // OK too (for the parser)
    |                ^^^^^^^^^^^^^^^^ only traits may use parentheses
 
-error: aborting due to previous error
+error[E0107]: wrong number of type arguments: expected 2, found 0
+  --> $DIR/unboxed-closure-sugar-used-on-struct-3.rs:14:13
+   |
+LL |     let b = Bar::(isize, usize)::new(); // OK too (for the parser)
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^ expected 2 type arguments
+
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0214`.
+Some errors occurred: E0107, E0214.
+For more information about an error, try `rustc --explain E0107`.
index d0267092030d8dc99721e9abf60ab34bdb362ecc..7bcf86774c7be06fcec460a959a91ef98f73edd0 100644 (file)
@@ -4,13 +4,13 @@ error[E0214]: parenthesized parameters may only be used with a trait
 LL | fn foo(b: Box<Bar()>) {
    |                  ^^ only traits may use parentheses
 
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures
+error[E0107]: wrong number of type arguments: expected 1, found 0
   --> $DIR/unboxed-closure-sugar-used-on-struct.rs:7:15
    |
 LL | fn foo(b: Box<Bar()>) {
-   |               ^^^^^ not allowed in type signatures
+   |               ^^^^^ expected 1 type argument
 
 error: aborting due to 2 previous errors
 
-Some errors occurred: E0121, E0214.
-For more information about an error, try `rustc --explain E0121`.
+Some errors occurred: E0107, E0214.
+For more information about an error, try `rustc --explain E0107`.