diff options
| author | Tshepang Mbambo <hopsi@tuta.io> | 2025-09-24 07:01:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-24 07:01:24 +0200 |
| commit | c9dc0e307ac643518ecf98373f86be5f68a197a0 (patch) | |
| tree | 2fc74107521c9235d98d72c82deaa05007228373 | |
| parent | ae12bc21d8ec76bbb753d4da168e9b08e1b09ebf (diff) | |
| download | rust-c9dc0e307ac643518ecf98373f86be5f68a197a0.tar.gz rust-c9dc0e307ac643518ecf98373f86be5f68a197a0.zip | |
temporary-lifetime-extension-tuple-ctor.rs: make usable on all editions
Also - add Reference id - fix typo
| -rw-r--r-- | tests/ui/lifetimes/temporary-lifetime-extension-tuple-ctor.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/ui/lifetimes/temporary-lifetime-extension-tuple-ctor.rs b/tests/ui/lifetimes/temporary-lifetime-extension-tuple-ctor.rs index bb537f855a4..7de786dff3b 100644 --- a/tests/ui/lifetimes/temporary-lifetime-extension-tuple-ctor.rs +++ b/tests/ui/lifetimes/temporary-lifetime-extension-tuple-ctor.rs @@ -1,4 +1,4 @@ -//@ edition:2024 +//@ reference: destructors.scope.lifetime-extension.exprs fn temp() -> String { String::from("Hello") @@ -22,7 +22,7 @@ fn main() { let a = &temp(); let b = Some(&temp()); let c = Option::Some::<&String>(&temp()); - use Option::Some as S; + use std::option::Option::Some as S; let d = S(&temp()); let e = X(&temp()); let f = Some(Ok::<_, ()>(std::borrow::Cow::Borrowed(if true { @@ -31,6 +31,6 @@ fn main() { panic!() }))); let some = Some; // Turn the ctor into a regular function. - let g = some(&temp()); //~ERROR temporary value dropped while borrowe + let g = some(&temp()); //~ERROR temporary value dropped while borrowed println!("{a:?} {b:?} {c:?} {d:?} {e:?} {f:?} {g:?}"); } |
