Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
74e85a2
removed gate
Kivooeo Aug 3, 2025
f6ce4ac
Anonymize binders in tail call sig
compiler-errors Aug 2, 2025
c7ea022
Enforce tail call type is related to body return type in borrowck
compiler-errors Aug 4, 2025
904e2af
Port `#[coroutine]` to the new attribute system
scrabsha Aug 1, 2025
a573fd9
Don't actually pass BB to check_call_dest
compiler-errors Aug 4, 2025
d09cf61
Added checks for attribute in type case
Kivooeo Jul 19, 2025
092c6f3
Gate const trait syntax
fmease Aug 5, 2025
ea2c080
we only merge candidates for trait and normalizes-to goals
lcnr Aug 5, 2025
34b358d
rustdoc: fix caching of intra-doc links on reexports
lolbinarycat Aug 5, 2025
d8e8a5e
add code example showing that file_prefix treats dotfiles as the name…
the8472 Aug 5, 2025
1bb14a8
`File::set_times`: Remove `write(true)` from the example so it works …
joshtriplett Aug 5, 2025
a99860b
`File::set_times`: Add documentation about setting directory timestamps
joshtriplett Aug 5, 2025
02ea38c
Fortify generic param default checks
fmease Aug 5, 2025
2909de5
simplifycfg: Mark as changed when start is modified in collapse goto …
dianqk Aug 6, 2025
d55cc9a
mir: Do not modify NonUse in `super_projection_elem`
dianqk Aug 6, 2025
057df26
Remove unneeded `stage` parameter when setting up stdlib Cargo
Kobzol Aug 6, 2025
768f977
Fix rustdoc scrape-examples feature crash
GuillaumeGomez Aug 6, 2025
a2b1714
Add regression test for rustdoc scrape-examples feature crash (#144752)
GuillaumeGomez Aug 6, 2025
e597071
Reword documentation for `set_times` to clarify directory handling
joshtriplett Aug 6, 2025
d180873
Rollup merge of #144195 - Kivooeo:bad-attr, r=fmease,compiler-errors
GuillaumeGomez Aug 6, 2025
96a41c5
Rollup merge of #144794 - scrabsha:push-noqrrttovmwy, r=jdonszelmann
GuillaumeGomez Aug 6, 2025
940a003
Rollup merge of #144835 - compiler-errors:tail-call-sig-binder, r=Waf…
GuillaumeGomez Aug 6, 2025
5209bc6
Rollup merge of #144861 - Kivooeo:payload-as-str-stabilization, r=Chr…
GuillaumeGomez Aug 6, 2025
65479f7
Rollup merge of #144917 - compiler-errors:tail-call-linked-lifetimes,…
GuillaumeGomez Aug 6, 2025
f752035
Rollup merge of #144948 - lcnr:change-candidate-handling, r=compiler-…
GuillaumeGomez Aug 6, 2025
48d5756
Rollup merge of #144956 - fmease:gate-const-trait-syntax, r=BoxyUwU
GuillaumeGomez Aug 6, 2025
de6c639
Rollup merge of #144970 - lolbinarycat:rustdoc-macro-wrong-link-14496…
GuillaumeGomez Aug 6, 2025
09de71b
Rollup merge of #144972 - the8472:file-prefix-docs, r=joshtriplett
GuillaumeGomez Aug 6, 2025
094b893
Rollup merge of #144975 - joshtriplett:file-times-dir, r=jhpratt
GuillaumeGomez Aug 6, 2025
12d1b17
Rollup merge of #144977 - fmease:fortify-param-default-checks, r=comp…
GuillaumeGomez Aug 6, 2025
e56c241
Rollup merge of #144996 - dianqk:simplifycfg-collapse_goto_chain-chan…
GuillaumeGomez Aug 6, 2025
c152aa8
Rollup merge of #144998 - dianqk:visit-no-use-proj, r=cjgillot
GuillaumeGomez Aug 6, 2025
c17f50b
Rollup merge of #145000 - Kobzol:std-cargo-stage, r=jieyouxu
GuillaumeGomez Aug 6, 2025
d369a1f
Rollup merge of #145008 - GuillaumeGomez:fix-rustdoc-scrape-examples-…
GuillaumeGomez Aug 6, 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
Prev Previous commit
Next Next commit
Enforce tail call type is related to body return type in borrowck
  • Loading branch information
compiler-errors committed Aug 4, 2025
commit c7ea022166d2b6d55c3f69bbf69a31b0d7b053e2
10 changes: 7 additions & 3 deletions compiler/rustc_borrowck/src/type_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -845,9 +845,13 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
);
}

if let TerminatorKind::Call { destination, target, .. } = term.kind {
self.check_call_dest(term, &sig, destination, target, term_location);
}
let (destination, target) =
if let TerminatorKind::Call { destination, target, .. } = term.kind {
(destination, target)
} else {
(RETURN_PLACE.into(), Some(BasicBlock::ZERO))
};
self.check_call_dest(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
Expand Down
16 changes: 16 additions & 0 deletions tests/ui/explicit-tail-calls/ret-ty-borrowck-constraints.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#![feature(explicit_tail_calls)]
#![expect(incomplete_features)]

fn link(x: &str) -> &'static str {
become passthrough(x);
//~^ ERROR lifetime may not live long enough
}

fn passthrough<T>(t: T) -> T { t }

fn main() {
let x = String::from("hello, world");
let s = link(&x);
drop(x);
println!("{s}");
}
10 changes: 10 additions & 0 deletions tests/ui/explicit-tail-calls/ret-ty-borrowck-constraints.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
error: lifetime may not live long enough
--> $DIR/ret-ty-borrowck-constraints.rs:5:5
|
LL | fn link(x: &str) -> &'static str {
| - let's call the lifetime of this reference `'1`
LL | become passthrough(x);
| ^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'static`

error: aborting due to 1 previous error