Skip to content

Commit afc58be

Browse files
committed
Add warn(unreachable_pub) to rustc_query_system.
1 parent 2eea2d2 commit afc58be

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

compiler/rustc_query_system/src/dep_graph/serialized.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -617,14 +617,14 @@ impl<D: Deps> EncoderState<D> {
617617
}
618618
}
619619

620-
pub struct GraphEncoder<D: Deps> {
620+
pub(crate) struct GraphEncoder<D: Deps> {
621621
profiler: SelfProfilerRef,
622622
status: Lock<Option<EncoderState<D>>>,
623623
record_graph: Option<Lock<DepGraphQuery>>,
624624
}
625625

626626
impl<D: Deps> GraphEncoder<D> {
627-
pub fn new(
627+
pub(crate) fn new(
628628
encoder: FileEncoder,
629629
prev_node_count: usize,
630630
record_graph: bool,
@@ -723,7 +723,7 @@ impl<D: Deps> GraphEncoder<D> {
723723
)
724724
}
725725

726-
pub fn finish(&self) -> FileEncodeResult {
726+
pub(crate) fn finish(&self) -> FileEncodeResult {
727727
let _prof_timer = self.profiler.generic_activity("incr_comp_encode_dep_graph_finish");
728728

729729
self.status.lock().take().unwrap().finish(&self.profiler)

compiler/rustc_query_system/src/error.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_span::{Span, Symbol};
55

66
#[derive(Subdiagnostic)]
77
#[note(query_system_cycle_stack_middle)]
8-
pub struct CycleStack {
8+
pub(crate) struct CycleStack {
99
#[primary_span]
1010
pub span: Span,
1111
pub desc: String,
@@ -20,15 +20,15 @@ pub enum HandleCycleError {
2020
}
2121

2222
#[derive(Subdiagnostic)]
23-
pub enum StackCount {
23+
pub(crate) enum StackCount {
2424
#[note(query_system_cycle_stack_single)]
2525
Single,
2626
#[note(query_system_cycle_stack_multiple)]
2727
Multiple,
2828
}
2929

3030
#[derive(Subdiagnostic)]
31-
pub enum Alias {
31+
pub(crate) enum Alias {
3232
#[note(query_system_cycle_recursive_ty_alias)]
3333
#[help(query_system_cycle_recursive_ty_alias_help1)]
3434
#[help(query_system_cycle_recursive_ty_alias_help2)]
@@ -39,15 +39,15 @@ pub enum Alias {
3939

4040
#[derive(Subdiagnostic)]
4141
#[note(query_system_cycle_usage)]
42-
pub struct CycleUsage {
42+
pub(crate) struct CycleUsage {
4343
#[primary_span]
4444
pub span: Span,
4545
pub usage: String,
4646
}
4747

4848
#[derive(Diagnostic)]
4949
#[diag(query_system_cycle, code = E0391)]
50-
pub struct Cycle {
50+
pub(crate) struct Cycle {
5151
#[primary_span]
5252
pub span: Span,
5353
pub stack_bottom: String,
@@ -65,14 +65,14 @@ pub struct Cycle {
6565

6666
#[derive(Diagnostic)]
6767
#[diag(query_system_reentrant)]
68-
pub struct Reentrant;
68+
pub(crate) struct Reentrant;
6969

7070
#[derive(Diagnostic)]
7171
#[diag(query_system_increment_compilation)]
7272
#[help]
7373
#[note(query_system_increment_compilation_note1)]
7474
#[note(query_system_increment_compilation_note2)]
75-
pub struct IncrementCompilation {
75+
pub(crate) struct IncrementCompilation {
7676
pub run_cmd: String,
7777
pub dep_node: String,
7878
}

compiler/rustc_query_system/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#![feature(hash_raw_entry)]
66
#![feature(let_chains)]
77
#![feature(min_specialization)]
8+
#![warn(unreachable_pub)]
89
// tidy-alphabetical-end
910

1011
pub mod cache;

0 commit comments

Comments
 (0)