Skip to content

Commit a0ca9b1

Browse files
committed
Don't suggest update nightly if using internal features
1 parent a5245ef commit a0ca9b1

File tree

3 files changed

+7
-28
lines changed

3 files changed

+7
-28
lines changed

compiler/rustc_driver_impl/messages.ftl

-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
driver_impl_ice = the compiler unexpectedly panicked. this is a bug.
22
driver_impl_ice_bug_report = we would appreciate a bug report: {$bug_report_url}
33
driver_impl_ice_bug_report_internal_feature = using internal features is not supported and expected to cause internal compiler errors when used incorrectly
4-
driver_impl_ice_bug_report_internal_feature_outdated =
5-
using internal features is not supported and expected to cause internal compiler errors when used incorrectly
6-
.outdated = it seems this '{$version}' is outdated, a newer nightly should have been released in the mean time
7-
.update = please consider running `rustup update nightly` to update the nightly channel and check if this problem still persists
84
driver_impl_ice_bug_report_outdated =
95
it seems this '{$version}' is outdated, a newer nightly should have been released in the mean time
106
.update = please consider running `rustup update nightly` to update the nightly channel and check if this problem still persists

compiler/rustc_driver_impl/src/lib.rs

+7-14
Original file line numberDiff line numberDiff line change
@@ -1415,21 +1415,14 @@ fn report_ice(
14151415
&& let ver_datetime = OffsetDateTime::new_utc(ver_date, Time::MIDNIGHT)
14161416
&& let system_datetime = OffsetDateTime::from(SystemTime::now())
14171417
&& system_datetime.checked_sub(36.hours()).is_some_and(|d| d > ver_datetime)
1418+
&& !using_internal_features.load(std::sync::atomic::Ordering::Relaxed)
14181419
{
1419-
if using_internal_features.load(std::sync::atomic::Ordering::Relaxed) {
1420-
dcx.emit_note(session_diagnostics::IceBugReportInternalFeatureOutdated {
1421-
version,
1422-
note_update: (),
1423-
note_outdated: (),
1424-
});
1425-
} else {
1426-
dcx.emit_note(session_diagnostics::IceBugReportOutdated {
1427-
version,
1428-
bug_report_url,
1429-
note_update: (),
1430-
note_url: (),
1431-
});
1432-
}
1420+
dcx.emit_note(session_diagnostics::IceBugReportOutdated {
1421+
version,
1422+
bug_report_url,
1423+
note_update: (),
1424+
note_url: (),
1425+
});
14331426
} else {
14341427
if using_internal_features.load(std::sync::atomic::Ordering::Relaxed) {
14351428
dcx.emit_note(session_diagnostics::IceBugReportInternalFeature);

compiler/rustc_driver_impl/src/session_diagnostics.rs

-10
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,6 @@ pub(crate) struct IceBugReportOutdated<'a> {
5757
pub note_url: (),
5858
}
5959

60-
#[derive(Diagnostic)]
61-
#[diag(driver_impl_ice_bug_report_internal_feature_outdated)]
62-
pub(crate) struct IceBugReportInternalFeatureOutdated<'a> {
63-
pub version: &'a str,
64-
#[note(driver_impl_outdated)]
65-
pub note_outdated: (),
66-
#[note(driver_impl_update)]
67-
pub note_update: (),
68-
}
69-
7060
#[derive(Diagnostic)]
7161
#[diag(driver_impl_ice_version)]
7262
pub(crate) struct IceVersion<'a> {

0 commit comments

Comments
 (0)