Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
f9878e1
Add test for `FnMut` closure moving value
estebank Sep 24, 2026
e0b39b5
Add enclosing item context when pointing at `FnMut` bound
estebank Sep 24, 2026
143e186
Preserve equality when relating binder regions
Dnreikronos Oct 11, 2026
754a3c8
Test equality and variance across binder boundaries
Dnreikronos Oct 11, 2026
7530fc1
Mark the compile unit for `-Zdebuginfo-for-profiling`
apolloww Nov 4, 2026
9c6e032
Move `trivial_field_reads` from trait to impl trait fn
tehforsch Oct 3, 2026
2ee054c
stop using gce in a test
WaffleLapkin Nov 6, 2026
44a7763
Upgrade bundled musl to 1.2.6
Amanieu Nov 6, 2026
6d1c8f1
Feat: move trait gate
zannabianca1997 Nov 6, 2026
aafd174
Fix: rustdoc tests
zannabianca1997 Nov 6, 2026
45b068b
Fix: core doctests need the relaxed bound policy
zannabianca1997 Nov 6, 2026
9882511
Keep the minimum required musl version at 1.2.5
Amanieu Nov 7, 2026
48106d7
rename this -> ecx in intrinsics/x86
programskillforverification Nov 8, 2026
ae4771b
Rename evaluation context bindings from this to ecx
Kaileshwar16 Nov 8, 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
bbcae61
fix ICE when reading as signed
programskillforverification Nov 1, 2026
c07d3b3
add test for closing the end of a socketpair that someone is blocked on
RalfJung Nov 9, 2026
8c9cbb2
Merge pull request #5591 from programskillforverification/this-to-ecx-3
RalfJung Nov 9, 2026
ea34445
Merge pull request #5593 from Kaileshwar16/issue-5569-operator-gc-all…
RalfJung Nov 9, 2026
a6611ac
Merge pull request #5600 from RalfJung/socketpair-deadlock-test
RalfJung Nov 9, 2026
0edc67f
syscall: return ENOSYS for unknown syscalls
RalfJung Nov 9, 2026
462d762
Rename evaluation context bindings in shims
darkraider01 Nov 9, 2026
a4cc283
Merge pull request #5602 from RalfJung/syscall-nosys
RalfJung Nov 9, 2026
e7007d3
interpret: ensure newly created unions have uninit in their padding
RalfJung Nov 9, 2026
98962a2
statx: explain why we initialize these fields
RalfJung Nov 9, 2026
a4016e0
Fix: fast path for rustdoc
zannabianca1997 Nov 9, 2026
be44f80
Merge pull request #5605 from RalfJung/statx-comment
RalfJung Nov 9, 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
32d7c93
Merge pull request #5603 from darkraider01/rename-shims-ecx
RalfJung Nov 9, 2026
792c14e
tweak comment
RalfJung Nov 9, 2026
9ee159b
Merge pull request #5537 from programskillforverification/fix-len-arg…
RalfJung Nov 9, 2026
8d31601
Change the span building of paths from first-to-last to chained
FranciscoTGouveia Oct 27, 2026
b52077c
Remove `backend_optimization_level`.
veluca93 Nov 7, 2026
6e05a38
Partially stabilize `ptr_alignment_type` as `alignment_type`
GrigorenkoPV Mar 1, 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
eaf2a71
fs::Dir tests: ensure remove and rename do not follow symlinks
RalfJung Oct 19, 2026
811ebf7
windows: fix Dir::{remove_*,rename} symlink behavior
RalfJung Oct 19, 2026
9adef1b
remove NOP File::flush from fs tests
RalfJung Nov 10, 2026
70426a6
Trace `#[rustc_trivial_field_reads]` sites through dead code analysis
tehforsch Oct 3, 2026
73309b6
Add safety requirements for Pattern, Searcher and ReverseSearcher
yilin0518 Nov 10, 2026
c77c7c4
avoid Terminator:None in MIR inliner
panstromek Nov 10, 2026
cfd4720
Rollup merge of #164217 - tehforsch:fix-160621, r=mejrs,mu001999
JonathanBrouwer Nov 10, 2026
8448990
Rollup merge of #165569 - zannabianca1997:move-trait-split, r=jdonsze…
JonathanBrouwer Nov 10, 2026
02b45b7
Rollup merge of #165575 - Amanieu:musl-1.2.6, r=cuviper
JonathanBrouwer Nov 10, 2026
e3c7666
Rollup merge of #157984 - Dnreikronos:trait_solver/binder_region_cons…
JonathanBrouwer Nov 10, 2026
30d76b0
Rollup merge of #163241 - estebank:closure-context, r=BoxyUwU
JonathanBrouwer Nov 10, 2026
db1bc19
Rollup merge of #163992 - folkertdev:x87_f80-simple, r=beetrees,RalfJung
JonathanBrouwer Nov 10, 2026
5560894
Rollup merge of #165047 - FranciscoTGouveia:rustc-show-spans-attr, r=…
JonathanBrouwer Nov 10, 2026
9a3d123
Rollup merge of #165458 - paradoxicalguy:fix-msvc-byte-count-clean, r…
JonathanBrouwer Nov 10, 2026
9115f9b
Rollup merge of #165490 - apolloww:debuginfo-for-profiling-compile-un…
JonathanBrouwer Nov 10, 2026
c76ad67
Rollup merge of #165586 - veluca93:cleanup-opt-speed, r=nikic
JonathanBrouwer Nov 10, 2026
9a1b37a
Rollup merge of #165646 - malezjaa:fix-from_field_count, r=workingjub…
JonathanBrouwer Nov 10, 2026
879e3db
Rollup merge of #165655 - GuillaumeGomez:gcc-tests, r=antoyo
JonathanBrouwer Nov 10, 2026
7b1d2b9
Rollup merge of #165740 - RalfJung:miri, r=RalfJung
JonathanBrouwer Nov 10, 2026
78f7a86
Rollup merge of #165753 - panstromek:no-terminator-option-in-inline, …
JonathanBrouwer Nov 10, 2026
f238012
Rollup merge of #153261 - GrigorenkoPV:stabilize/alignment, r=clarfon…
JonathanBrouwer Nov 10, 2026
1fb2041
Rollup merge of #164559 - RalfJung:dir-remove-rename-symlinks, r=Chri…
JonathanBrouwer Nov 10, 2026
5f7ef1e
Rollup merge of #165562 - WaffleLapkin:no-gce-test, r=BoxyUwU
JonathanBrouwer Nov 10, 2026
47b70a0
Rollup merge of #165681 - yilin0518:pattern_searcher, r=maxdexh
JonathanBrouwer Nov 10, 2026
824ffcb
Rollup merge of #165682 - RalfJung:union-init, r=oli-obk
JonathanBrouwer Nov 10, 2026
aead582
Rollup merge of #165693 - JonathanBrouwer:check-attr, r=mejrs
JonathanBrouwer Nov 10, 2026
6af8195
Rollup merge of #165715 - rust9x:windows-osstr-null-precheck, r=Chris…
JonathanBrouwer Nov 10, 2026
12b2bb5
Rollup merge of #165717 - RalfJung:stream_send_recv_stress, r=maxdexh
JonathanBrouwer Nov 10, 2026
8650e0a
Rollup merge of #165733 - sorairolake:remove-needless-ws-from-reverse…
JonathanBrouwer Nov 10, 2026
9dfdbe9
Rollup merge of #165739 - RalfJung:file-flush, r=ChrisDenton
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
  •  
  •  
  •  
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
9 changes: 9 additions & 0 deletions compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3489,6 +3489,7 @@ pub enum GeneratedAttr {
DocHidden,
CoverageOff,
RustcTestMarker(Symbol),
RustcTrivialFieldReads,
}

