Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
9abec7c
Move some tests around for alias-liveness
jackh726 Jun 7, 2026
4e17689
Consider captured regions for opaque type region liveness.
jackh726 Apr 30, 2026
9ab5a94
Also extend liveness rules for non-opaque aliases
jackh726 Jun 11, 2026
cb8b147
Move opaque outlives computation out of live_args_for_alias_from_outl…
jackh726 Jun 13, 2026
84f2896
rustdoc: do not include extra stuff in span
notriddle Jun 7, 2026
2001b88
Fix `unbalanced_ticks` when doc isn't contiguous
notriddle Jun 8, 2026
e66a504
Add test case for split missing punctuation
notriddle Jun 8, 2026
f7302b9
Skip the unhelpful binary search
notriddle Jun 13, 2026
b66a23f
Rename `span` and `line_bytes` to more specific
notriddle Jun 18, 2026
f93f2e4
Use an intermediate variable for readability
notriddle Jun 18, 2026
7975dc7
Add clarifying comment
notriddle Jun 18, 2026
4d83004
Remove unused `Option` return
notriddle Jun 18, 2026
9438aac
Handle span failure in redundant_explicit_links
notriddle Jun 18, 2026
74c203d
Add clarifying comment for shrink_to_hi
notriddle Jun 18, 2026
162a90c
Handle block doc comments better
notriddle Jun 18, 2026
b8c8868
Address review
jackh726 Jun 26, 2026
9e4b398
Enable `static_position_executables` on all gnu and musl targets
Amanieu Jun 28, 2026
4d1093d
Do not inherit `ConstArgHasType` predicates when it is applied to con…
aerooneqq Jul 3, 2026
1912e4f
Rename variable and add comment
jackh726 Jul 3, 2026
b66097b
Move DuplicateEiiImpls to rustc_middle
qaijuang May 11, 2026
0c82287
Reject linked dylib EII default overrides
qaijuang May 11, 2026
53897bb
address a few nits
qaijuang May 28, 2026
f6ce3ba
preserve EII rlib-only aux builds
qaijuang May 28, 2026
ae82b10
Improve error message on `-Zls`, to direct the user to input .rmeta f…
blyxyas Jul 6, 2026
a6b888c
Update Unstable Book with some information about `-Zls`
blyxyas Jul 6, 2026
6741efa
borrowck: Keep returned `path` from `best_blame_constraint()` consistent
Enselic Jun 27, 2026
2d18054
tests: fix enum-match.rs to handle LLVM 23
durin42 Jul 6, 2026
6050294
Split unsafe fn ptr accesses into their own test
teor2345 Jul 1, 2026
0b6190f
Check arg errors then write splatted call info
teor2345 Jul 1, 2026
23eeafc
Avoid an unwrap using a u16 splat index
teor2345 Jul 1, 2026
1e3fca8
Remove a splat check arg only used for debugging
teor2345 Jul 1, 2026
baccb0c
Improve ICE diag for splatted FnPtrs
teor2345 Jul 1, 2026
6a68767
Ban splat on closures and rust-call
teor2345 Jul 1, 2026
042e779
Add diagram to comment
notriddle Jul 7, 2026
8f1fd2c
Fix wrong diagram in comment
notriddle Jul 7, 2026
fd07857
Use better name for lint struct
notriddle Jul 7, 2026
9116f7d
Fix `unaligned_volatile_store` by removing `MemFlags::UNALIGNED`
scottmcm Jul 7, 2026
bbba496
Propagate errors from list_file_metadata into list_metadata
blyxyas Jul 7, 2026
ab783ad
accept extern calls to compiler-builtin functions
folkertdev Jun 23, 2026
47acba7
remove `-Zmiri-force-intrinsic-fallback` test run
folkertdev Jul 4, 2026
63bec90
intrinsics: Add a fallback for non-const libm float functions
tgross35 Jan 10, 2026
d20d049
Reword splat arg index limit error for clarity
teor2345 Jul 8, 2026
67986af
allow mGCA const arguments to fall back to anon consts
khyperia Jul 8, 2026
1818498
unify `MaxUniverse`s
adwinwhite Jul 6, 2026
fc267a6
Improve generic parameters handling for #[diagnostic::on_const]
rperier Jun 21, 2026
abc324c
Move `std::io::default_write_vectored` to `core::io`
bushrat011899 May 21, 2026
55585ea
Move `std::io::cursor`internals to `core::io`
bushrat011899 May 22, 2026
66f79f1
Move `WriteThroughCursor` internals to `alloc::io`
bushrat011899 Jul 3, 2026
ec0534f
Move `std::io::Write` to `core::io`
bushrat011899 Jul 3, 2026
4ecb0cd
Fix documentation links to `Write`
bushrat011899 May 22, 2026
53727e6
Add documentation to `core::io` internal methods
bushrat011899 Jul 7, 2026
0e61812
Reduce visibility of `core::io::write::default_write_fmt`
bushrat011899 Jul 7, 2026
cb09bff
Add `Vec::try_extend_from_slice_of_bytes`
bushrat011899 Jul 7, 2026
3378897
address suggestions
qaijuang Jul 8, 2026
41bdaed
address follow up nits
qaijuang Jul 8, 2026
b8d3a4a
Reapply "LLVM 23: Run AssignGUIDPass in some places"
durin42 Jul 8, 2026
90496ea
fix: Actually take error and panic by default, only emitting a custom
blyxyas Jul 8, 2026
a5ee71c
use f32 intrinsic directly in fallback for f16 intrinsic
folkertdev Jul 8, 2026
58c2c07
on msvc, make f32 fallback to f64
folkertdev Jul 8, 2026
ed9bfaf
A couple minor things: rename args_known_to_outlive_associated_type_p…
jackh726 Jul 9, 2026
47e62ee
Add a unit test for `TokenStreamIter`.
nnethercote Jul 8, 2026
fa43a69
Improve `TokenStreamIter`.
nnethercote Jul 8, 2026
5af3b45
Use REST API in linkchecker script
ehuss Jul 9, 2026
7269b96
[compiler] Implement `PartialOrd` via `Ord` for `Span` and newtype_in…
scottmcm Jul 9, 2026
5e4558e
view-types: add a bunch of tests
scrabsha May 3, 2026
9ee193e
view-types: lower view types to HIR
scrabsha May 3, 2026
09b43e4
view-types: error when viewing the same field twice
scrabsha May 4, 2026
55ab4c7
view-types: error when used on non-struct types
scrabsha May 10, 2026
1390f89
view-types: resolve viewed fields
scrabsha May 4, 2026
77d7cf2
Implement feature `char_to_u32`
okaneco Apr 28, 2026
e732dd1
configure out 32-bit transcendental functions on x86 msvc
folkertdev Jul 9, 2026
da925ef
Add documentation for the `no_std` attribute
jschillem Jul 9, 2026
8ecf21c
Propagate error downwards and emit it, even if not related to file
blyxyas Jul 9, 2026
ab8da78
Do not write errors to `out`, return Err(..) directly
blyxyas Jul 9, 2026
055af58
Remove compile-fail
jackh726 Jul 9, 2026
ebe343b
Clean up redundant explicit intra-doc link
notriddle Jul 9, 2026
c3257a5
Infer all anonymous lifetimes in (assoc) consts as `'static`
oli-obk May 12, 2026
23cf412
Allow BackwardIncompatibleDropHint in polonius legacy
KiChjang Jul 8, 2026
a28700d
Rollup merge of #150946 - tgross35:float-intrinsic-fallback, r=RalfJu…
JonathanBrouwer Jul 9, 2026
4294b1b
Rollup merge of #158510 - Amanieu:static-pie-gnu, r=saethlin
JonathanBrouwer Jul 9, 2026
9de7081
Rollup merge of #158541 - bushrat011899:core_io_write, r=clarfonthey
JonathanBrouwer Jul 9, 2026
18b5730
Rollup merge of #158899 - scottmcm:better-volatile-store, r=saethlin
JonathanBrouwer Jul 9, 2026
72dcfc8
Rollup merge of #156027 - jackh726:opaque-liveness, r=lqd
JonathanBrouwer Jul 9, 2026
7bfdf31
Rollup merge of #156370 - qaijuang:eii-dylib-default-override, r=bjorn3
JonathanBrouwer Jul 9, 2026
ca03087
Rollup merge of #156508 - oli-obk:boom, r=petrochenkov
JonathanBrouwer Jul 9, 2026
e227df9
Rollup merge of #157561 - notriddle:do-not-destroy-function-name, r=l…
JonathanBrouwer Jul 9, 2026
ba885d9
Rollup merge of #158617 - khyperia:gca-syntax-flip, r=BoxyUwU
JonathanBrouwer Jul 9, 2026
c9333db
Rollup merge of #158645 - teor2345:splat-fn-fixes, r=folkertdev
JonathanBrouwer Jul 9, 2026
02fe59f
Rollup merge of #158859 - blyxyas:fix-ls-unstable-opt, r=bjorn3
JonathanBrouwer Jul 9, 2026
8fdd267
Rollup merge of #158988 - nnethercote:redo-TokenStreamIter, r=chenyukang
JonathanBrouwer Jul 9, 2026
7074901
Rollup merge of #158347 - rperier:diagnostic_on_const_format_argument…
JonathanBrouwer Jul 9, 2026
cfa2774
Rollup merge of #158384 - KiChjang:allow-backward-incompat-drop-hint,…
JonathanBrouwer Jul 9, 2026
5d8b525
Rollup merge of #158722 - aerooneqq:delegation-const-predicates-ice, …
JonathanBrouwer Jul 9, 2026
602df68
Rollup merge of #158739 - scrabsha:view-types/resolve-fields, r=oli-obk
JonathanBrouwer Jul 9, 2026
37d67e7
Rollup merge of #158877 - Enselic:adjust-best_blame_constraint, r=fee…
JonathanBrouwer Jul 9, 2026
d72e79d
Rollup merge of #158883 - durin42:llvm-23-instsimplify, r=nikic
JonathanBrouwer Jul 9, 2026
866fcb7
Rollup merge of #158886 - jschillem:docs-no-std-attribute, r=Guillaum…
JonathanBrouwer Jul 9, 2026
3a9949a
Rollup merge of #158940 - okaneco:char_to_u32, r=hanna-kruppe
JonathanBrouwer Jul 9, 2026
4066c20
Rollup merge of #158951 - adwinwhite:unify-max-universe, r=ShoyuVanilla
JonathanBrouwer Jul 9, 2026
fc3477d
Rollup merge of #158961 - durin42:llvm-23-guid-pass-again, r=nikic
JonathanBrouwer Jul 9, 2026
1abf55f
Rollup merge of #158995 - ehuss:linkchecker-use-git, r=jieyouxu
JonathanBrouwer Jul 9, 2026
c057362
Rollup merge of #158996 - scottmcm:better-partial-cmp, r=folkertdev
JonathanBrouwer Jul 9, 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
19 changes: 9 additions & 10 deletions compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1378,15 +1378,6 @@ pub enum UnsafeSource {
UserProvided,
}

