Skip to content

Commit 0d9c014

Browse files
remove implied link bound per review
also update .stderr outputs
1 parent 24aab52 commit 0d9c014

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

compiler/rustc_error_codes/src/error_codes/E0311.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ type parameter `T` to outlive `'anon` because of the `T: 'a bound` in
2626
outlive `'anon` in `no_restriction()`.
2727

2828
If `no_restriction()` were to use `&T` instead of `&()` as an argument, the
29-
compiler would have added an implied bound [implied
30-
bound](https://rust-lang.github.io/rfcs/2089-implied-bounds.html), causing this
31-
to compile.
29+
compiler would have added an implied bound, causing this to compile.
3230

3331
This error can be resolved by explicitly naming the elided lifetime for `x` and
3432
then explicily requiring that the generic parameter `T` outlives that lifetime:

src/test/ui/error-codes/E0311.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ LL | with_restriction::<T>(x)
1616
| ^^^^^^^^^^^^^^^^^^^^^
1717
help: consider adding an explicit lifetime bound...
1818
|
19-
LL | fn no_restriction<T: 'a>(x: &()) -> &() {
20-
| ++++
19+
LL | fn no_restriction<'a, T: 'a>(x: &()) -> &() {
20+
| +++ ++++
2121

2222
error: aborting due to previous error
2323

src/test/ui/lifetimes/suggest-introducing-and-adding-missing-lifetime.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ LL | fn no_restriction<'a, T: 'a>(x: &()) -> &() {
2121

2222
error: aborting due to previous error
2323

24+
For more information about this error, try `rustc --explain E0311`.

0 commit comments

Comments
 (0)