From ef24de24a82fe681581cc130f342363c47c0969a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 7 Jun 2024 07:48:48 +0200 Subject: Merging upstream version 1.75.0+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/borrowck/alias-liveness/rtn-static.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/ui/borrowck/alias-liveness/rtn-static.rs (limited to 'tests/ui/borrowck/alias-liveness/rtn-static.rs') diff --git a/tests/ui/borrowck/alias-liveness/rtn-static.rs b/tests/ui/borrowck/alias-liveness/rtn-static.rs new file mode 100644 index 000000000..1f136b8b9 --- /dev/null +++ b/tests/ui/borrowck/alias-liveness/rtn-static.rs @@ -0,0 +1,23 @@ +// check-pass + +#![feature(return_type_notation)] +//~^ WARN the feature `return_type_notation` is incomplete + +trait Foo { + fn borrow(&mut self) -> impl Sized + '_; +} + +fn live_past_borrow>(mut t: T) { + let x = t.borrow(); + drop(t); + drop(x); +} + +// Test that the `'_` item bound in `borrow` does not cause us to +// overlook the `'static` RTN bound. +fn overlapping_mut>(mut t: T) { + let x = t.borrow(); + let x = t.borrow(); +} + +fn main() {} -- cgit v1.2.3