]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/enum-variant-generic-args.stderr
Rollup merge of #57107 - mjbshaw:thread_local_test, r=nikomatsakis
[rust.git] / src / test / ui / enum-variant-generic-args.stderr
index 2d622a49e20aff2461f4c77b811dd5a7d07af904..4d3b576734643f5c32295d611cad086fc652368e 100644 (file)
-error[E0423]: expected function, found struct variant `Enum::SVariant`
-  --> $DIR/enum-variant-generic-args.rs:50:5
-   |
-LL |     Enum::<()>::SVariant::<()>(());
-   |     ^^^^^^^^^^^^--------^^^^^^
-   |     |           |
-   |     |           did you mean `TSVariant`?
-   |     did you mean `Enum::SVariant { /* fields */ }`?
+error[E0308]: mismatched types
+  --> $DIR/enum-variant-generic-args.rs:9:25
+   |
+LL |         Self::TSVariant(());
+   |                         ^^ expected type parameter, found ()
+   |
+   = note: expected type `T`
+              found type `()`
 
 error[E0109]: type arguments are not allowed on this entity
-  --> $DIR/enum-variant-generic-args.rs:9:27
+  --> $DIR/enum-variant-generic-args.rs:11:27
    |
 LL |         Self::TSVariant::<()>(());
    |                           ^^ type argument not allowed
 
 error[E0109]: type arguments are not allowed on this entity
-  --> $DIR/enum-variant-generic-args.rs:11:16
+  --> $DIR/enum-variant-generic-args.rs:13:16
    |
 LL |         Self::<()>::TSVariant(());
    |                ^^ type argument not allowed
 
+error[E0308]: mismatched types
+  --> $DIR/enum-variant-generic-args.rs:13:31
+   |
+LL |         Self::<()>::TSVariant(());
+   |                               ^^ expected type parameter, found ()
+   |
+   = note: expected type `T`
+              found type `()`
+
 error[E0109]: type arguments are not allowed on this entity
-  --> $DIR/enum-variant-generic-args.rs:13:16
+  --> $DIR/enum-variant-generic-args.rs:16:16
    |
 LL |         Self::<()>::TSVariant::<()>(());
    |                ^^ type argument not allowed
 
 error[E0109]: type arguments are not allowed on this entity
-  --> $DIR/enum-variant-generic-args.rs:13:33
+  --> $DIR/enum-variant-generic-args.rs:16:33
    |
 LL |         Self::<()>::TSVariant::<()>(());
    |                                 ^^ type argument not allowed
 
+error[E0308]: mismatched types
+  --> $DIR/enum-variant-generic-args.rs:22:29
+   |
+LL |         Self::SVariant { v: () };
+   |                             ^^ expected type parameter, found ()
+   |
+   = note: expected type `T`
+              found type `()`
+
 error[E0109]: type arguments are not allowed on this entity
-  --> $DIR/enum-variant-generic-args.rs:19:26
+  --> $DIR/enum-variant-generic-args.rs:24:26
    |
-LL |         Self::SVariant::<()>(());
+LL |         Self::SVariant::<()> { v: () };
    |                          ^^ type argument not allowed
 
-error[E0618]: expected function, found enum variant `<Self>::SVariant::<()>`
-  --> $DIR/enum-variant-generic-args.rs:19:9
-   |
-LL | enum Enum<T> { TSVariant(T), SVariant { v: T } }
-   |                              ----------------- `<Self>::SVariant::<()>` defined here
-...
-LL |         Self::SVariant::<()>(());
-   |         ^^^^^^^^^^^^^^^^^^^^----
-   |         |
-   |         call expression requires function
-help: `<Self>::SVariant::<()>` is a unit variant, you need to write it without the parenthesis
-   |
-LL |         <Self>::SVariant::<()>;
-   |         ^^^^^^^^^^^^^^^^^^^^^^
+error[E0308]: mismatched types
+  --> $DIR/enum-variant-generic-args.rs:24:35
+   |
+LL |         Self::SVariant::<()> { v: () };
+   |                                   ^^ expected type parameter, found ()
+   |
+   = note: expected type `T`
+              found type `()`
 
 error[E0109]: type arguments are not allowed on this entity
-  --> $DIR/enum-variant-generic-args.rs:21:16
+  --> $DIR/enum-variant-generic-args.rs:27:16
    |
-LL |         Self::<()>::SVariant(());
+LL |         Self::<()>::SVariant { v: () };
    |                ^^ type argument not allowed
 
-error[E0618]: expected function, found enum variant `<Self<()>>::SVariant`
-  --> $DIR/enum-variant-generic-args.rs:21:9
-   |
-LL | enum Enum<T> { TSVariant(T), SVariant { v: T } }
-   |                              ----------------- `<Self<()>>::SVariant` defined here
-...
-LL |         Self::<()>::SVariant(());
-   |         ^^^^^^^^^^^^^^^^^^^^----
-   |         |
-   |         call expression requires function
-help: `<Self<()>>::SVariant` is a unit variant, you need to write it without the parenthesis
-   |
-LL |         <Self<()>>::SVariant;
-   |         ^^^^^^^^^^^^^^^^^^^^
+error[E0308]: mismatched types
+  --> $DIR/enum-variant-generic-args.rs:27:35
+   |
+LL |         Self::<()>::SVariant { v: () };
+   |                                   ^^ expected type parameter, found ()
+   |
+   = note: expected type `T`
+              found type `()`
 
 error[E0109]: type arguments are not allowed on this entity
