add transparent attribute for mod items by yaahc · Pull Request #147709 · rust-lang/rust (original) (raw)

---- [ui] tests/ui/modules/no-transparent-fail.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/modules/no-transparent-fail/no-transparent-fail.stderr`
diff of stderr:

10 LL +         use crate::y::s;
11    |
12 
- error[E0412]: cannot find type `S` in this scope
+ error[E0425]: cannot find type `S` in this scope
14   --> $DIR/no-transparent-fail.rs:32:18
15    |
16 LL |         struct Y(S);

21 LL |         struct Y<S>(S);
22    |                 +++
23 
- error[E0412]: cannot find type `C` in this scope
+ error[E0425]: cannot find type `C` in this scope
25   --> $DIR/no-transparent-fail.rs:37:21
---
+    |                                         ^ use of undeclared type `S`
+    |
+ help: a struct with a similar name exists
+    |
+ LL -             const SNAME: &'static str = S::NAME;
+ LL +             const SNAME: &'static str = Y::NAME;
+    |
51 
52 error[E0599]: no method named `method` found for unit type `()` in the current scope
53   --> $DIR/no-transparent-fail.rs:40:16

---
+    |             ^ use of undeclared type `C`
+    |
+ help: a struct with a similar name exists
+    |
+ LL -             C::B
+ LL +             Y::B
+    |
75 
76 error: aborting due to 6 previous errors
77 

- Some errors have detailed explanations: E0412, E0433, E0599.
- For more information about an error, try `rustc --explain E0412`.
+ Some errors have detailed explanations: E0425, E0433, E0599.
+ For more information about an error, try `rustc --explain E0425`.
80 

Note: some mismatched output was normalized before being compared
- LL -             const SNAME: &'static str = S::NAME; //~ ERROR failed to resolve: use of undeclared type `S`
- LL +             const SNAME: &'static str = Y::NAME; //~ ERROR failed to resolve: use of undeclared type `S`
- LL -             C::B //~ ERROR failed to resolve: use of undeclared type `C`
- LL +             Y::B //~ ERROR failed to resolve: use of undeclared type `C`
+ error[E0425]: cannot find type `S` in this scope
+ error[E0425]: cannot find type `C` in this scope
+    |                                         ^ use of undeclared type `S`
+    |
+ help: a struct with a similar name exists
+    |
+ LL -             const SNAME: &'static str = S::NAME;
+ LL +             const SNAME: &'static str = Y::NAME;
+    |
+    |             ^ use of undeclared type `C`
+    |
+ help: a struct with a similar name exists
+    |
+ LL -             C::B
+ LL +             Y::B
+    |
+ Some errors have detailed explanations: E0425, E0433, E0599.
+ For more information about an error, try `rustc --explain E0425`.


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args modules/no-transparent-fail.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/modules/no-transparent-fail.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/modules/no-transparent-fail" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2018"
stdout: none
--- stderr -------------------------------
error: cannot find macro `s` in this scope
##[error]  --> /checkout/tests/ui/modules/no-transparent-fail.rs:30:9
   |
LL |         s!(); //~ ERROR cannot find macro `s` in this scope
   |         ^
   |
   = help: have you added the `#[macro_use]` on the module/import?
help: consider importing this macro through its public re-export
   |
LL +         use crate::y::s;
   |

error[E0425]: cannot find type `S` in this scope
##[error]  --> /checkout/tests/ui/modules/no-transparent-fail.rs:32:18
   |
LL |         struct Y(S); //~ ERROR cannot find type `S` in this scope
   |                  ^ not found in this scope
   |
help: you might be missing a type parameter
   |
LL |         struct Y<S>(S); //~ ERROR cannot find type `S` in this scope
   |                 +++

error[E0425]: cannot find type `C` in this scope
##[error]  --> /checkout/tests/ui/modules/no-transparent-fail.rs:37:21
   |
LL |         struct Y(S); //~ ERROR cannot find type `S` in this scope
   |         ------------ similarly named struct `Y` defined here
...
LL |         fn bar() -> C {
   |                     ^
   |
help: a struct with a similar name exists
   |
LL -         fn bar() -> C {
LL +         fn bar() -> Y {
   |
help: you might be missing a type parameter
   |
LL |         fn bar<C>() -> C {
   |               +++

error[E0433]: failed to resolve: use of undeclared type `S`
##[error]  --> /checkout/tests/ui/modules/no-transparent-fail.rs:35:41
   |
LL |             const SNAME: &'static str = S::NAME; //~ ERROR failed to resolve: use of undeclared type `S`
   |                                         ^ use of undeclared type `S`
   |
help: a struct with a similar name exists
   |
LL -             const SNAME: &'static str = S::NAME; //~ ERROR failed to resolve: use of undeclared type `S`
LL +             const SNAME: &'static str = Y::NAME; //~ ERROR failed to resolve: use of undeclared type `S`
   |

error[E0599]: no method named `method` found for unit type `()` in the current scope
##[error]  --> /checkout/tests/ui/modules/no-transparent-fail.rs:40:16
   |
LL |     fn method(&self) {}
   |        ------ the method is available for `()` here
...
LL |             ().method(); //~ ERROR no method named `method` found for unit type `()` in the current scope
   |                ^^^^^^ method not found in `()`
   |
   = help: items from traits can only be used if the trait is in scope
help: trait `IWantAMethod` which provides `method` is implemented but not in scope; perhaps you want to import it
   |
LL +         use crate::IWantAMethod;
   |

error[E0433]: failed to resolve: use of undeclared type `C`
##[error]  --> /checkout/tests/ui/modules/no-transparent-fail.rs:42:13
   |
LL |             C::B //~ ERROR failed to resolve: use of undeclared type `C`
   |             ^ use of undeclared type `C`
   |
help: a struct with a similar name exists
   |
LL -             C::B //~ ERROR failed to resolve: use of undeclared type `C`
LL +             Y::B //~ ERROR failed to resolve: use of undeclared type `C`
   |

error: aborting due to 6 previous errors

Some errors have detailed explanations: E0425, E0433, E0599.
---
To only update this specific test, also pass `--test-args modules/transparent-fail.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/modules/transparent-fail.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/modules/transparent-fail" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2018"
stdout: none
--- stderr -------------------------------
error: cannot find macro `s` in this scope
##[error]  --> /checkout/tests/ui/modules/transparent-fail.rs:19:13
   |
LL |             s!(); //~ ERROR cannot find macro `s` in this scope
   |             ^
   |
   = help: have you added the `#[macro_use]` on the module/import?
help: consider importing this macro through its public re-export
   |
LL +             use crate::s;
   |

error[E0425]: cannot find type `S` in this scope
##[error]  --> /checkout/tests/ui/modules/transparent-fail.rs:21:22
   |
LL |             struct Y(S); //~ ERROR cannot find type `S` in this scope
   |                      ^ not found in this scope
   |
help: consider importing this struct
   |
LL +             use crate::S;