Skip to content

Commit 89835a0

Browse files
authored
Rollup merge of #100268 - TaKO8Ki:add-regression-test-for-79148, r=Mark-Simulacrum
Add regression test for #79148 closes #79148
2 parents d63d2bd + b3bc211 commit 89835a0

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// force-host
2+
// no-prefer-dynamic
3+
4+
#![crate_type = "proc-macro"]
5+
6+
extern crate proc_macro;
7+
8+
use proc_macro::TokenStream;
9+
10+
#[proc_macro]
11+
pub fn cause_ice(_: TokenStream) -> TokenStream {
12+
"
13+
enum IceCause {
14+
Variant,
15+
}
16+
17+
pub use IceCause::Variant;
18+
".parse().unwrap()
19+
}

src/test/ui/proc-macro/issue-79148.rs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// aux-build:re-export.rs
2+
// edition:2018
3+
4+
extern crate re_export;
5+
6+
use re_export::cause_ice;
7+
8+
cause_ice!(); //~ ERROR `Variant` is only public within the crate, and cannot be re-exported outside
9+
10+
fn main() {}
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
error[E0364]: `Variant` is only public within the crate, and cannot be re-exported outside
2+
--> $DIR/issue-79148.rs:8:1
3+
|
4+
LL | cause_ice!();
5+
| ^^^^^^^^^^^^
6+
|
7+
note: consider marking `Variant` as `pub` in the imported module
8+
--> $DIR/issue-79148.rs:8:1
9+
|
10+
LL | cause_ice!();
11+
| ^^^^^^^^^^^^
12+
= note: this error originates in the macro `cause_ice` (in Nightly builds, run with -Z macro-backtrace for more info)
13+
14+
error: aborting due to previous error
15+
16+
For more information about this error, try `rustc --explain E0364`.

0 commit comments

Comments
 (0)