Skip to content

Rollup of 16 pull requests #142299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 53 commits into from
Jun 10, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
dc14e73
Delete unused variant and document AttributeKind
mejrs Apr 27, 2025
5fdacfe
Force exhaustive handling of every parsed attribute
mejrs Apr 27, 2025
c677dc2
Allow transmute casts in pre-runtime-MIR
oli-obk Jun 6, 2025
cd7533a
Stabilize the `keylocker_x86` flag, and the `kl` and `widekl` target …
sayantn May 7, 2025
3ab5e60
Add execution context
Shourya742 Jun 8, 2025
81ee86b
add execution context to bootstrap workflow
Shourya742 Jun 8, 2025
def4488
move git command to new execution context
Shourya742 Jun 8, 2025
8bd8169
moved render_tests in utils to new execution context
Shourya742 Jun 6, 2025
c2986ee
Add ui test removed-features-note-version-and-pr-issue-141619
xizheyin May 27, 2025
b4ba017
Note the version and PR of removed features when using it
xizheyin May 27, 2025
4b89804
Make `since` of removed features the version removed and fill `pull`
xizheyin Jun 4, 2025
9b0ad97
deduplicate the rest of AST walker functions
fee1-dead Jun 9, 2025
81abbe1
moved sanity command to exec context
Shourya742 Jun 6, 2025
2d1ca83
moved curl to use new execution_context
Shourya742 Jun 6, 2025
d544c2b
covert uname to new extext method
Shourya742 Jun 6, 2025
bae39b8
move all download.rs method to new execution context command invocation
Shourya742 Jun 6, 2025
746276c
moved git command to new exec context
Shourya742 Jun 7, 2025
98be2a0
move all config command invocation to new execution context invocation
Shourya742 Jun 7, 2025
50725f3
move all commands to new execution context
Shourya742 Jun 7, 2025
f3e1eb1
update dry_run value in exec_ctx and start forwarding exec_ctx verbos…
Shourya742 Jun 8, 2025
e9ced50
remove execution context from flag module and correct the command inv…
Shourya742 Jun 9, 2025
51fbd14
Initialize the execution context in parse_inner, start using dry run …
Shourya742 Jun 9, 2025
1cdd33e
core::ptr: deduplicate more method docs
lolbinarycat Jun 6, 2025
a9401ea
platform-support.md: Mention specific Linux kernel version or later
teohhanhui Jun 9, 2025
1b9d7ea
Mark `core::slice::memchr` as `#[doc(hidden)]`
aDotInTheVoid Jun 9, 2025
fea6a22
Specify the behavior of `file!`
epage Dec 17, 2024
4f0b60a
Don't create .msi installer for gnullvm hosts
mati865 May 6, 2025
580a955
compiler: Fix reusing same lint on fn ptrs with newly-deprecated ABIs
workingjubilee Jun 9, 2025
0df01a0
tests: bless unsupported_calling_conventions linting on some fn_ptrs
workingjubilee Jun 9, 2025
856c997
rustdoc: Refractor `clean_ty_generics`
aDotInTheVoid Jun 10, 2025
7d7fedb
docs: Small clarification on the usage of read_to_string and read_to_…
Jun 7, 2025
8808a9c
hir_analysis: Elaborate on lint strategy for unsupported ABIs
workingjubilee Jun 10, 2025
f3af860
add a fixme to use `extern_custom` when available
folkertdev Jun 9, 2025
b6eb4f9
use `#[naked]` for `__rust_probestack`
folkertdev Jun 3, 2025
45d649e
merge the sgx/fortanix `__rust_probestack` into the general `x86_64` one
folkertdev Jun 3, 2025
b030442
indent the probestack inline assembly
folkertdev Jun 3, 2025
6d1db11
const_eval: fix some outdated comments
RalfJung Jun 10, 2025
ea1d186
Rollup merge of #134442 - epage:change, r=workingjubilee
fmease Jun 10, 2025
0f16ccb
Rollup merge of #140372 - mejrs:attrs, r=jdonszelmann
fmease Jun 10, 2025
d11756f
Rollup merge of #140766 - sayantn:stabilize-keylocker, r=traviscross,…
fmease Jun 10, 2025
2aea4b2
Rollup merge of #141642 - xizheyin:issue-141619, r=BoxyUwU
fmease Jun 10, 2025
04025fa
Rollup merge of #141818 - mati865:dont-create-msi-from-non-windows, r…
fmease Jun 10, 2025
b9a578e
Rollup merge of #141909 - Shourya742:2025-06-01-add-execution-context…
fmease Jun 10, 2025
a55b610
Rollup merge of #141992 - folkertdev:probestack-naked-function, r=tgr…
fmease Jun 10, 2025
b13df84
Rollup merge of #142101 - lolbinarycat:core-dedup-ptr-docs-139190-pt2…
fmease Jun 10, 2025
590f630
Rollup merge of #142102 - kiseitai3:141714_stdin_read_to_string_docs,…
fmease Jun 10, 2025
e8be230
Rollup merge of #142124 - oli-obk:transmute-cast, r=scottmcm
fmease Jun 10, 2025
407b81c
Rollup merge of #142240 - fee1-dead-contrib:push-zkkzoxlymslv, r=oli-obk
fmease Jun 10, 2025
28d3856
Rollup merge of #142258 - teohhanhui:docs/platform-support-linux-kern…
fmease Jun 10, 2025
f76f1f2
Rollup merge of #142262 - aDotInTheVoid:nomemchr, r=Noratrieb
fmease Jun 10, 2025
a2badeb
Rollup merge of #142271 - workingjubilee:fn-ptrs-have-two-different-l…
fmease Jun 10, 2025
34d39eb
Rollup merge of #142275 - aDotInTheVoid:gen-ty-of, r=fmease
fmease Jun 10, 2025
9f5c10e
Rollup merge of #142288 - RalfJung:const-eval-comments, r=oli-obk
fmease Jun 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Note the version and PR of removed features when using it
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
  • Loading branch information
