Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
8946711
tidy-alphabetical: fix line number in error message
scrabsha Mar 22, 2026
5f2790c
using rustc in the middle of an attrpath errors
jdonszelmann Mar 7, 2026
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
3250d8d
Move 3 files (2 .rs and 1 .stderr) from ui/issues to ui/transmute
ujjwalvishwakarma2006 Mar 26, 2026
58ceac1
Add issue link at the top in file tests/ui/transmute/transmute-slice-…
ujjwalvishwakarma2006 Mar 26, 2026
e0f17b9
Add issue link, and update trait and type names for better readability
ujjwalvishwakarma2006 Mar 26, 2026
a261c8c
Add updated .stderr file
ujjwalvishwakarma2006 Mar 26, 2026
f1797f8
Moved and renamed issue-34571.rs to enum/enum_u8_variant.rs
aryannrd Mar 28, 2026
6d8c10e
Added description and orignal issue link to enum_u8_variant.rs
aryannrd Mar 28, 2026
09e48be
Moved and renamed issue-49973.rs to layout/opt-repr-i32-min.rs
aryannrd Mar 29, 2026
49ea8ce
Added link and test description for opt-repr-i32-min.rs
aryannrd Mar 29, 2026
16c3d97
Moved and renamed issue-38160 to macros/macro-const-stringify.rs
aryannrd Mar 30, 2026
c0e8750
Added issue link and description to macro-const-stringify.rs
aryannrd Mar 30, 2026
9bdf217
rustdoc: seperate methods and associated functions in sidebar
lolbinarycat Mar 31, 2026
147d110
fixing tidy issues
aryannrd 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
eb5453f
ty_utils: lower tuples to `ScalableVector` repr
davidtwco Feb 19, 2026
e3d70b6
cg_llvm: `sve_tuple_{create,get,set}` intrinsics
davidtwco Feb 19, 2026
8cccf30
cg_llvm/debuginfo: scalable vectors
davidtwco Feb 26, 2026
73fdeed
cg_llvm: `sve_cast` intrinsic
davidtwco Feb 28, 2026
3e0572e
improve diagnostics for attrs that *contain* the word rustc
jdonszelmann Mar 7, 2026
7dc9a08
Lower spans for literal const args
reddevilmidzy Mar 27, 2026
28b06a6
Rename probe_ty_var to try_resolve_ty_var
jdonszelmann Mar 30, 2026
e29f4f4
Revert `Ty` type alias in `rustc_type_ir`
Jamesbarford Apr 2, 2026
0e2c554
rename opaque_generic_const_args to generic_const_args
khyperia Mar 31, 2026
9465366
remove the o from oGCA
khyperia Apr 2, 2026
22faa52
Revert "Rollup merge of #149904 - ShoyuVanilla:ns-remove-sg-hack, r=l…
lqd Apr 2, 2026
77a9316
`FindParamInClause` non-global on overflow
lcnr Mar 9, 2026
b3b29ed
handle concrete alias norm to generic
lcnr Mar 20, 2026
69148fd
add mgca fixme
lcnr Apr 2, 2026
fdcfd11
Rollup merge of #153105 - makai410:erase-if-error, r=lcnr
JonathanBrouwer Apr 2, 2026
75c3f00
Rollup merge of #153286 - davidtwco:sve-intrinsics, r=Amanieu
JonathanBrouwer Apr 2, 2026
2acd366
Rollup merge of #153532 - jdonszelmann:attributes-containing-rustc, r…
JonathanBrouwer Apr 2, 2026
d0a10f9
Rollup merge of #153960 - Zoxc:fatal-layout-of-cycles, r=TaKO8Ki
JonathanBrouwer Apr 2, 2026
a18dd67
Rollup merge of #154527 - fmease:more-soft-gates, r=nnethercote
JonathanBrouwer Apr 2, 2026
e2e9da6
Rollup merge of #154666 - nnethercote:rm-StableHashContext-impls, r=p…
JonathanBrouwer Apr 2, 2026
93c62ca
Rollup merge of #154669 - rperier:diagnostic_on_move_for_the_arc_type…
JonathanBrouwer Apr 2, 2026
963e695
Rollup merge of #154710 - khyperia:rename-ogca, r=BoxyUwU
JonathanBrouwer Apr 2, 2026
e32af01
Rollup merge of #154712 - lqd:revert-149904, r=jieyouxu
JonathanBrouwer Apr 2, 2026
5ac237a
Rollup merge of #153614 - lcnr:find-param-in-clause-ambig, r=BoxyUwU
JonathanBrouwer Apr 2, 2026
7816d67
Rollup merge of #154213 - scrabsha:push-znnnnwtwxntz, r=WaffleLapkin
JonathanBrouwer Apr 2, 2026
5bb0013
Rollup merge of #154425 - ujjwalvishwakarma2006:migrate-transmute-tes…
JonathanBrouwer Apr 2, 2026
b253bf1
Rollup merge of #154442 - nik-contrib:derive-root, r=jhpratt
JonathanBrouwer Apr 2, 2026
4f172b5
Rollup merge of #154469 - reddevilmidzy:mgca-lower, r=BoxyUwU
JonathanBrouwer Apr 2, 2026
ce26d07
Rollup merge of #154578 - jdonszelmann:rename-probe, r=lcnr,boxyuwu
JonathanBrouwer Apr 2, 2026
dfd60bd
Rollup merge of #154615 - aryannrd:moving-issues, r=Kivooeo
JonathanBrouwer Apr 2, 2026
38d62d6
Rollup merge of #154644 - lolbinarycat:rustdoc-sidebar-assoc-items, r…
JonathanBrouwer Apr 2, 2026
2b4156b
Rollup merge of #154660 - mu001999-contrib:fix/146754, r=Kivooeo
JonathanBrouwer Apr 2, 2026
ea962a9
Rollup merge of #154671 - jakubadamw:issue-127423, r=Kivooeo
JonathanBrouwer Apr 2, 2026
a661be0
Rollup merge of #154680 - GuillaumeGomez:doccontext-cleanup, r=Urgau
JonathanBrouwer Apr 2, 2026
8e821ed
Rollup merge of #154709 - Jamesbarford:chore/revert-ty-type-alias, r=…
JonathanBrouwer 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
4 changes: 2 additions & 2 deletions compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2683,7 +2683,7 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> {
overly_complex_const(self)
}
ExprKind::Lit(literal) => {
let span = expr.span;
let span = self.lower_span(expr.span);
let literal = self.lower_lit(literal, span);

ConstArg {
Expand All @@ -2695,7 +2695,7 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> {
ExprKind::Unary(UnOp::Neg, inner_expr)
if let ExprKind::Lit(literal) = &inner_expr.kind =>
{
let span = expr.span;
let span = self.lower_span(expr.span);
let literal = self.lower_lit(literal, span);

if !matches!(literal.node, LitKind::Int(..)) {
Expand Down
Loading
Loading