Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2c31b0d
check if redundant args spans belong to the same context
TaKO8Ki Jan 2, 2026
31531b3
Add regression tests for keyword-in-identifier-position recovery ICE
jieyouxu Jan 2, 2026
79c4727
Don't try to recover keyword as non-keyword identifier
jieyouxu Jan 2, 2026
308c607
remove borrowck handling for inline const patterns
dianne Jan 8, 2026
98d3026
Resolve intra-doc links to variant fields behind type aliases
camelid Jan 2, 2026
a90e041
rustdoc: Refactor `def_id_to_res` as `ty_to_res`
camelid Jan 2, 2026
945f3f9
rustdoc: Use trait as root `Res` instead of assoc item
camelid Jan 2, 2026
f503b89
rustdoc: Extract helper function for resolving assoc items on ADTs
camelid Jan 2, 2026
2c98517
Refactor out many free functions from intra-doc link code
camelid Jan 2, 2026
2b618ed
rustdoc: Correctly resolve variant and struct fields on alias
camelid Jan 2, 2026
8a8b31a
compiler: Make Externally Implementable Item (eii) macros "semiopaque"
Enselic Jan 12, 2026
467a2d2
use self instead of super
jdonszelmann Jan 11, 2026
df55233
disallow in statement position
jdonszelmann Jan 11, 2026
8dd701c
add test for rejecting EIIs in statement position
jdonszelmann Jan 11, 2026
414e00d
Clarify the docs/examples for `ProjectionElem::ConstantIndex`
Zalathar Jan 14, 2026
a9ce750
Pull array length determination out of `prefix_slice_suffix`
Zalathar Jan 14, 2026
a72083f
Avoid some more usize-to-u64 casts in `prefix_slice_suffix`
Zalathar Jan 14, 2026
2b209a6
Avoid serde dependency in build_helper when not necessary
bjorn3 Jan 14, 2026
7d80e7d
rustc_target: Remove unused Arch::PowerPC64LE
taiki-e Jan 14, 2026
c1bcae0
Fix WASI threading regression with minimal invasive change
cdmurph32 Jan 12, 2026
00384df
Delete `MetaItemOrLitParser::Err`
mejrs Jan 14, 2026
8b52c73
resolve: Relax some asserts in glob overwriting and add tests
petrochenkov Jan 10, 2026
81ef42d
resolve: Consistently use old decls before new decls in interfaces
petrochenkov Jan 10, 2026
1c3841b
Add a test for issue 150977
petrochenkov Jan 11, 2026
83c5f2c
resolve: Relax one more assert in glob overwriting and add a test
petrochenkov Jan 11, 2026
520da22
Rollup merge of #150585 - issue-149559, r=petrochenkov
JonathanBrouwer Jan 14, 2026
4311238
Rollup merge of #150586 - intra-doc-assoc-alias, r=GuillaumeGomez
JonathanBrouwer Jan 14, 2026
692c665
Rollup merge of #150590 - ident-kw-ice, r=petrochenkov
JonathanBrouwer Jan 14, 2026
ea18e77
Rollup merge of #150817 - cleanup-inline-const-pat-borrowck, r=lcnr
JonathanBrouwer Jan 14, 2026
3690a7e
Rollup merge of #150939 - impasse, r=estebank
JonathanBrouwer Jan 14, 2026
cf62d29
Rollup merge of #150966 - arch-powerpc64le, r=petrochenkov
JonathanBrouwer Jan 14, 2026
82484c5
Rollup merge of #150971 - disallow-eii-in-statement-position, r=waffl…
JonathanBrouwer Jan 14, 2026
854da99
Rollup merge of #151016 - fix_wasi_threading, r=alexcrichton
JonathanBrouwer Jan 14, 2026
0741782
Rollup merge of #151046 - semiopaque-eii-fix, r=jdonszelmann
JonathanBrouwer Jan 14, 2026
73e6d62
Rollup merge of #151103 - array-pat-len, r=Nadrieril,petrochenkov
JonathanBrouwer Jan 14, 2026
2734bce
Rollup merge of #151117 - reduce_deps, r=Kobzol
JonathanBrouwer Jan 14, 2026
c57dafe
Rollup merge of #151127 - delete_variant, r=JonathanBrouwer
JonathanBrouwer Jan 14, 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
1 change: 0 additions & 1 deletion compiler/rustc_attr_parsing/src/attributes/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ pub fn parse_cfg_entry<S: Stage>(
LitKind::Bool(b) => CfgEntry::Bool(b, lit.span),
_ => return Err(cx.expected_identifier(lit.span)),
},
MetaItemOrLitParser::Err(_, err) => return Err(*err),
})
}

