diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-08-30 13:15:02 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-09-03 08:49:54 +1000 |
| commit | b0f22ff98ff345aa7daf8c2f67d5b55f721c366a (patch) | |
| tree | f4b453a3cad5bb6fc51b323ada94e3528857b8d2 | |
| parent | b457ab31860b9c92fd2a52c7a2ca328a04cdfa23 (diff) | |
| download | rust-b0f22ff98ff345aa7daf8c2f67d5b55f721c366a.tar.gz rust-b0f22ff98ff345aa7daf8c2f67d5b55f721c366a.zip | |
Add `warn(unreachable_pub)` to `rustc_span`.
| -rw-r--r-- | compiler/rustc_span/src/analyze_source_file.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_span/src/lib.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_span/src/span_encoding.rs | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_span/src/analyze_source_file.rs b/compiler/rustc_span/src/analyze_source_file.rs index ba7e0cec5bd..28ce883daee 100644 --- a/compiler/rustc_span/src/analyze_source_file.rs +++ b/compiler/rustc_span/src/analyze_source_file.rs @@ -8,7 +8,7 @@ mod tests; /// /// This function will use an SSE2 enhanced implementation if hardware support /// is detected at runtime. -pub fn analyze_source_file(src: &str) -> (Vec<RelativeBytePos>, Vec<MultiByteChar>) { +pub(crate) fn analyze_source_file(src: &str) -> (Vec<RelativeBytePos>, Vec<MultiByteChar>) { let mut lines = vec![RelativeBytePos::from_u32(0)]; let mut multi_byte_chars = vec![]; diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs index 7b020f11cdd..45dca3af6c0 100644 --- a/compiler/rustc_span/src/lib.rs +++ b/compiler/rustc_span/src/lib.rs @@ -30,6 +30,7 @@ #![feature(round_char_boundary)] #![feature(rustc_attrs)] #![feature(rustdoc_internals)] +#![warn(unreachable_pub)] // tidy-alphabetical-end // The code produced by the `Encodable`/`Decodable` derive macros refer to diff --git a/compiler/rustc_span/src/span_encoding.rs b/compiler/rustc_span/src/span_encoding.rs index 8988becb171..3047abfbb5c 100644 --- a/compiler/rustc_span/src/span_encoding.rs +++ b/compiler/rustc_span/src/span_encoding.rs @@ -424,7 +424,7 @@ impl Span { } #[derive(Default)] -pub struct SpanInterner { +pub(crate) struct SpanInterner { spans: FxIndexSet<SpanData>, } |
