diff options
| author | 许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com> | 2024-02-27 12:40:02 +0000 | 
|---|---|---|
| committer | 许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com> | 2024-02-27 12:40:02 +0000 | 
| commit | a0ca9b16338be84a520dd842d351de0679d5e2f1 (patch) | |
| tree | 0458fa81a84bff4b7184f70410af4ddf98513ac0 /compiler/rustc_driver_impl | |
| parent | a5245ef284f70e048e9a4f6bbe1678067d0a3bb6 (diff) | |
| download | rust-a0ca9b16338be84a520dd842d351de0679d5e2f1.tar.gz rust-a0ca9b16338be84a520dd842d351de0679d5e2f1.zip | |
Don't suggest update nightly if using internal features
Diffstat (limited to 'compiler/rustc_driver_impl')
| -rw-r--r-- | compiler/rustc_driver_impl/messages.ftl | 4 | ||||
| -rw-r--r-- | compiler/rustc_driver_impl/src/lib.rs | 21 | ||||
| -rw-r--r-- | compiler/rustc_driver_impl/src/session_diagnostics.rs | 10 | 
3 files changed, 7 insertions, 28 deletions
| diff --git a/compiler/rustc_driver_impl/messages.ftl b/compiler/rustc_driver_impl/messages.ftl index 4b0efeba4c6..5dd0295897b 100644 --- a/compiler/rustc_driver_impl/messages.ftl +++ b/compiler/rustc_driver_impl/messages.ftl @@ -1,10 +1,6 @@ driver_impl_ice = the compiler unexpectedly panicked. this is a bug. driver_impl_ice_bug_report = we would appreciate a bug report: {$bug_report_url} driver_impl_ice_bug_report_internal_feature = using internal features is not supported and expected to cause internal compiler errors when used incorrectly -driver_impl_ice_bug_report_internal_feature_outdated = - using internal features is not supported and expected to cause internal compiler errors when used incorrectly - .outdated = it seems this '{$version}' is outdated, a newer nightly should have been released in the mean time - .update = please consider running `rustup update nightly` to update the nightly channel and check if this problem still persists driver_impl_ice_bug_report_outdated = it seems this '{$version}' is outdated, a newer nightly should have been released in the mean time .update = please consider running `rustup update nightly` to update the nightly channel and check if this problem still persists diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs index fcf18b67497..95747ee6cd5 100644 --- a/compiler/rustc_driver_impl/src/lib.rs +++ b/compiler/rustc_driver_impl/src/lib.rs @@ -1415,21 +1415,14 @@ fn report_ice( && let ver_datetime = OffsetDateTime::new_utc(ver_date, Time::MIDNIGHT) && let system_datetime = OffsetDateTime::from(SystemTime::now()) && system_datetime.checked_sub(36.hours()).is_some_and(|d| d > ver_datetime) + && !using_internal_features.load(std::sync::atomic::Ordering::Relaxed) { - if using_internal_features.load(std::sync::atomic::Ordering::Relaxed) { - dcx.emit_note(session_diagnostics::IceBugReportInternalFeatureOutdated { - version, - note_update: (), - note_outdated: (), - }); - } else { - dcx.emit_note(session_diagnostics::IceBugReportOutdated { - version, - bug_report_url, - note_update: (), - note_url: (), - }); - } + dcx.emit_note(session_diagnostics::IceBugReportOutdated { + version, + bug_report_url, + note_update: (), + note_url: (), + }); } else { if using_internal_features.load(std::sync::atomic::Ordering::Relaxed) { dcx.emit_note(session_diagnostics::IceBugReportInternalFeature); diff --git a/compiler/rustc_driver_impl/src/session_diagnostics.rs b/compiler/rustc_driver_impl/src/session_diagnostics.rs index 0c3909e68ca..62d0da62d2a 100644 --- a/compiler/rustc_driver_impl/src/session_diagnostics.rs +++ b/compiler/rustc_driver_impl/src/session_diagnostics.rs @@ -58,16 +58,6 @@ pub(crate) struct IceBugReportOutdated<'a> { } #[derive(Diagnostic)] -#[diag(driver_impl_ice_bug_report_internal_feature_outdated)] -pub(crate) struct IceBugReportInternalFeatureOutdated<'a> { - pub version: &'a str, - #[note(driver_impl_outdated)] - pub note_outdated: (), - #[note(driver_impl_update)] - pub note_update: (), -} - -#[derive(Diagnostic)] #[diag(driver_impl_ice_version)] pub(crate) struct IceVersion<'a> { pub version: &'a str, | 
