Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
7530fc1
Mark the compile unit for `-Zdebuginfo-for-profiling`
apolloww Nov 4, 2026
1a9e176
Don't blindly say that a macro call doesn't expand to a certain fragment
fmease Nov 4, 2026
a7c41c1
Turn `pattern_type` into a macro 2.0 that expands to `k#pattern_type(…
fmease Sep 3, 2026
8f7bf49
Turn `view_type` into a macro 2.0 that expands to `k#view_type(...)`
fmease Nov 4, 2026
44a7763
Upgrade bundled musl to 1.2.6
Amanieu Nov 6, 2026
9882511
Keep the minimum required musl version at 1.2.5
Amanieu Nov 7, 2026
ad13cdf
fix NumScalableVectors::from_field_count
malezjaa Nov 8, 2026
a79fce1
add `core::arch::{x86, x86_64}::x87_f80`
folkertdev Sep 23, 2026
9da70e9
rename `Reg::align` and `Uniform::align` to `scratch_align`
folkertdev Nov 2, 2026
3592132
use `type_padding_filler` for `x87_f80_raw` in arrays and structs
folkertdev Nov 1, 2026
cc199fa
add assert that we never cast to `x87_f80`
folkertdev Nov 4, 2026
802a33e
adjust comments on backend type functions
folkertdev Nov 4, 2026
7274b42
support x87_f80 in const eval's `try_visit_primitive`
folkertdev Nov 5, 2026
3cf3c87
std Miri testing: use skip_unsupported_miri_tests to control when tes…
RalfJung Oct 29, 2026
f64ebf2
windows: check for null before wide encoding
seritools Nov 8, 2026
0aa6251
Unignore passing GCC backend tests
GuillaumeGomez Nov 8, 2026
0e99915
mpsc_sync::stream_send_recv_stress: wait for all thread to finish
RalfJung Nov 9, 2026
d11b3f4
fix MSVC calling convention symbol byte counts
paradoxicalguy Nov 8, 2026
b52077c
Remove `backend_optimization_level`.
veluca93 Nov 7, 2026
0ba7052
chore: Update annotate-snippets to 0.12.17
Muscraft Oct 19, 2026
c34bdf9
feat: Add support for annotate-snippets's no-graphics output format
Muscraft Oct 17, 2026
117c517
docs(num): remove needless whitespaces
sorairolake Nov 10, 2026
2fa016a
Remove parsed arm of `check_attr`
JonathanBrouwer Nov 9, 2026
6fd528c
Move `check_attr` to attribute parsing
JonathanBrouwer Nov 9, 2026
0a179cc
Add test checking that the behaviour for diagnostic attrs is preserved
JonathanBrouwer Nov 9, 2026
8326b5c
Rollup merge of #165575 - Amanieu:musl-1.2.6, r=cuviper
JonathanBrouwer Nov 10, 2026
a2608f0
Rollup merge of #163992 - folkertdev:x87_f80-simple, r=beetrees,RalfJung
JonathanBrouwer Nov 10, 2026
5bc2b14
Rollup merge of #165117 - RalfJung:skip_missing_miri_shims, r=maxdexh
JonathanBrouwer Nov 10, 2026
b82fefa
Rollup merge of #165458 - paradoxicalguy:fix-msvc-byte-count-clean, r…
JonathanBrouwer Nov 10, 2026
3423d5a
Rollup merge of #165487 - fmease:built-in-macro-to-internal-syntax, r…
JonathanBrouwer Nov 10, 2026
21b0f12
Rollup merge of #165490 - apolloww:debuginfo-for-profiling-compile-un…
JonathanBrouwer Nov 10, 2026
02ea906
Rollup merge of #165586 - veluca93:cleanup-opt-speed, r=nikic
JonathanBrouwer Nov 10, 2026
74dfc93
Rollup merge of #165646 - malezjaa:fix-from_field_count, r=workingjub…
JonathanBrouwer Nov 10, 2026
0f8668f
Rollup merge of #165655 - GuillaumeGomez:gcc-tests, r=antoyo
JonathanBrouwer Nov 10, 2026
1a26601
Rollup merge of #165708 - Muscraft:support-no-graphics, r=estebank
JonathanBrouwer Nov 10, 2026
afee98b
Rollup merge of #165693 - JonathanBrouwer:check-attr, r=mejrs
JonathanBrouwer Nov 10, 2026
c7e4c9d
Rollup merge of #165715 - rust9x:windows-osstr-null-precheck, r=Chris…
JonathanBrouwer Nov 10, 2026
92b18fb
Rollup merge of #165717 - RalfJung:stream_send_recv_stress, r=maxdexh
JonathanBrouwer Nov 10, 2026
c0650b3
Rollup merge of #165733 - sorairolake:remove-needless-ws-from-reverse…
JonathanBrouwer Nov 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 5 additions & 5 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ dependencies = [

[[package]]
name = "annotate-snippets"
version = "0.12.16"
version = "0.12.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f211a51805bc641f3ad5b7664c77d2547af685cc33b4cd8d31964027a46f13f1"
checksum = "b2a5b0a5ab8561c603f16c3b78c24a386b1f70e7fc1b1b1e8c15738828e4a176"
dependencies = [
"anstyle",
"memchr",
Expand Down Expand Up @@ -680,7 +680,7 @@ dependencies = [
name = "clippy-dev"
version = "0.0.1"
dependencies = [
"annotate-snippets 0.12.16",
"annotate-snippets 0.12.17",
"anstream 0.6.21",
"chrono",
"clap",
Expand Down Expand Up @@ -4041,7 +4041,7 @@ dependencies = [
name = "rustc_errors"
version = "0.0.0"
dependencies = [
"annotate-snippets 0.12.16",
"annotate-snippets 0.12.17",
"anstream 0.6.21",
"anstyle",
"derive_setters",
Expand Down Expand Up @@ -5179,7 +5179,7 @@ dependencies = [
name = "rustfmt-nightly"
version = "1.12.0"
dependencies = [
"annotate-snippets 0.12.16",
"annotate-snippets 0.12.17",
"anyhow",
"bytecount",
"cargo_metadata 0.23.1",
Expand Down
14 changes: 10 additions & 4 deletions compiler/rustc_abi/src/callconv/reg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ impl RegKind {
match primitive {
Primitive::Int(..) | Primitive::Pointer(_) => RegKind::Integer,
Primitive::Float(Float::PpcF128) => RegKind::PpcF128,
Primitive::Float(Float::F16 | Float::F16B | Float::F32 | Float::F64 | Float::F128) => {
RegKind::Float
}
Primitive::Float(
Float::F16 | Float::F16B | Float::F32 | Float::F64 | Float::X87F80 | Float::F128,
) => RegKind::Float,
}
}
}
Expand Down Expand Up @@ -60,6 +60,7 @@ impl Reg {
reg_ctor!(f16, Float, 16);
reg_ctor!(f32, Float, 32);
reg_ctor!(f64, Float, 64);
reg_ctor!(x87_f80, Float, 80);
reg_ctor!(f128, Float, 128);

/// A vector of the given size with an unknown (and irrelevant) element type.
Expand All @@ -70,7 +71,8 @@ impl Reg {
}

impl Reg {
pub fn align<C: HasDataLayout>(&self, cx: &C) -> Align {
/// Alignment used for the scratch space when this type is part of a `PassMode::Cast`.
pub fn scratch_align<C: HasDataLayout>(&self, cx: &C) -> Align {
let dl = cx.data_layout();
match self.kind {
RegKind::Integer => match self.size.bits() {
Expand All @@ -86,6 +88,10 @@ impl Reg {
16 => dl.f16_align,
32 => dl.f32_align,
64 => dl.f64_align,
// This alignment is not a multiple of 80 bits, but the alignment
// here is only used to align the alloca of a cast, and there the
// full alignment of x87_f80 should be used.
80 => dl.x87_f80_align,
128 => dl.f128_align,
_ => panic!("unsupported float: {self:?}"),
},
Expand Down
17 changes: 17 additions & 0 deletions compiler/rustc_abi/src/layout/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ pub trait TyAbiInterface<'a, C>: Sized + std::fmt::Debug + std::fmt::Display {
fn is_unit(this: TyAndLayout<'a, Self>) -> bool;
fn is_transparent(this: TyAndLayout<'a, Self>) -> bool;
fn is_complex_number_lang_item(this: TyAndLayout<'a, Self>, cx: &C) -> bool;
fn is_x87_f80_lang_item(this: TyAndLayout<'a, Self>, cx: &C) -> bool;
fn is_scalable_vector(this: TyAndLayout<'a, Self>) -> bool;
/// See [`TyAndLayout::pass_indirectly_in_non_rustic_abis`] for details.
fn is_pass_indirectly_in_non_rustic_abis_flag_set(this: TyAndLayout<'a, Self>) -> bool;
Expand Down Expand Up @@ -232,6 +233,17 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
Ty::is_scalable_vector(self)
}

/// Returns `true` if this type is the `x87_f80` lang item.
///
/// Note that this function returns `false` for the `x87_f80_raw` lang item.
pub fn is_x87_f80<C>(self, cx: &C) -> bool
where
Ty: TyAbiInterface<'a, C> + Copy,
{
// A 1-ZST is never x87_f80.
Ty::is_x87_f80_lang_item(self.peel_transparent_wrappers_from_non_1zst(cx), cx)
}

/// If this method returns `true`, then this type should always have a `PassMode` of
/// `Indirect { mode: IndirectMode::Pointer, .. }` when being used as the argument type of a
/// function with a non-Rustic ABI (this is true for structs annotated with the
Expand Down Expand Up @@ -339,6 +351,10 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {

let component = complex.field(cx, 0).peel_transparent_wrappers_from_non_1zst(cx);

if component.is_x87_f80(cx) {
return Some(Numeric::Float(Float::X87F80));
}

let BackendRepr::Scalar(scalar) = component.backend_repr else {
return None;
};
Expand All @@ -353,6 +369,7 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
Primitive::Float(
float @ (Float::F16 | Float::F32 | Float::F64 | Float::F128 | Float::PpcF128),
) => Some(Numeric::Float(float)),
Primitive::Float(Float::X87F80) => None, // x87_f80_raw has incorrect alignment.
Primitive::Pointer(..) | Primitive::Float(Float::F16B) => None,
}
}
Expand Down
36 changes: 28 additions & 8 deletions compiler/rustc_abi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ pub struct TargetDataLayout {
pub f16_align: Align,
pub f32_align: Align,
pub f64_align: Align,
pub x87_f80_align: Align,
pub f128_align: Align,
pub aggregate_align: Align,

Expand Down Expand Up @@ -367,6 +368,7 @@ impl Default for TargetDataLayout {
f16_align: align(16),
f32_align: align(32),
f64_align: align(64),
x87_f80_align: align(128),
f128_align: align(128),
aggregate_align: align(8),
vector_align: vec![
Expand Down Expand Up @@ -510,6 +512,7 @@ impl TargetDataLayout {
["f16", a @ ..] => dl.f16_align = parse_align_seq(a, "f16")?,
["f32", a @ ..] => dl.f32_align = parse_align_seq(a, "f32")?,
["f64", a @ ..] => dl.f64_align = parse_align_seq(a, "f64")?,
["f80", a @ ..] => dl.x87_f80_align = parse_align_seq(a, "f80")?,
["f128", a @ ..] => dl.f128_align = parse_align_seq(a, "f128")?,
[p, s, a @ ..] if p.starts_with("p") => {
let mut p = p.strip_prefix('p').unwrap();
Expand Down Expand Up @@ -1387,10 +1390,22 @@ pub enum Float {
F16B,
F32,
F64,
/// `x87_f80`. This is not a builtin type in Rust (it is exposed as a lang item),
/// but it is a builtin type in LLVM so needs to be explicitly represented
/// in the backend.
///
/// Here we define the 80-bit scalar value that corresponds to the `x87_f80_raw` lang item.
/// In `core::arch::{x86, x86_64}` this type is wrapped by the `x87_f80` lang item that adds
/// the proper alignment and bumps the size to either 12 or 16 bytes depending on the target.
///
/// Only used on x86 and x86_64 targets.
X87F80,
F128,
/// `ppcf128`. This is not a builtin type in Rust (it is exposed as a lang item),
/// but it is a builtin type in LLVM so needs to be explicitly represented
/// in the backend.
///
/// Only used on powerpc and powerpc64 targets.
PpcF128,
}

Expand All @@ -1403,6 +1418,7 @@ impl Float {
F16B => Size::from_bits(16),
F32 => Size::from_bits(32),
F64 => Size::from_bits(64),
X87F80 => Size::from_bits(80),
F128 => Size::from_bits(128),
PpcF128 => Size::from_bits(128),
}
Expand All @@ -1416,6 +1432,9 @@ impl Float {
F16 | F16B => dl.f16_align,
F32 => dl.f32_align,
F64 => dl.f64_align,
// Use an alignment of 1 for x87_f80_raw,
// so that its size really is 80 bits in memory.
X87F80 => Align::ONE,
F128 => dl.f128_align,
PpcF128 => dl.f128_align,
}
Expand All @@ -1429,6 +1448,7 @@ impl Float {
F16B => "f16b",
F32 => "f32",
F64 => "f64",
X87F80 => "x87_f80",
F128 => "f128",
PpcF128 => "ppcf128",
}
Expand All @@ -1439,7 +1459,7 @@ impl Float {

match self {
F16 | F32 | F64 | F128 => true,
F16B | PpcF128 => false,
F16B | X87F80 | PpcF128 => false,
}
}
}
Expand All @@ -1465,9 +1485,9 @@ impl Numeric {
match self {
Numeric::Int(_, _) => RegKind::Integer,
Numeric::Float(Float::PpcF128) => RegKind::PpcF128,
Numeric::Float(Float::F16 | Float::F16B | Float::F32 | Float::F64 | Float::F128) => {
RegKind::Float
}
Numeric::Float(
Float::F16 | Float::F16B | Float::F32 | Float::F64 | Float::X87F80 | Float::F128,
) => RegKind::Float,
}
}
}
Expand Down Expand Up @@ -1778,12 +1798,12 @@ impl NumScalableVectors {
NumScalableVectors(1)
}

// Returns `NumScalableVectors` for values of two through eight, which are a valid number of
// fields for a tuple of scalable vectors to have. `1` is a valid value of `NumScalableVectors`
// but not for a tuple which would have a field count.
/// Returns `NumScalableVectors` for values of two through eight, which are a valid number of
/// fields for a tuple of scalable vectors to have. `1` is a valid value of `NumScalableVectors`
/// but not for a tuple which would have a field count.
pub fn from_field_count(count: usize) -> Option<Self> {
match count {
2..8 => Some(NumScalableVectors(count as u8)),
2..=8 => Some(NumScalableVectors(count as u8)),
_ => None,
}
}
Expand Down
5 changes: 0 additions & 5 deletions compiler/rustc_ast_passes/src/ast_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ use rustc_abi::{CVariadicStatus, CanonAbi, ExternAbi, InterruptKind};
use rustc_ast::visit::{AssocCtxt, BoundKind, FnCtxt, FnKind, Visitor, walk_list};
use rustc_ast::*;
use rustc_ast_pretty::pprust::{self, State};
use rustc_attr_parsing::validate_attr;
use rustc_data_structures::fx::FxIndexMap;
use rustc_errors::{DiagCtxtHandle, Diagnostic, LintBuffer};
use rustc_feature::Features;
Expand Down Expand Up @@ -1402,10 +1401,6 @@ fn validate_generic_param_order(dcx: DiagCtxtHandle<'_>, generics: &[GenericPara
}

impl Visitor<'_> for AstValidator<'_> {
fn visit_attribute(&mut self, attr: &Attribute) {
validate_attr::check_attr(&self.sess.psess, attr);
}

fn visit_ty(&mut self, ty: &Ty) {
self.visit_ty_common(ty);
self.walk_ty(ty)
Expand Down
7 changes: 0 additions & 7 deletions compiler/rustc_ast_passes/src/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
// Function pointers cannot be `const`
self.check_late_bound_lifetime_defs(&fn_ptr_ty.generic_params);
}
ast::TyKind::Pat(..) => {
gate!(self, pattern_types, ty.span, "pattern types are unstable");
}
ast::TyKind::View(..) => {
gate!(self, view_types, ty.span, "view types are unstable");
}
_ => {}
}
visit::walk_ty(self, ty)
Expand Down Expand Up @@ -469,7 +463,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
gate_all!(unnamed_enum_variants, "unnamed enum variants are experimental");
gate_all!(unsafe_binders, "unsafe binder types are experimental");
gate_all!(unsafe_fields, "`unsafe` fields are experimental");
gate_all!(view_types, "view types are experimental");
gate_all!(where_clause_attrs, "attributes in `where` clause are unstable");
gate_all!(yeet_expr, "`do yeet` expression is experimental");
// tidy-alphabetical-end
Expand Down
6 changes: 6 additions & 0 deletions compiler/rustc_ast_pretty/src/pprust/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1437,9 +1437,12 @@ impl<'a> State<'a> {
self.word("...");
}
ast::TyKind::Pat(ty, pat) => {
self.word("k#pattern_type");
self.popen();
self.print_type(ty);
self.word(" is ");
self.print_ty_pat(pat);
self.pclose();
}
ast::TyKind::FieldOf(ty, variant, field) => {
self.word("k#field_of");
Expand All @@ -1459,8 +1462,11 @@ impl<'a> State<'a> {
self.pclose();
}
ast::TyKind::View(ty, fields) => {
self.word("k#view_type");
self.popen();
self.print_type(ty);
self.print_view(fields);
self.pclose();
}
ast::TyKind::GcaMacro(expr) => {
self.word_nbsp("core::gca!");
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_pretty/src/pprust/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ fn test_field_view() {
};

let ty_str = ty_to_string(&ty);
assert_eq!(ty_str, "(/*DUMMY*/).{ milhouse, apu }");
assert_eq!(ty_str, "k#view_type((/*DUMMY*/).{ milhouse, apu })");
});
}
2 changes: 2 additions & 0 deletions compiler/rustc_attr_ir/src/lang_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ language_item_table! {

Complex, sym::complex, complex, Target::Struct, GenericRequirement::Exact(1);
PpcF128, sym::ppcf128, ppcf128, Target::Struct, GenericRequirement::None;
X87F80, sym::x87_f80, x87_f80, Target::Struct, GenericRequirement::None;
X87F80Raw, sym::x87_f80_raw, x87_f80_raw, Target::Struct, GenericRequirement::None;

Deref, kw::Deref, deref_trait, Target::Trait, GenericRequirement::Exact(0);
DerefMut, sym::deref_mut, deref_mut_trait, Target::Trait, GenericRequirement::Exact(0);
Expand Down
16 changes: 15 additions & 1 deletion compiler/rustc_attr_parsing/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use crate::diagnostics::ParsedDescription;
use crate::generated::GeneratedAttrState;
use crate::parser::{AllowExprMetavar, ArgParser, PathParser, RefPathParser};
use crate::synthetic::SyntheticAttrState;
use crate::validate_attr::parse_meta;
use crate::{AttributeTemplate, ShouldEmit, diagnostics};

pub struct EmitAttribute(
Expand Down Expand Up @@ -359,7 +360,8 @@ impl<'sess> AttributeParser<'sess> {
n.item.path.segments.iter().map(|seg| seg.ident.name).collect::<Vec<_>>();
let inner_span = lower_span(n.item.span);

if let Some(accept) = ATTRIBUTE_PARSERS.accepters.get(parts.as_slice()) {
let accepter = ATTRIBUTE_PARSERS.accepters.get(parts.as_slice());
if let Some(accept) = accepter {
self.check_attribute_safety(
&attr_path,
inner_span,
Expand Down Expand Up @@ -492,6 +494,18 @@ impl<'sess> AttributeParser<'sess> {

attributes.push(attr);
};

if accepter.is_none()
&& let rustc_ast::AttrArgs::Eq { .. } = n.item.args
{
// All key-value attributes are restricted to meta-item syntax.
match parse_meta(&self.sess.psess, &attr) {
Ok(_) => {}
Err(err) => {
err.emit();
}
}
}
}
}
}
Expand Down
Loading
Loading