-  --> $DIR/enum-variant-generic-args.rs:23:16
+  --> $DIR/enum-variant-generic-args.rs:30:16
    |
-LL |         Self::<()>::SVariant::<()>(());
+LL |         Self::<()>::SVariant::<()> { v: () };
    |                ^^ type argument not allowed
 
 error[E0109]: type arguments are not allowed on this entity
-  --> $DIR/enum-variant-generic-args.rs:23:32
+  --> $DIR/enum-variant-generic-args.rs:30:32
    |
-LL |         Self::<()>::SVariant::<()>(());
+LL |         Self::<()>::SVariant::<()> { v: () };
    |                                ^^ type argument not allowed
 
-error[E0618]: expected function, found enum variant `<Self<()>>::SVariant::<()>`
-  --> $DIR/enum-variant-generic-args.rs:23:9
-   |
-LL | enum Enum<T> { TSVariant(T), SVariant { v: T } }
-   |                              ----------------- `<Self<()>>::SVariant::<()>` defined here
-...
-LL |         Self::<()>::SVariant::<()>(());
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^----
-   |         |
-   |         call expression requires function
-help: `<Self<()>>::SVariant::<()>` is a unit variant, you need to write it without the parenthesis
-   |
-LL |         <Self<()>>::SVariant::<()>;
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
+error[E0308]: mismatched types
+  --> $DIR/enum-variant-generic-args.rs:30:41
+   |
+LL |         Self::<()>::SVariant::<()> { v: () };
+   |                                         ^^ expected type parameter, found ()
+   |
+   = note: expected type `T`
+              found type `()`
 
 error[E0109]: type arguments are not allowed on this entity
-  --> $DIR/enum-variant-generic-args.rs:32:29
+  --> $DIR/enum-variant-generic-args.rs:40:29
    |
 LL |     Enum::<()>::TSVariant::<()>(());
    |                             ^^ type argument not allowed
 
 error[E0109]: type arguments are not allowed on this entity
-  --> $DIR/enum-variant-generic-args.rs:35:24
+  --> $DIR/enum-variant-generic-args.rs:43:24
    |
 LL |     Alias::TSVariant::<()>(());
    |                        ^^ type argument not allowed
 
 error[E0109]: type arguments are not allowed on this entity
-  --> $DIR/enum-variant-generic-args.rs:37:30
+  --> $DIR/enum-variant-generic-args.rs:45:30
    |
 LL |     Alias::<()>::TSVariant::<()>(());
    |                              ^^ type argument not allowed
 
 error[E0109]: type arguments are not allowed on this entity
-  --> $DIR/enum-variant-generic-args.rs:40:29
+  --> $DIR/enum-variant-generic-args.rs:48:29
    |
 LL |     AliasFixed::TSVariant::<()>(());
    |                             ^^ type argument not allowed
 
 error[E0107]: wrong number of type arguments: expected 0, found 1
-  --> $DIR/enum-variant-generic-args.rs:42:18
+  --> $DIR/enum-variant-generic-args.rs:50:18
    |
 LL |     AliasFixed::<()>::TSVariant(());
    |                  ^^ unexpected type argument
 
 error[E0107]: wrong number of type arguments: expected 0, found 1
-  --> $DIR/enum-variant-generic-args.rs:44:18
+  --> $DIR/enum-variant-generic-args.rs:52:18
    |
 LL |     AliasFixed::<()>::TSVariant::<()>(());
    |                  ^^ unexpected type argument
 
 error[E0109]: type arguments are not allowed on this entity
-  --> $DIR/enum-variant-generic-args.rs:44:35
+  --> $DIR/enum-variant-generic-args.rs:52:35
    |
 LL |     AliasFixed::<()>::TSVariant::<()>(());
    |                                   ^^ type argument not allowed
 
 error[E0109]: type arguments are not allowed on this entity
-  --> $DIR/enum-variant-generic-args.rs:53:23
+  --> $DIR/enum-variant-generic-args.rs:58:28
    |
-LL |     Alias::SVariant::<()>(());
-   |                       ^^ type argument not allowed
+LL |     Enum::<()>::SVariant::<()> { v: () };
+   |                            ^^ type argument not allowed
 
-error[E0618]: expected function, found enum variant `<Alias>::SVariant::<()>`
-  --> $DIR/enum-variant-generic-args.rs:53:5
-   |
-LL | enum Enum<T> { TSVariant(T), SVariant { v: T } }
-   |                              ----------------- `<Alias>::SVariant::<()>` defined here
-...
-LL |     Alias::SVariant::<()>(());
-   |     ^^^^^^^^^^^^^^^^^^^^^----
-   |     |
-   |     call expression requires function
-help: `<Alias>::SVariant::<()>` is a unit variant, you need to write it without the parenthesis
-   |
-LL |     <Alias>::SVariant::<()>;
-   |     ^^^^^^^^^^^^^^^^^^^^^^^
+error[E0109]: type arguments are not allowed on this entity
+  --> $DIR/enum-variant-generic-args.rs:61:23
+   |
+LL |     Alias::SVariant::<()> { v: () };
+   |                       ^^ type argument not allowed
 
 error[E0109]: type arguments are not allowed on this entity