xizheyin committed Jun 9, 2025
commit b4ba017c3306bbdb8f3da3dff80e58ff3ed9a1ab
1 change: 1 addition & 0 deletions compiler/rustc_expand/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +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}
.reason = {$reason}

expand_glob_delegation_outside_impls =
Expand Down
11 changes: 11 additions & 0 deletions compiler/rustc_expand/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_expand/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,16 @@ pub(crate) struct HelperAttributeNameInvalid {

#[derive(Diagnostic)]
#[diag(expand_feature_removed, code = E0557)]
#[note]
pub(crate) struct FeatureRemoved<'a> {
#[primary_span]
#[label]
pub span: Span,
#[subdiagnostic]
pub reason: Option<FeatureRemovedReason<'a>>,
pub removed_rustc_version: &'a str,
pub current_rustc_version: &'a str,
pub pull_note: String,
}

#[derive(Subdiagnostic)]
Expand Down
19 changes: 16 additions & 3 deletions compiler/rustc_feature/src/removed.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
//! List of the removed feature gates.

use std::num::{NonZero, NonZeroU32};

use rustc_span::sym;

use super::{Feature, to_nonzero};

pub struct RemovedFeature {
pub feature: Feature,
pub reason: Option<&'static str>,
pub pull: Option<NonZero<u32>>,
}

macro_rules! opt_nonzero_u32 {
() => {
None
};
($val:expr) => {
Some(NonZeroU32::new($val).unwrap())
};
}

macro_rules! declare_features {
($(
$(#[doc = $doc:tt])* (removed, $feature:ident, $ver:expr, $issue:expr, $reason:expr),
$(#[doc = $doc:tt])* (removed, $feature:ident, $ver:expr, $issue:expr, $reason:expr $(, $pull:expr)?),
)+) => {
/// Formerly unstable features that have now been removed.
pub static REMOVED_LANG_FEATURES: &[RemovedFeature] = &[
Expand All @@ -21,7 +33,8 @@ macro_rules! declare_features {
since: $ver,
issue: to_nonzero($issue),
},
reason: $reason
reason: $reason,
pull: opt_nonzero_u32!($($pull)?),
}),+
];
};
Expand Down Expand Up @@ -120,7 +133,7 @@ declare_features! (
Some("subsumed by `::foo::bar` paths")),
/// Allows `#[doc(include = "some-file")]`.
(removed, external_doc, "1.54.0", Some(44732),
Some("use #[doc = include_str!(\"filename\")] instead, which handles macro invocations")),
Some("use #[doc = include_str!(\"filename\")] instead, which handles macro invocations"), 85457),
/// Allows using `#[ffi_returns_twice]` on foreign functions.
(removed, ffi_returns_twice, "1.78.0", Some(58314),
Some("being investigated by the ffi-unwind project group")),
Expand Down
2 changes: 2 additions & 0 deletions tests/ui/deprecation/deprecated_no_stack_check.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//@ normalize-stderr: "you are using [0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?( \([^)]*\))?" -> "you are using $$RUSTC_VERSION"

