Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
b5b31a1
Replace `CrateDump` with the Debug impl from `CStore`
blyxyas Jul 2, 2026
ceefd37
Add test case for non-unicode `env!` named through macro
Jul 26, 2026
4f5f05f
Avoid re-extracting env var name for `[option_]env!` errors
Jul 26, 2026
da005a1
tests/ui/union/union-nodrop.rs: fix typo "expressios"
DanielEScherzer Aug 12, 2026
ca390f3
[Priroda] Add debugger-lifecycle regression fixtures
moabo3li Aug 14, 2026
b05e1e9
[Priroda] Keep program exits in debugger state
moabo3li Aug 16, 2026
7c88962
add crashtests, remove unused aux files
cyrgani Aug 16, 2026
978de22
[Priroda] Stop at interpreter exceptions
moabo3li Aug 16, 2026
d5ec8d4
Merge pull request #5253 from moabo3li/priroda-exception-stop
oli-obk Aug 17, 2026
1df3fe0
chore: update to cc@1.4.3
weihanglo Aug 17, 2026
c866cfd
Merge pull request #5259 from weihanglo/cc-1.4.3
RalfJung Aug 17, 2026
c53d381
[Priroda] Add CLI next baseline fixture
moabo3li Aug 16, 2026
2dfa7df
[Priroda] Add CLI source next command
moabo3li Aug 17, 2026
1f2b669
[Priroda] Add CLI stepping baseline fixtures
moabo3li Aug 17, 2026
a48ff50
[Priroda] Add CLI source step-out command
moabo3li Aug 17, 2026
1fc2f12
[Priroda] Add DAP next baseline fixture
moabo3li Aug 16, 2026
8f41ebf
[Priroda] Wire DAP next to source step-over
moabo3li Aug 17, 2026
e9f1e4c
[Priroda] Add DAP stepOut baseline fixture
moabo3li Aug 16, 2026
3ac3fc3
[Priroda] Wire DAP stepOut request
moabo3li Aug 17, 2026
4b0fc31
[Priroda] Add source step-over fixtures
moabo3li Aug 17, 2026
3f00a98
[Priroda] Avoid re-hitting breakpoints while stepping
moabo3li Aug 17, 2026
470da33
[Priroda] Add DAP repeated next baseline fixture
moabo3li Aug 17, 2026
a7f6129
[Priroda] Skip backward source stops during next
moabo3li Aug 17, 2026
03f1984
[Priroda] Add DAP stepOut-from-main fixture
moabo3li Aug 17, 2026
77027e8
[Priroda] Keep stepOut within user frames
moabo3li Aug 17, 2026
6a37805
[Priroda] Clarify source stepping docs
moabo3li Aug 17, 2026
5e123fc
test aarch64 Complex
folkertdev Jul 13, 2026
1115605
test arm Complex
folkertdev Jul 13, 2026
097db24
test riscv/loongarch Complex
folkertdev Jul 13, 2026
67f7dd4
_Complex for s390x
folkertdev Jul 25, 2026
d27bb7c
_Complex for wasm
folkertdev Jul 25, 2026
1fb3384
_Complex for csky
folkertdev Jul 26, 2026
60c7310
Prepare for merging from rust-lang/rust
RalfJung Aug 19, 2026
0d33502
Merge ref 'f7d782a3be46' from rust-lang/rust
RalfJung Aug 19, 2026
9ca6f87
Merge pull request #5264 from RalfJung/rustup
RalfJung Aug 19, 2026
0250298
remove no-longer-needed horizontal SSE/AVX ops
RalfJung Aug 19, 2026
cd8163c
Merge pull request #5263 from RalfJung/x86-pack
RalfJung Aug 19, 2026
b5db2cb
[Priroda] Merge SourceLine into StepOver
moabo3li Aug 19, 2026
febb840
Merge pull request #5260 from moabo3li/priroda-simple-commands
oli-obk Aug 20, 2026
1331f4e
Add shim for `malloc_usable_size`
hkalbasi Aug 20, 2026
2b0b33a
Merge pull request #5266 from hkalbasi/push-xovrtsplxoqt
RalfJung Aug 20, 2026
279586e
Prepare for merging from rust-lang/rust
Aug 21, 2026
b121379
Merge ref '095d9ef41e23' from rust-lang/rust
Aug 21, 2026
4027f60
have triagebot link to LLM policy
RalfJung Aug 21, 2026
0ac1ae4
Merge pull request #5267 from rust-lang/rustup-2026-08-21
RalfJung Aug 21, 2026
ab908c2
Merge pull request #5268 from RalfJung/llm-link
RalfJung Aug 21, 2026
3d30691
Prepare for merging from rust-lang/rust
RalfJung Aug 22, 2026
0124bdb
Merge ref 'c656540d6467' from rust-lang/rust
RalfJung Aug 22, 2026
62714e4
Relax size and align check of extern statics
hkalbasi Aug 22, 2026
c50baf5
fmt, clippy, and spacing
RalfJung Aug 22, 2026
fec0be6
Merge pull request #5271 from hkalbasi/push-tsrlxwolltqr
RalfJung Aug 22, 2026
be0ba1e
Merge pull request #5270 from rust-lang/rustup-2026-08-22
RalfJung Aug 22, 2026
8b32975
support a few more basic things on netbsd
RalfJung Aug 22, 2026
93416e8
Merge pull request #5272 from RalfJung/netbsd
RalfJung Aug 22, 2026
c6b24c0
Bail out in more tests if we don't detect the required feature at run…
saethlin Aug 22, 2026
b6fa423
Merge pull request #5274 from saethlin/more-dynamic-native-tests
saethlin Aug 22, 2026
5e226be
Put back `tests/rustdoc-gui/search-result-display.goml`
GuillaumeGomez Aug 22, 2026
84ba90f
Unify the "wait search results" approach by reusing the same function
GuillaumeGomez Aug 22, 2026
b14b89f
Bump cfg_aliases to 0.2.2
zachs18 Aug 23, 2026
0d74fb7
re-bless `pretty-std` on windows
Walnut356 Aug 23, 2026
f774558
add and so on to the error
lcnr Aug 22, 2026
47b9a4a
also trigger fcw from overflow -> error
lcnr Aug 22, 2026
b087455
`root_goal_may_hold_opaque_types_jank` use `evaluate_root_goal`
lcnr Aug 23, 2026
c35f472
stop using check_shim_sig_lenient for main foreign_items
RalfJung Aug 22, 2026
b4f7e4e
we don't need the pointer's mutability for the ABI check
RalfJung Aug 23, 2026
cd12a28
deprecate the old 'lenient' check_shim_sig
RalfJung Aug 23, 2026
6a024d4
better error message for ABI mismatches
RalfJung Aug 23, 2026
5aff838
Merge pull request #5273 from RalfJung/less-lenient
RalfJung Aug 23, 2026
615e6d1
update eyre
RalfJung Aug 23, 2026
00be974
std: reduce visibility of some internal OsStr related types
pacak Aug 3, 2026
8662be8
core: refactor tests/pattern.rs tests
pacak Aug 3, 2026
1867b66
Add test for attribute in use tree
scrabsha Aug 23, 2026
e6e1f04
Recover on attribute in use tree
scrabsha Apr 10, 2026
1333ad7
Small tweaks to parse error recovery code
fmease Aug 23, 2026
1bb1610
[Bootstrap] Use full exact CI `llvm-config` executable path
jieyouxu Aug 23, 2026
3dee3c5
Path: use optimized is_empty() method
GTimothy Aug 23, 2026
2ea2b40
Fix flakyness issue for `tests/rustdoc-gui/headers-color.goml`
GuillaumeGomez Aug 23, 2026
6bc1b1b
-Ctarget-feature is not unsafe (any more)
RalfJung Aug 3, 2026
df3653a
coretests: Add a few tests for backward multibyte predicate
pacak Aug 11, 2026
7ba1be5
fix the reporting of layout normalization failures in transmute checks
meta-legend Jul 17, 2026
f7d576c
add crashtests
cyrgani Aug 18, 2026
9c78500
Use `symlink_dir` to create junctions on Windows instead of trying to…
Zoxc Feb 10, 2026
c0d8828
interpret: make validate_c_variadic_compatible_ty public
RalfJung Aug 23, 2026
412a5a5
Add codegen test for redundant bit mask after a range check
zakrad Aug 23, 2026
bdd3b54
make sure we pick the right copy of _Unwind_Reason_Code
RalfJung Aug 23, 2026
3b0424b
Rollup merge of #161586 - RalfJung:miri, r=RalfJung
Zalathar Aug 24, 2026
dd5814b
Rollup merge of #161187 - folkertdev:complex-layout-simple-targets, r…
Zalathar Aug 24, 2026
dabba55
Rollup merge of #161524 - GuillaumeGomez:flaky-gui-back, r=urgau
Zalathar Aug 24, 2026
654d975
Rollup merge of #161592 - pacak:change-pattern-tests, r=nia-e
Zalathar Aug 24, 2026
475c8ac
Rollup merge of #161602 - GuillaumeGomez:fix-flaky-test, r=Urgau
Zalathar Aug 24, 2026
6838533
Rollup merge of #152433 - Zoxc:bootstrap-symlink, r=ChrisDenton
Zalathar Aug 24, 2026
5d413fe
Rollup merge of #155254 - scrabsha:push-qlmmuuwqnoqv, r=fmease
Zalathar Aug 24, 2026
d3fba4d
Rollup merge of #158695 - blyxyas:remove-cratedump, r=fmease
Zalathar Aug 24, 2026
0458d73
Rollup merge of #159456 - meta-legend:fix-149588, r=cjgillot
Zalathar Aug 24, 2026
fc3fffc
Rollup merge of #159940 - bal-e:env-macro-unreachables, r=fmease
Zalathar Aug 24, 2026
c3b64e5
Rollup merge of #160452 - RalfJung:target-feature-safe, r=bjorn3
Zalathar Aug 24, 2026
d3053c8
Rollup merge of #161007 - DanielEScherzer:union-nodrop-typo, r=fmease
Zalathar Aug 24, 2026
d93943d
Rollup merge of #161166 - cyrgani:tests-5, r=fmease
Zalathar Aug 24, 2026
0118299
Rollup merge of #161294 - cyrgani:tests-6, r=fmease
Zalathar Aug 24, 2026
1a4d9a5
Rollup merge of #161552 - lcnr:overflow-fcw-chain, r=adwinwhite
Zalathar Aug 24, 2026
531f23d
Rollup merge of #161569 - zachs18:bump-cfg_aliases, r=hanna-kruppe
Zalathar Aug 24, 2026
f93955e
Rollup merge of #161573 - Walnut356:pretty_std_msvc, r=jieyouxu
Zalathar Aug 24, 2026
cb61a7d
Rollup merge of #161580 - zakrad:regr-test-78745, r=mu001999
Zalathar Aug 24, 2026
5f9b1b2
Rollup merge of #161588 - RalfJung:eyre, r=jieyouxu
Zalathar Aug 24, 2026
7eb11ba
Rollup merge of #161589 - pacak:private-osstr, r=clarfonthey
Zalathar Aug 24, 2026
cfaad20
Rollup merge of #161598 - jieyouxu:jieyouxu/fix/bootstrap-ci-llvm-con…
Zalathar Aug 24, 2026
e4100ab
Rollup merge of #161601 - GTimothy:empty-path-optim, r=fmease
Zalathar Aug 24, 2026
0c49c3a
Rollup merge of #161604 - pacak:test-multibyte, r=nia-e
Zalathar Aug 24, 2026
524eb32
Rollup merge of #161615 - RalfJung:vararg-check, r=folkertdev
Zalathar Aug 24, 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: 5 additions & 4 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,9 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"

