Skip to content

Commit c95537b

Browse files
authored
Merge pull request #2199 from sagudev/patch-1
Fix rib example
2 parents 047ccc0 + 8789c2c commit c95537b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/name-resolution.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,17 @@ even though they should be visible by ordinary scoping rules. An example:
120120
fn do_something<T: Default>(val: T) { // <- New rib in both types and values (1)
121121
// `val` is accessible, as is the helper function
122122
// `T` is accessible
123-
let helper = || { // New rib on `helper` (2) and another on the block (3)
123+
let helper = || { // New rib on the block (2)
124124
// `val` is accessible here
125-
}; // End of (3)
125+
}; // End of (2), new rib on `helper` (3)
126126
// `val` is accessible, `helper` variable shadows `helper` function
127127
fn helper() { // <- New rib in both types and values (4)
128128
// `val` is not accessible here, (4) is not transparent for locals
129129
// `T` is not accessible here
130130
} // End of (4)
131131
let val = T::default(); // New rib (5)
132132
// `val` is the variable, not the parameter here
133-
} // End of (5), (2) and (1)
133+
} // End of (5), (3) and (1)
134134
```
135135

136136
Because the rules for different namespaces are a bit different, each namespace

0 commit comments

Comments
 (0)