You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/early_late_parameters.md
+32-32
Original file line number
Diff line number
Diff line change
@@ -126,9 +126,9 @@ In this example we call `foo`'s function item type twice, each time with a borro
126
126
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:
127
127
128
128
```rust
129
-
#fnfoo<'a: 'a>(b:&'aString) ->&'aString { b }
130
-
#fnbar<'a>(b:&'aString) ->&'aString { b }
131
-
129
+
#fnfoo<'a: 'a>(b:&'aString) ->&'aString { b }
130
+
#fnbar<'a>(b:&'aString) ->&'aString { b }
131
+
#
132
132
// Early bound parameters are instantiated here, however as `'a` is
133
133
// late bound it is not provided here.
134
134
letb=bar;
@@ -220,24 +220,24 @@ Then, for the first case, we can call each function with a single lifetime argum
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:
0 commit comments