-  --> $DIR/enum-variant-generic-args.rs:55:29
+  --> $DIR/enum-variant-generic-args.rs:63:29
    |
-LL |     Alias::<()>::SVariant::<()>(());
+LL |     Alias::<()>::SVariant::<()> { v: () };
    |                             ^^ type argument not allowed
 
-error[E0618]: expected function, found enum variant `<Alias<()>>::SVariant::<()>`
-  --> $DIR/enum-variant-generic-args.rs:55:5
-   |
-LL | enum Enum<T> { TSVariant(T), SVariant { v: T } }
-   |                              ----------------- `<Alias<()>>::SVariant::<()>` defined here
-...
-LL |     Alias::<()>::SVariant::<()>(());
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^----
-   |     |
-   |     call expression requires function
-help: `<Alias<()>>::SVariant::<()>` is a unit variant, you need to write it without the parenthesis
-   |
-LL |     <Alias<()>>::SVariant::<()>;
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
 error[E0109]: type arguments are not allowed on this entity
-  --> $DIR/enum-variant-generic-args.rs:58:28
+  --> $DIR/enum-variant-generic-args.rs:66:28
    |
-LL |     AliasFixed::SVariant::<()>(());
+LL |     AliasFixed::SVariant::<()> { v: () };
    |                            ^^ type argument not allowed
 
-error[E0618]: expected function, found enum variant `<AliasFixed>::SVariant::<()>`
-  --> $DIR/enum-variant-generic-args.rs:58:5
-   |
-LL | enum Enum<T> { TSVariant(T), SVariant { v: T } }
-   |                              ----------------- `<AliasFixed>::SVariant::<()>` defined here
-...
-LL |     AliasFixed::SVariant::<()>(());
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^----
-   |     |
-   |     call expression requires function
-help: `<AliasFixed>::SVariant::<()>` is a unit variant, you need to write it without the parenthesis
-   |
-LL |     <AliasFixed>::SVariant::<()>;
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
 error[E0107]: wrong number of type arguments: expected 0, found 1
-  --> $DIR/enum-variant-generic-args.rs:60:18
+  --> $DIR/enum-variant-generic-args.rs:68:18
    |
-LL |     AliasFixed::<()>::SVariant(());
+LL |     AliasFixed::<()>::SVariant { v: () };
    |                  ^^ unexpected type argument
 
-error[E0618]: expected function, found enum variant `<AliasFixed<()>>::SVariant`
-  --> $DIR/enum-variant-generic-args.rs:60:5
-   |
-LL | enum Enum<T> { TSVariant(T), SVariant { v: T } }
-   |                              ----------------- `<AliasFixed<()>>::SVariant` defined here
-...
-LL |     AliasFixed::<()>::SVariant(());
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^----
-   |     |
-   |     call expression requires function
-help: `<AliasFixed<()>>::SVariant` is a unit variant, you need to write it without the parenthesis
-   |
-LL |     <AliasFixed<()>>::SVariant;
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
-
 error[E0107]: wrong number of type arguments: expected 0, found 1
-  --> $DIR/enum-variant-generic-args.rs:62:18
+  --> $DIR/enum-variant-generic-args.rs:70:18
    |
-LL |     AliasFixed::<()>::SVariant::<()>(());
+LL |     AliasFixed::<()>::SVariant::<()> { v: () };
    |                  ^^ unexpected type argument
 
 error[E0109]: type arguments are not allowed on this entity
-  --> $DIR/enum-variant-generic-args.rs:62:34
+  --> $DIR/enum-variant-generic-args.rs:70:34
    |
-LL |     AliasFixed::<()>::SVariant::<()>(());
+LL |     AliasFixed::<()>::SVariant::<()> { v: () };
    |                                  ^^ type argument not allowed
 
-error[E0618]: expected function, found enum variant `<AliasFixed<()>>::SVariant::<()>`
-  --> $DIR/enum-variant-generic-args.rs:62:5
-   |
-LL | enum Enum<T> { TSVariant(T), SVariant { v: T } }
-   |                              ----------------- `<AliasFixed<()>>::SVariant::<()>` defined here
-...
-LL |     AliasFixed::<()>::SVariant::<()>(());
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----
-   |     |
-   |     call expression requires function
-help: `<AliasFixed<()>>::SVariant::<()>` is a unit variant, you need to write it without the parenthesis
-   |
-LL |     <AliasFixed<()>>::SVariant::<()>;
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 30 previous errors
+error: aborting due to 28 previous errors
 
-Some errors occurred: E0107, E0109, E0423, E0618.
+Some errors occurred: E0107, E0109, E0308.
 For more information about an error, try `rustc --explain E0107`.