-
Notifications
You must be signed in to change notification settings - Fork 13k
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 #68587 - JohnTitor:rollup-fz45xwc, r=JohnTitor
Rollup of 11 pull requests Successful merges: - #68200 (Stabilize the debug_map_key_value feature) - #68383 (Clean up E0205 explanation) - #68412 (Clean up E0207 explanation) - #68454 (clean up E0214 explanation) - #68482 (clean up error codes explanation) - #68563 (Don't call `tcx.fn_sig` on closures) - #68570 (Bump LLVM submodule to fix LLVM assertion failure in MSP430 interrupt generation.) - #68571 (check_match: extract common logic) - #68573 (Clean up E0262 explanation) - #68575 (Disable the testcase for Vxworks.) - #68581 (Add support for icebreakers-cleanup-crew commands) Failed merges: r? @ghost
- Loading branch information
Showing
18 changed files
with
103 additions
and
48 deletions.
There are no files selected for viewing
9 changes: 0 additions & 9 deletions
9
src/doc/unstable-book/src/library-features/debug-map-key-value.md
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,12 +1,18 @@ | ||
You can only implement `Copy` for a struct or enum. Both of the following | ||
examples will fail, because neither `[u8; 256]` nor `&'static mut Bar` | ||
(mutable reference to `Bar`) is a struct or enum: | ||
The `Copy` trait was implemented on a type which is neither a struct nor an | ||
enum. | ||
|
||
Erroneous code example: | ||
|
||
```compile_fail,E0206 | ||
type Foo = [u8; 256]; | ||
impl Copy for Foo { } // error | ||
impl Copy for Foo { } // error! | ||
#[derive(Copy, Clone)] | ||
struct Bar; | ||
impl Copy for &'static mut Bar { } // error | ||
impl Copy for &'static mut Bar { } // error! | ||
``` | ||
|
||
You can only implement `Copy` for a struct or an enum. Both of the previous | ||
examples will fail, because neither `[u8; 256]` nor `&'static mut Bar` | ||
(mutable reference to `Bar`) is a struct or enum. |
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 |
---|---|---|
@@ -1,12 +1,17 @@ | ||
A generic type was described using parentheses rather than angle brackets. | ||
For example: | ||
|
||
Erroneous code example: | ||
|
||
```compile_fail,E0214 | ||
fn main() { | ||
let v: Vec(&str) = vec!["foo"]; | ||
} | ||
let v: Vec(&str) = vec!["foo"]; | ||
``` | ||
|
||
This is not currently supported: `v` should be defined as `Vec<&str>`. | ||
Parentheses are currently only used with generic types when defining parameters | ||
for `Fn`-family traits. | ||
|
||
The previous code example fixed: | ||
|
||
``` | ||
let v: Vec<&str> = vec!["foo"]; | ||
``` |
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 |
---|---|---|
@@ -1,8 +1,12 @@ | ||
Declaring certain lifetime names in parameters is disallowed. For example, | ||
because the `'static` lifetime is a special built-in lifetime name denoting | ||
the lifetime of the entire program, this is an error: | ||
An invalid name was used for a lifetime parameter. | ||
|
||
Erroneous code example: | ||
|
||
```compile_fail,E0262 | ||
// error, invalid lifetime parameter name `'static` | ||
fn foo<'static>(x: &'static str) { } | ||
``` | ||
|
||
Declaring certain lifetime names in parameters is disallowed. For example, | ||
because the `'static` lifetime is a special built-in lifetime name denoting | ||
the lifetime of the entire program, this is an error: |
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
Submodule llvm-project
updated
2 files
+5 −3 | llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp | |
+9 −0 | llvm/test/CodeGen/MSP430/interrupt.ll |
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,10 @@ | ||
// Regression test for issue #68542 | ||
// Tests that we don't ICE when a closure appears | ||
// in the length part of an array. | ||
|
||
struct Bug { | ||
a: [(); (|| { 0 })()] //~ ERROR calls in constants are limited to | ||
//~^ ERROR evaluation of constant value failed | ||
} | ||
|
||
fn main() {} |
16 changes: 16 additions & 0 deletions
16
src/test/ui/consts/issue-68542-closure-in-array-len.stderr
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,16 @@ | ||
error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants | ||
--> $DIR/issue-68542-closure-in-array-len.rs:6:13 | ||
| | ||
LL | a: [(); (|| { 0 })()] | ||
| ^^^^^^^^^^^^ | ||
|
||
error[E0080]: evaluation of constant value failed | ||
--> $DIR/issue-68542-closure-in-array-len.rs:6:13 | ||
| | ||
LL | a: [(); (|| { 0 })()] | ||
| ^^^^^^^^^^^^ calling non-const function `Bug::a::{{constant}}#0::{{closure}}#0` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0015, E0080. | ||
For more information about an error, try `rustc --explain E0015`. |
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