-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #119797 - matthiaskrgr:rollup-nn2lt39, r=matthiaskrgr
Rollup of 4 pull requests Successful merges: - #106893 (Explain base expression for struct update syntax) - #119769 (rustdoc: offset generic args of cross-crate trait object types when cleaning) - #119772 (Fix an ICE that occurs after an error has already been reported) - #119782 (rint intrinsics: caution against actually trying to check for floating-point exceptions) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
15 changed files
with
219 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Struct update syntax was used without a base expression. | ||
|
||
Erroneous code example: | ||
|
||
```compile_fail,E0797 | ||
struct Foo { | ||
fizz: u8, | ||
buzz: u8 | ||
} | ||
let f1 = Foo { fizz: 10, buzz: 1}; | ||
let f2 = Foo { fizz: 10, .. }; // error | ||
``` | ||
|
||
Using struct update syntax requires a 'base expression'. | ||
This will be used to fill remaining fields. | ||
|
||
``` | ||
struct Foo { | ||
fizz: u8, | ||
buzz: u8 | ||
} | ||
let f1 = Foo { fizz: 10, buzz: 1}; | ||
let f2 = Foo { fizz: 10, ..f1 }; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.