forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
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#94061 - matthiaskrgr:rollup-oduekp5, r=matthi…
…askrgr Rollup of 10 pull requests Successful merges: - rust-lang#92366 (Resolve concern of `derive_default_enum`) - rust-lang#93382 (Add a bit more padding in search box) - rust-lang#93962 (Make [u8]::cmp implementation branchless) - rust-lang#94015 (rustdoc --check option documentation) - rust-lang#94017 (Clarify confusing UB statement in MIR) - rust-lang#94020 (Support pretty printing of invalid constants) - rust-lang#94027 (Update browser UI test version) - rust-lang#94037 (Fix inconsistent symbol mangling with -Zverbose) - rust-lang#94045 (Update books) - rust-lang#94054 (:arrow_up: rust-analyzer) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
25 changed files
with
177 additions
and
68 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
Submodule book
updated
5 files
Submodule nomicon
updated
3 files
+1 −1 | src/exception-safety.md | |
+1 −1 | src/leaking.md | |
+6 −6 | src/vec/vec-alloc.md |
Submodule reference
updated
7 files
+4 −3 | src/attributes/codegen.md | |
+9 −0 | src/expressions/method-call-expr.md | |
+1 −1 | src/expressions/operator-expr.md | |
+1 −1 | src/glossary.md | |
+19 −7 | src/items/associated-items.md | |
+3 −2 | src/items/generics.md | |
+2 −1 | src/patterns.md |
Submodule rustc-dev-guide
updated
7 files
+1 −1 | src/building/how-to-build-and-run.md | |
+2 −2 | src/crates-io.md | |
+1 −1 | src/diagnostics/diagnostic-items.md | |
+5 −5 | src/diagnostics/lintstore.md | |
+2 −2 | src/git.md | |
+2 −1 | src/stabilization_guide.md | |
+2 −2 | src/tests/compiletest.md |
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
55 changes: 55 additions & 0 deletions
55
src/test/mir-opt/const_prop/invalid_constant.main.ConstProp.diff
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,55 @@ | ||
- // MIR for `main` before ConstProp | ||
+ // MIR for `main` after ConstProp | ||
|
||
fn main() -> () { | ||
let mut _0: (); // return place in scope 0 at $DIR/invalid_constant.rs:15:11: 15:11 | ||
let _1: std::option::Option<()>; // in scope 0 at $DIR/invalid_constant.rs:16:5: 16:12 | ||
let mut _2: std::option::Option<std::option::Option<()>>; // in scope 0 at $DIR/invalid_constant.rs:16:7: 16:11 | ||
scope 1 (inlined f) { // at $DIR/invalid_constant.rs:16:5: 16:12 | ||
debug x => _2; // in scope 1 at $DIR/invalid_constant.rs:16:5: 16:12 | ||
let mut _3: isize; // in scope 1 at $DIR/invalid_constant.rs:16:5: 16:12 | ||
let _4: std::option::Option<()>; // in scope 1 at $DIR/invalid_constant.rs:16:5: 16:12 | ||
scope 2 { | ||
debug y => _4; // in scope 2 at $DIR/invalid_constant.rs:16:5: 16:12 | ||
} | ||
} | ||
|
||
bb0: { | ||
discriminant(_2) = 0; // scope 0 at $DIR/invalid_constant.rs:16:7: 16:11 | ||
- _3 = discriminant(_2); // scope 1 at $DIR/invalid_constant.rs:16:5: 16:12 | ||
- switchInt(move _3) -> [0_isize: bb3, otherwise: bb2]; // scope 1 at $DIR/invalid_constant.rs:16:5: 16:12 | ||
+ _3 = const 0_isize; // scope 1 at $DIR/invalid_constant.rs:16:5: 16:12 | ||
+ switchInt(const 0_isize) -> [0_isize: bb3, otherwise: bb2]; // scope 1 at $DIR/invalid_constant.rs:16:5: 16:12 | ||
} | ||
|
||
bb1: { | ||
nop; // scope 0 at $DIR/invalid_constant.rs:15:11: 17:2 | ||
return; // scope 0 at $DIR/invalid_constant.rs:17:2: 17:2 | ||
} | ||
|
||
bb2: { | ||
- _4 = ((_2 as Some).0: std::option::Option<()>); // scope 1 at $DIR/invalid_constant.rs:16:5: 16:12 | ||
- _1 = _4; // scope 2 at $DIR/invalid_constant.rs:16:5: 16:12 | ||
+ _4 = const Scalar(0x02): Option::<()>; // scope 1 at $DIR/invalid_constant.rs:16:5: 16:12 | ||
+ // ty::Const | ||
+ // + ty: std::option::Option<()> | ||
+ // + val: Value(Scalar(0x02)) | ||
+ // mir::Constant | ||
+ // + span: $DIR/invalid_constant.rs:16:5: 16:12 | ||
+ // + literal: Const { ty: std::option::Option<()>, val: Value(Scalar(0x02)) } | ||
+ _1 = const Scalar(0x02): Option::<()>; // scope 2 at $DIR/invalid_constant.rs:16:5: 16:12 | ||
+ // ty::Const | ||
+ // + ty: std::option::Option<()> | ||
+ // + val: Value(Scalar(0x02)) | ||
+ // mir::Constant | ||
+ // + span: $DIR/invalid_constant.rs:16:5: 16:12 | ||
+ // + literal: Const { ty: std::option::Option<()>, val: Value(Scalar(0x02)) } | ||
goto -> bb1; // scope 0 at $DIR/invalid_constant.rs:10:20: 10:21 | ||
} | ||
|
||
bb3: { | ||
discriminant(_1) = 0; // scope 1 at $DIR/invalid_constant.rs:16:5: 16:12 | ||
goto -> bb1; // scope 0 at $DIR/invalid_constant.rs:9:17: 9:21 | ||
} | ||
} | ||
|
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,17 @@ | ||
// Verify that we can pretty print invalid constant introduced | ||
// by constant propagation. Regression test for issue #93688. | ||
// | ||
// compile-flags: -Copt-level=0 -Zinline-mir | ||
|
||
#[inline(always)] | ||
pub fn f(x: Option<Option<()>>) -> Option<()> { | ||
match x { | ||
None => None, | ||
Some(y) => y, | ||
} | ||
} | ||
|
||
// EMIT_MIR invalid_constant.main.ConstProp.diff | ||
fn main() { | ||
f(None); | ||
} |
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.