about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-08-29 16:55:43 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2024-08-29 20:18:44 +1000
commitafc58beebe2366a09baaf622e9834bdae25cc510 (patch)
tree9810c1cf059f48e0a7c5d162c1910b2b2fb2ecc5
parent2eea2d2cf105255b1ce7bd0eeb0d326a06adefc8 (diff)
downloadrust-afc58beebe2366a09baaf622e9834bdae25cc510.tar.gz
rust-afc58beebe2366a09baaf622e9834bdae25cc510.zip
Add `warn(unreachable_pub)` to `rustc_query_system`.
-rw-r--r--compiler/rustc_query_system/src/dep_graph/serialized.rs6
-rw-r--r--compiler/rustc_query_system/src/error.rs14
-rw-r--r--compiler/rustc_query_system/src/lib.rs1
3 files changed, 11 insertions, 10 deletions
diff --git a/compiler/rustc_query_system/src/dep_graph/serialized.rs b/compiler/rustc_query_system/src/dep_graph/serialized.rs
index ab4a8be0fbf..a4fb0a5b072 100644
--- a/compiler/rustc_query_system/src/dep_graph/serialized.rs
+++ b/compiler/rustc_query_system/src/dep_graph/serialized.rs
@@ -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,
@@ -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)
diff --git a/compiler/rustc_query_system/src/error.rs b/compiler/rustc_query_system/src/error.rs
index 9db6fac8036..860f2e66915 100644
--- a/compiler/rustc_query_system/src/error.rs
+++ b/compiler/rustc_query_system/src/error.rs
@@ -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,
@@ -20,7 +20,7 @@ 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)]
@@ -28,7 +28,7 @@ pub enum StackCount {
 }
 
 #[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)]
@@ -39,7 +39,7 @@ 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,
@@ -47,7 +47,7 @@ pub struct CycleUsage {
 
 #[derive(Diagnostic)]
 #[diag(query_system_cycle, code = E0391)]
-pub struct Cycle {
+pub(crate) struct Cycle {
     #[primary_span]
     pub span: Span,
     pub stack_bottom: String,
@@ -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,
 }
diff --git a/compiler/rustc_query_system/src/lib.rs b/compiler/rustc_query_system/src/lib.rs
index 7a50a9534c2..ba7a631fb54 100644
--- a/compiler/rustc_query_system/src/lib.rs
+++ b/compiler/rustc_query_system/src/lib.rs
@@ -5,6 +5,7 @@
 #![feature(hash_raw_entry)]
 #![feature(let_chains)]
 #![feature(min_specialization)]
+#![warn(unreachable_pub)]
 // tidy-alphabetical-end
 
 pub mod cache;