Skip to content

Commit d567460

Browse files
authored
Rollup merge of rust-lang#89523 - Aaron1011:derive-future-compat, r=wesleywiser
Make `proc_macro_derive_resolution_fallback` a future-breakage lint When `cargo report future-incompatibilities` is stabilized (see rust-lang#71249), this will cause dependencies that trigger this lint to be included in the report.
2 parents 55ea391 + 32a5abc commit d567460

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

compiler/rustc_lint_defs/src/builtin.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1960,6 +1960,7 @@ declare_lint! {
19601960
"detects proc macro derives using inaccessible names from parent modules",
19611961
@future_incompatible = FutureIncompatibleInfo {
19621962
reference: "issue #83583 <https://github.com/rust-lang/rust/issues/83583>",
1963+
reason: FutureIncompatibilityReason::FutureReleaseErrorReportNow,
19631964
};
19641965
}
19651966

src/test/ui/proc-macro/generate-mod.stderr

+72
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,75 @@ LL | #[derive(generate_mod::CheckDerive)]
8282
error: aborting due to 4 previous errors; 4 warnings emitted
8383

8484
For more information about this error, try `rustc --explain E0412`.
85+
Future incompatibility report: Future breakage diagnostic:
86+
warning: cannot find type `FromOutside` in this scope
87+
--> $DIR/generate-mod.rs:16:10
88+
|
89+
LL | #[derive(generate_mod::CheckDerive)]
90+
| ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
91+
|
92+
= note: `#[warn(proc_macro_derive_resolution_fallback)]` on by default
93+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
94+
= note: for more information, see issue #83583 <https://github.com/rust-lang/rust/issues/83583>
95+
= note: this warning originates in the derive macro `generate_mod::CheckDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
96+
97+
Future breakage diagnostic:
98+
warning: cannot find type `OuterDerive` in this scope
99+
--> $DIR/generate-mod.rs:16:10
100+
|
101+
LL | #[derive(generate_mod::CheckDerive)]
102+
| ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
103+
|
104+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
105+
= note: for more information, see issue #83583 <https://github.com/rust-lang/rust/issues/83583>
106+
= note: this warning originates in the derive macro `generate_mod::CheckDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
107+
108+
Future breakage diagnostic:
109+
warning: cannot find type `FromOutside` in this scope
110+
--> $DIR/generate-mod.rs:23:14
111+
|
112+
LL | #[derive(generate_mod::CheckDerive)]
113+
| ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
114+
|
115+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
116+
= note: for more information, see issue #83583 <https://github.com/rust-lang/rust/issues/83583>
117+
= note: this warning originates in the derive macro `generate_mod::CheckDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
118+
119+
Future breakage diagnostic:
120+
warning: cannot find type `OuterDerive` in this scope
121+
--> $DIR/generate-mod.rs:23:14
122+
|
123+
LL | #[derive(generate_mod::CheckDerive)]
124+
| ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
125+
|
126+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
127+
= note: for more information, see issue #83583 <https://github.com/rust-lang/rust/issues/83583>
128+
= note: this warning originates in the derive macro `generate_mod::CheckDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
129+
130+
Future breakage diagnostic:
131+
warning: cannot find type `FromOutside` in this scope
132+
--> $DIR/generate-mod.rs:30:10
133+
|
134+
LL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed
135+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
136+
|
137+
note: the lint level is defined here
138+
--> $DIR/generate-mod.rs:30:10
139+
|
140+
LL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed
141+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
142+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
143+
= note: for more information, see issue #83583 <https://github.com/rust-lang/rust/issues/83583>
144+
= note: this warning originates in the derive macro `generate_mod::CheckDeriveLint` (in Nightly builds, run with -Z macro-backtrace for more info)
145+
146+
Future breakage diagnostic:
147+
warning: cannot find type `OuterDeriveLint` in this scope
148+
--> $DIR/generate-mod.rs:30:10
149+
|
150+
LL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed
151+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
152+
|
153+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
154+
= note: for more information, see issue #83583 <https://github.com/rust-lang/rust/issues/83583>
155+
= note: this warning originates in the derive macro `generate_mod::CheckDeriveLint` (in Nightly builds, run with -Z macro-backtrace for more info)
156+

0 commit comments

Comments
 (0)