Skip to content

Commit a916f1c

Browse files
---
yaml --- r: 223645 b: refs/heads/beta c: 0d1deb5 h: refs/heads/master i: 223643: 3bac7f3 v: v3
1 parent 7923080 commit a916f1c

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 05fcb2e9bc679d689a92122f4803977c83b878aa
26+
refs/heads/beta: 0d1deb521c79207611f4a9b74811535150f4a031
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 938f5d7af401e2d8238522fed4a612943b6e77fd
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/librustc_typeck/diagnostics.rs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1431,6 +1431,30 @@ fn(isize, *const *const u8) -> isize
14311431
```
14321432
"##,
14331433

1434+
E0159: r##"
1435+
You tried to use a trait as a struct constructor. Erroneous code example:
1436+
1437+
```
1438+
trait TraitNotAStruct {}
1439+
1440+
TraitNotAStruct{ value: 0 }; // error: use of trait `TraitNotAStruct` as a
1441+
// struct constructor
1442+
```
1443+
1444+
Please verify you used the correct type name or please implement the trait
1445+
on a struct and use this struct constructor. Example:
1446+
1447+
```
1448+
trait TraitNotAStruct {}
1449+
1450+
struct Foo {
1451+
value: i32
1452+
}
1453+
1454+
Foo{ value: 0 }; // ok!
1455+
```
1456+
"##,
1457+
14341458
E0166: r##"
14351459
This error means that the compiler found a return expression in a function
14361460
marked as diverging. A function diverges if it has `!` in the place of the
@@ -2029,7 +2053,6 @@ register_diagnostics! {
20292053
E0127,
20302054
E0129,
20312055
E0141,
2032-
E0159,
20332056
E0163,
20342057
E0164,
20352058
E0167,

0 commit comments

Comments
 (0)