Expand Down
6 changes: 0 additions & 6 deletions compiler/rustc_attr_parsing/src/attributes/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,6 @@ impl DocParser {
MetaItemOrLitParser::Lit(lit) => {
cx.unexpected_literal(lit.span);
}
MetaItemOrLitParser::Err(..) => {
// already had an error here, move on.
}
}
}
}
Expand Down Expand Up @@ -600,9 +597,6 @@ impl DocParser {
MetaItemOrLitParser::Lit(lit) => {
cx.expected_name_value(lit.span, None);
}
MetaItemOrLitParser::Err(..) => {
// already had an error here, move on.
}
}
}
}
Expand Down
8 changes: 3 additions & 5 deletions compiler/rustc_attr_parsing/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use rustc_parse::exp;
use rustc_parse::parser::{ForceCollect, Parser, PathStyle, token_descr};
use rustc_session::errors::{create_lit_error, report_lit_error};
use rustc_session::parse::ParseSess;
use rustc_span::{ErrorGuaranteed, Ident, Span, Symbol, sym};
use rustc_span::{Ident, Span, Symbol, sym};
use thin_vec::ThinVec;

use crate::ShouldEmit;
Expand Down Expand Up @@ -192,7 +192,6 @@ impl ArgParser {
pub enum MetaItemOrLitParser {
MetaItemParser(MetaItemParser),
Lit(MetaItemLit),
Err(Span, ErrorGuaranteed),
}

impl MetaItemOrLitParser {
Expand All @@ -210,21 +209,20 @@ impl MetaItemOrLitParser {
generic_meta_item_parser.span()
}
MetaItemOrLitParser::Lit(meta_item_lit) => meta_item_lit.span,
MetaItemOrLitParser::Err(span, _) => *span,
}
}

pub fn lit(&self) -> Option<&MetaItemLit> {
match self {
MetaItemOrLitParser::Lit(meta_item_lit) => Some(meta_item_lit),
_ => None,
MetaItemOrLitParser::MetaItemParser(_) => None,
}
}

pub fn meta_item(&self) -> Option<&MetaItemParser> {
match self {
MetaItemOrLitParser::MetaItemParser(parser) => Some(parser),
_ => None,
MetaItemOrLitParser::Lit(_) => None,
}
}
}
Expand Down
67 changes: 9 additions & 58 deletions compiler/rustc_borrowck/src/type_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use rustc_infer::infer::{
BoundRegionConversionTime, InferCtxt, NllRegionVariableOrigin, RegionVariableOrigin,
};
use rustc_infer::traits::PredicateObligations;
use rustc_middle::bug;
use rustc_middle::mir::visit::{NonMutatingUseContext, PlaceContext, Visitor};
use rustc_middle::mir::*;
use rustc_middle::traits::query::NoSolution;
Expand All @@ -28,7 +29,6 @@ use rustc_middle::ty::{
self, CanonicalUserTypeAnnotation, CanonicalUserTypeAnnotations, CoroutineArgsExt,
GenericArgsRef, Ty, TyCtxt, TypeVisitableExt, UserArgs, UserTypeAnnotationIndex, fold_regions,
};
use rustc_middle::{bug, span_bug};
use rustc_mir_dataflow::move_paths::MoveData;
use rustc_mir_dataflow::points::DenseLocationMap;
use rustc_span::def_id::CRATE_DEF_ID;
Expand Down Expand Up @@ -387,18 +387,10 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
#[instrument(skip(self), level = "debug")]
fn check_user_type_annotations(&mut self) {
debug!(?self.user_type_annotations);
let tcx = self.tcx();
for user_annotation in self.user_type_annotations {
let CanonicalUserTypeAnnotation { span, ref user_ty, inferred_ty } = *user_annotation;
let annotation = self.instantiate_canonical(span, user_ty);
if let ty::UserTypeKind::TypeOf(def, args) = annotation.kind
&& let DefKind::InlineConst = tcx.def_kind(def)
{
assert!(annotation.bounds.is_empty());
self.check_inline_const(inferred_ty, def.expect_local(), args, span);
} else {
self.ascribe_user_type(inferred_ty, annotation, span);
}
self.ascribe_user_type(inferred_ty, annotation, span);
}
}