#![deny(warnings)]
#![feature(no_stack_check)]
//~^ ERROR: feature has been removed [E0557]
Expand Down
4 changes: 3 additions & 1 deletion tests/ui/deprecation/deprecated_no_stack_check.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
error[E0557]: feature has been removed
--> $DIR/deprecated_no_stack_check.rs:2:12
--> $DIR/deprecated_no_stack_check.rs:4:12
|
LL | #![feature(no_stack_check)]
| ^^^^^^^^^^^^^^ feature has been removed
|
= note: removed in 1.0.0 (you are using $RUSTC_VERSION)

error: aborting due to 1 previous error

Expand Down
2 changes: 2 additions & 0 deletions tests/ui/feature-gates/feature-gate-coverage-attribute.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//@ normalize-stderr: "you are using [0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?( \([^)]*\))?" -> "you are using $$RUSTC_VERSION"

#![crate_type = "lib"]
#![feature(no_coverage)] //~ ERROR feature has been removed [E0557]

Expand Down
5 changes: 3 additions & 2 deletions tests/ui/feature-gates/feature-gate-coverage-attribute.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
error[E0557]: feature has been removed
--> $DIR/feature-gate-coverage-attribute.rs:2:12
--> $DIR/feature-gate-coverage-attribute.rs:4:12
|
LL | #![feature(no_coverage)]
| ^^^^^^^^^^^ feature has been removed
|
= note: removed in 1.74.0 (you are using $RUSTC_VERSION)
= note: renamed to `coverage_attribute`

error[E0658]: the `#[coverage]` attribute is an experimental feature
--> $DIR/feature-gate-coverage-attribute.rs:10:1
--> $DIR/feature-gate-coverage-attribute.rs:12:1
|
LL | #[coverage(off)]
| ^^^^^^^^^^^^^^^^
Expand Down
1 change: 1 addition & 0 deletions tests/ui/feature-gates/gated-bad-feature.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//@ normalize-stderr: "you are using [0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?( \([^)]*\))?" -> "you are using $$RUSTC_VERSION"
#![feature(foo_bar_baz, foo(bar), foo = "baz", foo)]
//~^ ERROR malformed `feature`
//~| ERROR malformed `feature`
Expand Down
16 changes: 9 additions & 7 deletions tests/ui/feature-gates/gated-bad-feature.stderr
Original file line number Diff line number Diff line change
@@ -1,41 +1,43 @@
error[E0556]: malformed `feature` attribute input
--> $DIR/gated-bad-feature.rs:1:25
--> $DIR/gated-bad-feature.rs:2:25
|
LL | #![feature(foo_bar_baz, foo(bar), foo = "baz", foo)]
| ^^^^^^^^ help: expected just one word: `foo`

error[E0556]: malformed `feature` attribute input
--> $DIR/gated-bad-feature.rs:1:35
--> $DIR/gated-bad-feature.rs:2:35
|
LL | #![feature(foo_bar_baz, foo(bar), foo = "baz", foo)]
| ^^^^^^^^^^^ help: expected just one word: `foo`

error[E0557]: feature has been removed
--> $DIR/gated-bad-feature.rs:8:12
--> $DIR/gated-bad-feature.rs:9:12
|
LL | #![feature(test_removed_feature)]
| ^^^^^^^^^^^^^^^^^^^^ feature has been removed
|
= note: removed in 1.0.0 (you are using $RUSTC_VERSION)

error: malformed `feature` attribute input
--> $DIR/gated-bad-feature.rs:6:1
--> $DIR/gated-bad-feature.rs:7:1
|
LL | #![feature]
| ^^^^^^^^^^^ help: must be of the form: `#![feature(name1, name2, ...)]`

error: malformed `feature` attribute input
--> $DIR/gated-bad-feature.rs:7:1
--> $DIR/gated-bad-feature.rs:8:1
|
LL | #![feature = "foo"]
| ^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#![feature(name1, name2, ...)]`

error[E0635]: unknown feature `foo_bar_baz`
--> $DIR/gated-bad-feature.rs:1:12
--> $DIR/gated-bad-feature.rs:2:12
|
LL | #![feature(foo_bar_baz, foo(bar), foo = "baz", foo)]
| ^^^^^^^^^^^

error[E0635]: unknown feature `foo`
--> $DIR/gated-bad-feature.rs:1:48
--> $DIR/gated-bad-feature.rs:2:48
|
LL | #![feature(foo_bar_baz, foo(bar), foo = "baz", foo)]
| ^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//@ normalize-stderr: "you are using [0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?( \([^)]*\))?" -> "you are using $$RUSTC_VERSION"

