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 12 pull requests #127475

Closed
wants to merge 44 commits into from
Closed
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
18c248b
Make `NEVER_TYPE_FALLBACK_FLOWING_INTO_UNSAFE` deny-by-default in e2024
WaffleLapkin Jun 23, 2024
7c76747
rustdoc: Remove OpaqueTy
aDotInTheVoid Jul 3, 2024
c147805
library: outline VaList into ffi::va_list
workingjubilee Jun 24, 2024
c1a29b3
core: erase redundant stability attrs in va_list
workingjubilee Jun 24, 2024
7566f41
Run alloc sync tests
ChrisDenton Jul 5, 2024
8c2ea71
Use field ident spans directly instead of the full field span in diag…
oli-obk Jul 6, 2024
c990e00
Add support for literals
c410-f3r Jul 6, 2024
58aad3c
iter_identity is a better name
compiler-errors Jul 6, 2024
39bb14e
Improve `run-make/output-type-permutations` code and improve `filenam…
GuillaumeGomez Jul 7, 2024
4f54193
Fix intrinsic const parameter counting with `effects`
fee1-dead Jul 7, 2024
8e7314f
rustdoc-json: add trait/type alias tests
its-the-shrimp Jul 7, 2024
b2e30bd
Add fundamental to trait def
compiler-errors Jul 6, 2024
a982471
Uplift trait_ref_is_knowable and friends
compiler-errors Jul 6, 2024
ab27c2f
Get rid of trait_ref_is_knowable from delegate
compiler-errors Jul 6, 2024
484152d
Support tail calls in mir via `TerminatorKind::TailCall`
WaffleLapkin Feb 15, 2024
4187cdc
Properly handle drops for tail calls
beepster4096 Jun 14, 2023
3b5a5ee
Support tail calls in the interpreter
WaffleLapkin Jun 28, 2023
45c7031
Refactor common part of evaluating `Call`&`TailCall` in the interpreter
WaffleLapkin Jun 30, 2023
5f4caae
Fix unconditional recursion lint wrt tail calls
WaffleLapkin Jul 18, 2023
30b18d7
Add support for `mir::TerminatorKind::TailCall` in clippy
WaffleLapkin May 9, 2023
90423a7
Uplift elaboration
compiler-errors Jul 6, 2024
66eb346
Get rid of the redundant elaboration in middle
compiler-errors Jul 6, 2024
15d16f1
Finish uplifting supertraits
compiler-errors Jul 6, 2024
cda25e5
Refactor & fixup interpreter implementation of tail calls
WaffleLapkin Mar 15, 2024
6d4995f
add miri tests and a fixme
WaffleLapkin Jun 17, 2024
cda6f0c
doc fixups from review
WaffleLapkin Jun 17, 2024
2363520
make `StackPop` field names less confusing
WaffleLapkin Jun 17, 2024
dd5a447
Do renames proposed by review
WaffleLapkin Jun 17, 2024
54e11cf
add an assertion that machine hook doesn't return NoCleanup
WaffleLapkin Jul 7, 2024
7fd0c55
Fix conflicts after rebase
WaffleLapkin Jul 7, 2024
39eaefc
Fixup conflict with r-l/r/126567
WaffleLapkin Jul 7, 2024
14e5d5f
Fixup a typo in a comment in a test
WaffleLapkin Jul 7, 2024
fbc1120
Rollup merge of #113128 - WaffleLapkin:become_trully_unuwuable, r=oli…
jieyouxu Jul 8, 2024
49bcf82
Rollup merge of #126841 - c410-f3r:concat-again, r=petrochenkov
jieyouxu Jul 8, 2024
f345d50
Rollup merge of #126881 - WaffleLapkin:unsafe-code-affected-by-fallba…
jieyouxu Jul 8, 2024
f0608f9
Rollup merge of #126921 - workingjubilee:outline-va-list, r=Nilstrieb
jieyouxu Jul 8, 2024
6f753c8
Rollup merge of #127276 - aDotInTheVoid:no-opaque, r=camelid
jieyouxu Jul 8, 2024
c0765fb
Rollup merge of #127367 - ChrisDenton:run-sync, r=Nilstrieb
jieyouxu Jul 8, 2024
4ece021
Rollup merge of #127431 - oli-obk:feed_item_attrs, r=compiler-errors
jieyouxu Jul 8, 2024
88eca34
Rollup merge of #127437 - compiler-errors:uplift-trait-ref-is-knowabl…
jieyouxu Jul 8, 2024
dda162c
Rollup merge of #127439 - compiler-errors:uplift-elaborate, r=lcnr
jieyouxu Jul 8, 2024
1c83099
Rollup merge of #127451 - GuillaumeGomez:improve-output-type-permutat…
jieyouxu Jul 8, 2024
6a31edc
Rollup merge of #127452 - fee1-dead-contrib:fx-intrinsic-counting, r=…
jieyouxu Jul 8, 2024
d200683
Rollup merge of #127459 - its-the-shrimp:rustdocjson_add_alias_tests,…
jieyouxu Jul 8, 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
9 changes: 7 additions & 2 deletions compiler/rustc_borrowck/src/lib.rs
Original file line number Diff line number Diff line change
@@ -727,6 +727,12 @@ impl<'a, 'mir, 'tcx, R> rustc_mir_dataflow::ResultsVisitor<'mir, 'tcx, R>
}
self.mutate_place(loc, (*destination, span), Deep, flow_state);
}
TerminatorKind::TailCall { func, args, fn_span: _ } => {
self.consume_operand(loc, (func, span), flow_state);
for arg in args {
self.consume_operand(loc, (&arg.node, arg.span), flow_state);
}
}
TerminatorKind::Assert { cond, expected: _, msg, target: _, unwind: _ } => {
self.consume_operand(loc, (cond, span), flow_state);
if let AssertKind::BoundsCheck { len, index } = &**msg {
@@ -813,9 +819,8 @@ impl<'a, 'mir, 'tcx, R> rustc_mir_dataflow::ResultsVisitor<'mir, 'tcx, R>

TerminatorKind::UnwindResume
| TerminatorKind::Return
| TerminatorKind::TailCall { .. }
| TerminatorKind::CoroutineDrop => {
// Returning from the function implicitly kills storage for all locals and statics.
// Often, the storage will already have been killed by an explicit
// StorageDead, but we don't always emit those (notably on unwind paths),
// so this "extra check" serves as a kind of backup.
let borrow_set = self.borrow_set.clone();
6 changes: 6 additions & 0 deletions compiler/rustc_borrowck/src/polonius/loan_invalidations.rs
Original file line number Diff line number Diff line change
@@ -125,6 +125,12 @@ impl<'cx, 'tcx> Visitor<'tcx> for LoanInvalidationsGenerator<'cx, 'tcx> {
}
self.mutate_place(location, *destination, Deep);
}
TerminatorKind::TailCall { func, args, .. } => {
self.consume_operand(location, func);
for arg in args {
self.consume_operand(location, &arg.node);
}
}
TerminatorKind::Assert { cond, expected: _, msg, target: _, unwind: _ } => {
self.consume_operand(location, cond);
use rustc_middle::mir::AssertKind;
20 changes: 17 additions & 3 deletions compiler/rustc_borrowck/src/type_check/mod.rs
Original file line number Diff line number Diff line change
@@ -1352,7 +1352,14 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
}
// FIXME: check the values
}
TerminatorKind::Call { func, args, destination, call_source, target, .. } => {
TerminatorKind::Call { func, args, .. }
| TerminatorKind::TailCall { func, args, .. } => {
let call_source = match term.kind {
TerminatorKind::Call { call_source, .. } => call_source,
TerminatorKind::TailCall { .. } => CallSource::Normal,
_ => unreachable!(),
};

self.check_operand(func, term_location);
for arg in args {
self.check_operand(&arg.node, term_location);
@@ -1425,7 +1432,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
);
}

self.check_call_dest(body, term, &sig, *destination, *target, term_location);
if let TerminatorKind::Call { destination, target, .. } = term.kind {
self.check_call_dest(body, term, &sig, destination, target, term_location);
}

// The ordinary liveness rules will ensure that all
// regions in the type of the callee are live here. We
@@ -1443,7 +1452,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
.add_location(region_vid, term_location);
}

self.check_call_inputs(body, term, func, &sig, args, term_location, *call_source);
self.check_call_inputs(body, term, func, &sig, args, term_location, call_source);
}
TerminatorKind::Assert { cond, msg, .. } => {
self.check_operand(cond, term_location);
@@ -1675,6 +1684,11 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
span_mirbug!(self, block_data, "return on cleanup block")
}
}
TerminatorKind::TailCall { .. } => {
if is_cleanup {
span_mirbug!(self, block_data, "tailcall on cleanup block")
}
}
TerminatorKind::CoroutineDrop { .. } => {
if is_cleanup {
span_mirbug!(self, block_data, "coroutine_drop in cleanup block")
5 changes: 5 additions & 0 deletions compiler/rustc_codegen_cranelift/src/base.rs
Original file line number Diff line number Diff line change
@@ -491,6 +491,11 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
)
});
}
// FIXME(explicit_tail_calls): add support for tail calls to the cranelift backend, once cranelift supports tail calls
TerminatorKind::TailCall { fn_span, .. } => span_bug!(
*fn_span,
"tail calls are not yet supported in `rustc_codegen_cranelift` backend"
),
TerminatorKind::InlineAsm {
template,
operands,
1 change: 1 addition & 0 deletions compiler/rustc_codegen_cranelift/src/constant.rs
Original file line number Diff line number Diff line change
@@ -567,6 +567,7 @@ pub(crate) fn mir_operand_get_const_val<'tcx>(
{
return None;
}
TerminatorKind::TailCall { .. } => return None,
TerminatorKind::Call { .. } => {}
}
}
1 change: 1 addition & 0 deletions compiler/rustc_codegen_ssa/src/mir/analyze.rs
Original file line number Diff line number Diff line change
@@ -281,6 +281,7 @@ pub fn cleanup_kinds(mir: &mir::Body<'_>) -> IndexVec<mir::BasicBlock, CleanupKi
| TerminatorKind::UnwindResume
| TerminatorKind::UnwindTerminate(_)
| TerminatorKind::Return
| TerminatorKind::TailCall { .. }
| TerminatorKind::CoroutineDrop
| TerminatorKind::Unreachable
| TerminatorKind::SwitchInt { .. }
7 changes: 7 additions & 0 deletions compiler/rustc_codegen_ssa/src/mir/block.rs
Original file line number Diff line number Diff line change
@@ -1389,6 +1389,13 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
fn_span,
mergeable_succ(),
),
mir::TerminatorKind::TailCall { .. } => {
// FIXME(explicit_tail_calls): implement tail calls in ssa backend
span_bug!(
terminator.source_info.span,
"`TailCall` terminator is not yet supported by `rustc_codegen_ssa`"
)
}
mir::TerminatorKind::CoroutineDrop | mir::TerminatorKind::Yield { .. } => {
bug!("coroutine ops in codegen")
}
15 changes: 12 additions & 3 deletions compiler/rustc_const_eval/src/check_consts/check.rs
Original file line number Diff line number Diff line change
@@ -135,6 +135,8 @@ impl<'mir, 'tcx> Qualifs<'mir, 'tcx> {
ccx: &'mir ConstCx<'mir, 'tcx>,
tainted_by_errors: Option<ErrorGuaranteed>,
) -> ConstQualifs {
// FIXME(explicit_tail_calls): uhhhh I think we can return without return now, does it change anything

// Find the `Return` terminator if one exists.
//
// If no `Return` terminator exists, this MIR is divergent. Just return the conservative
@@ -711,7 +713,14 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
self.super_terminator(terminator, location);

match &terminator.kind {
TerminatorKind::Call { func, args, fn_span, call_source, .. } => {
TerminatorKind::Call { func, args, fn_span, .. }
| TerminatorKind::TailCall { func, args, fn_span, .. } => {
let call_source = match terminator.kind {
TerminatorKind::Call { call_source, .. } => call_source,
TerminatorKind::TailCall { .. } => CallSource::Normal,
_ => unreachable!(),
};

let ConstCx { tcx, body, param_env, .. } = *self.ccx;
let caller = self.def_id();

@@ -783,7 +792,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
callee,
args: fn_args,
span: *fn_span,
call_source: *call_source,
call_source,
feature: Some(if tcx.features().const_trait_impl {
sym::effects
} else {
@@ -830,7 +839,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
callee,
args: fn_args,
span: *fn_span,
call_source: *call_source,
call_source,
feature: None,
});
return;
Original file line number Diff line number Diff line change
@@ -108,6 +108,7 @@ impl<'tcx> Visitor<'tcx> for CheckLiveDrops<'_, 'tcx> {

mir::TerminatorKind::UnwindTerminate(_)
| mir::TerminatorKind::Call { .. }
| mir::TerminatorKind::TailCall { .. }
| mir::TerminatorKind::Assert { .. }
| mir::TerminatorKind::FalseEdge { .. }
| mir::TerminatorKind::FalseUnwind { .. }
Loading