Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
0645ac3
extract s390x `vector` and friends to their own rust feature
folkertdev Aug 20, 2025
d69442f
`std_detect`: remove unneeded stability lines from s390x features macro
folkertdev Aug 20, 2025
02e4db5
`std_detect`: give s390x features more accurate features / tracking i…
folkertdev Aug 20, 2025
c59298d
stabilize `stdarch_s390x_feature_detection`
folkertdev Aug 20, 2025
7516645
stabilize `s390x_target_feature_vector`
folkertdev Aug 20, 2025
1a9cc78
re-use `self.get_all_attrs` result for pass indirectly attribute
folkertdev Nov 6, 2025
12cde30
Add note for identifier with attempted hygiene violation
chenyukang Nov 7, 2025
c92ef47
Fix suggestion for returning async closures
chenyukang Nov 6, 2025
5ed01e9
Switch hexagon targets to rust-lld
androm3da Nov 7, 2025
fc20a28
Modify contributor email entries in .mailmap
hkBst Oct 28, 2025
f2794ce
Switch clean `print` methods into a function
GuillaumeGomez Nov 6, 2025
0f03429
Replace `Display::fmt` with `write_char`
GuillaumeGomez Nov 7, 2025
63efad0
Rollup merge of #145656 - folkertdev:stabilize-s390x-vector, r=Amanieu
GuillaumeGomez Nov 7, 2025
c91cc98
Rollup merge of #148204 - hkBst:patch-5, r=nnethercote
GuillaumeGomez Nov 7, 2025
298c104
Rollup merge of #148556 - chenyukang:yukang-fix-148493-async-closure,…
GuillaumeGomez Nov 7, 2025
126bfcb
Rollup merge of #148585 - GuillaumeGomez:improve-format-code, r=yotam…
GuillaumeGomez Nov 7, 2025
f4070cb
Rollup merge of #148600 - folkertdev:pass-indirectly-reuse-attrs, r=J…
GuillaumeGomez Nov 7, 2025
0ae62c9
Rollup merge of #148612 - chenyukang:yukang-fix-148580-macro-hygiene-…
GuillaumeGomez Nov 7, 2025
07d76d4
Rollup merge of #148613 - androm3da:bcain/hex_lld, r=JonathanBrouwer,…
GuillaumeGomez Nov 7, 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
19 changes: 16 additions & 3 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Aaron Todd <[email protected]>
Abhishek Chanda <[email protected]> Abhishek Chanda <[email protected]>
Abhijeet Bhagat <[email protected]>
Abroskin Alexander <[email protected]>
Adolfo Ochagavía <[email protected]>
Adolfo Ochagavía <[email protected]> <[email protected]>
Adrian Heine né Lang <[email protected]>
Adrien Tétar <[email protected]>
Ahmed Charles <[email protected]> <[email protected]>
Expand All @@ -36,6 +36,7 @@ Amanda Stjerna <[email protected]> <[email protected]>
Amanda Stjerna <[email protected]> <[email protected]>
Amanieu d'Antras <[email protected]> <[email protected]>
Amos Onn <[email protected]>
Amos Wenger <[email protected]> <[email protected]>
Ana-Maria Mihalache <[email protected]>
Anatoly Ikorsky <[email protected]>
Andre Bogus <[email protected]>
Expand Down Expand Up @@ -276,7 +277,8 @@ Irina Popa <[email protected]>
Ivan Ivaschenko <[email protected]>
ivan tkachenko <[email protected]>
J. J. Weber <[email protected]>
Jack Huey <[email protected]> <[email protected]>
Jack Huey <[email protected]> <[email protected]>
Jack Huey <[email protected]> <[email protected]>
Jacob <[email protected]>
Jacob Hoffman-Andrews <[email protected]> <[email protected]>
Jacob Greenfield <[email protected]>
Expand All @@ -292,6 +294,8 @@ Jakub Adam Wieczorek <[email protected]>
Jakub Adam Wieczorek <[email protected]> <[email protected]>
Jakub Adam Wieczorek <[email protected]> <[email protected]>
Jakub Adam Wieczorek <[email protected]> <[email protected]>
Jakub Adam Wieczorek <[email protected]> <[email protected]>
Jakub Adam Wieczorek <[email protected]> <[email protected]>
Jakub Beránek <[email protected]> <[email protected]>
James [Undefined] <[email protected]>
James Deng <[email protected]> <[email protected]>
Expand All @@ -303,6 +307,7 @@ Jamie Hill-Daniel <[email protected]> <[email protected]>
Jana Dönszelmann <[email protected]>
Jana Dönszelmann <[email protected]> <[email protected]>
Jana Dönszelmann <[email protected]> <[email protected]>
Jane Lusby <[email protected]> <[email protected]>
Jan-Erik Rediger <[email protected]> <[email protected]>
Jaro Fietz <[email protected]>
Jason Fager <[email protected]>
Expand All @@ -313,6 +318,7 @@ Jason Toffaletti <[email protected]> Jason Toffaletti <[email protected]>
Jauhien Piatlicki <[email protected]> Jauhien Piatlicki <[email protected]>
Jay True <[email protected]>
Jeremy Letang <[email protected]>
Jeremy Soller <[email protected]> <[email protected]>
Jeremy Sorensen <[email protected]>
Jeremy Stucki <[email protected]> <[email protected]>
Jeremy Stucki <[email protected]> <[email protected]>
Expand All @@ -336,6 +342,7 @@ John Kåre Alsaker <[email protected]>
John Kåre Alsaker <[email protected]> <[email protected]>
John Talling <[email protected]>
John Van Enk <[email protected]>
Jon Gjengset <[email protected]> <[email protected]>
Jonas Tepe <[email protected]>
Jonathan Bailey <[email protected]> <[email protected]>
Jonathan Chan Kwan Yin <[email protected]>
Expand Down Expand Up @@ -424,7 +431,7 @@ Malo Jaffré <[email protected]>
Manish Goregaokar <[email protected]>
Mara Bos <[email protected]>
Marcell Pardavi <[email protected]>
Marco Ieni <[email protected]>
Marco Ieni <[email protected]> <[email protected]>
Marcus Klaas de Vries <[email protected]>
Margaret Meyerhofer <[email protected]> <mmeyerho@andrew>
Marijn Schouten <[email protected]> <[email protected]>
Expand Down Expand Up @@ -531,6 +538,7 @@ Oliver Scherer <[email protected]> <[email protected]>
Oliver Scherer <[email protected]> <[email protected]>
Oliver Scherer <[email protected]> <[email protected]>
Oliver Scherer <[email protected]>
Onur Özkan <[email protected]> <[email protected]>
Onur Özkan <[email protected]> <[email protected]>
Onur Özkan <[email protected]>
Ömer Sinan Ağacan <[email protected]>
Expand Down Expand Up @@ -591,6 +599,7 @@ Rusty Blitzerr <[email protected]>
RustyYato <[email protected]>
Ruud van Asseldonk <[email protected]> Ruud van Asseldonk <[email protected]>
Ryan Leung <[email protected]>
Ryan Levick <[email protected]> <[email protected]>
Ryan Scheel <[email protected]>
Ryan Sullivant <[email protected]>
Ryan Wiedemann <[email protected]>
Expand Down Expand Up @@ -686,6 +695,8 @@ Weihang Lo <[email protected]>
Weihang Lo <[email protected]> <[email protected]>
Wesley Wiser <[email protected]> <[email protected]>
whitequark <[email protected]>
Will Crichton <[email protected]> <[email protected]>
Will Crichton <[email protected]> <[email protected]>
William Ting <[email protected]> <[email protected]>
Wim Looman <[email protected]> <[email protected]>
Wim Looman <[email protected]> <[email protected]>
Expand All @@ -695,6 +706,8 @@ Xinye Tao <[email protected]>
Xuefeng Wu <[email protected]> Xuefeng Wu <[email protected]>
Xuefeng Wu <[email protected]> XuefengWu <[email protected]>
York Xiang <[email protected]>
Yoshua Wuyts <[email protected]> <[email protected]>
Yoshua Wuyts <[email protected]> <[email protected]>
Yotam Ofek <[email protected]> <[email protected]>
Youngsoo Son <[email protected]> <[email protected]>
Youngsuk Kim <[email protected]>
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_feature/src/accepted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ declare_features! (
(accepted, return_position_impl_trait_in_trait, "1.75.0", Some(91611)),
/// Allows code like `let x: &'static u32 = &42` to work (RFC 1414).
(accepted, rvalue_static_promotion, "1.21.0", Some(38865)),
/// Allows use of the `vector` and related s390x target features.
(accepted, s390x_target_feature_vector, "CURRENT_RUSTC_VERSION", Some(145649)),
/// Allows `Self` in type definitions (RFC 2300).
(accepted, self_in_typedefs, "1.32.0", Some(49303)),
/// Allows `Self` struct constructor (RFC 2302).
Expand Down
15 changes: 15 additions & 0 deletions compiler/rustc_hir_analysis/src/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,21 @@ pub fn suggest_impl_trait<'tcx>(
infcx.tcx.lang_items().future_output(),
format_as_assoc,
),
(
infcx.tcx.lang_items().async_fn_trait(),
infcx.tcx.lang_items().async_fn_once_output(),
format_as_parenthesized,
),
(
infcx.tcx.lang_items().async_fn_mut_trait(),
infcx.tcx.lang_items().async_fn_once_output(),
format_as_parenthesized,
),
(
infcx.tcx.lang_items().async_fn_once_trait(),
infcx.tcx.lang_items().async_fn_once_output(),
format_as_parenthesized,
),
(
infcx.tcx.lang_items().fn_trait(),
infcx.tcx.lang_items().fn_once_output(),
Expand Down
10 changes: 3 additions & 7 deletions compiler/rustc_middle/src/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1512,9 +1512,8 @@ impl<'tcx> TyCtxt<'tcx> {
field_shuffle_seed ^= user_seed;
}

if let Some(reprs) =
find_attr!(self.get_all_attrs(did), AttributeKind::Repr { reprs, .. } => reprs)
{
let attributes = self.get_all_attrs(did);
if let Some(reprs) = find_attr!(attributes, AttributeKind::Repr { reprs, .. } => reprs) {
for (r, _) in reprs {
flags.insert(match *r {
attr::ReprRust => ReprFlags::empty(),
Expand Down Expand Up @@ -1574,10 +1573,7 @@ impl<'tcx> TyCtxt<'tcx> {
}

// See `TyAndLayout::pass_indirectly_in_non_rustic_abis` for details.
if find_attr!(
self.get_all_attrs(did),
AttributeKind::RustcPassIndirectlyInNonRusticAbis(..)
) {
if find_attr!(attributes, AttributeKind::RustcPassIndirectlyInNonRusticAbis(..)) {
flags.insert(ReprFlags::PASS_INDIRECTLY_IN_NON_RUSTIC_ABIS);
}

Expand Down
24 changes: 24 additions & 0 deletions compiler/rustc_resolve/src/late/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,8 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
}
}
}

self.suggest_ident_hidden_by_hygiene(err, path, span);
} else if err_code == E0412 {
if let Some(correct) = Self::likely_rust_type(path) {
err.span_suggestion(
Expand All @@ -1138,6 +1140,28 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
}
}

fn suggest_ident_hidden_by_hygiene(&self, err: &mut Diag<'_>, path: &[Segment], span: Span) {
let [segment] = path else { return };

let ident = segment.ident;
let callsite_span = span.source_callsite();
for rib in self.ribs[ValueNS].iter().rev() {
for (binding_ident, _) in &rib.bindings {
if binding_ident.name == ident.name
&& !binding_ident.span.eq_ctxt(span)
&& !binding_ident.span.from_expansion()
&& binding_ident.span.lo() < callsite_span.lo()
{
err.span_help(
binding_ident.span,
"an identifier with the same name exists, but is not accessible due to macro hygiene",
);
return;
}
}
}
}

/// Emit special messages for unresolved `Self` and `self`.
fn suggest_self_ty(
&self,
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2000,6 +2000,7 @@ symbols! {
s,
s390x,
s390x_target_feature,
s390x_target_feature_vector,
safety,
sanitize,
sanitizer_cfi_generalize_pointers,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub(crate) fn target() -> Target {
base.features = "-small-data,+hvx-length128b".into();

base.has_rpath = true;
base.linker = Some("rust-lld".into());
base.linker_flavor = LinkerFlavor::Unix(Cc::Yes);

base.c_enum_min_bits = Some(8);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub(crate) fn target() -> Target {
max_atomic_width: Some(32),
emit_debug_gdb_scripts: false,
c_enum_min_bits: Some(8),
linker: Some("rust-lld".into()),
..Default::default()
},
}
Expand Down
24 changes: 12 additions & 12 deletions compiler/rustc_target/src/target_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -844,20 +844,20 @@ const IBMZ_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
("message-security-assist-extension8", Unstable(sym::s390x_target_feature), &["message-security-assist-extension3"]),
("message-security-assist-extension9", Unstable(sym::s390x_target_feature), &["message-security-assist-extension3", "message-security-assist-extension4"]),
("message-security-assist-extension12", Unstable(sym::s390x_target_feature), &[]),
("miscellaneous-extensions-2", Unstable(sym::s390x_target_feature), &[]),
("miscellaneous-extensions-3", Unstable(sym::s390x_target_feature), &[]),
("miscellaneous-extensions-4", Unstable(sym::s390x_target_feature), &[]),
("nnp-assist", Unstable(sym::s390x_target_feature), &["vector"]),
("miscellaneous-extensions-2", Stable, &[]),
("miscellaneous-extensions-3", Stable, &[]),
("miscellaneous-extensions-4", Stable, &[]),
("nnp-assist", Stable, &["vector"]),
("soft-float", Forbidden { reason: "currently unsupported ABI-configuration feature" }, &[]),
("transactional-execution", Unstable(sym::s390x_target_feature), &[]),
("vector", Unstable(sym::s390x_target_feature), &[]),
("vector-enhancements-1", Unstable(sym::s390x_target_feature), &["vector"]),
("vector-enhancements-2", Unstable(sym::s390x_target_feature), &["vector-enhancements-1"]),
("vector-enhancements-3", Unstable(sym::s390x_target_feature), &["vector-enhancements-2"]),
("vector-packed-decimal", Unstable(sym::s390x_target_feature), &["vector"]),
("vector-packed-decimal-enhancement", Unstable(sym::s390x_target_feature), &["vector-packed-decimal"]),
("vector-packed-decimal-enhancement-2", Unstable(sym::s390x_target_feature), &["vector-packed-decimal-enhancement"]),
("vector-packed-decimal-enhancement-3", Unstable(sym::s390x_target_feature), &["vector-packed-decimal-enhancement-2"]),
("vector", Stable, &[]),
("vector-enhancements-1", Stable, &["vector"]),
("vector-enhancements-2", Stable, &["vector-enhancements-1"]),
("vector-enhancements-3", Stable, &["vector-enhancements-2"]),
("vector-packed-decimal", Stable, &["vector"]),
("vector-packed-decimal-enhancement", Stable, &["vector-packed-decimal"]),
("vector-packed-decimal-enhancement-2", Stable, &["vector-packed-decimal-enhancement"]),
("vector-packed-decimal-enhancement-3", Stable, &["vector-packed-decimal-enhancement-2"]),
// tidy-alphabetical-end
];

Expand Down
2 changes: 1 addition & 1 deletion library/std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ pub mod arch {
pub use std_detect::is_loongarch_feature_detected;
#[unstable(feature = "is_riscv_feature_detected", issue = "111192")]
pub use std_detect::is_riscv_feature_detected;
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
#[stable(feature = "stdarch_s390x_feature_detection", since = "CURRENT_RUSTC_VERSION")]
pub use std_detect::is_s390x_feature_detected;
#[stable(feature = "simd_x86", since = "1.27.0")]
pub use std_detect::is_x86_feature_detected;
Expand Down
4 changes: 0 additions & 4 deletions library/std/tests/run-time-detect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
all(target_arch = "aarch64", any(target_os = "linux", target_os = "android")),
feature(stdarch_aarch64_feature_detection)
)]
#![cfg_attr(
all(target_arch = "s390x", target_os = "linux"),
feature(stdarch_s390x_feature_detection)
)]
#![cfg_attr(
all(target_arch = "powerpc", target_os = "linux"),
feature(stdarch_powerpc_feature_detection)
Expand Down
2 changes: 1 addition & 1 deletion library/std_detect/src/detect/arch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ cfg_select! {
pub use loongarch::*;
}
target_arch = "s390x" => {
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
#[stable(feature = "stdarch_s390x_feature_detection", since = "CURRENT_RUSTC_VERSION")]
pub use s390x::*;
}
_ => {
Expand Down
Loading
Loading