]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/resolve/privacy-enum-ctor.stderr
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / ui / resolve / privacy-enum-ctor.stderr
index 807dadf417bf5c2a0d3b535c1a23101ce8a83eba..82a4211f08ac35fe6a5387a4e47552f0d2bf82a7 100644 (file)
@@ -18,13 +18,13 @@ LL | |         }
 help: you might have meant to use the following enum variant
    |
 LL |         m::Z::Unit;
-   |         ^^^^^^^^^^
-help: the following enum variants are available
+   |         ~~~~~~~~~~
+help: alternatively, the following enum variants are also available
    |
 LL |         (m::Z::Fn(/* fields */));
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^
+   |         ~~~~~~~~~~~~~~~~~~~~~~~~
 LL |         (m::Z::Struct { /* fields */ });
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 error[E0423]: expected value, found enum `Z`
   --> $DIR/privacy-enum-ctor.rs:25:9
@@ -46,13 +46,13 @@ LL | |         }
 help: you might have meant to use the following enum variant
    |
 LL |         m::Z::Unit;
-   |         ^^^^^^^^^^
-help: the following enum variants are available
+   |         ~~~~~~~~~~
+help: alternatively, the following enum variants are also available
    |
 LL |         (m::Z::Fn(/* fields */));
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^
+   |         ~~~~~~~~~~~~~~~~~~~~~~~~
 LL |         (m::Z::Struct { /* fields */ });
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 error[E0423]: expected value, found struct variant `Z::Struct`
   --> $DIR/privacy-enum-ctor.rs:29:20
@@ -88,23 +88,28 @@ LL | |     }
 help: you might have meant to use the following enum variant
    |
 LL |     let _: E = E::Unit;
-   |                ^^^^^^^
-help: the following enum variants are available
+   |                ~~~~~~~
+help: alternatively, the following enum variants are also available
    |
 LL |     let _: E = (E::Fn(/* fields */));
-   |                ^^^^^^^^^^^^^^^^^^^^^
+   |                ~~~~~~~~~~~~~~~~~~~~~
 LL |     let _: E = (E::Struct { /* fields */ });
-   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 help: a function with a similar name exists
    |
 LL |     let _: E = m::f;
-   |                   ^
+   |                   ~
 help: consider importing one of these items instead
    |
 LL | use std::f32::consts::E;
    |
 LL | use std::f64::consts::E;
    |
+help: if you import `E`, refer to it directly
+   |
+LL -     let _: E = m::E;
+LL +     let _: E = E;
+   |
 
 error[E0423]: expected value, found struct variant `m::E::Struct`
   --> $DIR/privacy-enum-ctor.rs:45:16
@@ -137,13 +142,13 @@ LL | |     }
 help: you might have meant to use the following enum variant
    |
 LL |     let _: E = E::Unit;
-   |                ^^^^^^^
-help: the following enum variants are available
+   |                ~~~~~~~
+help: alternatively, the following enum variants are also available
    |
 LL |     let _: E = (E::Fn(/* fields */));
-   |                ^^^^^^^^^^^^^^^^^^^^^
+   |                ~~~~~~~~~~~~~~~~~~~~~
 LL |     let _: E = (E::Struct { /* fields */ });
-   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 help: consider importing one of these items instead
    |
 LL | use std::f32::consts::E;
