Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 995d34e

Browse files
authoredJul 5, 2019
Rollup merge of rust-lang#61545 - flip1995:internal_lints, r=oli-obk
Implement another internal lints cc rust-lang#49509 This adds ~~two~~ one internal lint~~s~~: 1. LINT_PASS_IMPL_WITHOUT_MACRO: Make sure, that the `{declare,impl}_lint_pass` macro is used to implement lint passes. cc rust-lang#59669 2. ~~USAGE_OF_TYCTXT_AND_SPAN_ARGS: item 2 on the list in rust-lang#49509~~ ~~With 2. I wasn't sure, if this lint should be applied everywhere. That means a careful review of 0955835 would be great. Also 73fb9b4 allows this lint on some functions. Should I also apply this lint there?~~ TODO (not directly relevant for review): - [ ] rust-lang#59316 (comment) (not sure yet, if this works or how to query for `rustc_private`, since it's not in [`Features`](https://doc.rust-lang.org/nightly/nightly-rustc/syntax/feature_gate/struct.Features.html) 🤔 cc @eddyb) - [x] rust-lang#61735 (comment) - [x] Check explicitly for the `{declare,impl}_lint_pass!` macros r? @oli-obk
2 parents 29a035f + d0625a3 commit 995d34e

File tree

49 files changed

+209
-89
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+209
-89
lines changed
 

‎src/bootstrap/bin/rustc.rs

+14-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,20 @@ fn main() {
306306
}
307307

308308
// This is required for internal lints.
309-
cmd.arg("-Zunstable-options");
309+
if let Some(crate_name) = args.windows(2).find(|a| &*a[0] == "--crate-name") {
310+
let crate_name = crate_name[1].to_string_lossy();
311+
if crate_name != "rustc_version"
312+
&& (crate_name.starts_with("rustc")
313+
|| crate_name.starts_with("syntax")
314+
|| crate_name == "arena"
315+
|| crate_name == "fmt_macros")
316+
{
317+
cmd.arg("-Zunstable-options");
318+
if stage != "0" {
319+
cmd.arg("-Wrustc::internal");
320+
}
321+
}
322+
}
310323

311324
// Force all crates compiled by this compiler to (a) be unstable and (b)
312325
// allow the `rustc_private` feature to link to other unstable crates

‎src/libarena/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
test(no_crate_inject, attr(deny(warnings))))]
1313

1414
#![deny(rust_2018_idioms)]
15-
#![deny(internal)]
1615
#![deny(unused_lifetimes)]
1716

1817
#![feature(core_intrinsics)]

0 commit comments

Comments
 (0)
Please sign in to comment.