Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
fa63e12
Test mixed ambiguous ORs under assumptions on binders
Dnreikronos Sep 23, 2026
ead3450
Combine mixed ambiguous OR test cases
Dnreikronos Oct 17, 2026
9a721b6
Add region equality to the binder testing DSL
Dnreikronos Oct 10, 2026
40295c3
Resolve region variables before handling placeholders
Dnreikronos Oct 10, 2026
6d8cf48
Remove obsolete region variable ambiguity control
Dnreikronos Oct 12, 2026
22e2b8d
Use explicit target cpu in tests parsing generated asm
Oct 22, 2026
26c788b
Add regression tests for transmutability issues
philss Oct 22, 2026
e97ea96
Add revisions for both old and next solver
philss Oct 23, 2026
74ef3f5
move `ppcf128` to `core::num::imp`
folkertdev Oct 21, 2026
688479d
Add test for lifetime error involving field type with dyn Trait
estebank Oct 24, 2026
4c49bd9
Account for trait object with implicit `'static` lifetime in field ty…
estebank Oct 23, 2026
f4f657b
Account for lifetime mismatch introduced in sub-expression of field a…
estebank Oct 23, 2026
3574f1d
Point at introduction of unmet lifetime
estebank Oct 24, 2026
23148c1
Point at `impl` through which associated function is provided
estebank Oct 21, 2026
84b9cfd
Account for blanket impls in message when pointing at one
estebank Oct 24, 2026
178c4e1
Add regression tests for reborrow of non-Copy fields
yashaggarwal85d Oct 25, 2026
8c3a4b0
Add codegen test for power of two implying nonzero with debuginfo
zakrad Oct 25, 2026
badf74d
move check_naked() from check_attr.rs to codegen_attrs.rs
RichardTjokroutomo Sep 8, 2026
2a5584d
also consider associate item
RichardTjokroutomo Sep 11, 2026
94bf10c
wrap target_item & target_assoc_item into an enum
RichardTjokroutomo Sep 12, 2026
4d28e20
addressing review comments
RichardTjokroutomo Sep 13, 2026
f69f5a9
exhaust all possible types of AST Target (obtained from grepping all …
RichardTjokroutomo Sep 15, 2026
436ac66
addressing comments & fixing code after 0929 rebase
RichardTjokroutomo Sep 27, 2026
030e2e7
make AstTarget map 1-1 with Target
RichardTjokroutomo Oct 1, 2026
d3fd3f2
remove options
RichardTjokroutomo Oct 5, 2026
b516dbb
rebase latest changes & addressing latest comments
RichardTjokroutomo Oct 6, 2026
49577d5
some tidy ups
RichardTjokroutomo Oct 7, 2026
2c481cc
remove Item, AsocItem, & ForeignItem
RichardTjokroutomo Oct 7, 2026
f807201
pass AstTarget::Expression too
RichardTjokroutomo Oct 7, 2026
d2c019a
remove unused AstTarget types & some tidy ups
RichardTjokroutomo Oct 9, 2026
3c451a5
latest rebase & some mods involving genericparams
RichardTjokroutomo Oct 17, 2026
6c8618c
Replace `insta` with `expect-test` in bootstrap
Kobzol Oct 24, 2026
7ed5fb8
Update snapshots
Kobzol Oct 24, 2026
7ed40b3
Update documentation
Kobzol Oct 24, 2026
1a3a14c
latest rebase
RichardTjokroutomo Oct 26, 2026
c96cf93
Normalize Windows path separators in bootstrap snapshots
Kobzol Oct 26, 2026
3e63be1
Replace check_attr_crate_level with check_target
evavh Aug 22, 2026
8ec63ba
Fix string casting
evavh Aug 28, 2026
4842ce9
Add test for doc attr crate-level target checks
evavh Aug 28, 2026
f1a4228
Minimize doc-crate-level test for clarity
evavh Sep 1, 2026
30c334f
Restore crate level doc attr warning
evavh Sep 11, 2026
c6fdfff
Bless rustdoc ui test
evavh Sep 14, 2026
873c9c0
Revert rust-logo test
evavh Oct 26, 2026
1708abc
re-insertion of params in input list should not roll over
bit-aloo Oct 23, 2026
814e771
check whether the original param to not allow later self, to be consi…
bit-aloo Oct 23, 2026
84cbe3e
add test for example
bit-aloo Oct 23, 2026
ef9f215
scream if pos is lesser than zero
bit-aloo Oct 26, 2026
86bc6b1
Add test showing the problem
JonathanBrouwer Oct 26, 2026
2bec100
Only recover if we may for `recover_missing_dot`
JonathanBrouwer Oct 26, 2026
98fe913
Rollup merge of #163219 - Dnreikronos:assumptions_on_binders/mixed_am…
JonathanBrouwer Oct 26, 2026
f9d628f
Rollup merge of #164985 - JonathanBrouwer:fix-dot-recovery, r=estebank
JonathanBrouwer Oct 26, 2026
7154f9c
Rollup merge of #161521 - evavh:doc-crate-level-check, r=JonathanBrouwer
JonathanBrouwer Oct 26, 2026
e4f10c5
Rollup merge of #162530 - RichardTjokroutomo:check-attr-naked, r=Jona…
JonathanBrouwer Oct 26, 2026
05ee9d9
Rollup merge of #164103 - Dnreikronos:trait_solver_resolve_region_var…
JonathanBrouwer Oct 26, 2026
11c6c29
Rollup merge of #164692 - folkertdev:move-ppcf128-implementation, r=t…
JonathanBrouwer Oct 26, 2026
1b12e8b
Rollup merge of #164702 - estebank:point-at-blanket, r=mejrs
JonathanBrouwer Oct 26, 2026
24ec7bc
Rollup merge of #164741 - jchecahi:asm-tests-explicit-cpu, r=beetrees
JonathanBrouwer Oct 26, 2026
be6758e
Rollup merge of #164767 - philss:ps-add-test-ices-153357-154536, r=we…
JonathanBrouwer Oct 26, 2026
eb3b00a
Rollup merge of #164776 - estebank:short-lifetime-in-return-expr-2, r…
JonathanBrouwer Oct 26, 2026
7209d3f
Rollup merge of #164791 - bit-aloo:2026-10-23-self-param-after-const-…
JonathanBrouwer Oct 26, 2026
5c1949b
Rollup merge of #164856 - Kobzol:expect-test, r=Mark-Simulacrum
JonathanBrouwer Oct 26, 2026
b298069
Rollup merge of #164888 - yashaggarwal85d:fix-156380-reborrow-test, r…
JonathanBrouwer Oct 26, 2026
64a4eed
Rollup merge of #164967 - zakrad:codegen-test-137359, r=wesleywiser
JonathanBrouwer Oct 26, 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
9 changes: 9 additions & 0 deletions compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4239,11 +4239,20 @@ pub struct TestBinderBody {
pub span: Span,
pub foralls: ThinVec<TestBinderForall>,
pub exists: ThinVec<TestBinderExists>,
pub region_equalities: Vec<TestBinderRegionEquality>,
pub constraints: Vec<TestBinderConstraint>,
/// These are not where clauses, but rather predicates within the body to be proven
pub predicates: Vec<WherePredicate>,
}

#[derive(Clone, Encodable, Decodable, Debug, Walkable)]
pub struct TestBinderRegionEquality {
#[visitable(extra = LifetimeCtxt::Bound)]
pub lhs: Lifetime,
#[visitable(extra = LifetimeCtxt::Bound)]
pub rhs: Lifetime,
}

#[derive(Clone, Encodable, Decodable, Debug, Walkable)]
pub struct TestBinderForall {
pub span: Span,
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_ast/src/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ macro_rules! common_visitor_and_walkers {
StructExpr,
StructRest,
Term,
TestBinderRegionEquality,
Trait,
TraitBoundModifiers,
TraitObjectSyntax,
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_ast_lowering/src/block.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use rustc_ast::{Block, BlockCheckMode, Local, LocalKind, Stmt, StmtKind};
use rustc_attr_ir::target::Target;
use rustc_attr_ir::target::{AstTarget, Target};
use rustc_hir as hir;
use rustc_span::sym;
use smallvec::SmallVec;
Expand Down Expand Up @@ -37,7 +37,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
match &s.kind {
StmtKind::Let(local) => {
let hir_id = self.lower_node_id(s.id);
let local = self.lower_local(local);
let local = self.lower_local(local, &s);
self.alias_attrs(hir_id, local.hir_id);
let kind = hir::StmtKind::Let(local);
let span = self.lower_span(s.span);
Expand Down Expand Up @@ -88,7 +88,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
}
}

fn lower_local(&mut self, l: &Local) -> &'hir hir::LetStmt<'hir> {
fn lower_local(&mut self, l: &Local, s: &Stmt) -> &'hir hir::LetStmt<'hir> {
// Let statements are allowed to have impl trait in bindings.
let super_ = l.super_.map(|span| self.lower_span(span));
let ty = l.ty.as_ref().map(|t| {
Expand All @@ -104,7 +104,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
};
let span = self.lower_span(l.span);
let source = hir::LocalSource::Normal;
self.lower_attrs(hir_id, &l.attrs, l.span, Target::Statement);
self.lower_attrs(hir_id, &l.attrs, l.span, Target::Statement, AstTarget::Statement(s));
self.arena.alloc(hir::LetStmt { hir_id, super_, ty, pat, init, els, span, source })
}

Expand Down
34 changes: 26 additions & 8 deletions compiler/rustc_ast_lowering/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use rustc_ast::node_id::NodeMap;
use rustc_ast::visit::{Visitor, walk_expr};
use rustc_ast::*;
use rustc_attr_ir::lang_items::LangItem;
use rustc_attr_ir::target::Target;
use rustc_attr_ir::target::{AstTarget, Target};
use rustc_errors::msg;
use rustc_hir as hir;
use rustc_hir::HirId;
Expand Down Expand Up @@ -231,7 +231,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
let old_attrs =
self.curr_owner.attrs.get(&ex.hir_id.local_id).copied().unwrap_or(&[]);
let new_attrs = self
.lower_attrs_vec(&e.attrs, e.span, ex.hir_id, Target::from_expr(e), None)
.lower_attrs_vec(
&e.attrs,
e.span,
ex.hir_id,
Target::from_expr(e),
AstTarget::Expression(e),
)
.into_iter()
.chain(old_attrs.iter().cloned());
let new_attrs = &*self.arena.alloc_from_iter(new_attrs);
Expand All @@ -255,7 +261,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
}

let expr_hir_id = self.lower_node_id(e.id);
self.lower_attrs(expr_hir_id, &e.attrs, e.span, Target::from_expr(e));
self.lower_attrs(
expr_hir_id,
&e.attrs,
e.span,
Target::from_expr(e),
AstTarget::Expression(e),
);

let kind = match &e.kind {
ExprKind::Array(exprs) => hir::ExprKind::Array(self.lower_exprs(exprs)),
Expand Down Expand Up @@ -480,8 +492,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
ExprKind::Continue(opt_label) => {
hir::ExprKind::Continue(self.lower_jump_destination(e.id, *opt_label))
}
ExprKind::Ret(e) => {
let expr = e.as_ref().map(|x| self.lower_expr(x));
ExprKind::Ret(box_e) => {
let expr = box_e.as_ref().map(|x| self.lower_expr(x));
self.checked_return(expr)
}
ExprKind::Yeet(sub_expr) => self.lower_expr_yeet(e.span, sub_expr.as_deref()),
Expand Down Expand Up @@ -795,7 +807,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
let guard = arm.guard.as_ref().map(|guard| self.lower_expr(&guard.cond));
let hir_id = self.next_id();
let span = self.lower_span(arm.span);
self.lower_attrs(hir_id, &arm.attrs, arm.span, Target::Arm);
self.lower_attrs(hir_id, &arm.attrs, arm.span, Target::Arm, AstTarget::Arm(arm));
let is_never_pattern = pat.is_never_pattern();
// We need to lower the body even if it's unneeded for never pattern in match,
// ensure that we can get HirId for DefId if need (issue #137708).
Expand Down Expand Up @@ -1659,7 +1671,7 @@ impl<'hir> LoweringContext<'_, 'hir> {

fn lower_expr_field(&mut self, f: &ExprField) -> hir::ExprField<'hir> {
let hir_id = self.lower_node_id(f.id);
self.lower_attrs(hir_id, &f.attrs, f.span, Target::ExprField);
self.lower_attrs(hir_id, &f.attrs, f.span, Target::ExprField, AstTarget::ExprField(f));
hir::ExprField {
hir_id,
ident: self.lower_ident(f.ident),
Expand Down Expand Up @@ -1926,7 +1938,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
//
// Also, add the attributes to the outer returned expr node.
let expr = self.expr_drop_temps_mut(for_span, match_expr);
self.lower_attrs(expr.hir_id, &e.attrs, e.span, Target::from_expr(e));
self.lower_attrs(
expr.hir_id,
&e.attrs,
e.span,
Target::from_expr(e),
AstTarget::Expression(e),
);
expr
}

Expand Down
10 changes: 8 additions & 2 deletions compiler/rustc_ast_lowering/src/expr/closure.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use rustc_ast::*;
use rustc_attr_ir::find_attr;
use rustc_attr_ir::target::Target;
use rustc_attr_ir::target::{AstTarget, Target};
use rustc_hir as hir;
use rustc_hir::HirId;
use rustc_span::{Span, span_bug};
Expand All @@ -20,7 +20,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
closure: &Closure,
) -> hir::Expr<'hir> {
let expr_hir_id = self.lower_node_id(e.id);
let attrs = self.lower_attrs(expr_hir_id, &e.attrs, e.span, Target::from_expr(e));
let attrs = self.lower_attrs(
expr_hir_id,
&e.attrs,
e.span,
Target::from_expr(e),
AstTarget::Closure(closure),
);

match closure.coroutine_marker {
Some(coroutine_marker) => self.lower_expr_coroutine_closure_with_move_exprs(
Expand Down
38 changes: 29 additions & 9 deletions compiler/rustc_ast_lowering/src/item.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use rustc_abi::ExternAbi;
use rustc_ast::visit::AssocCtxt;
use rustc_ast::*;
use rustc_attr_ir::target::Target;
use rustc_attr_ir::target::{AstTarget, Target};
use rustc_attr_ir::{AttributeKind, EiiImplResolution, find_attr};
use rustc_errors::{E0570, ErrorGuaranteed, struct_span_code_err};
use rustc_hir::def::{DefKind, Res};
Expand Down Expand Up @@ -165,7 +165,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
&i.attrs,
i.span,
Target::from_ast_item(i),
Some(i),
AstTarget::from_ast_item(&i.kind),
&extra_hir_attributes,
);

Expand Down Expand Up @@ -614,8 +614,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
pub(super) fn lower_foreign_item(&mut self, i: &ForeignItem) -> &'hir hir::ForeignItem<'hir> {
let owner_id = self.curr_owner.owner_id();
let hir_id: HirId = owner_id.into();
let attrs =
self.lower_attrs(hir_id, &i.attrs, i.span, Target::from_foreign_item_kind(&i.kind));
let attrs = self.lower_attrs(
hir_id,
&i.attrs,
i.span,
Target::from_foreign_item_kind(&i.kind),
AstTarget::from_foreign_item_kind(&i.kind),
);
let (ident, kind) = match &i.kind {
ForeignItemKind::Fn(Fn { sig, ident, generics, define_opaque, .. }) => {
let fdec = &sig.decl;
Expand Down Expand Up @@ -693,7 +698,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
self.dcx().span_fatal(v.span, "unnamed enum variants are not yet implemented");
}
let hir_id = self.lower_node_id(v.id);
self.lower_attrs(hir_id, &v.attrs, v.span, Target::Variant);
self.lower_attrs(hir_id, &v.attrs, v.span, Target::Variant, AstTarget::Variant(v));
hir::Variant {
hir_id,
def_id: self.local_def_id(v.id),
Expand Down Expand Up @@ -780,7 +785,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
let ty =
self.lower_ty_alloc(&f.ty, ImplTraitContext::Disallowed(ImplTraitPosition::FieldTy));
let hir_id = self.lower_node_id(f.id);
self.lower_attrs(hir_id, &f.attrs, f.span, Target::Field);
self.lower_attrs(hir_id, &f.attrs, f.span, Target::Field, AstTarget::Field(f));
hir::FieldDef {
span: self.lower_span(f.span),
hir_id,
Expand Down Expand Up @@ -808,6 +813,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
&i.attrs,
i.span,
Target::from_assoc_item_kind(&i.kind, AssocCtxt::Trait),
AstTarget::from_assoc_item_kind(&i.kind),
);

let (ident, generics, kind, has_value) = match &i.kind {
Expand Down Expand Up @@ -1070,6 +1076,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
&i.attrs,
i.span,
Target::from_assoc_item_kind(&i.kind, AssocCtxt::Impl { of_trait: is_in_trait_impl }),
AstTarget::from_assoc_item_kind(&i.kind),
);

let (ident, (generics, kind)) = match &i.kind {
Expand Down Expand Up @@ -1238,7 +1245,7 @@ impl<'hir> LoweringContext<'_, 'hir> {

fn lower_param(&mut self, param: &Param) -> hir::Param<'hir> {
let hir_id = self.lower_node_id(param.id);
self.lower_attrs(hir_id, &param.attrs, param.span, Target::Param);
self.lower_attrs(hir_id, &param.attrs, param.span, Target::Param, AstTarget::Param(param));
hir::Param {
hir_id,
pat: self.lower_pat(&param.pat),
Expand Down Expand Up @@ -1948,7 +1955,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
) -> hir::WherePredicate<'hir> {
let hir_id = self.lower_node_id(pred.id);
let span = self.lower_span(pred.span);
self.lower_attrs(hir_id, &pred.attrs, span, Target::WherePredicate);
self.lower_attrs(
hir_id,
&pred.attrs,
span,
Target::WherePredicate,
AstTarget::WherePredicate(pred),
);
let kind = self.arena.alloc(match &pred.kind {
WherePredicateKind::BoundPredicate(WhereBoundPredicate {
bound_generic_params,
Expand Down Expand Up @@ -2008,6 +2021,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
let exists = self.arena.alloc_from_iter(
body.exists.iter().map(|exists| self.lower_test_binder_exists(exists)),
);
let region_equalities = self.arena.alloc_from_iter(body.region_equalities.iter().map(
|TestBinderRegionEquality { lhs, rhs }| {
let lhs = self.lower_lifetime(lhs, LifetimeSource::Other, lhs.ident.into());
let rhs = self.lower_lifetime(rhs, LifetimeSource::Other, rhs.ident.into());
(lhs, rhs)
},
));
let constraints = self.lower_test_binder_constraints_as_and(&body.constraints);
let mut dedup_map = Default::default();
let predicates = self.arena.alloc_from_iter(
Expand All @@ -2016,7 +2036,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
.map(|predicate| self.lower_where_predicate(predicate, &[], &mut dedup_map)),
);
let span = self.lower_span(body.span);
hir::TestBinderBody { foralls, exists, constraints, predicates, span }
hir::TestBinderBody { span, foralls, exists, region_equalities, constraints, predicates }
}

fn lower_test_binder_forall(
Expand Down
Loading
Loading