@@ -169,6 +169,7 @@ only valid if `T: 'a` holds.
169169
170170Implied bounds are added for all parameters and outputs of functions. Inside of ` requires_t_outlives_a `
171171you can assume ` T: 'a ` to hold even if you don't explicitly specify this:
172+
172173``` rust
173174fn requires_t_outlives_a_not_implied <'a , T : 'a >() {}
174175
@@ -179,7 +180,7 @@ fn requires_t_outlives_a<'a, T>(x: &'a T) {
179180}
180181```
181182
182- ``` rust,compile_fail
183+ ``` rust,compile_fail,E0309
183184# fn requires_t_outlives_a_not_implied<'a, T: 'a>() {}
184185fn not_implied<'a, T>() {
185186 // This errors, because `T: 'a` is not implied by
@@ -190,14 +191,15 @@ fn not_implied<'a, T>() {
190191
191192Only lifetime bounds are implied, trait bounds still have to be explicitly added.
192193The following example therefore causes an error:
193- ``` rust,compile_fail
194+
195+ ``` rust,compile_fail,E0277
194196use std::fmt::Debug;
195197struct IsDebug<T: Debug>(T);
196198// error[E0277]: `T` doesn't implement `Debug`
197199fn doesnt_specify_t_debug<T>(x: IsDebug<T>) {}
198200```
199201
200- Lifetime bounds are also inferred for type definitions and impl blocks for any type
202+ Lifetime bounds are also inferred for type definitions and impl blocks for any type:
201203
202204``` rust
203205struct Struct <'a , T > {
0 commit comments