/// Track whether under `feature(min_generic_const_args)` this anon const
/// was explicitly disambiguated as an anon const or not through the use of
/// `const { ... }` syntax.
#[derive(Clone, PartialEq, Encodable, Decodable, Debug, Copy, Walkable)]
pub enum MgcaDisambiguation {
AnonConst,
Direct,
}

/// A constant (expression) that's not an item or associated item,
/// but needs its own `DefId` for type-checking, const-eval, etc.
/// These are usually found nested inside types (e.g., array lengths)
Expand All @@ -1396,7 +1387,6 @@ pub enum MgcaDisambiguation {
pub struct AnonConst {
pub id: NodeId,
pub value: Box<Expr>,
pub mgca_disambiguation: MgcaDisambiguation,
}

/// An expression.
Expand Down Expand Up @@ -1627,6 +1617,7 @@ impl Expr {
| ExprKind::UnsafeBinderCast(..)
| ExprKind::While(..)
| ExprKind::Yield(YieldKind::Postfix(..))
| ExprKind::DirectConstArg(..)
| ExprKind::Err(_)
| ExprKind::Dummy => prefix_attrs_precedence(&self.attrs),
}
Expand Down Expand Up @@ -1920,6 +1911,9 @@ pub enum ExprKind {

UnsafeBinderCast(UnsafeBinderCastKind, Box<Expr>, Option<Box<Ty>>),

/// An mGCA `direct_const_arg!()` expression.
DirectConstArg(Box<Expr>),

/// Placeholder for an expression that wasn't syntactically well formed in some way.
Err(ErrorGuaranteed),

Expand Down Expand Up @@ -2566,6 +2560,8 @@ pub enum TyKind {
FieldOf(Box<Ty>, Option<Ident>, Ident),
/// A view of a type. `T.{ field_1, field_2 }`.
View(Box<Ty>, #[visitable(ignore)] ThinVec<Ident>),
/// An mGCA `direct_const_arg!()` expression.
DirectConstArg(Box<Expr>),
/// Sometimes we need a dummy value when no error has occurred.
Dummy,
/// Placeholder for a kind that has failed to be defined.
Expand Down Expand Up @@ -3066,6 +3062,9 @@ impl FnDecl {
/// Must have the same value as `FnSigKind::NO_SPLATTED_ARG_INDEX` and `FnDeclFlags::NO_SPLATTED_ARG_INDEX`.
pub const NO_SPLATTED_ARG_INDEX: u8 = u8::MAX;

/// The maximum valid splatted argument index.
pub const MAX_VALID_SPLATTED_ARG_INDEX: u8 = Self::NO_SPLATTED_ARG_INDEX - 1;

/// Returns a splatted argument index, if any are present.
pub fn splatted(&self) -> Option<u8> {
self.inputs.iter().enumerate().find_map(|(index, arg)| {
Expand Down
21 changes: 11 additions & 10 deletions compiler/rustc_ast/src/tokenstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ use crate::ast_traits::{HasAttrs, HasTokens};
use crate::token::{self, Delimiter, Token, TokenKind};
use crate::{AttrVec, Attribute};

#[cfg(test)]
mod tests;

/// Part of a `TokenStream`.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Encodable, Decodable, StableHash)]
pub enum TokenTree {
Expand Down Expand Up @@ -833,32 +836,30 @@ impl StableHash for TokenStream {
}

#[derive(Clone)]
pub struct TokenStreamIter<'t> {
stream: &'t TokenStream,
index: usize,
}
pub struct TokenStreamIter<'t>(std::slice::Iter<'t, TokenTree>);

impl<'t> TokenStreamIter<'t> {
fn new(stream: &'t TokenStream) -> Self {
TokenStreamIter { stream, index: 0 }
TokenStreamIter(stream.0.as_slice().iter())
}

// Peeking could be done via `Peekable`, but most iterators need peeking,
// and this is simple and avoids the need to use `peekable` and `Peekable`
// at all the use sites.
pub fn peek(&self) -> Option<&'t TokenTree> {
self.stream.0.get(self.index)
self.0.as_slice().first()
}
}

impl<'t> Iterator for TokenStreamIter<'t> {
type Item = &'t TokenTree;

fn next(&mut self) -> Option<&'t TokenTree> {
self.stream.0.get(self.index).map(|tree| {
self.index += 1;
tree
})
self.0.next()
}

fn size_hint(&self) -> (usize, Option<usize>) {
self.0.size_hint()
}
}

Expand Down
13 changes: 13 additions & 0 deletions compiler/rustc_ast/src/tokenstream/tests.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use rustc_span::DUMMY_SP;

use crate::token::TokenKind;
use crate::tokenstream::TokenStream;

#[test]
fn test_token_stream_iter() {
let ts = TokenStream::token_alone(TokenKind::Eq, DUMMY_SP);
assert_eq!(ts.len(), 1);

let iter = ts.iter();
assert_eq!(iter.size_hint(), (1, Some(1)));
}
7 changes: 5 additions & 2 deletions compiler/rustc_ast/src/util/classify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ pub fn leading_labeled_expr(mut expr: &ast::Expr) -> bool {
| Yeet(..)
| Yield(..)
| UnsafeBinderCast(..)
| DirectConstArg(..)
| Err(..)
| Dummy => return false,
}
Expand Down Expand Up @@ -240,6 +241,7 @@ pub fn expr_trailing_brace(mut expr: &ast::Expr) -> Option<TrailingBrace<'_>> {
| Try(_)
| Yeet(None)
| UnsafeBinderCast(..)
| DirectConstArg(..)
| Err(_)
| Dummy => {
break None;
Expand Down Expand Up @@ -301,9 +303,10 @@ fn type_trailing_braced_mac_call(mut ty: &ast::Ty) -> Option<&ast::MacCall> {
| ast::TyKind::CVarArgs
| ast::TyKind::Pat(..)
| ast::TyKind::FieldOf(..)
| ast::TyKind::View(..)
| ast::TyKind::DirectConstArg(..)
| ast::TyKind::Dummy
| ast::TyKind::Err(..)
| ast::TyKind::View(..) => break None,
| ast::TyKind::Err(..) => break None,
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_ast/src/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,6 @@ macro_rules! common_visitor_and_walkers {
UnsafeBinderCastKind,
BinOpKind,
BlockCheckMode,
MgcaDisambiguation,
BorrowKind,
BoundAsyncness,
BoundConstness,
Expand Down Expand Up @@ -1074,6 +1073,8 @@ macro_rules! common_visitor_and_walkers {
visit_visitable!($($mut)? vis, bytes),
ExprKind::UnsafeBinderCast(kind, expr, ty) =>
visit_visitable!($($mut)? vis, kind, expr, ty),
ExprKind::DirectConstArg(expr) =>
visit_visitable!($($mut)? vis, expr),
ExprKind::Err(_guar) => {}
ExprKind::Dummy => {}
}
Expand Down
18 changes: 13 additions & 5 deletions compiler/rustc_ast_lowering/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,18 @@ impl<'hir> LoweringContext<'_, 'hir> {
}

ExprKind::MacCall(_) => panic!("{:?} shouldn't exist here", e.span),

ExprKind::DirectConstArg(_) => {
let e = self
.tcx
.dcx()
.struct_span_err(
e.span,
"expected expression, found `direct_const_arg!()` constant",
)
.emit();
hir::ExprKind::Err(e)
}
};

hir::Expr { hir_id: expr_hir_id, kind, span }
Expand Down Expand Up @@ -599,11 +611,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
arg
};

let anon_const = AnonConst {
id: node_id,
value: const_value,
mgca_disambiguation: MgcaDisambiguation::AnonConst,
};
let anon_const = AnonConst { id: node_id, value: const_value };
generic_args.push(AngleBracketedArg::Arg(GenericArg::Const(anon_const)));
} else {
real_args.push(arg);
Expand Down
Loading
Loading