Commit eb04229
committed
auto merge of #17880 : pcwalton/rust/duplicate-bindings-in-parameter-list, r=alexcrichton
parameter list.
This breaks code like:
fn f(a: int, a: int) { ... }
fn g<T,T>(a: T) { ... }
Change this code to not use the same name for a parameter. For example:
fn f(a: int, b: int) { ... }
fn g<T,U>(a: T) { ... }
Code like this is *not* affected, since `_` is not an identifier:
fn f(_: int, _: int) { ... } // OK
Closes #17568.
r? @alexcrichton
[breaking-change]File tree
3 files changed
+83
-6
lines changed- src
- librustc/middle
- test/compile-fail
3 files changed
+83
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4232 | 4232 | | |
4233 | 4233 | | |
4234 | 4234 | | |
4235 | | - | |
4236 | | - | |
4237 | | - | |
| 4235 | + | |
4238 | 4236 | | |
4239 | | - | |
| 4237 | + | |
4240 | 4238 | | |
4241 | 4239 | | |
4242 | 4240 | | |
4243 | 4241 | | |
| 4242 | + | |
| 4243 | + | |
| 4244 | + | |
| 4245 | + | |
| 4246 | + | |
| 4247 | + | |
| 4248 | + | |
| 4249 | + | |
| 4250 | + | |
| 4251 | + | |
| 4252 | + | |
| 4253 | + | |
4244 | 4254 | | |
4245 | 4255 | | |
4246 | 4256 | | |
| |||
4313 | 4323 | | |
4314 | 4324 | | |
4315 | 4325 | | |
| 4326 | + | |
4316 | 4327 | | |
4317 | | - | |
4318 | 4328 | | |
4319 | 4329 | | |
4320 | 4330 | | |
| |||
5056 | 5066 | | |
5057 | 5067 | | |
5058 | 5068 | | |
5059 | | - | |
5060 | 5069 | | |
5061 | 5070 | | |
5062 | 5071 | | |
5063 | 5072 | | |
5064 | 5073 | | |
| 5074 | + | |
| 5075 | + | |
| 5076 | + | |
| 5077 | + | |
| 5078 | + | |
| 5079 | + | |
| 5080 | + | |
| 5081 | + | |
| 5082 | + | |
| 5083 | + | |
| 5084 | + | |
| 5085 | + | |
| 5086 | + | |
5065 | 5087 | | |
5066 | 5088 | | |
5067 | 5089 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
0 commit comments