-
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 #69535 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum
[beta] backports This backports the following PRs: * ci: switch macOS builders to 10.15 #68863 * Backport release notes of 1.41.1 #69468 * Cherry-pick the LLVM fix for #69225 #69450 * `lit_to_const`: gracefully bubble up type errors. #69330 * [beta] bootstrap from 1.41.1 stable #69518 * bootstrap: Configure cmake when building sanitizer runtimes #69104 r? @ghost
- Loading branch information
Showing
18 changed files
with
126 additions
and
73 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 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
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,11 @@ | ||
// This is a regression test for #69310, which was injected by #68118. | ||
// The issue here was that as a performance optimization, | ||
// we call the query `lit_to_const(input);`. | ||
// However, the literal `input.lit` would not be of the type expected by `input.ty`. | ||
// As a result, we immediately called `bug!(...)` instead of bubbling up the problem | ||
// so that it could be handled by the caller of `lit_to_const` (`ast_const_to_const`). | ||
|
||
fn main() {} | ||
|
||
const A: [(); 0.1] = [()]; //~ ERROR mismatched types | ||
const B: [(); b"a"] = [()]; //~ ERROR mismatched types |
15 changes: 15 additions & 0 deletions
15
src/test/ui/consts/issue-69310-array-size-lit-wrong-ty.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,15 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/issue-69310-array-size-lit-wrong-ty.rs:10:15 | ||
| | ||
LL | const A: [(); 0.1] = [()]; | ||
| ^^^ expected `usize`, found floating-point number | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/issue-69310-array-size-lit-wrong-ty.rs:11:15 | ||
| | ||
LL | const B: [(); b"a"] = [()]; | ||
| ^^^^ expected `usize`, found `&[u8; 1]` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// run-fail | ||
// compile-flags: -C opt-level=3 | ||
// error-pattern: index out of bounds: the len is 0 but the index is 16777216 | ||
// ignore-wasm no panic or subprocess support | ||
// ignore-emscripten no panic or subprocess support | ||
|
||
fn do_test(x: usize) { | ||
let mut arr = vec![vec![0u8; 3]]; | ||
|
||
let mut z = vec![0]; | ||
for arr_ref in arr.iter_mut() { | ||
for y in 0..x { | ||
for _ in 0..1 { | ||
z.reserve_exact(x); | ||
let iterator = std::iter::repeat(0).take(x); | ||
let mut cnt = 0; | ||
iterator.for_each(|_| { | ||
z[0] = 0; | ||
cnt += 1; | ||
}); | ||
let a = y * x; | ||
let b = (y + 1) * x - 1; | ||
let slice = &mut arr_ref[a..b]; | ||
slice[1 << 24] += 1; | ||
} | ||
} | ||
} | ||
} | ||
|
||
fn main() { | ||
do_test(1); | ||
do_test(2); | ||
} |