diff options
| author | xizheyin <xizheyin@smail.nju.edu.cn> | 2025-05-27 17:29:17 +0800 | 
|---|---|---|
| committer | xizheyin <xizheyin@smail.nju.edu.cn> | 2025-06-09 17:10:58 +0800 | 
| commit | b4ba017c3306bbdb8f3da3dff80e58ff3ed9a1ab (patch) | |
| tree | aea83af1eebf091023c1da5cfdc993ad6e2bea1d /compiler/rustc_expand/src/config.rs | |
| parent | c2986eed43be1d33b07207dc098b2392eea57d61 (diff) | |
| download | rust-b4ba017c3306bbdb8f3da3dff80e58ff3ed9a1ab.tar.gz rust-b4ba017c3306bbdb8f3da3dff80e58ff3ed9a1ab.zip | |
Note the version and PR of removed features when using it
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
Diffstat (limited to 'compiler/rustc_expand/src/config.rs')
| -rw-r--r-- | compiler/rustc_expand/src/config.rs | 11 | 
1 files changed, 11 insertions, 0 deletions
| diff --git a/compiler/rustc_expand/src/config.rs b/compiler/rustc_expand/src/config.rs index c50ab5959e2..9a359e9b031 100644 --- a/compiler/rustc_expand/src/config.rs +++ b/compiler/rustc_expand/src/config.rs @@ -80,9 +80,20 @@ pub fn features(sess: &Session, krate_attrs: &[Attribute], crate_name: Symbol) - // If the enabled feature has been removed, issue an error. if let Some(f) = REMOVED_LANG_FEATURES.iter().find(|f| name == f.feature.name) { + let pull_note = if let Some(pull) = f.pull { + format!( + "; see <https://github.com/rust-lang/rust/pull/{}> for more information", + pull + ) + } else { + "".to_owned() + }; sess.dcx().emit_err(FeatureRemoved { 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; } | 