@@ -169,16 +174,13 @@ LL |     pub enum E {
    |     ---------- similarly named enum `E` defined here
 ...
 LL |     let _: Z = m::n::Z;
-   |            ^
+   |            ^ help: an enum with a similar name exists: `E`
    |
-help: an enum with a similar name exists
-   |
-LL |     let _: E = m::n::Z;
-   |            ^
-help: consider importing this enum
-   |
-LL | use m::Z;
+note: enum `m::Z` exists but is inaccessible
+  --> $DIR/privacy-enum-ctor.rs:11:9
    |
+LL |         pub(in m) enum Z {
+   |         ^^^^^^^^^^^^^^^^ not accessible
 
 error[E0423]: expected value, found enum `m::n::Z`
   --> $DIR/privacy-enum-ctor.rs:57:16
@@ -200,13 +202,13 @@ LL | |         }
 help: you might have meant to use the following enum variant
    |
 LL |     let _: Z = m::Z::Unit;
-   |                ^^^^^^^^^^
-help: the following enum variants are available
+   |                ~~~~~~~~~~
+help: alternatively, the following enum variants are also available
    |
 LL |     let _: Z = (m::Z::Fn(/* fields */));
-   |                ^^^^^^^^^^^^^^^^^^^^^^^^
+   |                ~~~~~~~~~~~~~~~~~~~~~~~~
 LL |     let _: Z = (m::Z::Struct { /* fields */ });
-   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 error[E0412]: cannot find type `Z` in this scope
   --> $DIR/privacy-enum-ctor.rs:61:12
@@ -215,16 +217,13 @@ LL |     pub enum E {
    |     ---------- similarly named enum `E` defined here
 ...
 LL |     let _: Z = m::n::Z::Fn;
-   |            ^
-   |
-help: an enum with a similar name exists
-   |
-LL |     let _: E = m::n::Z::Fn;
-   |            ^
-help: consider importing this enum
+   |            ^ help: an enum with a similar name exists: `E`
    |
-LL | use m::Z;
+note: enum `m::Z` exists but is inaccessible
+  --> $DIR/privacy-enum-ctor.rs:11:9
    |
+LL |         pub(in m) enum Z {
+   |         ^^^^^^^^^^^^^^^^ not accessible
 
 error[E0412]: cannot find type `Z` in this scope
   --> $DIR/privacy-enum-ctor.rs:64:12
@@ -233,16 +232,13 @@ LL |     pub enum E {
    |     ---------- similarly named enum `E` defined here
 ...
 LL |     let _: Z = m::n::Z::Struct;
-   |            ^
-   |
-help: an enum with a similar name exists
+   |            ^ help: an enum with a similar name exists: `E`
    |
-LL |     let _: E = m::n::Z::Struct;
-   |            ^
-help: consider importing this enum
-   |
-LL | use m::Z;
+note: enum `m::Z` exists but is inaccessible
+  --> $DIR/privacy-enum-ctor.rs:11:9
    |
+LL |         pub(in m) enum Z {
+   |         ^^^^^^^^^^^^^^^^ not accessible
 
 error[E0423]: expected value, found struct variant `m::n::Z::Struct`
   --> $DIR/privacy-enum-ctor.rs:64:16
@@ -262,16 +258,13 @@ LL |     pub enum E {
    |     ---------- similarly named enum `E` defined here
 ...
 LL |     let _: Z = m::n::Z::Unit {};
-   |            ^
+   |            ^ help: an enum with a similar name exists: `E`
    |
-help: an enum with a similar name exists
-   |
-LL |     let _: E = m::n::Z::Unit {};
-   |            ^
-help: consider importing this enum
-   |
-LL | use m::Z;
+note: enum `m::Z` exists but is inaccessible
+  --> $DIR/privacy-enum-ctor.rs:11:9
    |
+LL |         pub(in m) enum Z {
+   |         ^^^^^^^^^^^^^^^^ not accessible
 
 error[E0603]: enum `Z` is private
   --> $DIR/privacy-enum-ctor.rs:57:22
@@ -325,7 +318,7 @@ error[E0308]: mismatched types
   --> $DIR/privacy-enum-ctor.rs:27:20
    |
 LL |             Fn(u8),
-   |             ------ fn(u8) -> Z {Z::Fn} defined here
+   |             -- fn(u8) -> Z {Z::Fn} defined here
 ...
 LL |         let _: Z = Z::Fn;
    |                -   ^^^^^ expected enum `Z`, found fn item
@@ -334,32 +327,33 @@ LL |         let _: Z = Z::Fn;
    |
    = note: expected enum `Z`
            found fn item `fn(u8) -> Z {Z::Fn}`
-help: use parentheses to instantiate this tuple variant
+help: use parentheses to construct this tuple variant
    |
-LL |         let _: Z = Z::Fn(_);
-   |                         ^^^
+LL |         let _: Z = Z::Fn(/* u8 */);
+   |                         ++++++++++
 
 error[E0618]: expected function, found enum variant `Z::Unit`
   --> $DIR/privacy-enum-ctor.rs:31:17
    |
 LL |             Unit,
-   |             ---- `Z::Unit` defined here
+   |             ---- enum variant `Z::Unit` defined here
 ...
 LL |         let _ = Z::Unit();
    |                 ^^^^^^^--
    |                 |
    |                 call expression requires function
    |
-help: `Z::Unit` is a unit variant, you need to write it without the parenthesis
+help: `Z::Unit` is a unit enum variant, and does not take parentheses to be constructed
+   |
+LL -         let _ = Z::Unit();
+LL +         let _ = Z::Unit;
    |
-LL |         let _ = Z::Unit;
-   |                 ^^^^^^^
 
 error[E0308]: mismatched types
   --> $DIR/privacy-enum-ctor.rs:43:16
    |
 LL |         Fn(u8),
-   |         ------ fn(u8) -> E {E::Fn} defined here
+   |         -- fn(u8) -> E {E::Fn} defined here
 ...
 LL |     let _: E = m::E::Fn;
    |            -   ^^^^^^^^ expected enum `E`, found fn item
@@ -368,32 +362,33 @@ LL |     let _: E = m::E::Fn;
    |
    = note: expected enum `E`
            found fn item `fn(u8) -> E {E::Fn}`
-help: use parentheses to instantiate this tuple variant
+help: use parentheses to construct this tuple variant
    |
-LL |     let _: E = m::E::Fn(_);
-   |                        ^^^
+LL |     let _: E = m::E::Fn(/* u8 */);
+   |                        ++++++++++
 
 error[E0618]: expected function, found enum variant `m::E::Unit`
   --> $DIR/privacy-enum-ctor.rs:47:16
    |
 LL |         Unit,
-   |         ---- `m::E::Unit` defined here
+   |         ---- enum variant `m::E::Unit` defined here
 ...
 LL |     let _: E = m::E::Unit();
    |                ^^^^^^^^^^--
    |                |
    |                call expression requires function
    |
-help: `m::E::Unit` is a unit variant, you need to write it without the parenthesis
+help: `m::E::Unit` is a unit enum variant, and does not take parentheses to be constructed
+   |
+LL -     let _: E = m::E::Unit();
+LL +     let _: E = m::E::Unit;
    |
-LL |     let _: E = m::E::Unit;
-   |                ^^^^^^^^^^
 
 error[E0308]: mismatched types
   --> $DIR/privacy-enum-ctor.rs:51:16
    |
 LL |         Fn(u8),
-   |         ------ fn(u8) -> E {E::Fn} defined here
+   |         -- fn(u8) -> E {E::Fn} defined here
 ...
 LL |     let _: E = E::Fn;
    |            -   ^^^^^ expected enum `E`, found fn item
@@ -402,26 +397,27 @@ LL |     let _: E = E::Fn;
    |
    = note: expected enum `E`
            found fn item `fn(u8) -> E {E::Fn}`
-help: use parentheses to instantiate this tuple variant
+help: use parentheses to construct this tuple variant
    |
-LL |     let _: E = E::Fn(_);
-   |                     ^^^
+LL |     let _: E = E::Fn(/* u8 */);
+   |                     ++++++++++
 
 error[E0618]: expected function, found enum variant `E::Unit`
   --> $DIR/privacy-enum-ctor.rs:55:16
    |
 LL |         Unit,
-   |         ---- `E::Unit` defined here
+   |         ---- enum variant `E::Unit` defined here
 ...
 LL |     let _: E = E::Unit();
    |                ^^^^^^^--
    |                |
    |                call expression requires function
    |
-help: `E::Unit` is a unit variant, you need to write it without the parenthesis
+help: `E::Unit` is a unit enum variant, and does not take parentheses to be constructed
+   |
+LL -     let _: E = E::Unit();
+LL +     let _: E = E::Unit;
    |
-LL |     let _: E = E::Unit;
-   |                ^^^^^^^
 
 error: aborting due to 23 previous errors