Skip to content

Rollup of 8 pull requests #142080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 48 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
11c1522
Enable `__powitf2` on MSVC
beetrees May 21, 2025
7966f1b
fixed typo in readme
Lorl0rd May 10, 2025
db21837
libm: Clean up unused files
tgross35 Apr 22, 2025
4c264c9
Update `CmpResult` to use a pointer-sized return type
tgross35 May 23, 2025
c04f133
Typo in README.md
D-Dario0 May 28, 2025
5978b8b
aarch64: Add a note saying why we use `frintx` rather than `frintn`
tgross35 May 28, 2025
2c9fb22
jsondoclint: Extract `Command`/`CommandKind` into its own file
aDotInTheVoid May 28, 2025
851aa05
cleanup: Reuse `MinInt` and `Int` from `libm` in `compiler-builtins`
tgross35 Apr 21, 2025
877feef
Reuse `libm`'s `Caat` and `CastFrom` in `compiler-builtins`
tgross35 May 29, 2025
97c0beb
Remove unneeded C symbols
tgross35 May 28, 2025
a63f482
Replace the `nm` symbol check with a Rust implementation
tgross35 Apr 19, 2025
8db9bd6
Remove the now-unneeded llvm-tools-preview
tgross35 May 28, 2025
151b1cb
Change `compiler-builtins` to edition 2024
tgross35 May 29, 2025
af16553
symcheck: Print the command to make reproducing errors easier
tgross35 May 29, 2025
7db8cf1
Add benchmarks for float parsing and printing
tgross35 May 29, 2025
c136fb7
Run `builtins-test-intrinsics` when possible
tgross35 Mar 19, 2025
3464b4b
ci: Allow concurrency outside of pull requests
tgross35 May 29, 2025
9f84e99
Increase the benchmark rustc version to 2025-05-28
tgross35 May 29, 2025
8edaa6e
libm-test: Make `extensive` an attribute rather than a test type
tgross35 May 29, 2025
4d325e8
ci: Allow for multiple icount benchmarks in the same run
tgross35 May 29, 2025
14db1b5
jsondocck: command -> directive
aDotInTheVoid May 28, 2025
3c35505
chore: release
github-actions[bot] May 29, 2025
c6df6a7
Fix new `dead_code` warnings from recent nightlies
tgross35 Jun 1, 2025
0a7e592
Upgrade all dependencies to the latest available version
tgross35 Jun 1, 2025
e83ca86
cleanup: Use `x.biteq(y)` rather than `x.to_bits() == y.to_bits()`
tgross35 Jun 2, 2025
ba7cdb6
ci: Refactor benchmark regression checks
tgross35 Jun 1, 2025
5778643
libm-test: Fix unintentional skips in `binop_common`
tgross35 Jun 2, 2025
763663a
rustdoc-json-type: Depend on `serde` and `serde_derive` seperately
aDotInTheVoid Jun 3, 2025
28231d9
Replace some `Option<Span>` with `Span` and use DUMMY_SP instead of None
oli-obk Jun 4, 2025
9091a94
bootstrap: Fix file permissions when dereferencing symlinks
smpdt Jun 4, 2025
06ab34e
cleaned up some tests
Kivooeo Jun 3, 2025
6417248
Report the actual item that evaluation failed for
oli-obk Jun 4, 2025
55f59fb
Fix parsing of frontmatters with inner hyphens
matthewjasper Jun 4, 2025
e1e3cc2
Replace the musl submodule with a download script
tgross35 Jun 4, 2025
f67ca0f
Add an empty rust-version file
tgross35 May 28, 2025
3353a89
Add tooling for `josh` syncs
tgross35 May 18, 2025
eb45e57
Update the upstream Rust version
tgross35 Jun 4, 2025
1599091
Merge ref 'df8102fe5f24:/library/compiler-builtins' from https://gith…
tgross35 Jun 4, 2025
ab453db
`panic-handler`: Remove the `no_core` feature
tgross35 Jun 4, 2025
91ad4bf
jsondocck: Explain what `KNOWN_DIRECTIVE_NAMES` is doing
aDotInTheVoid Jun 5, 2025
bee6dc4
Rollup merge of #141709 - aDotInTheVoid:split-for-docs, r=GuillaumeGomez
matthiaskrgr Jun 5, 2025
5a4abf0
Rollup merge of #141974 - Kivooeo:tf4, r=jieyouxu
matthiaskrgr Jun 5, 2025
1dcd4a7
Rollup merge of #141989 - aDotInTheVoid:sin-sooner, r=GuillaumeGomez
matthiaskrgr Jun 5, 2025
276506e
Rollup merge of #142012 - oli-obk:no-optional-spans, r=fee1-dead
matthiaskrgr Jun 5, 2025
8689de4
Rollup merge of #142015 - oli-obk:wrong-instance, r=RalfJung
matthiaskrgr Jun 5, 2025
64f4bd5
Rollup merge of #142026 - smpdt:master, r=Kobzol
matthiaskrgr Jun 5, 2025
5604376
Rollup merge of #142032 - matthewjasper:frontmatter-lexing, r=fee1-dead
matthiaskrgr Jun 5, 2025
eef9831
Rollup merge of #142036 - tgross35:update-builtins, r=tgross35
matthiaskrgr Jun 5, 2025
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: 1 addition & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4673,6 +4673,7 @@ dependencies = [
"bincode",
"rustc-hash 2.1.1",
"serde",
"serde_derive",
"serde_json",
]

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
span: Span,
args: Option<&'hir hir::GenericArgs<'hir>>,
) -> &'hir hir::Path<'hir> {
let def_id = self.tcx.require_lang_item(lang_item, Some(span));
let def_id = self.tcx.require_lang_item(lang_item, span);
let def_kind = self.tcx.def_kind(def_id);
let res = Res::Def(def_kind, def_id);
self.arena.alloc(hir::Path {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
// something that already has `Fn`-like bounds (or is a closure), so we can't
// restrict anyways.
} else {
let copy_did = self.infcx.tcx.require_lang_item(LangItem::Copy, Some(span));
let copy_did = self.infcx.tcx.require_lang_item(LangItem::Copy, span);
self.suggest_adding_bounds(&mut err, ty, copy_did, span);
}

Expand Down Expand Up @@ -1915,7 +1915,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {

let local_ty = self.body.local_decls[place.local].ty;
let typeck_results = tcx.typeck(self.mir_def_id());
let clone = tcx.require_lang_item(LangItem::Clone, Some(body.span));
let clone = tcx.require_lang_item(LangItem::Clone, body.span);
for expr in expr_finder.clones {
if let hir::ExprKind::MethodCall(_, rcvr, _, span) = expr.kind
&& let Some(rcvr_ty) = typeck_results.node_type_opt(rcvr.hir_id)
Expand Down
22 changes: 8 additions & 14 deletions compiler/rustc_borrowck/src/type_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
if !self.unsized_feature_enabled() {
let trait_ref = ty::TraitRef::new(
tcx,
tcx.require_lang_item(LangItem::Sized, Some(self.last_span)),
tcx.require_lang_item(LangItem::Sized, self.last_span),
[place_ty],
);
self.prove_trait_ref(
Expand Down Expand Up @@ -1010,7 +1010,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
let ty = place.ty(self.body, tcx).ty;
let trait_ref = ty::TraitRef::new(
tcx,
tcx.require_lang_item(LangItem::Copy, Some(span)),
tcx.require_lang_item(LangItem::Copy, span),
[ty],
);

Expand All @@ -1025,11 +1025,8 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
}

&Rvalue::NullaryOp(NullOp::SizeOf | NullOp::AlignOf, ty) => {
let trait_ref = ty::TraitRef::new(
tcx,
tcx.require_lang_item(LangItem::Sized, Some(span)),
[ty],
);
let trait_ref =
ty::TraitRef::new(tcx, tcx.require_lang_item(LangItem::Sized, span), [ty]);

self.prove_trait_ref(
trait_ref,
Expand All @@ -1041,11 +1038,8 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
&Rvalue::NullaryOp(NullOp::UbChecks, _) => {}

Rvalue::ShallowInitBox(_operand, ty) => {
let trait_ref = ty::TraitRef::new(
tcx,
tcx.require_lang_item(LangItem::Sized, Some(span)),
[*ty],
);
let trait_ref =
ty::TraitRef::new(tcx, tcx.require_lang_item(LangItem::Sized, span), [*ty]);

self.prove_trait_ref(
trait_ref,
Expand Down Expand Up @@ -1222,7 +1216,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
let &ty = ty;
let trait_ref = ty::TraitRef::new(
tcx,
tcx.require_lang_item(LangItem::CoerceUnsized, Some(span)),
tcx.require_lang_item(LangItem::CoerceUnsized, span),
[op.ty(self.body, tcx), ty],
);

Expand Down Expand Up @@ -1811,7 +1805,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
if let PlaceContext::NonMutatingUse(NonMutatingUseContext::Copy) = context {
let trait_ref = ty::TraitRef::new(
tcx,
tcx.require_lang_item(LangItem::Copy, Some(self.last_span)),
tcx.require_lang_item(LangItem::Copy, self.last_span),
[place_ty.ty],
);

Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_borrowck/src/universal_regions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,10 +544,10 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
// (as it's created inside the body itself, not passed in from outside).
if let DefiningTy::FnDef(def_id, _) = defining_ty {
if self.infcx.tcx.fn_sig(def_id).skip_binder().c_variadic() {
let va_list_did = self.infcx.tcx.require_lang_item(
LangItem::VaList,
Some(self.infcx.tcx.def_span(self.mir_def)),
);
let va_list_did = self
.infcx
.tcx
.require_lang_item(LangItem::VaList, self.infcx.tcx.def_span(self.mir_def));

let reg_vid = self
.infcx
Expand Down
16 changes: 8 additions & 8 deletions compiler/rustc_codegen_cranelift/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
rustc_hir::LangItem::PanicBoundsCheck,
&[index, len, location],
*unwind,
Some(source_info.span),
source_info.span,
);
}
AssertKind::MisalignedPointerDereference { ref required, ref found } => {
Expand All @@ -393,7 +393,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
rustc_hir::LangItem::PanicMisalignedPointerDereference,
&[required, found, location],
*unwind,
Some(source_info.span),
source_info.span,
);
}
AssertKind::NullPointerDereference => {
Expand All @@ -404,7 +404,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
rustc_hir::LangItem::PanicNullPointerDereference,
&[location],
*unwind,
Some(source_info.span),
source_info.span,
)
}
_ => {
Expand All @@ -415,7 +415,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
msg.panic_function(),
&[location],
*unwind,
Some(source_info.span),
source_info.span,
);
}
}
Expand Down Expand Up @@ -531,7 +531,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
);
}
TerminatorKind::UnwindTerminate(reason) => {
codegen_unwind_terminate(fx, Some(source_info.span), *reason);
codegen_unwind_terminate(fx, source_info.span, *reason);
}
TerminatorKind::UnwindResume => {
// FIXME implement unwinding
Expand Down Expand Up @@ -1074,7 +1074,7 @@ pub(crate) fn codegen_operand<'tcx>(
pub(crate) fn codegen_panic_nounwind<'tcx>(
fx: &mut FunctionCx<'_, '_, 'tcx>,
msg_str: &str,
span: Option<Span>,
span: Span,
) {
let msg_ptr = fx.anonymous_str(msg_str);
let msg_len = fx.bcx.ins().iconst(fx.pointer_type, i64::try_from(msg_str.len()).unwrap());
Expand All @@ -1091,7 +1091,7 @@ pub(crate) fn codegen_panic_nounwind<'tcx>(

pub(crate) fn codegen_unwind_terminate<'tcx>(
fx: &mut FunctionCx<'_, '_, 'tcx>,
span: Option<Span>,
span: Span,
reason: UnwindTerminateReason,
) {
codegen_panic_inner(fx, reason.lang_item(), &[], UnwindAction::Unreachable, span);
Expand All @@ -1102,7 +1102,7 @@ fn codegen_panic_inner<'tcx>(
lang_item: rustc_hir::LangItem,
args: &[Value],
_unwind: UnwindAction,
span: Option<Span>,
span: Span,
) {
fx.bcx.set_cold_block(fx.bcx.current_block().unwrap());

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/src/intrinsics/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub(crate) fn codegen_llvm_intrinsic_call<'tcx>(
See https://github.com/rust-lang/rustc_codegen_cranelift/issues/171\n\
Please open an issue at https://github.com/rust-lang/rustc_codegen_cranelift/issues"
);
crate::base::codegen_panic_nounwind(fx, &msg, None);
crate::base::codegen_panic_nounwind(fx, &msg, span);
return;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ pub(super) fn codegen_aarch64_llvm_intrinsic_call<'tcx>(
See https://github.com/rust-lang/rustc_codegen_cranelift/issues/171\n\
Please open an issue at https://github.com/rust-lang/rustc_codegen_cranelift/issues"
);
crate::base::codegen_panic_nounwind(fx, &msg, None);
crate::base::codegen_panic_nounwind(fx, &msg, fx.mir.span);
return;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,7 @@ pub(super) fn codegen_x86_llvm_intrinsic_call<'tcx>(
See https://github.com/rust-lang/rustc_codegen_cranelift/issues/171\n\
Please open an issue at https://github.com/rust-lang/rustc_codegen_cranelift/issues"
);
crate::base::codegen_panic_nounwind(fx, &msg, None);
crate::base::codegen_panic_nounwind(fx, &msg, span);
return;
}
}
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
}
})
});
crate::base::codegen_panic_nounwind(fx, &msg_str, Some(source_info.span));
crate::base::codegen_panic_nounwind(fx, &msg_str, source_info.span);
return Ok(());
}
}
Expand Down Expand Up @@ -884,7 +884,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
crate::base::codegen_panic_nounwind(
fx,
"128bit atomics not yet supported",
None,
source_info.span,
);
return Ok(());
} else {
Expand Down Expand Up @@ -919,7 +919,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
crate::base::codegen_panic_nounwind(
fx,
"128bit atomics not yet supported",
None,
source_info.span,
);
return Ok(());
} else {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_cranelift/src/main_shim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pub(crate) fn maybe_create_entry_wrapper(
let call_inst = bcx.ins().call(main_func_ref, &[]);
let call_results = bcx.func.dfg.inst_results(call_inst).to_owned();

let termination_trait = tcx.require_lang_item(LangItem::Termination, None);
let termination_trait = tcx.require_lang_item(LangItem::Termination, DUMMY_SP);
let report = tcx
.associated_items(termination_trait)
.find_by_ident_and_kind(
Expand Down Expand Up @@ -136,7 +136,7 @@ pub(crate) fn maybe_create_entry_wrapper(
}
} else {
// Regular main fn invoked via start lang item.
let start_def_id = tcx.require_lang_item(LangItem::Start, None);
let start_def_id = tcx.require_lang_item(LangItem::Start, DUMMY_SP);
let start_instance = Instance::expect_resolve(
tcx,
ty::TypingEnv::fully_monomorphized(),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/src/num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fn codegen_three_way_compare<'tcx>(
let gt = fx.bcx.ins().icmp(gt_cc, lhs, rhs);
let lt = fx.bcx.ins().icmp(lt_cc, lhs, rhs);
let val = fx.bcx.ins().isub(gt, lt);
CValue::by_val(val, fx.layout_of(fx.tcx.ty_ordering_enum(Some(fx.mir.span))))
CValue::by_val(val, fx.layout_of(fx.tcx.ty_ordering_enum(fx.mir.span)))
}

fn codegen_compare_bin_op<'tcx>(
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/src/unsize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ pub(crate) fn size_and_align_of<'tcx>(
})
});

