Skip to content

Commit 91be1fb

Browse files
authored
Merge pull request #2805 from rust-lang/tshepang-patch-1
fix a sentence regarding early bounds
2 parents 9d494a8 + a1ba3f1 commit 91be1fb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/early-late-parameters.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ f(&String::new());
130130
f(&String::new());
131131
```
132132

133+
The lifetime parameter on `foo` being early bound requires all callers of `f` to provide a borrow with the same lifetime.
133134
In this example, we call `foo`'s function item type twice, each time with a borrow of a temporary.
134-
These two borrows could not possibly have lifetimes that overlap as the temporaries are only alive during the function call, not after.
135-
The lifetime parameter on `foo` being early bound requires all callers of `f` to provide a borrow with the same lifetime, as this is not possible the borrow checker errors.
135+
These two borrows could not possibly have lifetimes that overlap as the temporaries are only alive during the function call, not after, so we get a compilation error.
136136

137137
If the lifetime parameter on `foo` was late bound, this would be able to compile as each caller could provide a different lifetime argument for its borrow.
138138
See the following example, which demonstrates this using the `bar` function defined above:

0 commit comments

Comments
 (0)