Skip to content

Commit d46b7b1

Browse files
---
yaml --- r: 217939 b: refs/heads/master c: 05fcb2e h: refs/heads/master i: 217937: a0c320d 217935: 53c41ff v: v3
1 parent 5ee92ef commit d46b7b1

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 7160d9220fd3df46e17e11fd25ac2e0665ed2507
2+
refs/heads/master: 05fcb2e9bc679d689a92122f4803977c83b878aa
33
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
44
refs/heads/try: b53c0f93eedcdedd4fd89bccc5a3a09d1c5cd23e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

trunk/src/librustc_typeck/diagnostics.rs

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,8 +1378,8 @@ pub struct Foo<SomeType=SomeType>;
13781378
// identifiers
13791379
```
13801380
1381-
Please verify you used the good type or change the type parameter identifier.
1382-
Example:
1381+
Please verify that a name clash hasn't been accidentally introduced, and rename
1382+
the type parameter if so. Example:
13831383
13841384
```
13851385
pub struct Foo<T=SomeType> {
@@ -1388,6 +1388,35 @@ pub struct Foo<T=SomeType> {
13881388
```
13891389
"##,
13901390

1391+
E0130: r##"
1392+
You declared a pattern as an argument in a foreign function declaration.
1393+
Erroneous code example:
1394+
1395+
```
1396+
extern {
1397+
fn foo((a, b): (u32, u32)); // error: patterns aren't allowed in foreign
1398+
// function declarations
1399+
}
1400+
```
1401+
1402+
Please replace the pattern argument with a regular one. Example:
1403+
1404+
```
1405+
struct SomeStruct {
1406+
a: u32,
1407+
b: u32,
1408+
}
1409+
1410+
extern {
1411+
fn foo(s: SomeStruct); // ok!
1412+
}
1413+
// or
1414+
extern {
1415+
fn foo(a: (u32, u32)); // ok!
1416+
}
1417+
```
1418+
"##,
1419+
13911420
E0131: r##"
13921421
It is not possible to define `main` with type parameters, or even with function
13931422
parameters. When `main` is present, it must take no arguments and return `()`.
@@ -1999,7 +2028,6 @@ register_diagnostics! {
19992028
E0123,
20002029
E0127,
20012030
E0129,
2002-
E0130,
20032031
E0141,
20042032
E0159,
20052033
E0163,

0 commit comments

Comments
 (0)