forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
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 rust-lang#118387 - GuillaumeGomez:rollup-hbkx6nc, r=Gui…
…llaumeGomez Rollup of 8 pull requests Successful merges: - rust-lang#111133 (Detect Python-like slicing and suggest how to fix) - rust-lang#114708 (Allow setting `rla` labels via `rustbot`) - rust-lang#117526 (Account for `!` arm in tail `match` expr) - rust-lang#118341 (Simplify indenting in THIR printing) - rust-lang#118366 (Detect and reject malformed `repr(Rust)` hints) - rust-lang#118375 (Add -Zunpretty=stable-mir output test) - rust-lang#118381 (rustc_span: Use correct edit distance start length for suggestions) - rust-lang#118384 (Address unused tuple struct fields in rustdoc) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
23 changed files
with
440 additions
and
36 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
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
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
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 @@ | ||
fn never() -> ! { | ||
loop {} | ||
} | ||
|
||
fn bar(a: bool) { | ||
match a { | ||
true => 1, | ||
false => { | ||
never() //~ ERROR `match` arms have incompatible types | ||
} | ||
} | ||
} | ||
fn main() { | ||
bar(true); | ||
bar(false); | ||
} |
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,21 @@ | ||
error[E0308]: `match` arms have incompatible types | ||
--> $DIR/match-tail-expr-never-type-error.rs:9:13 | ||
| | ||
LL | fn bar(a: bool) { | ||
| - help: try adding a return type: `-> i32` | ||
LL | / match a { | ||
LL | | true => 1, | ||
| | - this is found to be of type `{integer}` | ||
LL | | false => { | ||
LL | | never() | ||
| | ^^^^^^^ | ||
| | | | ||
| | expected integer, found `()` | ||
| | this expression is of type `!`, but it is coerced to `()` due to its surrounding expression | ||
LL | | } | ||
LL | | } | ||
| |_____- `match` arms have incompatible types | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
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
34 changes: 26 additions & 8 deletions
34
tests/ui/repr/issue-83921-ice.stderr → tests/ui/repr/malformed-repr-hints.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 |
---|---|---|
@@ -1,46 +1,64 @@ | ||
error[E0552]: incorrect `repr(packed)` attribute format: `packed` takes exactly one parenthesized argument, or no parentheses at all | ||
--> $DIR/issue-83921-ice.rs:6:8 | ||
--> $DIR/malformed-repr-hints.rs:6:8 | ||
| | ||
LL | #[repr(packed())] | ||
| ^^^^^^^^ | ||
|
||
error[E0589]: invalid `repr(align)` attribute: `align` needs an argument | ||
--> $DIR/issue-83921-ice.rs:10:8 | ||
--> $DIR/malformed-repr-hints.rs:10:8 | ||
| | ||
LL | #[repr(align)] | ||
| ^^^^^ help: supply an argument here: `align(...)` | ||
|
||
error[E0693]: incorrect `repr(align)` attribute format: `align` takes exactly one argument in parentheses | ||
--> $DIR/issue-83921-ice.rs:14:8 | ||
--> $DIR/malformed-repr-hints.rs:14:8 | ||
| | ||
LL | #[repr(align(2, 4))] | ||
| ^^^^^^^^^^^ | ||
|
||
error[E0693]: incorrect `repr(align)` attribute format: `align` takes exactly one argument in parentheses | ||
--> $DIR/issue-83921-ice.rs:18:8 | ||
--> $DIR/malformed-repr-hints.rs:18:8 | ||
| | ||
LL | #[repr(align())] | ||
| ^^^^^^^ | ||
|
||
error[E0552]: invalid representation hint: `Rust` does not take a parenthesized argument list | ||
--> $DIR/malformed-repr-hints.rs:23:8 | ||
| | ||
LL | #[repr(Rust(u8))] | ||
| ^^^^^^^^ | ||
|
||
error[E0552]: invalid representation hint: `Rust` does not take a parenthesized argument list | ||
--> $DIR/malformed-repr-hints.rs:25:8 | ||
| | ||
LL | #[repr(Rust(0))] | ||
| ^^^^^^^ | ||
|
||
error[E0552]: invalid representation hint: `Rust` does not take a value | ||
--> $DIR/malformed-repr-hints.rs:27:8 | ||
| | ||
LL | #[repr(Rust = 0)] | ||
| ^^^^^^^^ | ||
|
||
error[E0552]: invalid representation hint: `i8` does not take a parenthesized argument list | ||
--> $DIR/issue-83921-ice.rs:22:8 | ||
--> $DIR/malformed-repr-hints.rs:31:8 | ||
| | ||
LL | #[repr(i8())] | ||
| ^^^^ | ||
|
||
error[E0552]: invalid representation hint: `u32` does not take a parenthesized argument list | ||
--> $DIR/issue-83921-ice.rs:26:8 | ||
--> $DIR/malformed-repr-hints.rs:35:8 | ||
| | ||
LL | #[repr(u32(42))] | ||
| ^^^^^^^ | ||
|
||
error[E0552]: invalid representation hint: `i64` does not take a value | ||
--> $DIR/issue-83921-ice.rs:30:8 | ||
--> $DIR/malformed-repr-hints.rs:39:8 | ||
| | ||
LL | #[repr(i64 = 2)] | ||
| ^^^^^^^ | ||
|
||
error: aborting due to 7 previous errors | ||
error: aborting due to 10 previous errors | ||
|
||
Some errors have detailed explanations: E0552, E0589, E0693. | ||
For more information about an error, try `rustc --explain E0552`. |
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,14 @@ | ||
// compile-flags: -Z unpretty=stable-mir | ||
// check-pass | ||
|
||
fn foo(i:i32) -> i32 { | ||
i + 1 | ||
} | ||
|
||
fn bar(vec: &mut Vec<i32>) -> Vec<i32> { | ||
let mut new_vec = vec.clone(); | ||
new_vec.push(1); | ||
new_vec | ||
} | ||
|
||
fn main(){} |
Oops, something went wrong.