Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5dfe784
diagnostics: print HRTB binders before fn qualifiers
qaijuang May 1, 2026
89005b2
Update `askama` version to `0.16.0`
GuillaumeGomez May 4, 2026
08aca77
Regen `proc_macro_dep`
GuillaumeGomez May 4, 2026
cf636ec
resolve: Factor out reporting of "cannot reexport" errors into a sepa…
petrochenkov Apr 30, 2026
65e5bd6
resolve: Catch "cannot reexport" errors from macros 2.0 better
petrochenkov Apr 30, 2026
21c58d8
resolve: Harden some invariant checks for visibilities
petrochenkov Apr 30, 2026
fadb747
rust-analyzer: Fix `pub_use_of_private_extern_crate` lint
petrochenkov May 4, 2026
45b9459
Update `askama` version to `0.16.0` in `clippy`
GuillaumeGomez May 4, 2026
664177f
Remove const closure hacks in libstd
oli-obk Apr 27, 2026
a015eb1
Revert const hack and use const closure
oli-obk Apr 28, 2026
23cea55
Remove duplicate debug assert
zetanumbers May 5, 2026
4432f6b
Implement a new flag `-Zdisable-fast-paths` in trait solving
ShoyuVanilla May 5, 2026
ee35020
Revert "remove `MethodReceiverExpr` special-casing"
cyrgani May 5, 2026
e35334f
Rollup merge of #156014 - petrochenkov:kvak, r=mu001999
JonathanBrouwer May 5, 2026
73e5912
Rollup merge of #156058 - qaijuang:issue-151393, r=JohnTitor
JonathanBrouwer May 5, 2026
b503949
Rollup merge of #156172 - ShoyuVanilla:slowbro, r=lcnr
JonathanBrouwer May 5, 2026
17e266a
Rollup merge of #156184 - cyrgani:macros-are-weird, r=petrochenkov
JonathanBrouwer May 5, 2026
2e9a402
Rollup merge of #155957 - oli-obk:const-closure-std, r=jhpratt
JonathanBrouwer May 5, 2026
c2a463a
Rollup merge of #156127 - GuillaumeGomez:update-askama, r=Urgau
JonathanBrouwer May 5, 2026
e20ac1b
Rollup merge of #156183 - zetanumbers:rm_duplicate_dbg_ass, r=mati865
JonathanBrouwer May 5, 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
24 changes: 14 additions & 10 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"

