Skip to content

Commit a0ed0f3

Browse files
committed
Add example for Lifetime Elision with two inputs
Lifetime elision with two input references is not clear. Closes #21284
1 parent 70b13a7 commit a0ed0f3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/doc/trpl/ownership.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,7 @@ fn substr<'a>(s: &'a str, until: u32) -> &'a str; // expanded
533533
fn get_str() -> &str; // ILLEGAL, no inputs
534534
535535
fn frob(s: &str, t: &str) -> &str; // ILLEGAL, two inputs
536+
fn frob<'a, 'b>(s: &'a str, t: &'b str) -> &str; // Expanded: Output lifetime is unclear
536537
537538
fn get_mut(&mut self) -> &mut T; // elided
538539
fn get_mut<'a>(&'a mut self) -> &'a mut T; // expanded

0 commit comments

Comments
 (0)