impl GeneratedAttr {
Expand All @@ -3504,6 +3505,7 @@ impl GeneratedAttr {
GeneratedAttr::RustcTestMarker(test_path) => {
format!("#[rustc_test_marker = \"{test_path}\"]")
}
GeneratedAttr::RustcTrivialFieldReads => "#[rustc_trivial_field_reads]".into(),
}
}
pub fn value_span(&self) -> Option<Span> {
Expand All @@ -3514,6 +3516,7 @@ impl GeneratedAttr {
GeneratedAttr::DocHidden => None,
GeneratedAttr::CoverageOff => None,
GeneratedAttr::RustcTestMarker(_) => None,
GeneratedAttr::RustcTrivialFieldReads => None,
}
}

Expand All @@ -3525,6 +3528,7 @@ impl GeneratedAttr {
GeneratedAttr::DocHidden => false,
GeneratedAttr::CoverageOff => false,
GeneratedAttr::RustcTestMarker(_) => false,
GeneratedAttr::RustcTrivialFieldReads => false,
}
}

Expand All @@ -3536,6 +3540,7 @@ impl GeneratedAttr {
GeneratedAttr::DocHidden => &[sym::doc],
GeneratedAttr::CoverageOff => &[sym::coverage],
GeneratedAttr::RustcTestMarker(_) => &[sym::rustc_test_marker],
GeneratedAttr::RustcTrivialFieldReads => &[sym::rustc_trivial_field_reads],
}
}

Expand All @@ -3547,6 +3552,7 @@ impl GeneratedAttr {
GeneratedAttr::DocHidden => None,
GeneratedAttr::CoverageOff => None,
GeneratedAttr::RustcTestMarker(_) => None,
GeneratedAttr::RustcTrivialFieldReads => None,
}
}

Expand All @@ -3558,6 +3564,7 @@ impl GeneratedAttr {
GeneratedAttr::DocHidden => false,
GeneratedAttr::CoverageOff => false,
GeneratedAttr::RustcTestMarker(_) => false,
GeneratedAttr::RustcTrivialFieldReads => false,
}
}
pub fn value_str(&self) -> Option<Symbol> {
Expand All @@ -3568,6 +3575,7 @@ impl GeneratedAttr {
GeneratedAttr::DocHidden => None,
GeneratedAttr::CoverageOff => None,
GeneratedAttr::RustcTestMarker(test_path) => Some(*test_path),
GeneratedAttr::RustcTrivialFieldReads => None,
}
}

