diff options
| author | bors <bors@rust-lang.org> | 2022-05-21 06:38:49 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-05-21 06:38:49 +0000 |
| commit | 4f372b14dea58cbff1dd76bb651f9c035d3f6e7b (patch) | |
| tree | 950b33879d87e39f4112e562136c21191809aef0 /compiler/rustc_errors/src | |
| parent | 3b64fe953c23b7d56dd5ebf61b6dbd82b345f880 (diff) | |
| parent | 69702468865d582f512df31a52ac2608afe5df0d (diff) | |
| download | rust-4f372b14dea58cbff1dd76bb651f9c035d3f6e7b.tar.gz rust-4f372b14dea58cbff1dd76bb651f9c035d3f6e7b.zip | |
Auto merge of #97239 - jhpratt:remove-crate-vis, r=joshtriplett
Remove `crate` visibility modifier FCP to remove this syntax is just about complete in #53120. Once it completes, this should be merged ASAP to avoid merge conflicts. The first two commits remove usage of the feature in this repository, while the last removes the feature itself.
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/diagnostic.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_errors/src/diagnostic_builder.rs | 12 | ||||
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 1 |
3 files changed, 7 insertions, 8 deletions
diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs index 909ed566f64..f130b5aa9a6 100644 --- a/compiler/rustc_errors/src/diagnostic.rs +++ b/compiler/rustc_errors/src/diagnostic.rs @@ -90,7 +90,7 @@ pub trait AddSubdiagnostic { pub struct Diagnostic { // NOTE(eddyb) this is private to disallow arbitrary after-the-fact changes, // outside of what methods in this crate themselves allow. - crate level: Level, + pub(crate) level: Level, pub message: Vec<(DiagnosticMessage, Style)>, pub code: Option<DiagnosticId>, diff --git a/compiler/rustc_errors/src/diagnostic_builder.rs b/compiler/rustc_errors/src/diagnostic_builder.rs index 53ad6e5a0ed..6ef2c832c65 100644 --- a/compiler/rustc_errors/src/diagnostic_builder.rs +++ b/compiler/rustc_errors/src/diagnostic_builder.rs @@ -88,7 +88,7 @@ mod sealed_level_is_error { use crate::Level; /// Sealed helper trait for statically checking that a `Level` is an error. - crate trait IsError<const L: Level> {} + pub(crate) trait IsError<const L: Level> {} impl IsError<{ Level::Bug }> for () {} impl IsError<{ Level::DelayedBug }> for () {} @@ -101,7 +101,7 @@ mod sealed_level_is_error { impl<'a> DiagnosticBuilder<'a, ErrorGuaranteed> { /// Convenience function for internal use, clients should use one of the /// `struct_*` methods on [`Handler`]. - crate fn new_guaranteeing_error<M: Into<DiagnosticMessage>, const L: Level>( + pub(crate) fn new_guaranteeing_error<M: Into<DiagnosticMessage>, const L: Level>( handler: &'a Handler, message: M, ) -> Self @@ -168,7 +168,7 @@ impl EmissionGuarantee for ErrorGuaranteed { impl<'a> DiagnosticBuilder<'a, ()> { /// Convenience function for internal use, clients should use one of the /// `struct_*` methods on [`Handler`]. - crate fn new<M: Into<DiagnosticMessage>>( + pub(crate) fn new<M: Into<DiagnosticMessage>>( handler: &'a Handler, level: Level, message: M, @@ -179,7 +179,7 @@ impl<'a> DiagnosticBuilder<'a, ()> { /// Creates a new `DiagnosticBuilder` with an already constructed /// diagnostic. - crate fn new_diagnostic(handler: &'a Handler, diagnostic: Diagnostic) -> Self { + pub(crate) fn new_diagnostic(handler: &'a Handler, diagnostic: Diagnostic) -> Self { debug!("Created new diagnostic"); Self { inner: DiagnosticBuilderInner { @@ -210,14 +210,14 @@ impl EmissionGuarantee for () { impl<'a> DiagnosticBuilder<'a, !> { /// Convenience function for internal use, clients should use one of the /// `struct_*` methods on [`Handler`]. - crate fn new_fatal(handler: &'a Handler, message: impl Into<DiagnosticMessage>) -> Self { + pub(crate) fn new_fatal(handler: &'a Handler, message: impl Into<DiagnosticMessage>) -> Self { let diagnostic = Diagnostic::new_with_code(Level::Fatal, None, message); Self::new_diagnostic_fatal(handler, diagnostic) } /// Creates a new `DiagnosticBuilder` with an already constructed /// diagnostic. - crate fn new_diagnostic_fatal(handler: &'a Handler, diagnostic: Diagnostic) -> Self { + pub(crate) fn new_diagnostic_fatal(handler: &'a Handler, diagnostic: Diagnostic) -> Self { debug!("Created new diagnostic"); Self { inner: DiagnosticBuilderInner { diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 29643eaad99..d2f50d5df54 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -3,7 +3,6 @@ //! This module contains the code for creating and emitting diagnostics. #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] -#![feature(crate_visibility_modifier)] #![feature(drain_filter)] #![feature(backtrace)] #![feature(if_let_guard)] |
