Skip to content
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

Rollup of 8 pull requests #128739

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
644550f
Improve panic message and surrounding documentation for Ord violations
Voultapher Jul 27, 2024
00ce238
Improve panic sections for sort*, sort_unstable* and select_nth_unsta…
Voultapher Jul 27, 2024
d495b84
PinCoerceUnsized trait into core
dingxiangfei2009 May 12, 2024
afc404f
Apply review comments
Voultapher Jul 31, 2024
eae7a18
Hide internal sort module
Voultapher Aug 1, 2024
c2c46e3
Forbid unsafe_op_in_unsafe_fn in vxworks specific os and sys files
Aug 3, 2024
613155c
Apply review comments to PartialOrd section
Voultapher Aug 3, 2024
c369c20
Add a triagebot mention for `library/Cargo.lock`
tgross35 Aug 5, 2024
4af77df
implement BufReader::peek
lolbinarycat Jul 30, 2024
c8d50ef
Windows: Test if `\\.\NUL` works as an input file
ChrisDenton Aug 5, 2024
c6d9482
Don't ICE if getting the input's file_stem fails
ChrisDenton Aug 5, 2024
3fd645e
Check staticlib name falls back to `rust_out`
ChrisDenton Aug 5, 2024
fdb64b9
tests: add regression test to make sure `cfg_attr` isn't considered u…
jieyouxu Aug 6, 2024
97cbc20
check_attr: treat cfg_attr like cfg
jieyouxu Aug 6, 2024
522af10
interpret: refactor function call handling to be better-abstracted
RalfJung Aug 5, 2024
5783e73
make some Frame fields more private
RalfJung Aug 5, 2024
1c2705c
various cleanups based on review
RalfJung Aug 6, 2024
3af2dc9
Rollup merge of #125048 - dingxiangfei2009:stable-deref, r=amanieu
matthiaskrgr Aug 6, 2024
20b7b7e
Rollup merge of #128273 - Voultapher:improve-ord-violation-help, r=wo…
matthiaskrgr Aug 6, 2024
96cc747
Rollup merge of #128406 - lolbinarycat:bufreader_peek, r=Mark-Simulacrum
matthiaskrgr Aug 6, 2024
90ba285
Rollup merge of #128539 - biabbas:deny_unsafe, r=workingjubilee
matthiaskrgr Aug 6, 2024
6199460
Rollup merge of #128687 - RalfJung:interpret-call-refactor, r=WaffleL…
matthiaskrgr Aug 6, 2024
bcba481
Rollup merge of #128692 - tgross35:update-triagebot, r=Mark-Simulacrum
matthiaskrgr Aug 6, 2024
6c2a2e6
Rollup merge of #128710 - ChrisDenton:null, r=jieyouxu
matthiaskrgr Aug 6, 2024
38c2e62
Rollup merge of #128718 - jieyouxu:check-cfg_attr, r=nnethercote
matthiaskrgr Aug 6, 2024
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
4 changes: 3 additions & 1 deletion compiler/rustc_const_eval/src/const_eval/eval_queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ fn eval_body_using_ecx<'tcx, R: InterpretationResult<'tcx>>(
cid.promoted.map_or_else(String::new, |p| format!("::{p:?}"))
);

ecx.push_stack_frame(
// This can't use `init_stack_frame` since `body` is not a function,
// so computing its ABI would fail. It's also not worth it since there are no arguments to pass.
ecx.push_stack_frame_raw(
cid.instance,
body,
&ret.clone().into(),
Expand Down
17 changes: 8 additions & 9 deletions compiler/rustc_const_eval/src/const_eval/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ use crate::errors::{LongRunning, LongRunningWarn};
use crate::fluent_generated as fluent;
use crate::interpret::{
self, compile_time_machine, err_ub, throw_exhaust, throw_inval, throw_ub_custom, throw_unsup,
throw_unsup_format, AllocId, AllocRange, ConstAllocation, CtfeProvenance, FnArg, FnVal, Frame,
throw_unsup_format, AllocId, AllocRange, ConstAllocation, CtfeProvenance, FnArg, Frame,
GlobalAlloc, ImmTy, InterpCx, InterpResult, MPlaceTy, OpTy, Pointer, PointerArithmetic, Scalar,
StackPopCleanup,
};

/// When hitting this many interpreted terminators we emit a deny by default lint
Expand Down Expand Up @@ -306,17 +307,15 @@ impl<'tcx> CompileTimeInterpCx<'tcx> {
let align = ImmTy::from_uint(target_align, args[1].layout).into();
let fn_abi = self.fn_abi_of_instance(instance, ty::List::empty())?;

// We replace the entire function call with a "tail call".
// Note that this happens before the frame of the original function
// is pushed on the stack.
self.eval_fn_call(
FnVal::Instance(instance),
(CallAbi::Rust, fn_abi),
// Push the stack frame with our own adjusted arguments.
self.init_stack_frame(
instance,
self.load_mir(instance.def, None)?,
fn_abi,
&[FnArg::Copy(addr), FnArg::Copy(align)],
/* with_caller_location = */ false,
dest,
ret,
mir::UnwindAction::Unreachable,
StackPopCleanup::Goto { ret, unwind: mir::UnwindAction::Unreachable },
)?;
Ok(ControlFlow::Break(()))
} else {
Expand Down
Loading
Loading