diff options
| author | Jieyou Xu <jieyouxu@outlook.com> | 2025-06-24 10:09:58 +0800 |
|---|---|---|
| committer | Jieyou Xu <jieyouxu@outlook.com> | 2025-06-24 23:32:09 +0800 |
| commit | db11e747230caa23aad3f159e42dc3b47baf7557 (patch) | |
| tree | 9c6af9394f2bb0d8f94b85a416b1c063a31361d6 /compiler | |
| parent | 36b21637e93b038453924d3c66821089e71d8baa (diff) | |
| download | rust-db11e747230caa23aad3f159e42dc3b47baf7557.tar.gz rust-db11e747230caa23aad3f159e42dc3b47baf7557.zip | |
Don't include current rustc version string in feature removed help
The version string is difficult to properly normalize out, and removing it isn't a huge deal (the user can query version info easily through `rustc --version` or `cargo --version`). The normalization options were all non-ideal: - Per-test version string normalization is nasty to maintain, and we need to maintain `n` copies of it. - Centralized compiletest normalization (with a directive opt-out) is also not ideal, because `cfg(version(..))` tests can't have those accidentally normalized out (and you'd have to remember to opt-out).
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_expand/messages.ftl | 2 | ||||
| -rw-r--r-- | compiler/rustc_expand/src/config.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_expand/src/errors.rs | 1 |
3 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_expand/messages.ftl b/compiler/rustc_expand/messages.ftl index 8b7c47dad99..b7555bba28e 100644 --- a/compiler/rustc_expand/messages.ftl +++ b/compiler/rustc_expand/messages.ftl @@ -62,7 +62,7 @@ expand_feature_not_allowed = expand_feature_removed = feature has been removed .label = feature has been removed - .note = removed in {$removed_rustc_version} (you are using {$current_rustc_version}){$pull_note} + .note = removed in {$removed_rustc_version}{$pull_note} .reason = {$reason} expand_glob_delegation_outside_impls = diff --git a/compiler/rustc_expand/src/config.rs b/compiler/rustc_expand/src/config.rs index 9a359e9b031..170ac39d1ec 100644 --- a/compiler/rustc_expand/src/config.rs +++ b/compiler/rustc_expand/src/config.rs @@ -92,7 +92,6 @@ pub fn features(sess: &Session, krate_attrs: &[Attribute], crate_name: Symbol) - span: mi.span(), reason: f.reason.map(|reason| FeatureRemovedReason { reason }), removed_rustc_version: f.feature.since, - current_rustc_version: sess.cfg_version, pull_note, }); continue; diff --git a/compiler/rustc_expand/src/errors.rs b/compiler/rustc_expand/src/errors.rs index 714ba3bf0f4..e69ad9efac4 100644 --- a/compiler/rustc_expand/src/errors.rs +++ b/compiler/rustc_expand/src/errors.rs @@ -162,7 +162,6 @@ pub(crate) struct FeatureRemoved<'a> { #[subdiagnostic] pub reason: Option<FeatureRemovedReason<'a>>, pub removed_rustc_version: &'a str, - pub current_rustc_version: &'a str, pub pull_note: String, } |
