-
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 #72727 - JohnTitor:rollup-nni16m2, r=JohnTitor
Rollup of 11 pull requests Successful merges: - #71633 (Impl Error for Infallible) - #71843 (Tweak and stabilize AtomicN::fetch_update) - #72288 (Stabilization of weak-into-raw) - #72324 (Stabilize AtomicN::fetch_min and AtomicN::fetch_max) - #72452 (Clarified the documentation for Formatter::precision) - #72495 (Improve E0601 explanation) - #72534 (Improve missing `@` in slice binding pattern diagnostics) - #72547 (Added a codegen test for a recent optimization for overflow-checks=on) - #72711 (remove redundant `mk_const`) - #72713 (Whitelist #[allow_internal_unstable]) - #72720 (Clarify the documentation of `take`) Failed merges: r? @ghost
- Loading branch information
Showing
14 changed files
with
112 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// no-system-llvm | ||
// compile-flags: -O -C overflow-checks=on | ||
|
||
#![crate_type = "lib"] | ||
|
||
|
||
pub struct S1<'a> { | ||
data: &'a [u8], | ||
position: usize, | ||
} | ||
|
||
// CHECK-LABEL: @slice_no_index_order | ||
#[no_mangle] | ||
pub fn slice_no_index_order<'a>(s: &'a mut S1, n: usize) -> &'a [u8] { | ||
// CHECK-NOT: slice_index_order_fail | ||
let d = &s.data[s.position..s.position+n]; | ||
s.position += n; | ||
return d; | ||
} | ||
|
||
// CHECK-LABEL: @test_check | ||
#[no_mangle] | ||
pub fn test_check<'a>(s: &'a mut S1, x: usize, y: usize) -> &'a [u8] { | ||
// CHECK: slice_index_order_fail | ||
&s.data[x..y] | ||
} |
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,9 @@ | ||
fn foo(c: &[u32], n: u32) -> u32 { | ||
match *c { | ||
[h, ..] if h > n => 0, | ||
[h, ..] if h == n => 1, | ||
[h, ref ts..] => foo(c, n - h) + foo(ts, n), | ||
//~^ ERROR expected one of `,`, `@`, `]`, or `|`, found `..` | ||
[] => 0, | ||
} | ||
} |
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,13 @@ | ||
error: expected one of `,`, `@`, `]`, or `|`, found `..` | ||
--> $DIR/issue-72373.rs:5:19 | ||
| | ||
LL | [h, ref ts..] => foo(c, n - h) + foo(ts, n), | ||
| ^^ expected one of `,`, `@`, `]`, or `|` | ||
| | ||
help: if you meant to bind the contents of the rest of the array pattern into `ts`, use `@` | ||
| | ||
LL | [h, ref ts @ ..] => foo(c, n - h) + foo(ts, n), | ||
| ^ | ||
|
||
error: aborting due to previous error | ||
|
Oops, something went wrong.