Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
043bd76
Make `layout_of` cycles fatal errors
Zoxc Feb 27, 2026
4fd1d97
Skip ICE message for fatal errors
Zoxc Mar 16, 2026
db30a36
Update tests
Zoxc Mar 16, 2026
7d0577e
ty_utils: lower tuples to `ScalableVector` repr
davidtwco Feb 19, 2026
93dfff5
cg_llvm: `sve_tuple_{create,get,set}` intrinsics
davidtwco Feb 19, 2026
a05afe5
cg_llvm/debuginfo: scalable vectors
davidtwco Feb 26, 2026
72f2ace
cg_llvm: `sve_cast` intrinsic
davidtwco Feb 28, 2026
9bdf217
rustdoc: seperate methods and associated functions in sidebar
lolbinarycat Mar 31, 2026
8277043
Avoid creating async return opaques for foreign async fns
mu001999 Apr 1, 2026
910677f
Rename `HirCtx` as `Hcx`.
nnethercote Apr 1, 2026
d9a8a55
Reorder `use`/`mod` items in `rustc_session`.
nnethercote Apr 1, 2026
1a9a284
Simplify `HashStableContext`.
nnethercote Apr 1, 2026
e18dd4a
add `TypeFlags::HAS_NON_REGION_ERROR` and `TypeFlags::HAS_RE_ERROR`
makai410 Mar 16, 2026
339fb64
skip early return for region-only errors in projection types
makai410 Mar 16, 2026
fec0998
Export `derive` at `core::derive` and `std::derive`
nik-rev Mar 26, 2026
12f8364
Introduce #[diagnostic::on_move] on `Arc`
rperier Apr 1, 2026
253c03a
Add a test for a past ICE when calling a const fn with the wrong numb…
jakubadamw Mar 31, 2026
a7a7938
Replace `DocContext` argument with `TyCtxt` in rustdoc `inline::load_…
GuillaumeGomez Apr 1, 2026
65fbfa4
Replace `DocContext` argument with `TyCtxt` in rustdoc `inline::merge…
GuillaumeGomez Apr 1, 2026
9f95c38
Replace `DocContext` argument with `TyCtxt` in rustdoc `utils::displa…
GuillaumeGomez Apr 1, 2026
f3ba2c4
Replace `DocContext` argument with `TyCtxt` in rustdoc `inline::build…
GuillaumeGomez Apr 1, 2026
58077cc
Replace `DocContext` argument with `TyCtxt` in rustdoc `clean::clean_…
GuillaumeGomez Apr 1, 2026
5a48d5e
Replace `DocContext` argument with `TyCtxt` in rustdoc `clean::clean_…
GuillaumeGomez Apr 1, 2026
d77a2ea
Replace `DocContext` argument with `TyCtxt` in rustdoc `clean::clean_…
GuillaumeGomez Apr 1, 2026
3520351
Replace `DocContext` argument with `TyCtxt` in rustdoc `Type::from_de…
GuillaumeGomez Apr 1, 2026
509a444
Replace `DocContext` argument with `TyCtxt` in rustdoc `clean::clean_…
GuillaumeGomez Apr 1, 2026
822579e
Replace `DocContext` argument with `TyCtxt` in rustdoc `types::Generi…
GuillaumeGomez Apr 1, 2026
e2f3f78
Replace `DocContext` argument with `TyCtxt` in rustdoc `clean::clean_…
GuillaumeGomez Apr 1, 2026
28ca36d
Replace `DocContext` argument with `TyCtxt` in rustdoc `simplify` fun…
GuillaumeGomez Apr 1, 2026
d1f11b2
Change the test comment per PR review feedback
jakubadamw Apr 1, 2026
14aa3a9
Remove unused `DocContext` argument in `clean_middle_const`
GuillaumeGomez Apr 1, 2026
4b39934
Replace `DocContext` argument with `TyCtxt` in rustdoc `utils::print_…
GuillaumeGomez Apr 1, 2026
0b941ed
Last `DocContext`/`TyCtxt` cleanup
GuillaumeGomez Apr 1, 2026
98688ef
Simplify feature gating checks & macros
fmease Apr 1, 2026
dd96eff
Sort pre-expansion gates and add more visible disclaimers
fmease Apr 1, 2026
394012b
Emit pre-expansion feature gate warning for negative impls
fmease Mar 29, 2026
92fbfae
Emit pre-expansion feature gate warning for item modifier `default`
fmease Mar 28, 2026
3e658d3
Reword descriptions of soft feature gate tests
fmease Apr 1, 2026
145290a
Rollup merge of #153105 - makai410:erase-if-error, r=lcnr
jhpratt Apr 2, 2026
5b5711e
Rollup merge of #153286 - davidtwco:sve-intrinsics, r=Amanieu
jhpratt Apr 2, 2026
cdb7733
Rollup merge of #153960 - Zoxc:fatal-layout-of-cycles, r=TaKO8Ki
jhpratt Apr 2, 2026
7013fc4
Rollup merge of #154527 - fmease:more-soft-gates, r=nnethercote
jhpratt Apr 2, 2026
6adbd55
Rollup merge of #154666 - nnethercote:rm-StableHashContext-impls, r=p…
jhpratt Apr 2, 2026
3beee02
Rollup merge of #154669 - rperier:diagnostic_on_move_for_the_arc_type…
jhpratt Apr 2, 2026
8b2e2ac
Rollup merge of #154442 - nik-contrib:derive-root, r=jhpratt
jhpratt Apr 2, 2026
f07782a
Rollup merge of #154644 - lolbinarycat:rustdoc-sidebar-assoc-items, r…
jhpratt Apr 2, 2026
88d3703
Rollup merge of #154660 - mu001999-contrib:fix/146754, r=Kivooeo
jhpratt Apr 2, 2026
e2330b7
Rollup merge of #154671 - jakubadamw:issue-127423, r=Kivooeo
jhpratt Apr 2, 2026
534d7ff
Rollup merge of #154680 - GuillaumeGomez:doccontext-cleanup, r=Urgau
jhpratt Apr 2, 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
21 changes: 14 additions & 7 deletions compiler/rustc_abi/src/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use tracing::{debug, trace};