Expand All @@ -3579,6 +3587,7 @@ impl GeneratedAttr {
GeneratedAttr::DocHidden => None,
GeneratedAttr::CoverageOff => None,
GeneratedAttr::RustcTestMarker(_) => None,
GeneratedAttr::RustcTrivialFieldReads => None,
}
}

Expand Down
10 changes: 9 additions & 1 deletion compiler/rustc_ast_lowering/src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,13 +452,21 @@ impl<'hir> LoweringContext<'_, 'hir> {
let constness = self.lower_constness(attrs, *constness);
let impl_restriction = self.lower_impl_restriction(impl_restriction, hir_id);
let ident = self.lower_ident(*ident);
// FIXME(move_trait): We likely want to not add an implicit `Move` super trait
// at which point we shouldn't allow relaxed bounds here. Even if we do, we should
// make sure to only allow `?Move`.
let policy = if self.tcx.features().move_trait() {
RelaxedBoundPolicy::Allowed(&mut Default::default())
} else {
RelaxedBoundPolicy::Forbidden(RelaxedBoundForbiddenReason::SuperTrait)
};
let (generics, (safety, items, bounds)) = self.lower_generics(
generics,
ImplTraitContext::Disallowed(ImplTraitPosition::Generic),
|this| {
let bounds = this.lower_param_bounds(
bounds,
RelaxedBoundPolicy::Forbidden(RelaxedBoundForbiddenReason::SuperTrait),
policy,
ImplTraitContext::Disallowed(ImplTraitPosition::Bound),
);
let items = this.arena.alloc_from_iter(
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
2 changes: 1 addition & 1 deletion compiler/rustc_attr_ir/src/data_structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,7 @@ pub enum AttributeKind {
RustcThenThisWouldNeed(ThinVec<Ident>),

/// Represents `#[rustc_trivial_field_reads]`
RustcTrivialFieldReads,
RustcTrivialFieldReads(Span),

/// Represents `#[sanitize]`
///
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_attr_ir/src/encode_cross_crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ impl AttributeKind {
RustcStrictCoherence(..) => Yes,
RustcTestMarker(..) => No,
RustcThenThisWouldNeed(..) => No,
RustcTrivialFieldReads => Yes,
RustcTrivialFieldReads(..) => No,
Sanitize { .. } => No,
ShouldPanic { .. } => No,
Splat(..) => Yes,
Expand Down Expand Up @@ -417,7 +417,7 @@ impl AttributeKind {
RustcStrictCoherence(..) => false,
RustcTestMarker(..) => false,
RustcThenThisWouldNeed(..) => false,
RustcTrivialFieldReads => false,
RustcTrivialFieldReads(..) => false,
Sanitize { .. } => false,
ShouldPanic { .. } => false,
Splat(..) => false,
Expand Down
4 changes: 4 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 Expand Up @@ -280,6 +282,8 @@ language_item_table! {
Unpin, sym::unpin, unpin_trait, Target::Trait, GenericRequirement::None;
Pin, kw::Pin, pin_type, Target::Struct, GenericRequirement::None;

Move, sym::move_trait, move_trait, Target::Trait, GenericRequirement::None;

OrderingEnum, sym::Ordering, ordering_enum, Target::Enum, GenericRequirement::Exact(0);
PartialEq, sym::eq, eq_trait, Target::Trait, GenericRequirement::Exact(1);
PartialOrd, sym::partial_ord, partial_ord_trait, Target::Trait, GenericRequirement::Exact(1);
Expand Down
8 changes: 6 additions & 2 deletions compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,13 @@ pub(crate) struct RustcTrivialFieldReadsParser;

impl NoArgsAttributeParser for RustcTrivialFieldReadsParser {
const PATH: &[Symbol] = &[sym::rustc_trivial_field_reads];
const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowList(&[Allow(Target::Trait)]);
const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowList(&[
Allow(Target::Method(MethodKind::TraitImpl)),
Allow(Target::Method(MethodKind::Inherent)),
Allow(Target::Fn),
]);
const STABILITY: AttributeStability = unstable!(rustc_attrs);
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcTrivialFieldReads;
const CREATE: fn(Span) -> AttributeKind = AttributeKind::RustcTrivialFieldReads;
}

pub(crate) struct RustcNoMirInlineParser;
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_attr_parsing/src/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ impl GeneratedAttrState {
GeneratedAttr::RustcTestMarker(test_marker) => {
AttributeKind::RustcTestMarker(test_marker)
}
GeneratedAttr::RustcTrivialFieldReads => AttributeKind::RustcTrivialFieldReads(span),
};
self.state.push(attr);
}
Expand Down
Loading
Loading