Skip to content

Commit d93ef39

Browse files
authored
Rollup merge of rust-lang#138331 - nnethercote:use-RUSTC_LINT_FLAGS-more, r=onur-ozkan,jieyouxu
Use `RUSTC_LINT_FLAGS` more An alternative to the failed rust-lang#138084. Fixes rust-lang#138106. r? ````@jieyouxu````
2 parents a21d41a + ff0a5fe commit d93ef39

File tree

71 files changed

+39
-95
lines changed

Some content is hidden

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

71 files changed

+39
-95
lines changed

compiler/rustc_abi/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#![cfg_attr(feature = "nightly", feature(rustc_attrs))]
66
#![cfg_attr(feature = "nightly", feature(rustdoc_internals))]
77
#![cfg_attr(feature = "nightly", feature(step_trait))]
8-
#![warn(unreachable_pub)]
98
// tidy-alphabetical-end
109

1110
/*! ABI handling for rustc

compiler/rustc_arena/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#![feature(maybe_uninit_slice)]
2424
#![feature(rustc_attrs)]
2525
#![feature(rustdoc_internals)]
26-
#![warn(unreachable_pub)]
2726
// tidy-alphabetical-end
2827

2928
use std::alloc::Layout;

compiler/rustc_ast/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#![feature(never_type)]
2020
#![feature(rustdoc_internals)]
2121
#![feature(stmt_expr_attributes)]
22-
#![warn(unreachable_pub)]
2322
// tidy-alphabetical-end
2423

2524
pub mod util {

compiler/rustc_ast_ir/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#![cfg_attr(feature = "nightly", allow(internal_features))]
1010
#![cfg_attr(feature = "nightly", feature(never_type))]
1111
#![cfg_attr(feature = "nightly", feature(rustc_attrs))]
12-
#![warn(unreachable_pub)]
1312
// tidy-alphabetical-end
1413

1514
#[cfg(feature = "nightly")]

compiler/rustc_ast_lowering/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
#![feature(if_let_guard)]
4040
#![feature(let_chains)]
4141
#![feature(rustdoc_internals)]
42-
#![warn(unreachable_pub)]
4342
// tidy-alphabetical-end
4443

4544
use std::sync::Arc;

compiler/rustc_ast_passes/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#![feature(iter_is_partitioned)]
1111
#![feature(let_chains)]
1212
#![feature(rustdoc_internals)]
13-
#![warn(unreachable_pub)]
1413
// tidy-alphabetical-end
1514

1615
pub mod ast_validation;

compiler/rustc_ast_pretty/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#![doc(rust_logo)]
44
#![feature(box_patterns)]
55
#![feature(rustdoc_internals)]
6-
#![warn(unreachable_pub)]
76
// tidy-alphabetical-end
87

98
mod helpers;

compiler/rustc_attr_data_structures/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#![doc(rust_logo)]
44
#![feature(let_chains)]
55
#![feature(rustdoc_internals)]
6-
#![warn(unreachable_pub)]
76
// tidy-alphabetical-end
87

98
mod attributes;

compiler/rustc_attr_parsing/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
#![doc(rust_logo)]
8181
#![feature(let_chains)]
8282
#![feature(rustdoc_internals)]
83-
#![warn(unreachable_pub)]
8483
// tidy-alphabetical-end
8584

8685
#[macro_use]

compiler/rustc_baked_icu_data/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
// tidy-alphabetical-start
2424
#![allow(elided_lifetimes_in_paths)]
2525
#![allow(internal_features)]
26+
#![allow(unreachable_pub)] // because this crate is mostly generated code
2627
#![doc(rust_logo)]
2728
#![feature(rustdoc_internals)]
2829
// #![warn(unreachable_pub)] // don't use because this crate is mostly generated code

compiler/rustc_borrowck/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#![feature(rustdoc_internals)]
1414
#![feature(stmt_expr_attributes)]
1515
#![feature(try_blocks)]
16-
#![warn(unreachable_pub)]
1716
// tidy-alphabetical-end
1817

1918
use std::borrow::Cow;

compiler/rustc_builtin_macros/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#![feature(rustdoc_internals)]
1919
#![feature(string_from_utf8_lossy_owned)]
2020
#![feature(try_blocks)]
21-
#![warn(unreachable_pub)]
2221
// tidy-alphabetical-end
2322

2423
extern crate proc_macro;

compiler/rustc_codegen_llvm/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#![feature(rustdoc_internals)]
2020
#![feature(slice_as_array)]
2121
#![feature(try_blocks)]
22-
#![warn(unreachable_pub)]
2322
// tidy-alphabetical-end
2423

2524
use std::any::Any;

compiler/rustc_codegen_ssa/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#![feature(rustdoc_internals)]
1515
#![feature(trait_alias)]
1616
#![feature(try_blocks)]
17-
#![warn(unreachable_pub)]
1817
// tidy-alphabetical-end
1918

2019
//! This crate contains codegen code that is used by all codegen backends (LLVM and others).

compiler/rustc_const_eval/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#![feature(unqualified_local_imports)]
1717
#![feature(yeet_expr)]
1818
#![warn(unqualified_local_imports)]
19-
#![warn(unreachable_pub)]
2019
// tidy-alphabetical-end
2120

2221
pub mod check_consts;

compiler/rustc_data_structures/src/graph/tests.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ use std::cmp::max;
33
use super::*;
44
use crate::fx::FxHashMap;
55

6-
pub struct TestGraph {
6+
pub(super) struct TestGraph {
77
num_nodes: usize,
88
start_node: usize,
99
successors: FxHashMap<usize, Vec<usize>>,
1010
predecessors: FxHashMap<usize, Vec<usize>>,
1111
}
1212

1313
impl TestGraph {
14-
pub fn new(start_node: usize, edges: &[(usize, usize)]) -> Self {
14+
pub(super) fn new(start_node: usize, edges: &[(usize, usize)]) -> Self {
1515
let mut graph = TestGraph {
1616
num_nodes: start_node + 1,
1717
start_node,

compiler/rustc_data_structures/src/obligation_forest/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ pub struct Error<O, E> {
313313

314314
mod helper {
315315
use super::*;
316-
pub type ObligationTreeIdGenerator = impl Iterator<Item = ObligationTreeId>;
316+
pub(super) type ObligationTreeIdGenerator = impl Iterator<Item = ObligationTreeId>;
317317
impl<O: ForestObligation> ObligationForest<O> {
318318
#[cfg_attr(not(bootstrap), define_opaque(ObligationTreeIdGenerator))]
319319
pub fn new() -> ObligationForest<O> {

compiler/rustc_data_structures/src/sync.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ mod mode {
8888

8989
// Whether thread safety might be enabled.
9090
#[inline]
91-
pub fn might_be_dyn_thread_safe() -> bool {
91+
pub(super) fn might_be_dyn_thread_safe() -> bool {
9292
DYN_THREAD_SAFE_MODE.load(Ordering::Relaxed) != DYN_NOT_THREAD_SAFE
9393
}
9494

compiler/rustc_data_structures/src/sync/parallel.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub fn parallel_guard<R>(f: impl FnOnce(&ParallelGuard) -> R) -> R {
4646
ret
4747
}
4848

49-
pub fn serial_join<A, B, RA, RB>(oper_a: A, oper_b: B) -> (RA, RB)
49+
fn serial_join<A, B, RA, RB>(oper_a: A, oper_b: B) -> (RA, RB)
5050
where
5151
A: FnOnce() -> RA,
5252
B: FnOnce() -> RB,

compiler/rustc_data_structures/src/tagged_ptr/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::stable_hasher::{HashStable, StableHasher};
77

88
/// A tag type used in [`TaggedRef`] tests.
99
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
10-
pub enum Tag2 {
10+
enum Tag2 {
1111
B00 = 0b00,
1212
B01 = 0b01,
1313
B10 = 0b10,

compiler/rustc_driver_impl/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#![feature(result_flattening)]
1717
#![feature(rustdoc_internals)]
1818
#![feature(try_blocks)]
19-
#![warn(unreachable_pub)]
2019
// tidy-alphabetical-end
2120

2221
use std::cmp::max;

compiler/rustc_error_codes/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#![deny(rustdoc::invalid_codeblock_attributes)]
77
#![doc(rust_logo)]
88
#![feature(rustdoc_internals)]
9-
#![warn(unreachable_pub)]
109
// tidy-alphabetical-end
1110

1211
// This higher-order macro defines the error codes that are in use. It is used

compiler/rustc_error_messages/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#![feature(rustc_attrs)]
55
#![feature(rustdoc_internals)]
66
#![feature(type_alias_impl_trait)]
7-
#![warn(unreachable_pub)]
87
// tidy-alphabetical-end
98

109
use std::borrow::Cow;

compiler/rustc_errors/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#![feature(trait_alias)]
2626
#![feature(try_blocks)]
2727
#![feature(yeet_expr)]
28-
#![warn(unreachable_pub)]
2928
// tidy-alphabetical-end
3029

3130
extern crate self as rustc_errors;

compiler/rustc_expand/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#![feature(rustdoc_internals)]
1414
#![feature(try_blocks)]
1515
#![feature(yeet_expr)]
16-
#![warn(unreachable_pub)]
1716
// tidy-alphabetical-end
1817

1918
extern crate proc_macro as pm;

compiler/rustc_feature/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#![allow(internal_features)]
1616
#![doc(rust_logo)]
1717
#![feature(rustdoc_internals)]
18-
#![warn(unreachable_pub)]
1918
// tidy-alphabetical-end
2019

2120
mod accepted;

compiler/rustc_fluent_macro/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#![feature(proc_macro_span)]
88
#![feature(rustdoc_internals)]
99
#![feature(track_path)]
10-
#![warn(unreachable_pub)]
1110
// tidy-alphabetical-end
1211

1312
use proc_macro::TokenStream;

compiler/rustc_graphviz/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@
277277
)]
278278
#![doc(rust_logo)]
279279
#![feature(rustdoc_internals)]
280-
#![warn(unreachable_pub)]
281280
// tidy-alphabetical-end
282281

283282
use std::borrow::Cow;

compiler/rustc_hir/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#![feature(never_type)]
1414
#![feature(rustc_attrs)]
1515
#![feature(variant_count)]
16-
#![warn(unreachable_pub)]
1716
// tidy-alphabetical-end
1817

1918
extern crate self as rustc_hir;

compiler/rustc_hir_analysis/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ This API is completely unstable and subject to change.
7373
#![feature(slice_partition_dedup)]
7474
#![feature(try_blocks)]
7575
#![feature(unwrap_infallible)]
76-
#![warn(unreachable_pub)]
7776
// tidy-alphabetical-end
7877

7978
// These are used by Clippy.

compiler/rustc_hir_pretty/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
44
// tidy-alphabetical-start
55
#![recursion_limit = "256"]
6-
#![warn(unreachable_pub)]
76
// tidy-alphabetical-end
87

98
use std::cell::Cell;

compiler/rustc_hir_typeck/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#![feature(let_chains)]
99
#![feature(never_type)]
1010
#![feature(try_blocks)]
11-
#![warn(unreachable_pub)]
1211
// tidy-alphabetical-end
1312

1413
mod _match;

compiler/rustc_incremental/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#![doc(rust_logo)]
88
#![feature(file_buffered)]
99
#![feature(rustdoc_internals)]
10-
#![warn(unreachable_pub)]
1110
// tidy-alphabetical-end
1211

1312
mod assert_dep_graph;

compiler/rustc_index/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#![cfg_attr(feature = "nightly", feature(extend_one, step_trait, test))]
55
#![cfg_attr(feature = "nightly", feature(new_range_api))]
66
#![cfg_attr(feature = "nightly", feature(new_zeroed_alloc))]
7-
#![warn(unreachable_pub)]
87
// tidy-alphabetical-end
98

109
pub mod bit_set;

compiler/rustc_index_macros/src/newtype.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ impl Parse for Newtype {
305305
}
306306
}
307307

308-
pub fn newtype(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
308+
pub(crate) fn newtype(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
309309
let input = parse_macro_input!(input as Newtype);
310310
input.0.into()
311311
}

compiler/rustc_infer/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#![feature(let_chains)]
2525
#![feature(rustdoc_internals)]
2626
#![recursion_limit = "512"] // For rustdoc
27-
#![warn(unreachable_pub)]
2827
// tidy-alphabetical-end
2928

3029
mod errors;

compiler/rustc_interface/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#![feature(iter_intersperse)]
55
#![feature(let_chains)]
66
#![feature(try_blocks)]
7-
#![warn(unreachable_pub)]
87
// tidy-alphabetical-end
98

109
mod callbacks;

compiler/rustc_lexer/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
// We want to be able to build this crate with a stable compiler,
2424
// so no `#![feature]` attributes should be added.
2525
#![deny(unstable_features)]
26-
#![warn(unreachable_pub)]
2726
// tidy-alphabetical-end
2827

2928
mod cursor;

compiler/rustc_lint/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#![feature(rustc_attrs)]
3333
#![feature(rustdoc_internals)]
3434
#![feature(try_blocks)]
35-
#![warn(unreachable_pub)]
3635
// tidy-alphabetical-end
3736

3837
mod async_closures;

compiler/rustc_lint_defs/src/lib.rs

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
// tidy-alphabetical-start
2-
#![warn(unreachable_pub)]
3-
// tidy-alphabetical-end
4-
51
use rustc_abi::ExternAbi;
62
use rustc_ast::AttrId;
73
use rustc_ast::attr::AttributeExt;

compiler/rustc_llvm/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#![doc(rust_logo)]
55
#![feature(extern_types)]
66
#![feature(rustdoc_internals)]
7-
#![warn(unreachable_pub)]
87
// tidy-alphabetical-end
98

109
use std::cell::RefCell;

compiler/rustc_macros/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#![feature(proc_macro_diagnostic)]
77
#![feature(proc_macro_span)]
88
#![feature(proc_macro_tracked_env)]
9-
#![warn(unreachable_pub)]
109
// tidy-alphabetical-end
1110

1211
use proc_macro::TokenStream;

compiler/rustc_metadata/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#![feature(proc_macro_internals)]
1616
#![feature(rustdoc_internals)]
1717
#![feature(trusted_len)]
18-
#![warn(unreachable_pub)]
1918
// tidy-alphabetical-end
2019

2120
extern crate proc_macro;

compiler/rustc_middle/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
#![feature(try_trait_v2_yeet)]
6262
#![feature(type_alias_impl_trait)]
6363
#![feature(yeet_expr)]
64-
#![warn(unreachable_pub)]
6564
// tidy-alphabetical-end
6665

6766
#[cfg(test)]

compiler/rustc_mir_build/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#![feature(if_let_guard)]
99
#![feature(let_chains)]
1010
#![feature(try_blocks)]
11-
#![warn(unreachable_pub)]
1211
// tidy-alphabetical-end
1312

1413
// The `builder` module used to be named `build`, but that was causing GitHub's

compiler/rustc_mir_dataflow/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#![feature(let_chains)]
88
#![feature(never_type)]
99
#![feature(try_blocks)]
10-
#![warn(unreachable_pub)]
1110
// tidy-alphabetical-end
1211

1312
use rustc_middle::ty;

compiler/rustc_mir_transform/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#![feature(never_type)]
1313
#![feature(try_blocks)]
1414
#![feature(yeet_expr)]
15-
#![warn(unreachable_pub)]
1615
// tidy-alphabetical-end
1716

1817
use hir::ConstContext;

compiler/rustc_monomorphize/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#![feature(if_let_guard)]
55
#![feature(impl_trait_in_assoc_type)]
66
#![feature(let_chains)]
7-
#![warn(unreachable_pub)]
87
// tidy-alphabetical-end
98

109
use rustc_hir::lang_items::LangItem;

0 commit comments

Comments
 (0)