Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
a24022a
Fix LLVM intrinsic signatures for AVX-VNNI
sayantn Mar 1, 2026
35f7c8b
Correct stability attribute for avx512bw intrinsics
sayantn Mar 4, 2026
985cd23
Add immediate AMX intrinsics
sayantn Mar 1, 2026
5d3caa5
Merge pull request #2043 from sayantn/amx-avx512
folkertdev Mar 4, 2026
3483792
Merge pull request #2044 from sayantn/fix-signatures
folkertdev Mar 4, 2026
48d573f
Add movrs intrinsics
sayantn Mar 5, 2026
6abb95c
gate use of `wasm_target_feature` on wasm target arch
folkertdev Mar 6, 2026
753e5b8
Merge pull request #2049 from folkertdev/gate-wasm-target-features
sayantn Mar 6, 2026
c61045d
Merge pull request #2047 from sayantn/correct-bw-const
folkertdev Mar 6, 2026
3494337
Merge pull request #2048 from sayantn/movrs
folkertdev Mar 6, 2026
6c7d342
add ACLE random number generation intrinsics
folkertdev Mar 6, 2026
dceeb20
Fix LegacyKeyValueFormat report from docker build: various
homersimpsons Mar 7, 2026
279c43e
Prepare for merging from rust-lang/rust
invalid-email-address Mar 9, 2026
5cc9690
Merge ref 'eda4fc7733ee' from rust-lang/rust
invalid-email-address Mar 9, 2026
59dfb9e
remove concept of soft-unstable features
RalfJung Mar 9, 2026
f1bd647
Revert "Merge pull request #1871 from folkertdev/aarch64-float-min-max"
RalfJung Mar 10, 2026
d97cd54
Merge pull request #2052 from RalfJung/avoid-simd-minmax
folkertdev Mar 10, 2026
46bada3
aarch64: use `simd_reduce_{min, max}` on integers
folkertdev Mar 10, 2026
f326a42
Merge pull request #2051 from rust-lang/rustc-pull
folkertdev Mar 10, 2026
752a87f
s390x: use llvm.s390 intrinsics instead of simd_fmin/fmax
RalfJung Mar 10, 2026
47d82e2
add f32 min/max tests
RalfJung Mar 10, 2026
a668717
go back to portable LLVM intrinsic to avoid fallback trouble
RalfJung Mar 11, 2026
e6dc137
Merge pull request #2058 from RalfJung/s390x-minmax
folkertdev Mar 11, 2026
80b8698
s390x: add f64 tests for vec_min
RalfJung Mar 11, 2026
ebd8272
Merge pull request #2053 from folkertdev/aarch64-int-simd-reduce-min-max
folkertdev Mar 12, 2026
b245493
Merge pull request #2061 from RalfJung/f64-tests
folkertdev Mar 12, 2026
4f10c64
remove `cfg_attr` on `aarch64`/`arm64ec` in the aarch64 module
folkertdev Mar 12, 2026
30c24f4
ci: update to actions/checkout@v6
Mar 12, 2026
ccf7d4e
inline `assert_instr` tests
folkertdev Mar 12, 2026
185a329
Merge pull request #2062 from clado/github-action-checkout-v6
folkertdev Mar 13, 2026
3eb071e
Flip "region lattice" in RegionKind doc comment
khyperia Mar 13, 2026
39631fd
Point at unit structs on foreign crates in type errors when they are …
estebank Mar 15, 2026
408066f
Do not suggest introducing new binding when other suggestions are pre…
estebank Mar 15, 2026
461038f
improve `#[track_caller]` invalid ABI error
folkertdev Mar 15, 2026
93584fd
dissolve `tests/ui/cross`
cyrgani Mar 16, 2026
2d419b5
Rename `parent_module` to `parent_scope`
mu001999 Mar 16, 2026
757f224
Use nearest non block module as the correct parent module
mu001999 Mar 16, 2026
ccd1640
Add missing needs-sanitizer-kasan directive name
Darksonn Mar 16, 2026
9b1eb93
Tweak wording of failed predicate in inference error
estebank Mar 16, 2026
3776c07
Merge pull request #2050 from folkertdev/aarch64-rand
sayantn Mar 16, 2026
8155209
enable the `movrs` target feature in `core` and `std`
folkertdev Mar 16, 2026
19e9ec7
test `classify-runtime-const` for `f16`
folkertdev Mar 14, 2026
1814df1
Run ui tests on the parallel frontend
ywxt Mar 16, 2026
45b5d5f
Small report_cycle refactor
zetanumbers Mar 17, 2026
6a0ce16
Ignore tests for the parallel frontend
ywxt Mar 17, 2026
b5e53dc
Cleanup from_cycle_error::variances_of.
zetanumbers Mar 16, 2026
a72acee
correct `vpdpbusd` asserts in miri
folkertdev Mar 17, 2026
d81da4d
Fix missing kernel-address from error message list
Darksonn Mar 16, 2026
19f292a
Rollup merge of #153972 - folkertdev:stdarch-sync-2026-03-16, r=folke…
JonathanBrouwer Mar 17, 2026
fe68164
Rollup merge of #153801 - ywxt:parallel-test, r=petrochenkov
JonathanBrouwer Mar 17, 2026
b2a26be
Rollup merge of #153959 - mu001999-contrib:fix-153848, r=petrochenkov
JonathanBrouwer Mar 17, 2026
888990b
Rollup merge of #153967 - estebank:infer_must_implement, r=petrochenkov
JonathanBrouwer Mar 17, 2026
f7c9081
Rollup merge of #152968 - khyperia:regionkind-comment, r=BoxyUwU
JonathanBrouwer Mar 17, 2026
bf0c6d5
Rollup merge of #153531 - homersimpsons:chore/fix-LegacyKeyValueForma…
JonathanBrouwer Mar 17, 2026
626f9d3
Rollup merge of #153622 - RalfJung:rm-soft-unstable, r=JonathanBrouwer
JonathanBrouwer Mar 17, 2026
d8360a9
Rollup merge of #153709 - zetanumbers:from_cycle_error_cleanup, r=nne…
JonathanBrouwer Mar 17, 2026
cbebd5b
Rollup merge of #153884 - folkertdev:f16-classify-runtime-const, r=tg…
JonathanBrouwer Mar 17, 2026
a5e0306
Rollup merge of #153894 - estebank:issue-129792, r=nnethercote
JonathanBrouwer Mar 17, 2026
f4cc98a
Rollup merge of #153920 - folkertdev:track-caller-abi-error, r=Jonath…
JonathanBrouwer Mar 17, 2026
967e3cf
Rollup merge of #153946 - cyrgani:no-cross-tests-dir, r=Kivooeo
JonathanBrouwer Mar 17, 2026
c608c63
Rollup merge of #153965 - Darksonn:kasan-minor-bugs, r=JonathanBrouwer
JonathanBrouwer Mar 17, 2026
880d85f
Rollup merge of #153991 - zetanumbers:report_cycle_small_refactor, r=…
JonathanBrouwer Mar 17, 2026
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
20 changes: 19 additions & 1 deletion compiler/rustc_ast_passes/src/ast_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1487,6 +1487,15 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
ident,
sig,
);

