Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
e23f9b3
add additional lookup path for ref/ptr/array template args
Walnut356 Sep 30, 2025
8760d55
benchmark path.components() iteration
the8472 Oct 24, 2025
ea3a4e7
skip some Path prefix-component logic on platforms that don't have pr…
the8472 Oct 24, 2025
d263ab3
replace u8 iterator with slice matching
the8472 Oct 25, 2025
b247f67
Rename downcast_[ref|mut]_unchecked -> downcast_unchecked_[ref|mut]
taj-p Oct 24, 2025
2e5d395
refactor ub_checks and contract_checks to share logic
pitaj May 4, 2025
abd9fb4
O_NOFOLLOW is not supported on VxWorks
hax0kartik Oct 26, 2025
5943d07
Add Allocator proxy impls for Box, Rc, and Arc
cramertj Nov 5, 2025
12cde30
Add note for identifier with attempted hygiene violation
chenyukang Nov 7, 2025
5ed01e9
Switch hexagon targets to rust-lld
androm3da Nov 7, 2025
b827732
Enable std locking functions on AIX
amy-kwan Nov 7, 2025
fc20a28
Modify contributor email entries in .mailmap
hkBst Oct 28, 2025
fdced17
[bootstrap] Make `--open` option work with `doc src/tools/error_index…
GuillaumeGomez Nov 7, 2025
bd23d55
`invalid_atomic_ordering`: also lint `update` & `try_update`
GrigorenkoPV Nov 6, 2025
c07f11a
don't completely reset `HeadUsages`
lcnr Nov 7, 2025
566a86b
show packed alignment in mir_transform_unaligned_packed_ref
21aslade Oct 20, 2025
eac0c5a
Remove eslint-js from npm dependencies
Kobzol Nov 7, 2025
d1052e4
Recover `[T: N]` as `[T; N]`
ShE3py Nov 8, 2025
67802e0
rustc_builtin_macros: rename bench parameter to avoid collisions with…
IntegralPilot Oct 30, 2025
474501b
Remove a remnant of `dyn*` from the parser
fmease Nov 7, 2025
c52b703
Remove unused argument `features` from `eval_config_entry`
JonathanBrouwer Nov 8, 2025
7298174
add parser check for multi-reference self
Kivooeo Sep 7, 2025
cc8b95c
add `overflow_checks` intrinsic
pitaj Aug 4, 2024
0d64a5f
Use the current lint note id when parsing `cfg!()`
JonathanBrouwer Nov 8, 2025
edd7d8a
constify result unwrap unchecked
bend-n Oct 31, 2025
d347514
Rollup merge of #128666 - pitaj:intrinsic-overflow_checks, r=BoxyUwU
Zalathar Nov 9, 2025
0a74011
Rollup merge of #146305 - Kivooeo:a-lot-of-references-in-self, r=Jona…
Zalathar Nov 9, 2025
2f575f3
Rollup merge of #147179 - Walnut356:template_lookup, r=Mark-Simulacrum
Zalathar Nov 9, 2025
068e784
Rollup merge of #147743 - 21aslade:packed-diagnostic, r=RalfJung
Zalathar Nov 9, 2025
f424eb9
Rollup merge of #148079 - taj-p:master, r=Mark-Simulacrum
Zalathar Nov 9, 2025
1ad9e95
Rollup merge of #148084 - the8472:prefixless-path-components-iter, r=…
Zalathar Nov 9, 2025
5226e15
Rollup merge of #148126 - hax0kartik:vx-fix-148125, r=Mark-Simulacrum
Zalathar Nov 9, 2025
e3ced35
Rollup merge of #148204 - hkBst:patch-5, r=nnethercote
Zalathar Nov 9, 2025
645aa92
Rollup merge of #148279 - IntegralPilot:master, r=hkBst
Zalathar Nov 9, 2025
020dd31
Rollup merge of #148333 - bend-n:const_result_unwrap_unchecked, r=mar…
Zalathar Nov 9, 2025
ebb1777
Rollup merge of #148539 - cramertj:alloc-arc, r=Amanieu
Zalathar Nov 9, 2025
b0c4434
Rollup merge of #148601 - GrigorenkoPV:invalid_atomic_ordering, r=Kiv…
Zalathar Nov 9, 2025
99af1bc
Rollup merge of #148612 - chenyukang:yukang-fix-148580-macro-hygiene-…
Zalathar Nov 9, 2025
2fe368d
Rollup merge of #148613 - androm3da:bcain/hex_lld, r=JonathanBrouwer,…
Zalathar Nov 9, 2025
9663de0
Rollup merge of #148619 - amy-kwan:amyk/AddLockingFunctions_AIX, r=wo…
Zalathar Nov 9, 2025
6ced155
Rollup merge of #148644 - GuillaumeGomez:error-index-index-open, r=Ko…
Zalathar Nov 9, 2025
ec4e6e6
Rollup merge of #148649 - lcnr:rarwwww, r=BoxyUwU
Zalathar Nov 9, 2025
2fe69a9
Rollup merge of #148673 - fmease:del-dyn_star-remnant, r=JonathanBrouwer
Zalathar Nov 9, 2025
9fe2f4c
Rollup merge of #148675 - Kobzol:eslint-js, r=yotamofek
Zalathar Nov 9, 2025
784e91d
Rollup merge of #148680 - ShE3py:array-colon, r=JonathanBrouwer
Zalathar Nov 9, 2025
74e90d8
Rollup merge of #148688 - JonathanBrouwer:remove_features, r=jdonszel…
Zalathar Nov 9, 2025
4cf1d39
Rollup merge of #148711 - JonathanBrouwer:cfg_macro_lint_node_id, r=K…
Zalathar Nov 9, 2025
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: 16 additions & 3 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Aaron Todd <[email protected]>
Abhishek Chanda <[email protected]> Abhishek Chanda <[email protected]>
Abhijeet Bhagat <[email protected]>
Abroskin Alexander <[email protected]>
Adolfo Ochagavía <[email protected]>
Adolfo Ochagavía <[email protected]> <[email protected]>
Adrian Heine né Lang <[email protected]>
Adrien Tétar <[email protected]>
Ahmed Charles <[email protected]> <[email protected]>
Expand All @@ -36,6 +36,7 @@ Amanda Stjerna <[email protected]> <[email protected]>
Amanda Stjerna <[email protected]> <[email protected]>
Amanieu d'Antras <[email protected]> <[email protected]>
Amos Onn <[email protected]>
Amos Wenger <[email protected]> <[email protected]>
Ana-Maria Mihalache <[email protected]>
Anatoly Ikorsky <[email protected]>
Andre Bogus <[email protected]>
Expand Down Expand Up @@ -276,7 +277,8 @@ Irina Popa <[email protected]>
Ivan Ivaschenko <[email protected]>
ivan tkachenko <[email protected]>
J. J. Weber <[email protected]>
Jack Huey <[email protected]> <[email protected]>
Jack Huey <[email protected]> <[email protected]>
Jack Huey <[email protected]> <[email protected]>
Jacob <[email protected]>
Jacob Hoffman-Andrews <[email protected]> <[email protected]>
Jacob Greenfield <[email protected]>
Expand All @@ -292,6 +294,8 @@ Jakub Adam Wieczorek <[email protected]>
Jakub Adam Wieczorek <[email protected]> <[email protected]>
Jakub Adam Wieczorek <[email protected]> <[email protected]>
Jakub Adam Wieczorek <[email protected]> <[email protected]>
Jakub Adam Wieczorek <[email protected]> <[email protected]>
Jakub Adam Wieczorek <[email protected]> <[email protected]>
Jakub Beránek <[email protected]> <[email protected]>
James [Undefined] <[email protected]>
James Deng <[email protected]> <[email protected]>
Expand All @@ -303,6 +307,7 @@ Jamie Hill-Daniel <[email protected]> <[email protected]>
Jana Dönszelmann <[email protected]>
Jana Dönszelmann <[email protected]> <[email protected]>
Jana Dönszelmann <[email protected]> <[email protected]>
Jane Lusby <[email protected]> <[email protected]>
Jan-Erik Rediger <[email protected]> <[email protected]>
Jaro Fietz <[email protected]>
Jason Fager <[email protected]>
Expand All @@ -313,6 +318,7 @@ Jason Toffaletti <[email protected]> Jason Toffaletti <[email protected]>
Jauhien Piatlicki <[email protected]> Jauhien Piatlicki <[email protected]>
Jay True <[email protected]>
Jeremy Letang <[email protected]>
Jeremy Soller <[email protected]> <[email protected]>
Jeremy Sorensen <[email protected]>
Jeremy Stucki <[email protected]> <[email protected]>
Jeremy Stucki <[email protected]> <[email protected]>
Expand All @@ -336,6 +342,7 @@ John Kåre Alsaker <[email protected]>
John Kåre Alsaker <[email protected]> <[email protected]>
John Talling <[email protected]>
John Van Enk <[email protected]>
Jon Gjengset <[email protected]> <[email protected]>
Jonas Tepe <[email protected]>
Jonathan Bailey <[email protected]> <[email protected]>
Jonathan Chan Kwan Yin <[email protected]>
Expand Down Expand Up @@ -424,7 +431,7 @@ Malo Jaffré <[email protected]>
Manish Goregaokar <[email protected]>
Mara Bos <[email protected]>
Marcell Pardavi <[email protected]>
Marco Ieni <[email protected]>
Marco Ieni <[email protected]> <[email protected]>
Marcus Klaas de Vries <[email protected]>
Margaret Meyerhofer <[email protected]> <mmeyerho@andrew>
Marijn Schouten <[email protected]> <[email protected]>
Expand Down Expand Up @@ -531,6 +538,7 @@ Oliver Scherer <[email protected]> <[email protected]>
Oliver Scherer <[email protected]> <[email protected]>
Oliver Scherer <[email protected]> <[email protected]>
Oliver Scherer <[email protected]>
Onur Özkan <[email protected]> <[email protected]>
Onur Özkan <[email protected]> <[email protected]>
Onur Özkan <[email protected]>
Ömer Sinan Ağacan <[email protected]>
Expand Down Expand Up @@ -591,6 +599,7 @@ Rusty Blitzerr <[email protected]>
RustyYato <[email protected]>
Ruud van Asseldonk <[email protected]> Ruud van Asseldonk <[email protected]>
Ryan Leung <[email protected]>
Ryan Levick <[email protected]> <[email protected]>
Ryan Scheel <[email protected]>
Ryan Sullivant <[email protected]>
Ryan Wiedemann <[email protected]>
Expand Down Expand Up @@ -686,6 +695,8 @@ Weihang Lo <[email protected]>
Weihang Lo <[email protected]> <[email protected]>
Wesley Wiser <[email protected]> <[email protected]>
whitequark <[email protected]>
Will Crichton <[email protected]> <[email protected]>
Will Crichton <[email protected]> <[email protected]>
William Ting <[email protected]> <[email protected]>
Wim Looman <[email protected]> <[email protected]>
Wim Looman <[email protected]> <[email protected]>
Expand All @@ -695,6 +706,8 @@ Xinye Tao <[email protected]>
Xuefeng Wu <[email protected]> Xuefeng Wu <[email protected]>
Xuefeng Wu <[email protected]> XuefengWu <[email protected]>
York Xiang <[email protected]>
Yoshua Wuyts <[email protected]> <[email protected]>
Yoshua Wuyts <[email protected]> <[email protected]>
Yotam Ofek <[email protected]> <[email protected]>
Youngsoo Son <[email protected]> <[email protected]>
Youngsuk Kim <[email protected]>
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 @@ -714,6 +714,15 @@ impl Pat {
}
}

/// Strip off all reference patterns (`&`, `&mut`) and return the inner pattern.
pub fn peel_refs(&self) -> &Pat {
let mut current = self;
while let PatKind::Ref(inner, _) = &current.kind {
current = inner;
}
current
}

/// Is this a `..` pattern?
pub fn is_rest(&self) -> bool {
matches!(self.kind, PatKind::Rest)
Expand Down
7 changes: 3 additions & 4 deletions compiler/rustc_attr_parsing/src/attributes/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,13 @@ pub fn eval_config_entry(
sess: &Session,
cfg_entry: &CfgEntry,
id: NodeId,
features: Option<&Features>,
emit_lints: ShouldEmit,
) -> EvalConfigResult {
match cfg_entry {
CfgEntry::All(subs, ..) => {
let mut all = None;
for sub in subs {
let res = eval_config_entry(sess, sub, id, features, emit_lints);
let res = eval_config_entry(sess, sub, id, emit_lints);
// We cannot short-circuit because `eval_config_entry` emits some lints
if !res.as_bool() {
all.get_or_insert(res);
Expand All @@ -217,7 +216,7 @@ pub fn eval_config_entry(
CfgEntry::Any(subs, span) => {
let mut any = None;
for sub in subs {
let res = eval_config_entry(sess, sub, id, features, emit_lints);
let res = eval_config_entry(sess, sub, id, emit_lints);
// We cannot short-circuit because `eval_config_entry` emits some lints
if res.as_bool() {
any.get_or_insert(res);
Expand All @@ -229,7 +228,7 @@ pub fn eval_config_entry(
})
}
CfgEntry::Not(sub, span) => {
if eval_config_entry(sess, sub, id, features, emit_lints).as_bool() {
if eval_config_entry(sess, sub, id, emit_lints).as_bool() {
EvalConfigResult::False { reason: cfg_entry.clone(), reason_span: *span }
} else {
EvalConfigResult::True
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_borrowck/src/type_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1046,8 +1046,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
}
}

&Rvalue::NullaryOp(NullOp::ContractChecks, _) => {}
&Rvalue::NullaryOp(NullOp::UbChecks, _) => {}
&Rvalue::NullaryOp(NullOp::RuntimeChecks(_), _) => {}

Rvalue::ShallowInitBox(_operand, ty) => {
let trait_ref =
Expand Down
5 changes: 2 additions & 3 deletions compiler/rustc_builtin_macros/src/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! current compilation environment.

use rustc_ast::tokenstream::TokenStream;
use rustc_ast::{AttrStyle, CRATE_NODE_ID, token};
use rustc_ast::{AttrStyle, token};
use rustc_attr_parsing as attr;
use rustc_attr_parsing::parser::MetaItemOrLitParser;
use rustc_attr_parsing::{
Expand All @@ -30,7 +30,6 @@ pub(crate) fn expand_cfg(
cx.sess,
&cfg,
cx.current_expansion.lint_node_id,
Some(cx.ecfg.features),
ShouldEmit::ErrorsAndLints,
)
.as_bool();
Expand All @@ -57,7 +56,7 @@ fn parse_cfg(cx: &ExtCtxt<'_>, span: Span, tts: TokenStream) -> Result<CfgEntry,
AttrPath { segments: vec![Ident::from_str("cfg")].into_boxed_slice(), span },
ParsedDescription::Macro,
span,
CRATE_NODE_ID,
cx.current_expansion.lint_node_id,
Some(cx.ecfg.features),
ShouldEmit::ErrorsAndLints,
&meta,
Expand Down
14 changes: 7 additions & 7 deletions compiler/rustc_builtin_macros/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,30 +207,30 @@ pub(crate) fn expand_test_or_bench(
};

let test_fn = if is_bench {
// A simple ident for a lambda
let b = Ident::from_str_and_span("b", attr_sp);

// avoid name collisions by using the function name within the identifier, see bug #148275
let bencher_param =
Ident::from_str_and_span(&format!("__bench_{}", fn_.ident.name), attr_sp);
cx.expr_call(
sp,
cx.expr_path(test_path("StaticBenchFn")),
thin_vec![
// #[coverage(off)]
// |b| self::test::assert_test_result(
// |__bench_fn_name| self::test::assert_test_result(
coverage_off(cx.lambda1(
sp,
cx.expr_call(
sp,
cx.expr_path(test_path("assert_test_result")),
thin_vec![
// super::$test_fn(b)
// super::$test_fn(__bench_fn_name)
cx.expr_call(
ret_ty_sp,
cx.expr_path(cx.path(sp, vec![fn_.ident])),
thin_vec![cx.expr_ident(sp, b)],
thin_vec![cx.expr_ident(sp, bencher_param)],
),
],
),
b,
bencher_param,
)), // )
],
)
Expand Down
13 changes: 2 additions & 11 deletions compiler/rustc_codegen_cranelift/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -865,17 +865,8 @@ fn codegen_stmt<'tcx>(fx: &mut FunctionCx<'_, '_, 'tcx>, cur_block: Block, stmt:
fields.iter(),
)
.bytes(),
NullOp::UbChecks => {
let val = fx.tcx.sess.ub_checks();
let val = CValue::by_val(
fx.bcx.ins().iconst(types::I8, i64::from(val)),
fx.layout_of(fx.tcx.types.bool),
);
lval.write_cvalue(fx, val);
return;
}
NullOp::ContractChecks => {
let val = fx.tcx.sess.contract_checks();
NullOp::RuntimeChecks(kind) => {
let val = kind.value(fx.tcx.sess);
let val = CValue::by_val(
fx.bcx.ins().iconst(types::I8, i64::from(val)),
fx.layout_of(fx.tcx.types.bool),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3036,7 +3036,7 @@ fn add_dynamic_crate(cmd: &mut dyn Linker, sess: &Session, cratepath: &Path) {
fn relevant_lib(sess: &Session, lib: &NativeLib) -> bool {
match lib.cfg {
Some(ref cfg) => {
eval_config_entry(sess, cfg, CRATE_NODE_ID, None, ShouldEmit::ErrorsAndLints).as_bool()
eval_config_entry(sess, cfg, CRATE_NODE_ID, ShouldEmit::ErrorsAndLints).as_bool()
}
None => true,
}
Expand Down
8 changes: 2 additions & 6 deletions compiler/rustc_codegen_ssa/src/mir/rvalue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -624,12 +624,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
.bytes();
bx.cx().const_usize(val)
}
mir::NullOp::UbChecks => {
let val = bx.tcx().sess.ub_checks();
bx.cx().const_bool(val)
}
mir::NullOp::ContractChecks => {
let val = bx.tcx().sess.contract_checks();
mir::NullOp::RuntimeChecks(kind) => {
let val = kind.value(bx.tcx().sess);
bx.cx().const_bool(val)
}
};
Expand Down
5 changes: 1 addition & 4 deletions compiler/rustc_const_eval/src/check_consts/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -645,10 +645,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {

Rvalue::Cast(_, _, _) => {}

Rvalue::NullaryOp(
NullOp::OffsetOf(_) | NullOp::UbChecks | NullOp::ContractChecks,
_,
) => {}
Rvalue::NullaryOp(NullOp::OffsetOf(_) | NullOp::RuntimeChecks(_), _) => {}
Rvalue::ShallowInitBox(_, _) => {}

Rvalue::UnaryOp(op, operand) => {
Expand Down
22 changes: 9 additions & 13 deletions compiler/rustc_const_eval/src/interpret/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,11 @@ pub trait Machine<'tcx>: Sized {
interp_ok(())
}

/// Determines the result of a `NullaryOp::UbChecks` invocation.
fn ub_checks(_ecx: &InterpCx<'tcx, Self>) -> InterpResult<'tcx, bool>;

/// Determines the result of a `NullaryOp::ContractChecks` invocation.
fn contract_checks(_ecx: &InterpCx<'tcx, Self>) -> InterpResult<'tcx, bool>;
/// Determines the result of a `NullaryOp::RuntimeChecks` invocation.
fn runtime_checks(
_ecx: &InterpCx<'tcx, Self>,
r: mir::RuntimeChecks,
) -> InterpResult<'tcx, bool>;

/// Called when the interpreter encounters a `StatementKind::ConstEvalCounter` instruction.
/// You can use this to detect long or endlessly running programs.
Expand Down Expand Up @@ -681,14 +681,10 @@ pub macro compile_time_machine(<$tcx: lifetime>) {
}

#[inline(always)]
fn ub_checks(_ecx: &InterpCx<$tcx, Self>) -> InterpResult<$tcx, bool> {
// We can't look at `tcx.sess` here as that can differ across crates, which can lead to
// unsound differences in evaluating the same constant at different instantiation sites.
interp_ok(true)
}

#[inline(always)]
fn contract_checks(_ecx: &InterpCx<$tcx, Self>) -> InterpResult<$tcx, bool> {
fn runtime_checks(
_ecx: &InterpCx<$tcx, Self>,
_r: mir::RuntimeChecks,
) -> InterpResult<$tcx, bool> {
// We can't look at `tcx.sess` here as that can differ across crates, which can lead to
// unsound differences in evaluating the same constant at different instantiation sites.
interp_ok(true)
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_const_eval/src/interpret/operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
self.tcx.offset_of_subfield(self.typing_env, layout, fields.iter()).bytes();
ImmTy::from_uint(val, usize_layout())
}
UbChecks => ImmTy::from_bool(M::ub_checks(self)?, *self.tcx),
ContractChecks => ImmTy::from_bool(M::contract_checks(self)?, *self.tcx),
RuntimeChecks(r) => ImmTy::from_bool(M::runtime_checks(self, r)?, *self.tcx),
})
}
}
Loading
Loading