[[package]]
name = "askama"
version = "0.15.4"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08e1676b346cadfec169374f949d7490fd80a24193d37d2afce0c047cf695e57"
checksum = "f1bf825125edd887a019d0a3a837dcc5499a68b0d034cc3eb594070c3e18addc"
dependencies = [
"askama_macros",
"itoa",
Expand All @@ -187,12 +187,13 @@ dependencies = [

[[package]]
name = "askama_derive"
version = "0.15.4"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7661ff56517787343f376f75db037426facd7c8d3049cef8911f1e75016f3a37"
checksum = "e1c7065972a130eafa84215f21352ae15b4a7393da48c1f5e103904490736738"
dependencies = [
"askama_parser",
"basic-toml",
"glob",
"memchr",
"proc-macro2",
"quote",
Expand All @@ -204,24 +205,24 @@ dependencies = [

[[package]]
name = "askama_macros"
version = "0.15.4"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "713ee4dbfd1eb719c2dab859465b01fa1d21cb566684614a713a6b7a99a4e47b"
checksum = "0e23b1d2c4bd39a41971f6124cef4cc6fd0540913ecb90919b69ab3bbe44ae1a"
dependencies = [
"askama_derive",
]

[[package]]
name = "askama_parser"
version = "0.15.4"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d62d674238a526418b30c0def480d5beadb9d8964e7f38d635b03bf639c704c"
checksum = "7db09fde9143e7ac4513358fb32ee32847125b63b18ea715afd487956da715da"
dependencies = [
"rustc-hash 2.1.1",
"serde",
"serde_derive",
"unicode-ident",
"winnow 0.7.13",
"winnow 1.0.0",
]

[[package]]
Expand Down Expand Up @@ -756,7 +757,7 @@ checksum = "af491d569909a7e4dee0ad7db7f5341fef5c614d5b8ec8cf765732aba3cff681"
dependencies = [
"serde",
"termcolor",
"unicode-width 0.1.14",
"unicode-width 0.2.2",
]

[[package]]
Expand Down Expand Up @@ -6625,6 +6626,9 @@ name = "winnow"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a90e88e4667264a994d34e6d1ab2d26d398dcdca8b7f52bec8668957517fc7d8"
dependencies = [
"memchr",
]

[[package]]
name = "winsplit"
Expand Down
4 changes: 0 additions & 4 deletions compiler/rustc_expand/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,10 +423,6 @@ pub trait MacResult {
None
}

fn make_method_receiver_expr(self: Box<Self>) -> Option<Box<ast::Expr>> {
self.make_expr()
}

/// Creates zero or more items.
fn make_items(self: Box<Self>) -> Option<SmallVec<[Box<ast::Item>; 1]>> {
None
Expand Down
19 changes: 14 additions & 5 deletions compiler/rustc_expand/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,23 @@ macro_rules! ast_fragments {
/// Can also serve as an input and intermediate result for macro expansion operations.
pub enum AstFragment {
OptExpr(Option<Box<ast::Expr>>),
MethodReceiverExpr(Box<ast::Expr>),
$($Kind($AstTy),)*
}

/// "Discriminant" of an AST fragment.
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum AstFragmentKind {
OptExpr,
MethodReceiverExpr,
$($Kind,)*
}

impl AstFragmentKind {
pub fn name(self) -> &'static str {
match self {
AstFragmentKind::OptExpr => "expression",
AstFragmentKind::MethodReceiverExpr => "expression",
$(AstFragmentKind::$Kind => $kind_name,)*
}
}
Expand All @@ -90,6 +93,8 @@ macro_rules! ast_fragments {
match self {
AstFragmentKind::OptExpr =>
result.make_expr().map(Some).map(AstFragment::OptExpr),
AstFragmentKind::MethodReceiverExpr =>
result.make_expr().map(AstFragment::MethodReceiverExpr),
$(AstFragmentKind::$Kind => result.$make_ast().map(AstFragment::$Kind),)*
}
}
Expand All @@ -116,6 +121,13 @@ macro_rules! ast_fragments {
}
}

pub(crate) fn make_method_receiver_expr(self) -> Box<ast::Expr> {
match self {
AstFragment::MethodReceiverExpr(expr) => expr,
_ => panic!("AstFragment::make_method_receiver_expr called on the wrong kind of fragment"),
}
}

$(pub fn $make_ast(self) -> $AstTy {
match self {
AstFragment::$Kind(ast) => ast,
Expand All @@ -134,6 +146,7 @@ macro_rules! ast_fragments {
*opt_expr = vis.filter_map_expr(expr)
}
}
AstFragment::MethodReceiverExpr(expr) => vis.visit_method_receiver_expr(expr),
$($(AstFragment::$Kind(ast) => vis.$visit_ast(ast),)?)*
$($(AstFragment::$Kind(ast) =>
ast.flat_map_in_place(|ast| vis.$flat_map_ast_elt(ast, $($args)*)),)?)*
Expand All @@ -144,6 +157,7 @@ macro_rules! ast_fragments {
match self {
AstFragment::OptExpr(Some(expr)) => try_visit!(visitor.visit_expr(expr)),
AstFragment::OptExpr(None) => {}
AstFragment::MethodReceiverExpr(expr) => try_visit!(visitor.visit_method_receiver_expr(expr)),
$($(AstFragment::$Kind(ast) => try_visit!(visitor.$visit_ast(ast)),)?)*
$($(AstFragment::$Kind(ast) => walk_list!(visitor, $visit_ast_elt, &ast[..], $($args)*),)?)*
}
Expand All @@ -166,11 +180,6 @@ ast_fragments! {
one fn visit_expr;
fn make_expr;
}
MethodReceiverExpr(Box<ast::Expr>) {
"expression";
one fn visit_method_receiver_expr;
fn make_method_receiver_expr;
}
Pat(Box<ast::Pat>) {
"pattern";
one fn visit_pat;
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_infer/src/infer/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ impl<'tcx> rustc_type_ir::InferCtxtLike for InferCtxt<'tcx> {
self.next_trait_solver
}

fn disable_trait_solver_fast_paths(&self) -> bool {
self.disable_trait_solver_fast_paths()
}

fn typing_mode(&self) -> ty::TypingMode<'tcx> {
self.typing_mode()
}
Expand Down
5 changes: 5 additions & 0 deletions compiler/rustc_infer/src/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,11 @@ impl<'tcx> InferCtxt<'tcx> {
self.next_trait_solver
}

#[inline(always)]
pub fn disable_trait_solver_fast_paths(&self) -> bool {
self.tcx.disable_trait_solver_fast_paths()
}

#[inline(always)]
pub fn typing_mode(&self) -> TypingMode<'tcx> {
self.typing_mode
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_middle/src/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2657,6 +2657,10 @@ impl<'tcx> TyCtxt<'tcx> {
self.sess.opts.unstable_opts.next_solver.coherence
}

pub fn disable_trait_solver_fast_paths(self) -> bool {
self.sess.opts.unstable_opts.disable_fast_paths
}

#[allow(rustc::bad_opt_access)]
pub fn use_typing_mode_borrowck(self) -> bool {
self.next_trait_solver_globally() || self.sess.opts.unstable_opts.typing_mode_borrowck
Expand Down
6 changes: 5 additions & 1 deletion compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ where
ref sub_roots,
stalled_certainty,
}) = stalled_on
&& !self.delegate.disable_trait_solver_fast_paths()
&& !stalled_vars.iter().any(|value| self.delegate.is_changed_arg(*value))
&& !sub_roots
.iter()
Expand Down Expand Up @@ -666,7 +667,10 @@ where
// If this loop did not result in any progress, what's our final certainty.
let mut unchanged_certainty = Some(Certainty::Yes);
for (source, goal, stalled_on) in mem::take(&mut self.nested_goals) {
if let Some(certainty) = self.delegate.compute_goal_fast_path(goal, self.origin_span) {
if !self.delegate.disable_trait_solver_fast_paths()
&& let Some(certainty) =
self.delegate.compute_goal_fast_path(goal, self.origin_span)
{
match certainty {
Certainty::Yes => {}
Certainty::Maybe { .. } => {
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_passes/src/stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ fn inherit_const_stability(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool {
match def_kind {
DefKind::AssocFn | DefKind::AssocTy | DefKind::AssocConst { .. } => {
match tcx.def_kind(tcx.local_parent(def_id)) {
DefKind::Impl { .. } => true,
DefKind::Trait | DefKind::Impl { .. } => true,
_ => false,
}
}
DefKind::Closure => true,
_ => false,
}
}
Expand Down
Loading
Loading