if let Some(attr) = attr::find_by_name(fi.attrs(), sym::track_caller)
&& self.extern_mod_abi != Some(ExternAbi::Rust)
{
self.dcx().emit_err(errors::RequiresRustAbi {
track_caller_span: attr.span,
extern_abi_span: self.current_extern_span(),
});
}
}
ForeignItemKind::TyAlias(box TyAlias {
defaultness,
Expand Down Expand Up @@ -1672,10 +1681,19 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
}

if let FnKind::Fn(ctxt, _, fun) = fk
&& let Extern::Explicit(str_lit, _) = fun.sig.header.ext
&& let Extern::Explicit(str_lit, extern_abi_span) = fun.sig.header.ext
&& let Ok(abi) = ExternAbi::from_str(str_lit.symbol.as_str())
{
self.check_extern_fn_signature(abi, ctxt, &fun.ident, &fun.sig);

if let Some(attr) = attr::find_by_name(attrs, sym::track_caller)
&& abi != ExternAbi::Rust
{
self.dcx().emit_err(errors::RequiresRustAbi {
track_caller_span: attr.span,
extern_abi_span,
});
}
}

self.check_c_variadic_type(fk, attrs);
Expand Down
10 changes: 10 additions & 0 deletions compiler/rustc_ast_passes/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1140,3 +1140,13 @@ pub(crate) struct ScalableVectorBadArch {
#[primary_span]
pub span: Span,
}

#[derive(Diagnostic)]
#[diag("`#[track_caller]` can only be used with the Rust ABI", code = E0737)]
pub(crate) struct RequiresRustAbi {
#[primary_span]
#[label("using `#[track_caller]` here")]
pub track_caller_span: Span,
#[label("not using the Rust ABI because of this")]
pub extern_abi_span: Span,
}
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,7 @@ impl<S: Stage> SingleAttributeParser<S> for SanitizeParser {
item.path().span(),
&[
sym::address,
sym::kernel_address,
sym::cfi,
sym::kcfi,
sym::memory,
Expand Down
17 changes: 1 addition & 16 deletions compiler/rustc_attr_parsing/src/attributes/stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,6 @@ pub(crate) fn parse_unstability<S: Stage>(
let mut reason = None;
let mut issue = None;
let mut issue_num = None;
let mut is_soft = false;
let mut implied_by = None;
let mut old_name = None;

Expand Down Expand Up @@ -423,12 +422,6 @@ pub(crate) fn parse_unstability<S: Stage>(
},
};
}
Some(sym::soft) => {
if let Err(span) = args.no_args() {
cx.emit_err(session_diagnostics::SoftNoArgs { span });
}
is_soft = true;
}
Some(sym::implied_by) => {
insert_value_into_option_or_error(cx, &param, &mut implied_by, word.unwrap())?
}
Expand All @@ -438,14 +431,7 @@ pub(crate) fn parse_unstability<S: Stage>(
_ => {
cx.expected_specific_argument(
param.span(),
&[
sym::feature,
sym::reason,
sym::issue,
sym::soft,
sym::implied_by,
sym::old_name,
],
&[sym::feature, sym::reason, sym::issue, sym::implied_by, sym::old_name],
);
return None;
}
Expand All @@ -468,7 +454,6 @@ pub(crate) fn parse_unstability<S: Stage>(
let level = StabilityLevel::Unstable {
reason: UnstableReason::from_opt_reason(reason),
issue: issue_num,
is_soft,
implied_by,
old_name,
};
Expand Down
7 changes: 0 additions & 7 deletions compiler/rustc_attr_parsing/src/session_diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,13 +374,6 @@ pub(crate) struct InvalidSince {
pub span: Span,
}

#[derive(Diagnostic)]
#[diag("`soft` should not have any arguments")]
pub(crate) struct SoftNoArgs {
#[primary_span]
pub span: Span,
}

#[derive(Diagnostic)]
#[diag("unknown version literal format, assuming it refers to a future version")]
pub(crate) struct UnknownVersionLiteral {
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_codegen_ssa/src/codegen_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ fn process_builtin_attrs(
&& let Some(fn_sig) = try_fn_sig(tcx, did, *attr_span)
&& fn_sig.skip_binder().abi() != ExternAbi::Rust
{
tcx.dcx().emit_err(errors::RequiresRustAbi { span: *attr_span });
// This error is already reported in `rustc_ast_passes/src/ast_validation.rs`.
tcx.dcx().delayed_bug("`#[track_caller]` requires the Rust ABI");
}
if is_closure
&& !tcx.features().closure_track_caller()
Expand Down
7 changes: 0 additions & 7 deletions compiler/rustc_codegen_ssa/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,6 @@ pub(crate) struct NoSavedObjectFile<'a> {
pub cgu_name: &'a str,
}

#[derive(Diagnostic)]
#[diag("`#[track_caller]` requires Rust ABI", code = E0737)]
pub(crate) struct RequiresRustAbi {
#[primary_span]
pub span: Span,
}

#[derive(Diagnostic)]
#[diag("unable to copy {$source_file} to {$output_path}: {$error}")]
pub(crate) struct CopyPathBuf {
Expand Down
8 changes: 8 additions & 0 deletions compiler/rustc_errors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,14 @@ impl Suggestions {
Suggestions::Disabled => Vec::new(),
}
}

pub fn len(&self) -> usize {
match self {
Suggestions::Enabled(suggestions) => suggestions.len(),
Suggestions::Sealed(suggestions) => suggestions.len(),
Suggestions::Disabled => 0,
}
}
}

impl Default for Suggestions {
Expand Down
10 changes: 5 additions & 5 deletions compiler/rustc_hir/src/attrs/data_structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,15 +277,15 @@ impl Default for MacroUseArgs {
}

#[derive(Debug, Clone, Encodable, Decodable, HashStable_Generic)]
pub struct StrippedCfgItem<ModId = DefId> {
pub parent_module: ModId,
pub struct StrippedCfgItem<ScopeId = DefId> {
pub parent_scope: ScopeId,
pub ident: Ident,
pub cfg: (CfgEntry, Span),
}

impl<ModId> StrippedCfgItem<ModId> {
pub fn map_mod_id<New>(self, f: impl FnOnce(ModId) -> New) -> StrippedCfgItem<New> {
StrippedCfgItem { parent_module: f(self.parent_module), ident: self.ident, cfg: self.cfg }
impl<ScopeId> StrippedCfgItem<ScopeId> {
pub fn map_scope_id<New>(self, f: impl FnOnce(ScopeId) -> New) -> StrippedCfgItem<New> {
StrippedCfgItem { parent_scope: f(self.parent_scope), ident: self.ident, cfg: self.cfg }
}
}

Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_hir/src/stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ pub enum StabilityLevel {
reason: UnstableReason,
/// Relevant `rust-lang/rust` issue.
issue: Option<NonZero<u32>>,
is_soft: bool,
/// If part of a feature is stabilized and a new feature is added for the remaining parts,
/// then the `implied_by` attribute is used to indicate which now-stable feature previously
/// contained an item.
Expand Down
124 changes: 66 additions & 58 deletions compiler/rustc_hir_typeck/src/pat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1636,69 +1636,77 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
span_bug!(pat_span, "unexpected resolution for path pattern: {resolved_pat:?}");
};

if let Some(span) = self.tcx.hir_res_span(pat_res) {
let span = match (self.tcx.hir_res_span(pat_res), res.opt_def_id()) {
(Some(span), _) => span,
(None, Some(def_id)) => self.tcx.def_span(def_id),
(None, None) => {
e.emit();
return;
}
};
if let [hir::PathSegment { ident, args: None, .. }] = segments
&& e.suggestions.len() == 0
{
e.span_label(span, format!("{} defined here", res.descr()));
if let [hir::PathSegment { ident, .. }] = segments {
e.span_label(
pat_span,
format!(
"`{}` is interpreted as {} {}, not a new binding",
ident,
res.article(),
res.descr(),
),
);
match self.tcx.parent_hir_node(hir_id) {
hir::Node::PatField(..) => {
e.span_label(
pat_span,
format!(
"`{}` is interpreted as {} {}, not a new binding",
ident,
res.article(),
res.descr(),
),
);
match self.tcx.parent_hir_node(hir_id) {
hir::Node::PatField(..) => {
e.span_suggestion_verbose(
ident.span.shrink_to_hi(),
"bind the struct field to a different name instead",
format!(": other_{}", ident.as_str().to_lowercase()),
Applicability::HasPlaceholders,
);
}
_ => {
let (type_def_id, item_def_id) = match resolved_pat.ty.kind() {
ty::Adt(def, _) => match res {
Res::Def(DefKind::Const { .. }, def_id) => {
(Some(def.did()), Some(def_id))
}
_ => (None, None),
},
_ => (None, None),
};

let is_range = matches!(
type_def_id.and_then(|id| self.tcx.as_lang_item(id)),
Some(
LangItem::Range
| LangItem::RangeFrom
| LangItem::RangeTo
| LangItem::RangeFull
| LangItem::RangeInclusiveStruct
| LangItem::RangeToInclusive,
)
);
if is_range {
if !self.maybe_suggest_range_literal(&mut e, item_def_id, *ident) {
let msg = "constants only support matching by type, \
if you meant to match against a range of values, \
consider using a range pattern like `min ..= max` in the match block";
e.note(msg);
}
} else {
let msg = "introduce a new binding instead";
let sugg = format!("other_{}", ident.as_str().to_lowercase());
e.span_suggestion_verbose(
ident.span.shrink_to_hi(),
"bind the struct field to a different name instead",
format!(": other_{}", ident.as_str().to_lowercase()),
ident.span,
msg,
sugg,
Applicability::HasPlaceholders,
);
}
_ => {
let (type_def_id, item_def_id) = match resolved_pat.ty.kind() {
ty::Adt(def, _) => match res {
Res::Def(DefKind::Const { .. }, def_id) => {
(Some(def.did()), Some(def_id))
}
_ => (None, None),
},
_ => (None, None),
};

let is_range = matches!(
type_def_id.and_then(|id| self.tcx.as_lang_item(id)),
Some(
LangItem::Range
| LangItem::RangeFrom
| LangItem::RangeTo
| LangItem::RangeFull
| LangItem::RangeInclusiveStruct
| LangItem::RangeToInclusive,
)
);
if is_range {
if !self.maybe_suggest_range_literal(&mut e, item_def_id, *ident) {
let msg = "constants only support matching by type, \
if you meant to match against a range of values, \
consider using a range pattern like `min ..= max` in the match block";
e.note(msg);
}
} else {
let msg = "introduce a new binding instead";
let sugg = format!("other_{}", ident.as_str().to_lowercase());
e.span_suggestion(
ident.span,
msg,
sugg,
Applicability::HasPlaceholders,
);
}
}
};
}
}
};
}
e.emit();
}
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_lint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ fn register_builtins(store: &mut LintStore) {
see <https://github.com/rust-lang/rust/issues/40107> for more information",
);
store.register_removed("wasm_c_abi", "the wasm C ABI has been fixed");
store.register_removed("soft_unstable", "the general soft-unstable mechanism has been removed");
}

fn register_internals(store: &mut LintStore) {
Expand Down
17 changes: 0 additions & 17 deletions compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ declare_lint_pass! {
SEMICOLON_IN_EXPRESSIONS_FROM_MACROS,
SHADOWING_SUPERTRAIT_ITEMS,
SINGLE_USE_LIFETIMES,
SOFT_UNSTABLE,
STABLE_FEATURES,
TAIL_EXPR_DROP_ORDER,
TEST_UNSTABLE_LINT,
Expand Down Expand Up @@ -2345,22 +2344,6 @@ declare_lint! {
};
}

declare_lint! {
/// The `soft_unstable` lint detects unstable features that were unintentionally allowed on
/// stable. This is a [future-incompatible] lint to transition this to a hard error in the
/// future. See [issue #64266] for more details.
///
/// [issue #64266]: https://github.com/rust-lang/rust/issues/64266
/// [future-incompatible]: ../index.md#future-incompatible-lints
pub SOFT_UNSTABLE,
Deny,
"a feature gate that doesn't break dependent crates",
@future_incompatible = FutureIncompatibleInfo {
reason: fcw!(FutureReleaseError #64266),
report_in_deps: true,
};
}

declare_lint! {
/// The `inline_no_sanitize` lint detects incompatible use of
/// [`#[inline(always)]`][inline] and [`#[sanitize(xyz = "off")]`][sanitize].
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_metadata/src/rmeta/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ impl<'a> CrateMetadataRef<'a> {
.root
.stripped_cfg_items
.decode((self, tcx))
.map(|item| item.map_mod_id(|index| DefId { krate: cnum, index }));
.map(|item| item.map_scope_id(|index| DefId { krate: cnum, index }));
tcx.arena.alloc_from_iter(item_names)
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_metadata/src/rmeta/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2145,7 +2145,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
self.tcx
.stripped_cfg_items(LOCAL_CRATE)
.into_iter()
.map(|item| item.clone().map_mod_id(|def_id| def_id.index)),
.map(|item| item.clone().map_scope_id(|def_id| def_id.index)),
)
}

Expand Down
Loading
Loading