Skip to content

Commit

Permalink
Add warn(unreachable_pub) to rustc_query_system.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Aug 29, 2024
1 parent f7990bf commit 7f52540
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_query_system/src/dep_graph/serialized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -617,14 +617,14 @@ impl<D: Deps> EncoderState<D> {
}
}

pub struct GraphEncoder<D: Deps> {
pub(crate) struct GraphEncoder<D: Deps> {
profiler: SelfProfilerRef,
status: Lock<Option<EncoderState<D>>>,
record_graph: Option<Lock<DepGraphQuery>>,
}

impl<D: Deps> GraphEncoder<D> {
pub fn new(
pub(crate) fn new(
encoder: FileEncoder,
prev_node_count: usize,
record_graph: bool,
Expand Down Expand Up @@ -723,7 +723,7 @@ impl<D: Deps> GraphEncoder<D> {
)
}

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

self.status.lock().take().unwrap().finish(&self.profiler)
Expand Down
14 changes: 7 additions & 7 deletions compiler/rustc_query_system/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use rustc_span::{Span, Symbol};

#[derive(Subdiagnostic)]
#[note(query_system_cycle_stack_middle)]
pub struct CycleStack {
pub(crate) struct CycleStack {
#[primary_span]
pub span: Span,
pub desc: String,
Expand All @@ -20,15 +20,15 @@ pub enum HandleCycleError {
}

#[derive(Subdiagnostic)]
pub enum StackCount {
pub(crate) enum StackCount {
#[note(query_system_cycle_stack_single)]
Single,
#[note(query_system_cycle_stack_multiple)]
Multiple,
}

#[derive(Subdiagnostic)]
pub enum Alias {
pub(crate) enum Alias {
#[note(query_system_cycle_recursive_ty_alias)]
#[help(query_system_cycle_recursive_ty_alias_help1)]
#[help(query_system_cycle_recursive_ty_alias_help2)]
Expand All @@ -39,15 +39,15 @@ pub enum Alias {

#[derive(Subdiagnostic)]
#[note(query_system_cycle_usage)]
pub struct CycleUsage {
pub(crate) struct CycleUsage {
#[primary_span]
pub span: Span,
pub usage: String,
}

#[derive(Diagnostic)]
#[diag(query_system_cycle, code = E0391)]
pub struct Cycle {
pub(crate) struct Cycle {
#[primary_span]
pub span: Span,
pub stack_bottom: String,
Expand All @@ -65,14 +65,14 @@ pub struct Cycle {

#[derive(Diagnostic)]
#[diag(query_system_reentrant)]
pub struct Reentrant;
pub(crate) struct Reentrant;

#[derive(Diagnostic)]
#[diag(query_system_increment_compilation)]
#[help]
#[note(query_system_increment_compilation_note1)]
#[note(query_system_increment_compilation_note2)]
pub struct IncrementCompilation {
pub(crate) struct IncrementCompilation {
pub run_cmd: String,
pub dep_node: String,
}
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_query_system/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#![feature(hash_raw_entry)]
#![feature(let_chains)]
#![feature(min_specialization)]
#![warn(unreachable_pub)]
// tidy-alphabetical-end

pub mod cache;
Expand Down

0 comments on commit 7f52540

Please sign in to comment.