use crate::{
AbiAlign, Align, BackendRepr, FieldsShape, HasDataLayout, IndexSlice, IndexVec, Integer,
LayoutData, Niche, NonZeroUsize, Primitive, ReprOptions, Scalar, Size, StructKind, TagEncoding,
TargetDataLayout, Variants, WrappingRange,
LayoutData, Niche, NonZeroUsize, NumScalableVectors, Primitive, ReprOptions, Scalar, Size,
StructKind, TagEncoding, TargetDataLayout, Variants, WrappingRange,
};

mod coroutine;
Expand Down Expand Up @@ -204,13 +204,19 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
&self,
element: F,
count: u64,
number_of_vectors: NumScalableVectors,
) -> LayoutCalculatorResult<FieldIdx, VariantIdx, F>
where
FieldIdx: Idx,
VariantIdx: Idx,
F: AsRef<LayoutData<FieldIdx, VariantIdx>> + fmt::Debug,
{
vector_type_layout(SimdVectorKind::Scalable, self.cx.data_layout(), element, count)
vector_type_layout(
SimdVectorKind::Scalable(number_of_vectors),
self.cx.data_layout(),
element,
count,
)
}

pub fn simd_type<FieldIdx, VariantIdx, F>(
Expand Down Expand Up @@ -1526,7 +1532,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {

enum SimdVectorKind {
/// `#[rustc_scalable_vector]`
Scalable,
Scalable(NumScalableVectors),
/// `#[repr(simd, packed)]`
PackedFixed,
/// `#[repr(simd)]`
Expand Down Expand Up @@ -1559,9 +1565,10 @@ where
let size =
elt.size.checked_mul(count, dl).ok_or_else(|| LayoutCalculatorError::SizeOverflow)?;
let (repr, align) = match kind {
SimdVectorKind::Scalable => {
(BackendRepr::SimdScalableVector { element, count }, dl.llvmlike_vector_align(size))
}
SimdVectorKind::Scalable(number_of_vectors) => (
BackendRepr::SimdScalableVector { element, count, number_of_vectors },
dl.llvmlike_vector_align(size),
),
// Non-power-of-two vectors have padding up to the next power-of-two.
// If we're a packed repr, remove the padding while keeping the alignment as close
// to a vector as possible.
Expand Down
39 changes: 30 additions & 9 deletions compiler/rustc_abi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ pub use layout::{FIRST_VARIANT, FieldIdx, LayoutCalculator, LayoutCalculatorErro
#[cfg(feature = "nightly")]
pub use layout::{Layout, TyAbiInterface, TyAndLayout};

/// Requirements for a `StableHashingContext` to be used in this crate.
/// This is a hack to allow using the `HashStable_Generic` derive macro
/// instead of implementing everything in `rustc_middle`.
#[cfg(feature = "nightly")]
pub trait HashStableContext {}

#[derive(Clone, Copy, PartialEq, Eq, Default)]
#[cfg_attr(
feature = "nightly",
Expand Down Expand Up @@ -1702,6 +1696,28 @@ impl AddressSpace {
pub const ZERO: Self = AddressSpace(0);
}

/// How many scalable vectors are in a `BackendRepr::ScalableVector`?
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "nightly", derive(HashStable_Generic))]
pub struct NumScalableVectors(pub u8);

impl NumScalableVectors {
/// Returns a `NumScalableVector` for a non-tuple scalable vector (e.g. a single vector).
pub fn for_non_tuple() -> Self {
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.
pub fn from_field_count(count: usize) -> Option<Self> {
match count {
2..8 => Some(NumScalableVectors(count as u8)),
_ => None,
}
}
}

/// The way we represent values to the backend
///
/// Previously this was conflated with the "ABI" a type is given, as in the platform-specific ABI.
Expand All @@ -1720,6 +1736,7 @@ pub enum BackendRepr {
SimdScalableVector {
element: Scalar,
count: u64,
number_of_vectors: NumScalableVectors,
},
SimdVector {
element: Scalar,
Expand Down Expand Up @@ -1826,8 +1843,12 @@ impl BackendRepr {
BackendRepr::SimdVector { element: element.to_union(), count }
}
BackendRepr::Memory { .. } => BackendRepr::Memory { sized: true },
BackendRepr::SimdScalableVector { element, count } => {
BackendRepr::SimdScalableVector { element: element.to_union(), count }
BackendRepr::SimdScalableVector { element, count, number_of_vectors } => {
BackendRepr::SimdScalableVector {
element: element.to_union(),
count,
number_of_vectors,
}
}
}
}
Expand Down Expand Up @@ -2167,7 +2188,7 @@ impl<FieldIdx: Idx, VariantIdx: Idx> LayoutData<FieldIdx, VariantIdx> {
}

/// Returns `true` if the size of the type is only known at runtime.
pub fn is_runtime_sized(&self) -> bool {
pub fn is_scalable_vector(&self) -> bool {
matches!(self.backend_repr, BackendRepr::SimdScalableVector { .. })
}

Expand Down
5 changes: 3 additions & 2 deletions compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ use rustc_data_structures::tagged_ptr::Tag;
use rustc_macros::{Decodable, Encodable, HashStable_Generic, Walkable};
pub use rustc_span::AttrId;
use rustc_span::{
ByteSymbol, DUMMY_SP, ErrorGuaranteed, Ident, Span, Spanned, Symbol, kw, respan, sym,
ByteSymbol, DUMMY_SP, ErrorGuaranteed, HashStableContext, Ident, Span, Spanned, Symbol, kw,
respan, sym,
};
use thin_vec::{ThinVec, thin_vec};

Expand Down Expand Up @@ -120,7 +121,7 @@ impl PartialEq<&[Symbol]> for Path {
}
}

impl<Hcx: rustc_span::HashStableContext> HashStable<Hcx> for Path {
impl<Hcx: HashStableContext> HashStable<Hcx> for Path {
fn hash_stable(&self, hcx: &mut Hcx, hasher: &mut StableHasher) {
self.segments.len().hash_stable(hcx, hasher);
for segment in &self.segments {
Expand Down
5 changes: 0 additions & 5 deletions compiler/rustc_ast/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,3 @@ pub mod visit;

pub use self::ast::*;
pub use self::ast_traits::{AstNodeWrapper, HasAttrs, HasNodeId, HasTokens};

/// Requirements for a `StableHashingContext` to be used in this crate.
/// This is a hack to allow using the `HashStable_Generic` derive macro
/// instead of implementing everything in `rustc_middle`.
pub trait HashStableContext: rustc_span::HashStableContext {}
4 changes: 2 additions & 2 deletions compiler/rustc_ast/src/tokenstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_data_structures::sync;
use rustc_macros::{Decodable, Encodable, HashStable_Generic, Walkable};
use rustc_serialize::{Decodable, Encodable};
use rustc_span::{DUMMY_SP, Span, SpanDecoder, SpanEncoder, Symbol, sym};
use rustc_span::{DUMMY_SP, HashStableContext, Span, SpanDecoder, SpanEncoder, Symbol, sym};
use thin_vec::ThinVec;

use crate::ast::AttrStyle;
Expand Down Expand Up @@ -826,7 +826,7 @@ impl FromIterator<TokenTree> for TokenStream {

impl<Hcx> HashStable<Hcx> for TokenStream
where
Hcx: crate::HashStableContext,
Hcx: HashStableContext,
{
fn hash_stable(&self, hcx: &mut Hcx, hasher: &mut StableHasher) {
for sub_tt in self.iter() {
Expand Down
Loading
Loading