Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
2849153
Implement RangeIntersect on core::range types
GrimlockOnline Nov 7, 2026
eaa4d94
Make unsafe unknown diagnostic attributes an error again
mejrs Nov 10, 2026
3b965e3
Deallocate with the right provenance on Windows
saethlin Nov 11, 2026
9af8f54
Enable tidy alphabetical --bless on Windows
mejrs Nov 12, 2026
2ff1a02
Fix docs of alloc fn: Allocator API stabilized
BioTomateDE Nov 12, 2026
06154f0
feat: added more AdtDef queries
adpthegreat Nov 15, 2026
b0fdb91
fix: fixed wrong return type
adpthegreat Nov 15, 2026
6a4efb5
fix : fixed comments
adpthegreat Nov 15, 2026
30a6ef9
Don't load/store a LLVM aggregate type when returning an array from a…
beetrees Nov 13, 2026
371f04d
Suggest using `Global.allocate` instead
workingjubilee Nov 17, 2026
6c11872
Support `NonNull` pointers as asm! input operands
hsanzg Oct 26, 2026
02725d0
Don't require `extern "llvm-intrinsic"` return structs to be `#[repr(…
beetrees Oct 24, 2026
158d77e
OpenOptions::append: clarify docs
RalfJung Nov 19, 2026
e4611fa
remove `Box` from `Annotatable::Stmt`
cyrgani Oct 30, 2026
0471f67
remove useless wrap
cyrgani Oct 10, 2026
78f12f8
remove `AllocFnFactory`
cyrgani Oct 12, 2026
75f70ce
small debug tweaks
cyrgani Nov 11, 2026
66b2a86
avoid let statements in debug output
cyrgani Nov 11, 2026
05725ef
use `generic_param_to_arg` more
cyrgani Nov 11, 2026
ebeac38
store the corresponding `FieldDef` in the `FieldInfo`
cyrgani Oct 30, 2026
3a2322d
reorder and regroup special case checks
cyrgani Nov 11, 2026
7ed6bd3
add `MethodBody` to transition away from `Substructure`
cyrgani Nov 12, 2026
94ffc73
remove all usages of `StaticStruct` and `StaticEnum`
cyrgani Nov 12, 2026
eed5c03
remove all resulting dead code and outdated documentation
cyrgani Nov 12, 2026
dabbdeb
move `fieldless_variants_strategy` into `MethodBody::SubstructureFunc`
cyrgani Nov 12, 2026
835b140
inline `call_substructure_method`
cyrgani Nov 12, 2026
d48a5b7
move `has_other_selflike_arg` into `MethodBody::SubstructureFunc`
cyrgani Nov 12, 2026
8bd8604
merge `explicit_self` and `nonselflike_args`
cyrgani Nov 12, 2026
4518388
Stop using #![no_core] in profiler_builtins
bjorn3 Nov 19, 2026
ef3b581
Stabilize unchecked `nonzero_ops`
hsanzg Oct 17, 2026
bf85368
feat: write tests for new and existing adtdef queries
adpthegreat Nov 20, 2026
2f5945c
chore: ran ./x fmt
adpthegreat Nov 20, 2026
45426d2
chore: remove whitespace, fix typo
adpthegreat Nov 20, 2026
6ade1d0
Show slice split results for empty and singleton slices
arifd Nov 20, 2026
4f2ad6c
Add red-green mark when dumping dep graph. Show DefIds if available
blyxyas Nov 13, 2026
16c78c6
std: also mark doctests with skip_unsupported_miri_tests
RalfJung Nov 20, 2026
f9becad
use `cfg!(overflow_checks)` in `overflow_checks` intrinsic instead of…
BioTomateDE Nov 21, 2026
42804ba
fmt: Improve `Debug` for `FormattingOptions`
tgross35 Nov 20, 2026
fc41ee7
Rollup merge of #164878 - beetrees:llvm-intrinsic-dont-require-repr-p…
JonathanBrouwer Nov 22, 2026
f5f9151
Rollup merge of #165008 - hsanzg:rich-asm-ptr-inputs, r=Amanieu
JonathanBrouwer Nov 22, 2026
abfb1d4
Rollup merge of #165892 - cyrgani:builtin-macros-10, r=nnethercote
JonathanBrouwer Nov 22, 2026
6db246a
Rollup merge of #165930 - blyxyas:better-dump-dep-graph, r=jackh726
JonathanBrouwer Nov 22, 2026
e903670
Rollup merge of #166280 - RalfJung:miri-std-doctests, r=maxdexh
JonathanBrouwer Nov 22, 2026
a13544e
Rollup merge of #166295 - BioTomateDE:intrinsics-stuff, r=thomcc
JonathanBrouwer Nov 22, 2026
a3c276d
Rollup merge of #164485 - hsanzg:stable-nonzero, r=clarfonthey
JonathanBrouwer Nov 22, 2026
ff6a0a2
Rollup merge of #165618 - Kolgrim33:range-intersect-165428, r=Mark-Si…
JonathanBrouwer Nov 22, 2026
7998bd4
Rollup merge of #165782 - mejrs:unsafe_attrs, r=JonathanBrouwer
JonathanBrouwer Nov 22, 2026
1094076
Rollup merge of #165833 - saethlin:windows-allocator-provenance, r=Ma…
JonathanBrouwer Nov 22, 2026
f0985f8
Rollup merge of #165834 - mejrs:tempfile, r=Mark-Simulacrum
JonathanBrouwer Nov 22, 2026
a9541b3
Rollup merge of #165889 - BioTomateDE:outdated-docs, r=Mark-Simulacrum
JonathanBrouwer Nov 22, 2026
a33ef1d
Rollup merge of #165923 - beetrees:generic-simd-array-return, r=worki…
JonathanBrouwer Nov 22, 2026
4e740c9
Rollup merge of #166012 - adpthegreat:add_more_adtdef_queries, r=maka…
JonathanBrouwer Nov 22, 2026
21cade8
Rollup merge of #166186 - RalfJung:file-append, r=JohnTitor
JonathanBrouwer Nov 22, 2026
57323ce
Rollup merge of #166216 - bjorn3:profiler_builtins_core_dep, r=Mark-S…
JonathanBrouwer Nov 22, 2026
32a65b4
Rollup merge of #166259 - tgross35:formatoptions-debug, r=hanna-kruppe
JonathanBrouwer Nov 22, 2026
7365320
Rollup merge of #166263 - arifd:slice-split-single-element-docs, r=Ma…
JonathanBrouwer Nov 22, 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
28 changes: 13 additions & 15 deletions compiler/rustc_attr_parsing/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,20 @@ impl<'sess> AttributeParser<'sess> {
let inner_span = lower_span(n.item.span);

let accepter = ATTRIBUTE_PARSERS.accepters.get(parts.as_slice());

self.check_attribute_safety(
&attr_path,
inner_span,
n.item.unsafety,
if let Some(accept) = accepter {
accept.safety
} else {
AttributeSafety::Normal
},
&mut emit_lint,
);

if let Some(accept) = accepter {
self.check_attribute_safety(
&attr_path,
inner_span,
n.item.unsafety,
accept.safety,
&mut emit_lint,
);
self.check_attribute_stability(&attr_path, attr_span, accept.stability);
if let [part] = parts.as_slice() {
debug_assert!(BUILTIN_ATTRIBUTE_SET.contains(part));
Expand Down Expand Up @@ -491,14 +497,6 @@ impl<'sess> AttributeParser<'sess> {
span: attr_span,
};

self.check_attribute_safety(
&attr_path,
inner_span,
n.item.unsafety,
AttributeSafety::Normal,
&mut emit_lint,
);

if !matches!(self.should_emit, ShouldEmit::Nothing)
&& Target::from_ast_target(&ast_target) == Target::Crate
{
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_builtin_macros/src/alloc_error_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ pub(crate) fn expand(
return vec![orig_item];
};

// Generate a bunch of new items using the AllocFnFactory
let span = ecx.with_def_site_ctxt(item.span);

// Generate item statements for the allocator methods.
Expand All @@ -42,7 +41,7 @@ pub(crate) fn expand(
// Generate anonymous constant serving as container for the allocator methods.
let const_item = ecx.item_const_underscore(span, ecx.block(span, stmts));
let const_item = if is_stmt {
Annotatable::Stmt(Box::new(ecx.stmt_item(span, const_item)))
Annotatable::Stmt(ecx.stmt_item(span, const_item))
} else {
Annotatable::Item(const_item)
};
Expand Down
17 changes: 5 additions & 12 deletions compiler/rustc_builtin_macros/src/autodiff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ mod llvm_enzyme {
use rustc_ast::tokenstream::*;
use rustc_ast::visit::AssocCtxt::*;
use rustc_ast::{
self as ast, FnRetTy, FnSig, GenericArg, GenericParamKind, Generics, ItemKind,
MetaItemInner, PatKind, TyKind, Visibility,
self as ast, FnRetTy, FnSig, GenericParamKind, Generics, ItemKind, MetaItemInner, PatKind,
TyKind, Visibility,
};
use rustc_attr_ir::RustcAutodiff;
use rustc_expand::base::{Annotatable, ExtCtxt};
Expand All @@ -24,6 +24,7 @@ mod llvm_enzyme {
use tracing::{debug, trace};

use crate::diagnostics;
use crate::util::generic_param_to_arg;

pub(crate) fn outer_normal_attr(
kind: &Box<rustc_ast::NormalAttr>,
Expand Down Expand Up @@ -449,7 +450,7 @@ mod llvm_enzyme {
Annotatable::Stmt(_) => {
let mut d_fn = ecx.item(span, d_attrs, ItemKind::Fn(d_fn));
d_fn.vis = vis;
Annotatable::Stmt(Box::new(ecx.stmt_item(span, d_fn)))
Annotatable::Stmt(ecx.stmt_item(span, d_fn))
}
_ => {
unreachable!("item kind checked previously")
Expand Down Expand Up @@ -577,16 +578,8 @@ mod llvm_enzyme {
.params
.iter()
.filter_map(|p| match &p.kind {
GenericParamKind::Type { .. } => {
let path = ast::Path::from_ident(p.ident);
let ty = ecx.ty_path(path);
Some(GenericArg::Type(ty))
}
GenericParamKind::Const { .. } => {
let anon_const = ecx.const_ident(span, p.ident);
Some(GenericArg::Const(anon_const))
}
GenericParamKind::Lifetime => None,
_ => Some(generic_param_to_arg(ecx, p, span)),
})
.collect::<Vec<_>>();

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/cfg_eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ impl CfgEval<'_> {
Annotatable::Stmt(_) => {
let stmt =
parser.parse_stmt_without_recovery(false, ForceCollect::Yes, false)?;
self.flat_map_stmt(stmt).pop().map(|stmt| Annotatable::Stmt(Box::new(stmt)))
self.flat_map_stmt(stmt).pop().map(Annotatable::Stmt)
}
Annotatable::Expr(_) => {
let mut expr = parser.parse_expr_force_collect()?;
Expand Down
6 changes: 1 addition & 5 deletions compiler/rustc_builtin_macros/src/cfg_select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ fn tts_to_mac_result<'cx, 'sess>(
tts: TokenStream,
span: Span,
) -> Box<dyn MacResult + 'cx> {
match ExpandResult::from_tts(ecx, tts, site_span, span, Ident::with_dummy_span(sym::cfg_select))
{
ExpandResult::Ready(x) => x,
_ => unreachable!("from_tts always returns Ready"),
}
ExpandResult::from_tts(ecx, tts, site_span, span, Ident::with_dummy_span(sym::cfg_select))
}

macro_rules! forward_to_parser_any_macro {
Expand Down
35 changes: 19 additions & 16 deletions compiler/rustc_builtin_macros/src/deriving/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub(crate) fn expand_derive_clone(
// enough. Whether Clone is implemented for fields is irrelevant so we
// don't assert it.)
let bounds;
let body: MethodBodyFunc<'_>;
let body;
let is_simple;
match &item.kind {
ItemKind::Struct(_, Generics { params, .. }, _)
Expand All @@ -42,16 +42,22 @@ pub(crate) fn expand_derive_clone(
.any(|param| matches!(param.kind, ast::GenericParamKind::Type { .. }))
{
is_simple = true;
body = Box::new(|c, s, sub| clone_simple_body(c, s, sub, false));
body = MethodBody::Directly(clone_simple_body(cx, span, item, false));
} else {
is_simple = false;
body = Box::new(|c, s, sub| clone_body(c, s, sub, item.kind.ident().unwrap()));
body = MethodBody::SubstructureFunc {
body_func: Box::new(|c, s, sub| {
clone_body(c, s, sub, item.kind.ident().unwrap())
}),
strategy: FieldlessVariantsStrategy::Default,
has_other_selflike_arg: false,
};
}
}
ItemKind::Union(..) => {
bounds = smallvec![path_std!(cx, span, marker::Copy)];
is_simple = true;
body = Box::new(|c, s, sub| clone_simple_body(c, s, sub, true));
body = MethodBody::Directly(clone_simple_body(cx, span, item, true));
}
_ => cx.dcx().span_bug(span, "`derive(Clone)` on wrong item kind"),
}
Expand Down Expand Up @@ -86,28 +92,25 @@ pub(crate) fn expand_derive_clone(
methods: smallvec![MethodDef {
name: sym::clone,
generics: cx.empty_generics(span),
explicit_self: true,
nonself_args: SmallVec::new(),
has_other_selflike_arg: false,
args: thin_vec![cx.param_self_ref(span)],
ret_ty: cx.ty_self(span),
attributes: thin_vec![
cx.generated_attr(span, ast::GeneratedAttr::Inline),
cx.generated_attr(span, ast::GeneratedAttr::RustcTrivialFieldReads)
],
fieldless_variants_strategy: FieldlessVariantsStrategy::Default,
body,
}],
is_const,
..
};

trait_def.expand_ext(cx, item, push, is_simple)
trait_def.expand(cx, item, push);
}

fn clone_simple_body(
cx: &ExtCtxt<'_>,
trait_span: Span,
substr: Substructure<'_>,
item: &ast::Item,
is_union: bool,
) -> BlockOrExpr {
let mut stmts = ThinVec::new();
Expand Down Expand Up @@ -148,16 +151,16 @@ fn clone_simple_body(
&[sym::clone, sym::AssertParamIsCopy],
);
} else {
match substr {
StaticStruct(vdata, ..) => {
match &item.kind {
ast::ItemKind::Struct(.., vdata) => {
process_variant(vdata);
}
StaticEnum(enum_def, ..) => {
ast::ItemKind::Enum(.., enum_def) => {
for variant in &enum_def.variants {
process_variant(&variant.data);
}
}
_ => cx.dcx().span_bug(trait_span, "unexpected substructure in simple `derive(Clone)`"),
_ => unreachable!(),
}
}
BlockOrExpr::new_mixed(stmts, Some(cx.expr_deref(trait_span, cx.expr_self(trait_span))))
Expand All @@ -169,7 +172,7 @@ fn clone_body(
substr: Substructure<'_>,
type_ident: Ident,
) -> BlockOrExpr {
let subcall = |field: FieldInfo| {
let subcall = |field: FieldInfo<'_>| {
let args = thin_vec![field.self_expr];
cx.expr_call_global(
field.span,
Expand Down Expand Up @@ -201,7 +204,7 @@ fn clone_body(
VariantData::Struct { .. } => {
let fields = all_fields
.into_iter()
.map(|field| cx.field_imm(field.span, field.name.unwrap(), subcall(field)))
.map(|field| cx.field_imm(field.span, field.def.ident.unwrap(), subcall(field)))
.collect::<ThinVec<_>>();

cx.expr_struct(trait_span, ctor_path, fields)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use thin_vec::{ThinVec, thin_vec};
use crate::deriving::generic::*;
use crate::deriving::path_std;
use crate::diagnostics;
use crate::util::generic_param_to_arg;

pub(crate) fn expand_derive_coerce_pointee(
cx: &ExtCtxt<'_>,
Expand Down
Loading
Loading