Expand Down Expand Up @@ -560,36 +552,6 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
self.constraints.liveness_constraints.add_location(region, location);
}
}

fn check_inline_const(
&mut self,
inferred_ty: Ty<'tcx>,
def_id: LocalDefId,
args: UserArgs<'tcx>,
span: Span,
) {
assert!(args.user_self_ty.is_none());
let tcx = self.tcx();
let const_ty = tcx.type_of(def_id).instantiate(tcx, args.args);
if let Err(terr) =
self.eq_types(const_ty, inferred_ty, Locations::All(span), ConstraintCategory::Boring)
{
span_bug!(
span,
"bad inline const pattern: ({:?} = {:?}) {:?}",
const_ty,
inferred_ty,
terr
);
}
let args = self.infcx.resolve_vars_if_possible(args.args);
let predicates = self.prove_closure_bounds(tcx, def_id, args, Locations::All(span));
self.normalize_and_prove_instantiated_predicates(
def_id.to_def_id(),
predicates,
Locations::All(span),
);
}
}

impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
Expand Down Expand Up @@ -1731,12 +1693,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
let def_id = uv.def;
if tcx.def_kind(def_id) == DefKind::InlineConst {
let def_id = def_id.expect_local();
let predicates = self.prove_closure_bounds(
tcx,
def_id,
uv.args,
location.to_locations(),
);
let predicates = self.prove_closure_bounds(tcx, def_id, uv.args, location);
self.normalize_and_prove_instantiated_predicates(
def_id.to_def_id(),
predicates,
Expand Down Expand Up @@ -2519,15 +2476,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
// clauses on the struct.
AggregateKind::Closure(def_id, args)
| AggregateKind::CoroutineClosure(def_id, args)
| AggregateKind::Coroutine(def_id, args) => (
def_id,
self.prove_closure_bounds(
tcx,
def_id.expect_local(),
args,
location.to_locations(),
),
),
| AggregateKind::Coroutine(def_id, args) => {
(def_id, self.prove_closure_bounds(tcx, def_id.expect_local(), args, location))
}

AggregateKind::Array(_) | AggregateKind::Tuple | AggregateKind::RawPtr(..) => {
(CRATE_DEF_ID.to_def_id(), ty::InstantiatedPredicates::empty())
Expand All @@ -2546,12 +2497,12 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
tcx: TyCtxt<'tcx>,
def_id: LocalDefId,
args: GenericArgsRef<'tcx>,
locations: Locations,
location: Location,
) -> ty::InstantiatedPredicates<'tcx> {
let root_def_id = self.root_cx.root_def_id();
// We will have to handle propagated closure requirements for this closure,
// but need to defer this until the nested body has been fully borrow checked.
self.deferred_closure_requirements.push((def_id, args, locations));
self.deferred_closure_requirements.push((def_id, args, location.to_locations()));

// Equate closure args to regions inherited from `root_def_id`. Fixes #98589.
let typeck_root_args = ty::GenericArgs::identity_for_item(tcx, root_def_id);
Expand All @@ -2575,7 +2526,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
if let Err(_) = self.eq_args(
typeck_root_args,
parent_args,
locations,
location.to_locations(),
ConstraintCategory::BoringNoLocation,
) {
span_mirbug!(
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_builtin_macros/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ builtin_macros_eii_only_once = `#[{$name}]` can only be specified once

builtin_macros_eii_shared_macro_expected_function = `#[{$name}]` is only valid on functions
builtin_macros_eii_shared_macro_expected_max_one_argument = `#[{$name}]` expected no arguments or a single argument: `#[{$name}(default)]`
builtin_macros_eii_shared_macro_in_statement_position = `#[{$name}]` can only be used on functions inside a module
.label = `#[{$name}]` is used on this item, which is part of another item's local scope

builtin_macros_env_not_defined = environment variable `{$var}` not defined at compile time
.cargo = Cargo sets build script variables at run time. Use `std::env::var({$var_expr})` instead
Expand Down
Loading
Loading