codegen_panic_nounwind(fx, &msg_str, None);
codegen_panic_nounwind(fx, &msg_str, fx.mir.span);

fx.bcx.switch_to_block(next_block);

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ pub fn maybe_create_entry_wrapper<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(

let EntryFnType::Main { sigpipe } = entry_type;
let (start_fn, start_ty, args, instance) = {
let start_def_id = cx.tcx().require_lang_item(LangItem::Start, None);
let start_def_id = cx.tcx().require_lang_item(LangItem::Start, DUMMY_SP);
let start_instance = ty::Instance::expect_resolve(
cx.tcx(),
cx.typing_env(),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ mod temp_stable_hash_impls {

pub(crate) fn build_langcall<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
bx: &Bx,
span: Option<Span>,
span: Span,
li: LangItem,
) -> (Bx::FnAbiOfResult, Bx::Value, Instance<'tcx>) {
let tcx = bx.tcx();
Expand Down
9 changes: 5 additions & 4 deletions compiler/rustc_codegen_ssa/src/mir/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
}
};

let (fn_abi, llfn, instance) = common::build_langcall(bx, Some(span), lang_item);
let (fn_abi, llfn, instance) = common::build_langcall(bx, span, lang_item);

// Codegen the actual panic invoke/call.
let merging_succ =
Expand All @@ -803,7 +803,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
self.set_debug_loc(bx, terminator.source_info);

// Obtain the panic entry point.
let (fn_abi, llfn, instance) = common::build_langcall(bx, Some(span), reason.lang_item());
let (fn_abi, llfn, instance) = common::build_langcall(bx, span, reason.lang_item());

// Codegen the actual panic invoke/call.
let merging_succ = helper.do_call(
Expand Down Expand Up @@ -871,7 +871,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {

// Obtain the panic entry point.
let (fn_abi, llfn, instance) =
common::build_langcall(bx, Some(source_info.span), LangItem::PanicNounwind);
common::build_langcall(bx, source_info.span, LangItem::PanicNounwind);

// Codegen the actual panic invoke/call.
Some(helper.do_call(
Expand Down Expand Up @@ -1830,7 +1830,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {

self.set_debug_loc(&mut bx, mir::SourceInfo::outermost(self.mir.span));

let (fn_abi, fn_ptr, instance) = common::build_langcall(&bx, None, reason.lang_item());
let (fn_abi, fn_ptr, instance) =
common::build_langcall(&bx, self.mir.span, reason.lang_item());
if is_call_from_compiler_builtins_to_upstream_monomorphization(bx.tcx(), instance) {
bx.abort();
} else {
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_codegen_ssa/src/size_of_val.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use rustc_hir::LangItem;
use rustc_middle::bug;
use rustc_middle::ty::print::{with_no_trimmed_paths, with_no_visible_paths};
use rustc_middle::ty::{self, Ty};
use rustc_span::DUMMY_SP;
use tracing::{debug, trace};

use crate::common::IntPredicate;
Expand Down Expand Up @@ -62,7 +63,7 @@ pub fn size_and_align_of_dst<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(

// Obtain the panic entry point.
let (fn_abi, llfn, _instance) =
common::build_langcall(bx, None, LangItem::PanicNounwind);
common::build_langcall(bx, DUMMY_SP, LangItem::PanicNounwind);

// Generate the call. Cannot use `do_call` since we don't have a MIR terminator so we
// can't create a `TerminationCodegenHelper`. (But we are in good company, this code is
Expand Down
6 changes: 1 addition & 5 deletions compiler/rustc_const_eval/src/check_consts/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,7 @@ fn build_error_for_const_call<'tcx>(
non_or_conditionally,
});

note_trait_if_possible(
&mut err,
self_ty,
tcx.require_lang_item(LangItem::Deref, Some(span)),
);
note_trait_if_possible(&mut err, self_ty, tcx.require_lang_item(LangItem::Deref, span));
err
}
_ if tcx.opt_parent(callee) == tcx.get_diagnostic_item(sym::FmtArgumentsNew) => {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_const_eval/src/check_consts/qualifs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl Qualif for HasMutInterior {
// requires borrowck, which in turn will invoke mir_const_qualifs again, causing a cycle error.
// Instead we invoke an obligation context manually, and provide the opaque type inference settings
// that allow the trait solver to just error out instead of cycling.
let freeze_def_id = cx.tcx.require_lang_item(LangItem::Freeze, Some(cx.body.span));
let freeze_def_id = cx.tcx.require_lang_item(LangItem::Freeze, cx.body.span);
// FIXME(#132279): Once we've got a typing mode which reveals opaque types using the HIR
// typeck results without causing query cycles, we should use this here instead of defining
// opaque types.
Expand Down Expand Up @@ -180,7 +180,7 @@ impl Qualif for NeedsNonConstDrop {
// that the components of this type are also `~const Destruct`. This
// amounts to verifying that there are no values in this ADT that may have
// a non-const drop.
let destruct_def_id = cx.tcx.require_lang_item(LangItem::Destruct, Some(cx.body.span));
let destruct_def_id = cx.tcx.require_lang_item(LangItem::Destruct, cx.body.span);
let (infcx, param_env) = cx.tcx.infer_ctxt().build_with_typing_env(cx.typing_env);
let ocx = ObligationCtxt::new(&infcx);
ocx.register_obligation(Obligation::new(
Expand Down
5 changes: 3 additions & 2 deletions compiler/rustc_const_eval/src/const_eval/eval_queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,11 +454,12 @@ fn report_eval_error<'tcx>(
// FIXME(oli-obk): figure out how to use structured diagnostics again.
diag.code(E0080);
diag.span_label(span, crate::fluent_generated::const_eval_error);
diag.arg("instance", instance);
diag.arg("error_kind", kind);
for frame in frames {
diag.subdiagnostic(frame);
}
// Add after the frame rendering above, as it adds its own `instance` args.
diag.arg("instance", instance);
diag.arg("error_kind", kind);
},
)
}
Expand Down
Loading
Loading