Skip to content

Commit 1eab815

Browse files
authored
Merge pull request #2224 from ehuss/rustdoc-boring
Update boring lines to sync with rustdoc
2 parents a0bc41f + 3ffcf60 commit 1eab815

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

src/early_late_parameters.md

+32-32
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ In this example we call `foo`'s function item type twice, each time with a borro
126126
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. See the following example which demonstrates this using the `bar` function defined above:
127127

128128
```rust
129-
#fn foo<'a: 'a>(b: &'a String) -> &'a String { b }
130-
#fn bar<'a>(b: &'a String) -> &'a String { b }
131-
129+
# fn foo<'a: 'a>(b: &'a String) -> &'a String { b }
130+
# fn bar<'a>(b: &'a String) -> &'a String { b }
131+
#
132132
// Early bound parameters are instantiated here, however as `'a` is
133133
// late bound it is not provided here.
134134
let b = bar;
@@ -220,24 +220,24 @@ Then, for the first case, we can call each function with a single lifetime argum
220220
```rust
221221
#![deny(late_bound_lifetime_arguments)]
222222

223-
#fn free_function<'a: 'a, 'b>(_: &'a (), _: &'b ()) {}
223+
# fn free_function<'a: 'a, 'b>(_: &'a (), _: &'b ()) {}
224224
#
225-
#struct Foo;
225+
# struct Foo;
226226
#
227-
#trait Trait: Sized {
228-
# fn trait_method<'a: 'a, 'b>(self, _: &'a (), _: &'b ());
229-
# fn trait_function<'a: 'a, 'b>(_: &'a (), _: &'b ());
230-
#}
227+
# trait Trait: Sized {
228+
# fn trait_method<'a: 'a, 'b>(self, _: &'a (), _: &'b ());
229+
# fn trait_function<'a: 'a, 'b>(_: &'a (), _: &'b ());
230+
# }
231231
#
232-
#impl Trait for Foo {
233-
# fn trait_method<'a: 'a, 'b>(self, _: &'a (), _: &'b ()) {}
234-
# fn trait_function<'a: 'a, 'b>(_: &'a (), _: &'b ()) {}
235-
#}
232+
# impl Trait for Foo {
233+
# fn trait_method<'a: 'a, 'b>(self, _: &'a (), _: &'b ()) {}
234+
# fn trait_function<'a: 'a, 'b>(_: &'a (), _: &'b ()) {}
235+
# }
236236
#
237-
#impl Foo {
238-
# fn inherent_method<'a: 'a, 'b>(self, _: &'a (), _: &'b ()) {}
239-
# fn inherent_function<'a: 'a, 'b>(_: &'a (), _: &'b ()) {}
240-
#}
237+
# impl Foo {
238+
# fn inherent_method<'a: 'a, 'b>(self, _: &'a (), _: &'b ()) {}
239+
# fn inherent_function<'a: 'a, 'b>(_: &'a (), _: &'b ()) {}
240+
# }
241241
#
242242
// Specifying as many arguments as there are early
243243
// bound parameters is always a future compat warning
@@ -251,24 +251,24 @@ free_function::<'static>(&(), &());
251251

252252
For the second case we call each function with more lifetime arguments than there are lifetime parameters (be it early or late bound) and note that method calls result in a FCW as opposed to the free/associated functions which result in a hard error:
253253
```rust
254-
#fn free_function<'a: 'a, 'b>(_: &'a (), _: &'b ()) {}
254+
# fn free_function<'a: 'a, 'b>(_: &'a (), _: &'b ()) {}
255255
#
256-
#struct Foo;
256+
# struct Foo;
257257
#
258-
#trait Trait: Sized {
259-
# fn trait_method<'a: 'a, 'b>(self, _: &'a (), _: &'b ());
260-
# fn trait_function<'a: 'a, 'b>(_: &'a (), _: &'b ());
261-
#}
258+
# trait Trait: Sized {
259+
# fn trait_method<'a: 'a, 'b>(self, _: &'a (), _: &'b ());
260+
# fn trait_function<'a: 'a, 'b>(_: &'a (), _: &'b ());
261+
# }
262262
#
263-
#impl Trait for Foo {
264-
# fn trait_method<'a: 'a, 'b>(self, _: &'a (), _: &'b ()) {}
265-
# fn trait_function<'a: 'a, 'b>(_: &'a (), _: &'b ()) {}
266-
#}
263+
# impl Trait for Foo {
264+
# fn trait_method<'a: 'a, 'b>(self, _: &'a (), _: &'b ()) {}
265+
# fn trait_function<'a: 'a, 'b>(_: &'a (), _: &'b ()) {}
266+
# }
267267
#
268-
#impl Foo {
269-
# fn inherent_method<'a: 'a, 'b>(self, _: &'a (), _: &'b ()) {}
270-
# fn inherent_function<'a: 'a, 'b>(_: &'a (), _: &'b ()) {}
271-
#}
268+
# impl Foo {
269+
# fn inherent_method<'a: 'a, 'b>(self, _: &'a (), _: &'b ()) {}
270+
# fn inherent_function<'a: 'a, 'b>(_: &'a (), _: &'b ()) {}
271+
# }
272272
#
273273
// Specifying more arguments than there are early
274274
// bound parameters is a future compat warning when
@@ -421,4 +421,4 @@ impl<'a> Fn<()> for FooFnItem<'a> {
421421
type Output = &'a String;
422422
/* fn call(...) -> ... { ... } */
423423
}
424-
```
424+
```

0 commit comments

Comments
 (0)