Rollup merge of #100268 - TaKO8Ki:add-regression-test-for-79148, r=Mark-Simulacrum
Add regression test for #79148 closes #79148
This commit is contained in:
commit
89835a018e
3 changed files with 45 additions and 0 deletions
19
src/test/ui/proc-macro/auxiliary/re-export.rs
Normal file
19
src/test/ui/proc-macro/auxiliary/re-export.rs
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
// force-host
|
||||||
|
// no-prefer-dynamic
|
||||||
|
|
||||||
|
#![crate_type = "proc-macro"]
|
||||||
|
|
||||||
|
extern crate proc_macro;
|
||||||
|
|
||||||
|
use proc_macro::TokenStream;
|
||||||
|
|
||||||
|
#[proc_macro]
|
||||||
|
pub fn cause_ice(_: TokenStream) -> TokenStream {
|
||||||
|
"
|
||||||
|
enum IceCause {
|
||||||
|
Variant,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub use IceCause::Variant;
|
||||||
|
".parse().unwrap()
|
||||||
|
}
|
10
src/test/ui/proc-macro/issue-79148.rs
Normal file
10
src/test/ui/proc-macro/issue-79148.rs
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
// aux-build:re-export.rs
|
||||||
|
// edition:2018
|
||||||
|
|
||||||
|
extern crate re_export;
|
||||||
|
|
||||||
|
use re_export::cause_ice;
|
||||||
|
|
||||||
|
cause_ice!(); //~ ERROR `Variant` is only public within the crate, and cannot be re-exported outside
|
||||||
|
|
||||||
|
fn main() {}
|
16
src/test/ui/proc-macro/issue-79148.stderr
Normal file
16
src/test/ui/proc-macro/issue-79148.stderr
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
error[E0364]: `Variant` is only public within the crate, and cannot be re-exported outside
|
||||||
|
--> $DIR/issue-79148.rs:8:1
|
||||||
|
|
|
||||||
|
LL | cause_ice!();
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
|
||||||
|
note: consider marking `Variant` as `pub` in the imported module
|
||||||
|
--> $DIR/issue-79148.rs:8:1
|
||||||
|
|
|
||||||
|
LL | cause_ice!();
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
= note: this error originates in the macro `cause_ice` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0364`.
|
Loading…
Add table
Add a link
Reference in a new issue