[[package]]
name = "cfg_aliases"
version = "0.2.1"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527"

[[package]]
name = "chacha20"
Expand Down Expand Up @@ -1400,10 +1400,11 @@ dependencies = [

[[package]]
name = "eyre"
version = "0.6.12"
version = "0.6.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec"
checksum = "c08309dbcc659c5549a24ddb9b27027640641b282ef5768267c7e675558986a3"
dependencies = [
"autocfg",
"indenter",
"once_cell",
]
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_builtin_macros/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,23 +562,23 @@ pub(crate) enum EnvNotDefined {
CargoEnvVar {
#[primary_span]
span: Span,
var: Symbol,
var: String,
var_expr: String,
},
#[diag("environment variable `{$var}` not defined at compile time")]
#[help("there is a similar Cargo environment variable: `{$suggested_var}`")]
CargoEnvVarTypo {
#[primary_span]
span: Span,
var: Symbol,
var: String,
suggested_var: Symbol,
},
#[diag("environment variable `{$var}` not defined at compile time")]
#[help("use `std::env::var({$var_expr})` to read the variable at run time")]
CustomEnvVar {
#[primary_span]
span: Span,
var: Symbol,
var: String,
var_expr: String,
},
}
Expand All @@ -588,7 +588,7 @@ pub(crate) enum EnvNotDefined {
pub(crate) struct EnvNotUnicode {
#[primary_span]
pub(crate) span: Span,
pub(crate) var: Symbol,
pub(crate) var: String,
}

#[derive(Diagnostic)]
Expand Down
86 changes: 34 additions & 52 deletions compiler/rustc_builtin_macros/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
use std::env;
use std::env::VarError;

use rustc_ast::token::{self, LitKind};
use rustc_ast::tokenstream::TokenStream;
use rustc_ast::{ExprKind, GenericArg, Mutability};
use rustc_ast::{GenericArg, Mutability};
use rustc_ast_pretty::pprust;
use rustc_expand::base::{DummyResult, ExpandResult, ExtCtxt, MacEager, MacroExpanderResult};
use rustc_span::edit_distance::edit_distance;
Expand Down Expand Up @@ -69,14 +68,8 @@ pub(crate) fn expand_option_env<'cx>(
))
}
Err(VarError::NotUnicode(_)) => {
let ExprKind::Lit(token::Lit {
kind: LitKind::Str | LitKind::StrRaw(..), symbol, ..
}) = &var_expr.kind
else {
unreachable!("`expr_to_string` ensures this is a string lit")
};

let guar = cx.dcx().emit_err(diagnostics::EnvNotUnicode { span: sp, var: *symbol });
let escaped_var = var.as_str().escape_debug().to_string();
let guar = cx.dcx().emit_err(diagnostics::EnvNotUnicode { span: sp, var: escaped_var });
return ExpandResult::Ready(DummyResult::any(sp, guar));
}
Ok(value) => cx.expr_call_global(
Expand Down Expand Up @@ -106,6 +99,7 @@ pub(crate) fn expand_env<'cx>(
};