#![feature(external_doc)] //~ ERROR feature has been removed
#![doc(include("README.md"))] //~ ERROR unknown `doc` attribute `include`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
error[E0557]: feature has been removed
--> $DIR/removed-features-note-version-and-pr-issue-141619.rs:1:12
--> $DIR/removed-features-note-version-and-pr-issue-141619.rs:3:12
|
LL | #![feature(external_doc)]
| ^^^^^^^^^^^^ feature has been removed
|
= note: removed in 1.54.0 (you are using $RUSTC_VERSION); see <https://github.com/rust-lang/rust/pull/85457> for more information
= note: use #[doc = include_str!("filename")] instead, which handles macro invocations

error: unknown `doc` attribute `include`
--> $DIR/removed-features-note-version-and-pr-issue-141619.rs:2:8
--> $DIR/removed-features-note-version-and-pr-issue-141619.rs:4:8
|
LL | #![doc(include("README.md"))]
| ^^^^^^^^^^^^^^^^^^^^
Expand Down
1 change: 1 addition & 0 deletions tests/ui/macros/macro-reexport-removed.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//@ aux-build:two_macros.rs
//@ normalize-stderr: "you are using [0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?( \([^)]*\))?" -> "you are using $$RUSTC_VERSION"

#![feature(macro_reexport)] //~ ERROR feature has been removed

Expand Down
5 changes: 3 additions & 2 deletions tests/ui/macros/macro-reexport-removed.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
error[E0557]: feature has been removed
--> $DIR/macro-reexport-removed.rs:3:12
--> $DIR/macro-reexport-removed.rs:4:12
|
LL | #![feature(macro_reexport)]
| ^^^^^^^^^^^^^^ feature has been removed
|
= note: removed in 1.0.0 (you are using $RUSTC_VERSION)
= note: subsumed by `pub use`

error: cannot find attribute `macro_reexport` in this scope
--> $DIR/macro-reexport-removed.rs:5:3
--> $DIR/macro-reexport-removed.rs:6:3
|
LL | #[macro_reexport(macro_one)]
| ^^^^^^^^^^^^^^ help: a built-in attribute with a similar name exists: `macro_export`
Expand Down
2 changes: 2 additions & 0 deletions tests/ui/rustdoc/renamed-features-rustdoc_internals.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//@ normalize-stderr: "you are using [0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?( \([^)]*\))?" -> "you are using $$RUSTC_VERSION"

#![feature(doc_keyword)] //~ ERROR
#![feature(doc_primitive)] //~ ERROR
#![crate_type = "lib"]
Expand Down
6 changes: 4 additions & 2 deletions tests/ui/rustdoc/renamed-features-rustdoc_internals.stderr
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
error[E0557]: feature has been removed
--> $DIR/renamed-features-rustdoc_internals.rs:1:12
--> $DIR/renamed-features-rustdoc_internals.rs:3:12
|
LL | #![feature(doc_keyword)]
| ^^^^^^^^^^^ feature has been removed
|
= note: removed in 1.28.0 (you are using $RUSTC_VERSION)
= note: merged into `#![feature(rustdoc_internals)]`

error[E0557]: feature has been removed
--> $DIR/renamed-features-rustdoc_internals.rs:2:12
--> $DIR/renamed-features-rustdoc_internals.rs:4:12
|
LL | #![feature(doc_primitive)]
| ^^^^^^^^^^^^^ feature has been removed
|
= note: removed in 1.56.0 (you are using $RUSTC_VERSION)
= note: merged into `#![feature(rustdoc_internals)]`

error: aborting due to 2 previous errors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Regression test for issue #125877.

//@ compile-flags: -Znext-solver
//@ normalize-stderr: "you are using [0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?( \([^)]*\))?" -> "you are using $$RUSTC_VERSION"

#![feature(const_trait_impl, effects)]
//~^ ERROR feature has been removed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
error[E0557]: feature has been removed
--> $DIR/const-trait-impl-parameter-mismatch.rs:10:30
--> $DIR/const-trait-impl-parameter-mismatch.rs:11:30
|
LL | #![feature(const_trait_impl, effects)]
| ^^^^^^^ feature has been removed
|
= note: removed in 1.84.0 (you are using $RUSTC_VERSION)
= note: removed, redundant with `#![feature(const_trait_impl)]`

error[E0049]: associated function `compute` has 0 type parameters but its trait declaration has 1 type parameter
--> $DIR/const-trait-impl-parameter-mismatch.rs:19:16
--> $DIR/const-trait-impl-parameter-mismatch.rs:20:16
|
LL | fn compute<T: ~const Aux>() -> u32;
| - expected 1 type parameter
Expand Down