let var_expr = exprs.next().unwrap();
// FIXME: `get_exprs_from_tts()` already performed macro expansion...
let ExpandResult::Ready(mac) = expr_to_string(cx, var_expr.clone(), "expected string literal")
else {
return ExpandResult::Retry(());
Expand Down Expand Up @@ -133,49 +127,37 @@ pub(crate) fn expand_env<'cx>(
let value = lookup_env(cx, var);
cx.sess.env_depinfo.borrow_mut().insert((var, value.as_ref().ok().copied()));
let e = match value {
Err(err) => {
let ExprKind::Lit(token::Lit {
kind: LitKind::Str | LitKind::StrRaw(..), symbol, ..
}) = &var_expr.kind
else {
unreachable!("`expr_to_string` ensures this is a string lit")
};

let var = var.as_str();
let guar = match err {
VarError::NotPresent => {
if let Some(msg_from_user) = custom_msg {
cx.dcx().emit_err(diagnostics::EnvNotDefinedWithUserMessage {
span,
msg_from_user,
})
} else if let Some(suggested_var) = find_similar_cargo_var(var)
&& suggested_var != var
{
cx.dcx().emit_err(diagnostics::EnvNotDefined::CargoEnvVarTypo {
span,
var: *symbol,
suggested_var: Symbol::intern(suggested_var),
})
} else if is_cargo_env_var(var) {
cx.dcx().emit_err(diagnostics::EnvNotDefined::CargoEnvVar {
span,
var: *symbol,
var_expr: pprust::expr_to_string(&var_expr),
})
} else {
cx.dcx().emit_err(diagnostics::EnvNotDefined::CustomEnvVar {
span,
var: *symbol,
var_expr: pprust::expr_to_string(&var_expr),
})
}
}
VarError::NotUnicode(_) => {
cx.dcx().emit_err(diagnostics::EnvNotUnicode { span, var: *symbol })
}
Err(VarError::NotPresent) => {
let var_str = var.as_str();
let escaped_var = var_str.escape_debug().to_string();
let guar = if let Some(msg_from_user) = custom_msg {
cx.dcx().emit_err(diagnostics::EnvNotDefinedWithUserMessage { span, msg_from_user })
} else if let Some(suggested_var) = find_similar_cargo_var(var_str)
&& suggested_var != var_str
{
cx.dcx().emit_err(diagnostics::EnvNotDefined::CargoEnvVarTypo {
span,
var: escaped_var,
suggested_var: Symbol::intern(suggested_var),
})
} else if is_cargo_env_var(var_str) {
cx.dcx().emit_err(diagnostics::EnvNotDefined::CargoEnvVar {
span,
var: escaped_var,
var_expr: pprust::expr_to_string(&var_expr),
})
} else {
cx.dcx().emit_err(diagnostics::EnvNotDefined::CustomEnvVar {
span,
var: escaped_var,
var_expr: pprust::expr_to_string(&var_expr),
})
};

return ExpandResult::Ready(DummyResult::any(sp, guar));
}
Err(VarError::NotUnicode(_)) => {
let escaped_var = var.as_str().escape_debug().to_string();
let guar = cx.dcx().emit_err(diagnostics::EnvNotUnicode { span, var: escaped_var });
return ExpandResult::Ready(DummyResult::any(sp, guar));
}
Ok(value) => cx.expr_str(span, value),
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_ssa/src/back/rpath.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ fn get_rpath_relative_to_output(config: &RPathConfig<'_>, lib: &Path) -> OsStrin
let output = config.out_filename.parent().unwrap();

// If output or lib is empty, just assume it locates in current path
let lib = if lib == Path::new("") { Path::new(".") } else { lib };
let output = if output == Path::new("") { Path::new(".") } else { output };
let lib = if lib.is_empty() { Path::new(".") } else { lib };
let output = if output.is_empty() { Path::new(".") } else { output };

let lib = try_canonicalize(lib).unwrap();
let output = try_canonicalize(output).unwrap();
Expand Down
13 changes: 2 additions & 11 deletions compiler/rustc_const_eval/src/interpret/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub(crate) enum MinMax {

/// Whether two types `T` and `U` are compatible when a value of type `T` is passed as a c-variadic
/// argument and read as a value of type `U`.
enum VarArgCompatible {
pub enum VarArgCompatible {
/// `T` and `U` are compatible, e.g.
///
/// - They're the same type.
Expand Down Expand Up @@ -829,15 +829,6 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
return interp_ok(());
}

// Types of different sizes can never be compatible.
if arg_mplace.layout.size != callee_type.size {
throw_ub_format!(
"va_arg type mismatch: requested `{}` is incompatible with next argument of type `{}`",
callee_ty,
caller_ty,
)
}

match self.validate_c_variadic_compatible_ty(arg_mplace.layout.ty, callee_type.ty)? {
VarArgCompatible::Compatible => interp_ok(()),
VarArgCompatible::Incompatible => throw_ub_format!(
Expand Down Expand Up @@ -875,7 +866,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
/// - `T` and `U` are both pointers, and their target types are compatible.
/// - `T` is a pointer to [`std::ffi::c_void`] and `U` is a pointer to [`i8`] or [`u8`],
/// or vice versa.
fn validate_c_variadic_compatible_ty(
pub fn validate_c_variadic_compatible_ty(
&mut self,
caller_type: Ty<'tcx>,
callee_type: Ty<'tcx>,
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_const_eval/src/interpret/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pub use self::intern::{
HasStaticRootDefId, InternError, InternKind, intern_const_alloc_for_constprop,
intern_const_alloc_recursive,
};
pub use self::intrinsics::VarArgCompatible;
pub use self::machine::{
AllocMap, Machine, MayLeak, RetagMode, ReturnAction, compile_time_machine,
};
Expand Down
19 changes: 7 additions & 12 deletions compiler/rustc_hir_typeck/src/intrinsicck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,15 @@ fn check_transmute<'tcx>(
hir_id: HirId,
) -> Result<(), ErrorGuaranteed> {
let span = tcx.hir_span(hir_id);
let normalize = |ty| {
if let Ok(ty) = tcx.try_normalize_erasing_regions(typing_env, ty) {
ty
} else {
Ty::new_error_with_message(
tcx,
span,
format!("tried to normalize non-wf type {ty:#?} in check_transmute"),
)
}
let normalize = |ty: Unnormalized<'tcx, Ty<'tcx>>| -> Result<Ty<'tcx>, ErrorGuaranteed> {
tcx.try_normalize_erasing_regions(typing_env, ty).map_err(|err| {
let err = LayoutError::NormalizationFailure(ty.skip_normalization(), err);
tcx.dcx().struct_span_err(span, err.to_string()).emit()
})
};

let from = normalize(from);
let to = normalize(to);
let from = normalize(from)?;
let to = normalize(to)?;
trace!(?from, ?to);

// Transmutes that are only changing lifetimes are always ok.
Expand Down
14 changes: 3 additions & 11 deletions compiler/rustc_metadata/src/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@ pub struct CStore {
has_crate_resolve_with_fail: bool,
}

impl std::fmt::Debug for CStore {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("CStore").finish_non_exhaustive()
}
}

pub enum LoadedMacro {
MacroDef {
def: MacroDef,
Expand All @@ -113,12 +107,10 @@ enum LoadResult {
Loaded(Library),
}

struct CrateDump<'a>(&'a CStore);

impl<'a> std::fmt::Debug for CrateDump<'a> {
impl std::fmt::Debug for CStore {
fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
writeln!(fmt, "resolved crates:")?;
for (cnum, data) in self.0.iter_crate_data() {
for (cnum, data) in self.iter_crate_data() {
writeln!(fmt, " name: {}", data.name())?;
writeln!(fmt, " cnum: {cnum}")?;
writeln!(fmt, " hash: {}", data.hash())?;
Expand Down Expand Up @@ -1288,7 +1280,7 @@ impl CStore {
self.report_unused_deps_in_crate(tcx, krate);
self.report_future_incompatible_deps(tcx, krate);

info!("{:?}", CrateDump(self));
info!("{:?}", self);
}

/// Process an `extern crate foo` AST node.
Expand Down
23 changes: 9 additions & 14 deletions compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,7 @@ where
goal: Goal<Self::Interner, <Self::Interner as Interner>::Predicate>,
) -> bool {
self.probe(|| {
EvalCtxt::enter_root(self, self.cx().recursion_limit(), I::Span::dummy(), |ecx| {
ecx.evaluate_goal(GoalSource::Misc, goal, None)
})
.is_ok_and(|r| match r.certainty {
self.evaluate_root_goal(goal, I::Span::dummy(), None).is_ok_and(|r| match r.certainty {
Certainty::Yes => true,
Certainty::Maybe(MaybeInfo {
cause: _,
Expand Down Expand Up @@ -359,12 +356,11 @@ fn maybe_evaluate_root_goal_with_higher_recursion_limit<D, I>(
EvalCtxt::enter_root(delegate, delegate.cx().recursion_limit() * 2, span, |ecx| {
ecx.evaluate_goal_no_fast_paths(GoalSource::Misc, goal)
});
if let Ok(goal_evaluation) = &rerun_result
&& !goal_evaluation.certainty.is_overflow()
{
Ok(rerun_result)
} else {

if rerun_result.as_ref().is_ok_and(|evaluation| evaluation.certainty.is_overflow()) {
Err(())
} else {
Ok(rerun_result)
}
});
if let Ok(rerun_result) = rerun_result {
Expand Down Expand Up @@ -408,12 +404,11 @@ fn maybe_evaluate_root_goal_for_proof_tree_with_higher_recursion_limit<D, I>(
span,
delegate.cx().recursion_limit() * 2,
);
if let Ok(response) = &new_goal_evaluation.result
&& !response.value.certainty.is_overflow()
{
Ok((new_result, new_goal_evaluation))
} else {

if new_goal_evaluation.result.is_ok_and(|response| response.value.certainty.is_overflow()) {
Err(())
} else {
Ok((new_result, new_goal_evaluation))
}
});
if let Ok(rerun_result) = rerun_result {
Expand Down
21 changes: 21 additions & 0 deletions compiler/rustc_parse/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,27 @@ pub(crate) struct ArrayBracketsInsteadOfBracesSugg {
pub right: Span,
}

#[derive(Diagnostic)]
#[diag("attributes are not allowed inside imports")]
pub(crate) struct AttrInUseTree {
#[primary_span]
pub attr_span: Span,
#[subdiagnostic]
pub sub: Option<AttrInUseTreeSugg>,
}

#[derive(Subdiagnostic)]
#[multipart_suggestion("move the import to its own item", style = "verbose")]
pub(crate) struct AttrInUseTreeSugg {
#[suggestion_part(code = "{code}")]
pub use_lo: Span,
#[suggestion_part(code = "")]
pub attr_span: Span,
#[suggestion_part(code = "")]
pub tree_span: Span,
pub code: String,
}

#[derive(Diagnostic)]
#[diag("`match` arm body without braces")]
pub(crate) struct MatchArmBodyWithoutBraces {
Expand Down
14 changes: 9 additions & 5 deletions compiler/rustc_parse/src/parser/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,15 @@ impl<'a> Parser<'a> {
/// Parses an inner part of an attribute (the path and following tokens).
/// The tokens must be either a delimited token stream, or empty token stream,
/// or the "legacy" key-value form.
/// PATH `(` TOKEN_STREAM `)`
/// PATH `[` TOKEN_STREAM `]`
/// PATH `{` TOKEN_STREAM `}`
/// PATH
/// PATH `=` UNSUFFIXED_LIT
///
/// ```text
/// PATH `(` TOKEN_STREAM `)`
/// PATH `[` TOKEN_STREAM `]`
/// PATH `{` TOKEN_STREAM `}`
/// PATH
/// PATH `=` UNSUFFIXED_LIT
/// ```
///
/// The delimiters or `=` are still put into the resulting token stream.
pub fn parse_attr_item(
&mut self,
Expand Down
Loading
Loading