Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Remove StorageDead and StorageLive statements using MIR locals of type () #70004

Closed
wants to merge 2 commits into from

Conversation

Zoxc
Copy link
Contributor

@Zoxc Zoxc commented Mar 14, 2020

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 14, 2020
@Zoxc
Copy link
Contributor Author

Zoxc commented Mar 14, 2020

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion

@bors
Copy link
Contributor

bors commented Mar 14, 2020

⌛ Trying commit c0ea8f3 with merge ba94172...

bors added a commit that referenced this pull request Mar 14, 2020
[WIP] Remove `StorageDead` and `StorageLive` statements using MIR locals of type `()`

r? @oli-obk
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2020-03-14T16:55:46.5187358Z ========================== Starting Command Output ===========================
2020-03-14T16:55:46.5191703Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/ba93de98-c219-434e-9113-d98a060f153b.sh
2020-03-14T16:55:46.5192083Z 
2020-03-14T16:55:46.5196076Z ##[section]Finishing: Disable git automatic line ending conversion
2020-03-14T16:55:46.5211241Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70004/merge to s
2020-03-14T16:55:46.5214041Z Task         : Get sources
2020-03-14T16:55:46.5214261Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-14T16:55:46.5214470Z Version      : 1.0.0
2020-03-14T16:55:46.5214654Z Author       : Microsoft
---
2020-03-14T16:55:49.3590021Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-03-14T16:55:49.3596798Z ##[command]git config gc.auto 0
2020-03-14T16:55:49.3600712Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-03-14T16:55:49.3604665Z ##[command]git config --get-all http.proxy
2020-03-14T16:55:49.3612768Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/70004/merge:refs/remotes/pull/70004/merge
---
2020-03-14T17:47:51.1619780Z .................................................................................................... 1700/9771
2020-03-14T17:47:54.6374896Z ..F................................................................................................. 1800/9771
2020-03-14T17:48:04.0376936Z ...................................................................i................................ 1900/9771
2020-03-14T17:48:09.6128970Z .................................................................................................... 2000/9771
2020-03-14T17:48:21.3028572Z .........................................................iiiii...................................... 2100/9771
2020-03-14T17:48:30.0125441Z .................................................................................................... 2300/9771
2020-03-14T17:48:31.7868661Z .................................................................................................... 2400/9771
2020-03-14T17:48:34.4077530Z .................................................................................................... 2500/9771
2020-03-14T17:48:52.5022050Z .................................................................................................... 2600/9771
---
2020-03-14T17:51:01.6148555Z .............................i...............i...................................................... 5000/9771
2020-03-14T17:51:09.1743985Z .................................................................................................... 5100/9771
2020-03-14T17:51:14.1683953Z ........................................................................i........................... 5200/9771
2020-03-14T17:51:18.5993901Z .................................................................................................... 5300/9771
2020-03-14T17:51:26.4525263Z .....................................................ii.ii........i...i............................. 5400/9771
2020-03-14T17:51:32.9399306Z .................................................................................................... 5600/9771
2020-03-14T17:51:40.5694639Z .................................................................................................... 5700/9771
2020-03-14T17:51:45.4308712Z .............................................i...................................................... 5800/9771
2020-03-14T17:51:51.0279402Z .................................................................................................... 5900/9771
2020-03-14T17:51:51.0279402Z .................................................................................................... 5900/9771
2020-03-14T17:51:59.2140665Z .................................................................................................... 6000/9771
2020-03-14T17:52:03.9697535Z .......................................ii...i..ii...........i....................................... 6100/9771
2020-03-14T17:52:20.7794796Z .................................................................................................... 6300/9771
2020-03-14T17:52:26.2527727Z .................................................................................................... 6400/9771
2020-03-14T17:52:26.2527727Z .................................................................................................... 6400/9771
2020-03-14T17:52:33.1000969Z .....................................................................i..ii.......................... 6500/9771
2020-03-14T17:52:51.5231405Z .................................................................................................... 6700/9771
2020-03-14T17:52:58.2468771Z ...................................................................i................................ 6800/9771
2020-03-14T17:52:59.7382980Z .................................................................................................... 6900/9771
2020-03-14T17:53:01.4006650Z .................................................................................................... 7000/9771
---
2020-03-14T17:54:25.5563688Z .................................................................................................... 7800/9771
2020-03-14T17:54:30.2922210Z .................................................................................................... 7900/9771
2020-03-14T17:54:34.9289194Z ...................................................i................................................ 8000/9771
2020-03-14T17:54:43.2258542Z .................................................................................................... 8100/9771
2020-03-14T17:54:47.5337460Z iiiiiiiiii.i........................................................................................ 8200/9771
2020-03-14T17:54:58.6727830Z .................................................................................................... 8400/9771
2020-03-14T17:55:07.4323901Z .................................................................................................... 8500/9771
2020-03-14T17:55:17.7612441Z .................................................................................................... 8600/9771
2020-03-14T17:55:22.4114633Z .................................................................................................... 8700/9771
---
2020-03-14T17:56:53.1624688Z ---- [ui] ui/consts/dangling-alloc-id-ice.rs stdout ----
2020-03-14T17:56:53.1625017Z 
2020-03-14T17:56:53.1625317Z error: ui test compiled successfully!
2020-03-14T17:56:53.1625622Z status: exit code: 0
2020-03-14T17:56:53.1627546Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/consts/dangling-alloc-id-ice.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/dangling-alloc-id-ice" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-A" "unused" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/dangling-alloc-id-ice/auxiliary"
2020-03-14T17:56:53.1629244Z ------------------------------------------
2020-03-14T17:56:53.1629514Z 
2020-03-14T17:56:53.1630123Z ------------------------------------------
2020-03-14T17:56:53.1630433Z stderr:
---
2020-03-14T17:56:53.1637570Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
2020-03-14T17:56:53.1638109Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-03-14T17:56:53.1644191Z 
2020-03-14T17:56:53.1644519Z 
2020-03-14T17:56:53.1647837Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-7/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "7.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2020-03-14T17:56:53.1650019Z 
2020-03-14T17:56:53.1650102Z 
2020-03-14T17:56:53.1656677Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2020-03-14T17:56:53.1656976Z Build completed unsuccessfully in 0:54:38
2020-03-14T17:56:53.1656976Z Build completed unsuccessfully in 0:54:38
2020-03-14T17:56:53.1728258Z == clock drift check ==
2020-03-14T17:56:53.1744012Z   local time: Sat Mar 14 17:56:53 UTC 2020
2020-03-14T17:56:53.3350650Z   network time: Sat, 14 Mar 2020 17:56:53 GMT
2020-03-14T17:56:53.3355794Z == end clock drift check ==
2020-03-14T17:56:53.8835142Z 
2020-03-14T17:56:53.8903940Z ##[error]Bash exited with code '1'.
2020-03-14T17:56:53.8915187Z ##[section]Finishing: Run build
2020-03-14T17:56:53.8958379Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70004/merge to s
2020-03-14T17:56:53.8962763Z Task         : Get sources
2020-03-14T17:56:53.8963028Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-14T17:56:53.8963281Z Version      : 1.0.0
2020-03-14T17:56:53.8963446Z Author       : Microsoft
2020-03-14T17:56:53.8963446Z Author       : Microsoft
2020-03-14T17:56:53.8963717Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-03-14T17:56:53.8964042Z ==============================================================================
2020-03-14T17:56:54.1703740Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-03-14T17:56:54.1744852Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/70004/merge to s
2020-03-14T17:56:54.1817160Z Cleaning up task key
2020-03-14T17:56:54.1818228Z Start cleaning up orphan processes.
2020-03-14T17:56:54.1968845Z Terminate orphan process: pid (4070) (python)
2020-03-14T17:56:54.2110063Z ##[section]Finishing: Finalize Job

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

Comment on lines 13 to 14
let unit_locals: SmallVec<[_; 32]> =
body.local_decls.iter().map(|local| local.ty == tcx.types.unit).collect();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm far from an expert in this code, but what's the need to allocate an array here instead of just indexing into body.local_decls and comparing the types on line 20?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the code below mutates the body, so we can't hold an immutable at the same time. technically it is doable, but not with the current API. Maybe basic_block_mut could return a reference to the rest of the body... not sure, but there's still quite some design space available here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

bors commented Mar 14, 2020

☀️ Try build successful - checks-azure
Build commit: ba94172 (ba941729d654f397a191304136d414bcc11a49a5)

@rust-timer
Copy link
Collaborator

Queued ba94172 with parent 0f1e814, future comparison URL.

for block in body.basic_blocks_mut() {
for stmt in &mut block.statements {
match &stmt.kind {
StatementKind::StorageLive(l) | StatementKind::StorageDead(l) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
StatementKind::StorageLive(l) | StatementKind::StorageDead(l) => {
if let StatementKind::StorageLive(l) | StatementKind::StorageDead(l) = &stmt.kind {

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit ba94172, comparison URL.

@jonas-schievink
Copy link
Contributor

StorageDead is required for soundness AFAICT since it kills borrows on the value (hence the test failure). Or is this PR just to investigate potential impact of something like #68622?

@Zoxc
Copy link
Contributor Author

Zoxc commented Mar 14, 2020

What uses StorageDead for soundness?

@jonas-schievink
Copy link
Contributor

MIR borrowck if I'm not mistaken. From #68622:

StorageDead could also be similar ("least (common) post-dominator"?).

However, it also has the effect of invalidating borrows, so we would need to keep an InvalidateBorrows(x) statement around, and consider it one of the mentions of x.

@jonas-schievink
Copy link
Contributor

The failing test looks like this:

// https://github.com/rust-lang/rust/issues/55223

union Foo<'a> {
    y: &'a (),
    long_live_the_unit: &'static (),
}

const FOO: &() = { //~ ERROR any use of this value will cause an error
    let y = ();
    unsafe { Foo { y: &y }.long_live_the_unit }
};

fn main() {}

The error is no longer emitted, which makes sense given the changes

@bjorn3
Copy link
Member

bjorn3 commented Mar 14, 2020

This runs after borrowck.

@jonas-schievink
Copy link
Contributor

@bjorn3 yeah, was about to comment that. There still seem to be things relying on this though, do const checking passes use optimized MIR maybe?

@wesleywiser
Copy link
Member

If we do this for (), we could do it for any ZST right?

@Zoxc
Copy link
Contributor Author

Zoxc commented Mar 15, 2020

@wesleywiser Yes. My goal was to improve the compiler performance here, so I just checked for ().

@bjorn3
Copy link
Member

bjorn3 commented Mar 15, 2020

Maybe do this during codegen of StorageLive and StorageDead? That way const eval won't notice the change, and layout info is already computed previously.

@oli-obk
Copy link
Contributor

oli-obk commented Mar 15, 2020

we should not diverge codegen and const eval. cc @RalfJung

a while back I tried making all zsts have integer addresses, that would have worked here, too. there were some problems with it though. please run ./x.py test src/tools/miri so we can see whether the rust memory model is unhappy about this change.

@RalfJung
Copy link
Member

I think Miri will be fine in the sense that this strictly removes UB. The question is, is anything relying on that being UB? But all the relevant analyses should be looking at StorageDead/Live, I assume that will just mean they will be less precise for optimizations that run after this.

This removal means that address of ZST locals are (after this pass) guaranteed to remain the same throughout the execution of the function, including ZST locals inside a loop remaining the same for multiple loop iterations:

loop {
  let x = ();
  println!("{:?}", &x as *const _); // prints the same thing each round
}

@ecstatic-morse @eddyb I hope our dataflow analyses treat this correctly, i.e. they will treat these locals as being alive throughout the entire function?

@Zoxc
Copy link
Contributor Author

Zoxc commented Mar 20, 2020

I think the test failure happens because Miri does not mark the locals as deallocated on return like it should. I also noticed that it doesn't initialize locals as dead if Storage* statements are used and the Mir is in a constant, but clearly those still affect constants.

It seems like the semantics for Mir used for constant contexts diverge from Mir intended to execute that run-time. I'm not sure how intentional this is, but it doesn't seem great.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2020-03-20T23:27:14.0783852Z ========================== Starting Command Output ===========================
2020-03-20T23:27:14.0787342Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/553dc17d-75c1-45b6-a27a-bcc383ae9702.sh
2020-03-20T23:27:14.0787668Z 
2020-03-20T23:27:14.0793167Z ##[section]Finishing: Disable git automatic line ending conversion
2020-03-20T23:27:14.0816289Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70004/merge to s
2020-03-20T23:27:14.0820589Z Task         : Get sources
2020-03-20T23:27:14.0820918Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-20T23:27:14.0821262Z Version      : 1.0.0
2020-03-20T23:27:14.0821480Z Author       : Microsoft
---
2020-03-20T23:27:15.0702880Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-03-20T23:27:15.0708116Z ##[command]git config gc.auto 0
2020-03-20T23:27:15.0711773Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-03-20T23:27:15.0715143Z ##[command]git config --get-all http.proxy
2020-03-20T23:27:15.0721268Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/70004/merge:refs/remotes/pull/70004/merge
---
2020-03-21T00:26:17.8853704Z .................................................................................................... 1700/9804
2020-03-21T00:26:22.1972496Z .................................................................................................... 1800/9804
2020-03-21T00:26:33.5796246Z ..........................................................................i......................... 1900/9804
2020-03-21T00:26:39.7844848Z .................................................................................................... 2000/9804
2020-03-21T00:26:48.0090521Z ................................................................iiiii............................... 2100/9804
2020-03-21T00:27:06.1531207Z .................................................................................................... 2300/9804
2020-03-21T00:27:08.4972459Z .................................................................................................... 2400/9804
2020-03-21T00:27:12.3677592Z .................................................................................................... 2500/9804
2020-03-21T00:27:31.5122207Z .................................................................................................... 2600/9804
---
2020-03-21T00:30:07.7984137Z .....................................i...............i.............................................. 5000/9804
2020-03-21T00:30:16.3893289Z .................................................................................................... 5100/9804
2020-03-21T00:30:22.7269442Z ................................................................................i................... 5200/9804
2020-03-21T00:30:28.1389250Z .................................................................................................... 5300/9804
2020-03-21T00:30:38.1011689Z .............................................................ii.ii........i...i..................... 5400/9804
2020-03-21T00:30:46.0567975Z i................................................................................................... 5600/9804
2020-03-21T00:30:55.6749744Z .....i.............................................................................................. 5700/9804
2020-03-21T00:31:01.8053018Z ........................................................i........................................... 5800/9804
2020-03-21T00:31:08.1060467Z .................................................................................................... 5900/9804
2020-03-21T00:31:08.1060467Z .................................................................................................... 5900/9804
2020-03-21T00:31:16.2755054Z .................................................................................................... 6000/9804
2020-03-21T00:31:24.1132490Z ..................................................ii...i..ii...........i............................ 6100/9804
2020-03-21T00:31:44.3160679Z .................................................................................................... 6300/9804
2020-03-21T00:31:51.3073769Z .................................................................................................... 6400/9804
2020-03-21T00:31:51.3073769Z .................................................................................................... 6400/9804
2020-03-21T00:31:59.4605281Z ................................................................................i..ii............... 6500/9804
2020-03-21T00:32:22.3393564Z .................................................................................................... 6700/9804
2020-03-21T00:32:31.7230341Z ...............................................................................i.................... 6800/9804
2020-03-21T00:32:33.7833396Z .................................................................................................... 6900/9804
2020-03-21T00:32:35.8083814Z .................................................................................................... 7000/9804
---
2020-03-21T00:34:17.9258683Z .................................................................................................... 7800/9804
2020-03-21T00:34:23.5227540Z .................................................................................................... 7900/9804
2020-03-21T00:34:29.6881303Z ..................................................................i................................. 8000/9804
2020-03-21T00:34:39.9784843Z .................................................................................................... 8100/9804
2020-03-21T00:34:45.4912520Z ...............iiiiiiiiii.i......................................................................... 8200/9804
2020-03-21T00:34:59.5090122Z .................................................................................................... 8400/9804
2020-03-21T00:35:05.7962874Z .................................................................................................... 8500/9804
2020-03-21T00:35:21.3301748Z .................................................................................................... 8600/9804
2020-03-21T00:35:27.9887467Z .................................................................................................... 8700/9804
---
2020-03-21T00:37:38.6485253Z Suite("src/test/mir-opt") not skipped for "bootstrap::test::MirOpt" -- not in ["src/tools/tidy"]
2020-03-21T00:37:38.6637405Z Check compiletest suite=mir-opt mode=mir-opt (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-03-21T00:37:38.8224412Z 
2020-03-21T00:37:38.8225203Z running 84 tests
2020-03-21T00:37:46.3539911Z .................................FF................................F..........FFFF..
2020-03-21T00:37:46.3544608Z 
2020-03-21T00:37:46.3571120Z ---- [mir-opt] mir-opt/generator-drop-cleanup.rs stdout ----
2020-03-21T00:37:46.3571120Z ---- [mir-opt] mir-opt/generator-drop-cleanup.rs stdout ----
2020-03-21T00:37:46.3571946Z [ERROR compiletest::runtest] Some("bb1: {")
2020-03-21T00:37:46.3573301Z thread '[mir-opt] mir-opt/generator-drop-cleanup.rs' panicked at 'Did not find expected line, error: Mismatch in lines
2020-03-21T00:37:46.3574102Z Current block: bb1: {
2020-03-21T00:37:46.3577325Z Actual Line: "        goto -> bb5;"
2020-03-21T00:37:46.3577964Z Expected Line: "    StorageDead(_4);"
2020-03-21T00:37:46.3578768Z Test Name: rustc.main-{{closure}}.generator_drop.0.mir
2020-03-21T00:37:46.3579512Z ... (elided)
2020-03-21T00:37:46.3579835Z bb0: {
2020-03-21T00:37:46.3579835Z bb0: {
2020-03-21T00:37:46.3580167Z     _7 = discriminant((*_1));
2020-03-21T00:37:46.3580939Z     switchInt(move _7) -> [0u32: bb4, 3u32: bb7, otherwise: bb8];
2020-03-21T00:37:46.3581686Z bb1: {
2020-03-21T00:37:46.3582021Z     StorageDead(_4);
2020-03-21T00:37:46.3582714Z     StorageDead(_3);
2020-03-21T00:37:46.3583873Z     goto -> bb5;
---
2020-03-21T00:37:46.3592019Z }
2020-03-21T00:37:46.3592165Z bb8: {
2020-03-21T00:37:46.3592330Z     return;
2020-03-21T00:37:46.3592483Z }
2020-03-21T00:37:46.3592644Z Actual:
2020-03-21T00:37:46.3593339Z fn  main::{{closure}}#0(_1: *mut [generator@/checkout/src/test/mir-opt/generator-drop-cleanup.rs:7:15: 9:6 {()}]) -> () {
2020-03-21T00:37:46.3593797Z     let mut _0: ();
2020-03-21T00:37:46.3594038Z     let mut _2: ();
2020-03-21T00:37:46.3594253Z     let _3: ();
2020-03-21T00:37:46.3594466Z     let mut _4: ();
2020-03-21T00:37:46.3594705Z     let mut _5: ();
2020-03-21T00:37:46.3594928Z     let mut _6: ();
2020-03-21T00:37:46.3595163Z     let mut _7: isize;
2020-03-21T00:37:46.3595387Z     bb0: {
2020-03-21T00:37:46.3595611Z         _7 = discriminant((*_1));
2020-03-21T00:37:46.3596220Z         switchInt(move _7) -> [0u32: bb4, 3u32: bb7, otherwise: bb8];
2020-03-21T00:37:46.3596721Z     bb1: {
2020-03-21T00:37:46.3597083Z         goto -> bb5;
2020-03-21T00:37:46.3597266Z     }
2020-03-21T00:37:46.3597446Z     bb2: {
---
2020-03-21T00:37:46.3601957Z     }
2020-03-21T00:37:46.3602401Z }', src/tools/compiletest/src/runtest.rs:3133:13
2020-03-21T00:37:46.3602799Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-03-21T00:37:46.3603084Z 
2020-03-21T00:37:46.3603566Z ---- [mir-opt] mir-opt/generator-storage-dead-unwind.rs stdout ----
2020-03-21T00:37:46.3604453Z thread '[mir-opt] mir-opt/generator-storage-dead-unwind.rs' panicked at 'Did not find expected line, error: ran out of mir dump to match against
2020-03-21T00:37:46.3605021Z Expected Line: "    StorageLive(_7);"
2020-03-21T00:37:46.3605562Z Test Name: rustc.main-{{closure}}.StateTransform.before.mir
2020-03-21T00:37:46.3606023Z ... (elided)
2020-03-21T00:37:46.3606201Z ... (elided)
2020-03-21T00:37:46.3606478Z let _3: Foo;
2020-03-21T00:37:46.3606669Z ... (elided)
---
2020-03-21T00:37:46.3608065Z     scope 2 {
2020-03-21T00:37:46.3608265Z         debug b => _4;
2020-03-21T00:37:46.3608448Z     }
2020-03-21T00:37:46.3608589Z }
2020-03-21T00:37:46.3608749Z bb0: {
2020-03-21T00:37:46.3608935Z     StorageLive(_3);
2020-03-21T00:37:46.3609158Z     _3 = Foo(const 5i32,);
2020-03-21T00:37:46.3609400Z     StorageLive(_4);
2020-03-21T00:37:46.3609621Z     _4 = Bar(const 6i32,);
2020-03-21T00:37:46.3609827Z ... (elided)
2020-03-21T00:37:46.3610370Z     _5 = yield(move _6) -> [resume: bb2, drop: bb4];
2020-03-21T00:37:46.3610637Z }
2020-03-21T00:37:46.3610808Z bb1 (cleanup): {
2020-03-21T00:37:46.3611000Z     resume;
2020-03-21T00:37:46.3611321Z bb2: {
2020-03-21T00:37:46.3611490Z ... (elided)
2020-03-21T00:37:46.3611697Z     StorageLive(_7);
2020-03-21T00:37:46.3611905Z     StorageLive(_8);
2020-03-21T00:37:46.3611905Z     StorageLive(_8);
2020-03-21T00:37:46.3612108Z     _8 = move _3;
2020-03-21T00:37:46.3612681Z     _7 = const take::<Foo>(move _8) -> [return: bb7, unwind: bb9];
2020-03-21T00:37:46.3612984Z }
2020-03-21T00:37:46.3613154Z bb3 (cleanup): {
2020-03-21T00:37:46.3613437Z     StorageDead(_3);
2020-03-21T00:37:46.3613840Z     drop(_1) -> bb1;
2020-03-21T00:37:46.3614161Z bb4: {
2020-03-21T00:37:46.3614347Z ... (elided)
2020-03-21T00:37:46.3614548Z     StorageDead(_4);
2020-03-21T00:37:46.3614548Z     StorageDead(_4);
2020-03-21T00:37:46.3615078Z     drop(_3) -> [return: bb5, unwind: bb3];
2020-03-21T00:37:46.3615483Z bb5: {
2020-03-21T00:37:46.3615666Z     StorageDead(_3);
2020-03-21T00:37:46.3615666Z     StorageDead(_3);
2020-03-21T00:37:46.3616154Z     drop(_1) -> [return: bb6, unwind: bb1];
2020-03-21T00:37:46.3616541Z bb6: {
2020-03-21T00:37:46.3616729Z     generator_drop;
2020-03-21T00:37:46.3616913Z }
2020-03-21T00:37:46.3617056Z bb7: {
2020-03-21T00:37:46.3617056Z bb7: {
2020-03-21T00:37:46.3617240Z     StorageDead(_8);
2020-03-21T00:37:46.3617466Z     StorageDead(_7);
2020-03-21T00:37:46.3617674Z     StorageLive(_9);
2020-03-21T00:37:46.3617885Z     StorageLive(_10);
2020-03-21T00:37:46.3618111Z     _10 = move _4;
2020-03-21T00:37:46.3618680Z     _9 = const take::<Bar>(move _10) -> [return: bb10, unwind: bb11];
2020-03-21T00:37:46.3618988Z }
2020-03-21T00:37:46.3619159Z bb8 (cleanup): {
2020-03-21T00:37:46.3619388Z     StorageDead(_4);
2020-03-21T00:37:46.3619596Z     StorageDead(_3);
2020-03-21T00:37:46.3620110Z     drop(_1) -> bb1;
2020-03-21T00:37:46.3620303Z }
2020-03-21T00:37:46.3620473Z bb9 (cleanup): {
2020-03-21T00:37:46.3620683Z     StorageDead(_8);
2020-03-21T00:37:46.3620908Z     StorageDead(_7);
2020-03-21T00:37:46.3621269Z     goto -> bb8;
2020-03-21T00:37:46.3621599Z bb10: {
2020-03-21T00:37:46.3621793Z     StorageDead(_10);
2020-03-21T00:37:46.3622010Z     StorageDead(_9);
2020-03-21T00:37:46.3623172Z ... (elided)
2020-03-21T00:37:46.3623172Z ... (elided)
2020-03-21T00:37:46.3623596Z     StorageDead(_4);
2020-03-21T00:37:46.3623813Z     StorageDead(_3);
2020-03-21T00:37:46.3624402Z     drop(_1) -> [return: bb12, unwind: bb1];
2020-03-21T00:37:46.3624670Z }
2020-03-21T00:37:46.3624844Z bb11 (cleanup): {
2020-03-21T00:37:46.3625060Z     StorageDead(_10);
2020-03-21T00:37:46.3625287Z     StorageDead(_9);
2020-03-21T00:37:46.3625658Z     goto -> bb8;
2020-03-21T00:37:46.3625971Z bb12: {
2020-03-21T00:37:46.3626163Z     return;
2020-03-21T00:37:46.3626318Z }
2020-03-21T00:37:46.3626473Z Actual:
2020-03-21T00:37:46.3626473Z Actual:
2020-03-21T00:37:46.3627267Z fn  main::{{closure}}#0(_1: [generator@/checkout/src/test/mir-opt/generator-storage-dead-unwind.rs:21:16: 27:6 {Foo, Bar, ()}], _2: ()) -> ()
2020-03-21T00:37:46.3627741Z yields ()
2020-03-21T00:37:46.3627892Z  {
2020-03-21T00:37:46.3628089Z     let mut _0: ();
2020-03-21T00:37:46.3628307Z     let _3: Foo;
2020-03-21T00:37:46.3628511Z     let _5: ();
2020-03-21T00:37:46.3628876Z     let mut _6: ();
2020-03-21T00:37:46.3629104Z     let _7: ();
2020-03-21T00:37:46.3629320Z     let mut _8: Foo;
2020-03-21T00:37:46.3629536Z     let _9: ();
2020-03-21T00:37:46.3629772Z     let mut _10: Bar;
2020-03-21T00:37:46.3630184Z         debug a => _3;
2020-03-21T00:37:46.3630421Z         let _4: Bar;
2020-03-21T00:37:46.3630634Z         scope 2 {
2020-03-21T00:37:46.3630850Z             debug b => _4;
---
2020-03-21T00:37:46.3631854Z         _3 = Foo(const 5i32,);
2020-03-21T00:37:46.3632092Z         StorageLive(_4);
2020-03-21T00:37:46.3632329Z         _4 = Bar(const 6i32,);
2020-03-21T00:37:46.3632569Z         _6 = ();
2020-03-21T00:37:46.3633128Z         _5 = yield(move _6) -> [resume: bb2, drop: bb4];
2020-03-21T00:37:46.3633415Z     }
2020-03-21T00:37:46.3633627Z     bb1 (cleanup): {
2020-03-21T00:37:46.3633839Z         resume;
2020-03-21T00:37:46.3634188Z     bb2: {
2020-03-21T00:37:46.3634392Z         StorageLive(_8);
2020-03-21T00:37:46.3634611Z         _8 = move _3;
2020-03-21T00:37:46.3634611Z         _8 = move _3;
2020-03-21T00:37:46.3635194Z         _7 = const take::<Foo>(move _8) -> [return: bb7, unwind: bb9];
2020-03-21T00:37:46.3635529Z     }
2020-03-21T00:37:46.3635719Z     bb3 (cleanup): {
2020-03-21T00:37:46.3635948Z         StorageDead(_3);
2020-03-21T00:37:46.3636363Z         drop(_1) -> bb1;
2020-03-21T00:37:46.3636717Z     bb4: {
2020-03-21T00:37:46.3636943Z         StorageDead(_4);
2020-03-21T00:37:46.3636943Z         StorageDead(_4);
2020-03-21T00:37:46.3637440Z         drop(_3) -> [return: bb5, unwind: bb3];
2020-03-21T00:37:46.3637882Z     bb5: {
2020-03-21T00:37:46.3638086Z         StorageDead(_3);
2020-03-21T00:37:46.3638086Z         StorageDead(_3);
2020-03-21T00:37:46.3638580Z         drop(_1) -> [return: bb6, unwind: bb1];
2020-03-21T00:37:46.3639021Z     bb6: {
2020-03-21T00:37:46.3639229Z         generator_drop;
2020-03-21T00:37:46.3639414Z     }
2020-03-21T00:37:46.3639591Z     bb7: {
2020-03-21T00:37:46.3639591Z     bb7: {
2020-03-21T00:37:46.3639793Z         StorageDead(_8);
2020-03-21T00:37:46.3640021Z         StorageLive(_10);
2020-03-21T00:37:46.3640260Z         _10 = move _4;
2020-03-21T00:37:46.3640850Z         _9 = const take::<Bar>(move _10) -> [return: bb10, unwind: bb11];
2020-03-21T00:37:46.3641181Z     }
2020-03-21T00:37:46.3641385Z     bb8 (cleanup): {
2020-03-21T00:37:46.3641616Z         StorageDead(_4);
2020-03-21T00:37:46.3641840Z         StorageDead(_3);
2020-03-21T00:37:46.3642237Z         drop(_1) -> bb1;
2020-03-21T00:37:46.3642541Z     }
2020-03-21T00:37:46.3642731Z     bb9 (cleanup): {
2020-03-21T00:37:46.3642959Z         StorageDead(_8);
2020-03-21T00:37:46.3643385Z         goto -> bb8;
2020-03-21T00:37:46.3643734Z     bb10: {
2020-03-21T00:37:46.3643959Z         StorageDead(_10);
2020-03-21T00:37:46.3644171Z         _0 = ();
2020-03-21T00:37:46.3644388Z         StorageDead(_4);
2020-03-21T00:37:46.3644388Z         StorageDead(_4);
2020-03-21T00:37:46.3644613Z         StorageDead(_3);
2020-03-21T00:37:46.3645133Z         drop(_1) -> [return: bb12, unwind: bb1];
2020-03-21T00:37:46.3645398Z     }
2020-03-21T00:37:46.3645591Z     bb11 (cleanup): {
2020-03-21T00:37:46.3645841Z         StorageDead(_10);
2020-03-21T00:37:46.3646228Z         goto -> bb8;
2020-03-21T00:37:46.3646591Z     bb12: {
2020-03-21T00:37:46.3646780Z         return;
2020-03-21T00:37:46.3646949Z     }
2020-03-21T00:37:46.3647411Z }', src/tools/compiletest/src/runtest.rs:3133:13
2020-03-21T00:37:46.3647411Z }', src/tools/compiletest/src/runtest.rs:3133:13
2020-03-21T00:37:46.3647633Z 
2020-03-21T00:37:46.3648142Z ---- [mir-opt] mir-opt/simplify-locals-removes-unused-consts.rs stdout ----
2020-03-21T00:37:46.3648535Z [ERROR compiletest::runtest] Some("bb0: {")
2020-03-21T00:37:46.3649385Z thread '[mir-opt] mir-opt/simplify-locals-removes-unused-consts.rs' panicked at 'Did not find expected line, error: Mismatch in lines
2020-03-21T00:37:46.3649879Z Current block: bb0: {
2020-03-21T00:37:46.3650220Z Actual Line: "        _2 = const ();"
2020-03-21T00:37:46.3650706Z Expected Line: "  StorageLive(_2);"
2020-03-21T00:37:46.3651016Z Test Name: rustc.main.SimplifyLocals.before.mir
2020-03-21T00:37:46.3651449Z ... (elided)
2020-03-21T00:37:46.3651639Z let mut _0: ();
2020-03-21T00:37:46.3651856Z let mut _1: ((), ());
2020-03-21T00:37:46.3652085Z let mut _2: ();
---
2020-03-21T00:37:46.3653727Z let mut _10: u8;
2020-03-21T00:37:46.3653940Z let mut _11: Temp;
2020-03-21T00:37:46.3654146Z scope 1 {
2020-03-21T00:37:46.3654295Z }
2020-03-21T00:37:46.3654440Z bb0: {
2020-03-21T00:37:46.3654621Z   StorageLive(_1);
2020-03-21T00:37:46.3654841Z   StorageLive(_2);
2020-03-21T00:37:46.3655039Z   _2 = const ();
2020-03-21T00:37:46.3655238Z   StorageLive(_3);
2020-03-21T00:37:46.3655449Z   _3 = const ();
2020-03-21T00:37:46.3655708Z   _1 = const {transmute(()): ((), ())};
2020-03-21T00:37:46.3655969Z   StorageDead(_3);
2020-03-21T00:37:46.3656182Z   StorageDead(_2);
2020-03-21T00:37:46.3656381Z   StorageDead(_1);
2020-03-21T00:37:46.3656580Z   StorageLive(_4);
2020-03-21T00:37:46.3656793Z   StorageLive(_6);
2020-03-21T00:37:46.3656990Z   _6 = const ();
2020-03-21T00:37:46.3657186Z   StorageLive(_7);
2020-03-21T00:37:46.3657382Z   _7 = const ();
2020-03-21T00:37:46.3657593Z   StorageDead(_7);
2020-03-21T00:37:46.3657797Z   StorageDead(_6);
2020-03-21T00:37:46.3658384Z   _4 = const use_zst(const {transmute(()): ((), ())}) -> bb1;
2020-03-21T00:37:46.3658827Z bb1: {
2020-03-21T00:37:46.3659007Z   StorageDead(_4);
2020-03-21T00:37:46.3659225Z   StorageLive(_8);
2020-03-21T00:37:46.3659426Z   StorageLive(_10);
2020-03-21T00:37:46.3659426Z   StorageLive(_10);
2020-03-21T00:37:46.3659639Z   StorageLive(_11);
2020-03-21T00:37:46.3659905Z   _11 = const {transmute(0x28) : Temp};
2020-03-21T00:37:46.3660186Z   _10 = const 40u8;
2020-03-21T00:37:46.3660390Z   StorageDead(_10);
2020-03-21T00:37:46.3660833Z   _8 = const use_u8(const 42u8) -> bb2;
2020-03-21T00:37:46.3661207Z bb2: {
2020-03-21T00:37:46.3661391Z   StorageDead(_11);
2020-03-21T00:37:46.3661607Z   StorageDead(_8);
2020-03-21T00:37:46.3661790Z   return;
---
2020-03-21T00:37:46.3665254Z     let mut _10: u8;
2020-03-21T00:37:46.3665488Z     let mut _11: Temp;
2020-03-21T00:37:46.3666422Z     scope 1 {
2020-03-21T00:37:46.3666592Z     }
2020-03-21T00:37:46.3666751Z     bb0: {
2020-03-21T00:37:46.3666967Z         StorageLive(_1);
2020-03-21T00:37:46.3667187Z         _2 = const ();
2020-03-21T00:37:46.3667403Z         _3 = const ();
2020-03-21T00:37:46.3668252Z         _1 = const {transmute(()): ((), ())};
2020-03-21T00:37:46.3668545Z         StorageDead(_1);
2020-03-21T00:37:46.3668764Z         _6 = const ();
2020-03-21T00:37:46.3669011Z         _7 = const ();
2020-03-21T00:37:46.3669755Z         _4 = const use_zst(const {transmute(()): ((), ())}) -> bb1;
2020-03-21T00:37:46.3670225Z     bb1: {
2020-03-21T00:37:46.3670449Z         StorageLive(_10);
2020-03-21T00:37:46.3670679Z         StorageLive(_11);
2020-03-21T00:37:46.3670679Z         StorageLive(_11);
2020-03-21T00:37:46.3670967Z         _11 = const {transmute(0x28): Temp};
2020-03-21T00:37:46.3671412Z         _10 = const 40u8;
2020-03-21T00:37:46.3671654Z         StorageDead(_10);
2020-03-21T00:37:46.3672164Z         _8 = const use_u8(const 42u8) -> bb2;
2020-03-21T00:37:46.3672580Z     bb2: {
2020-03-21T00:37:46.3672784Z         StorageDead(_11);
2020-03-21T00:37:46.3673009Z         return;
2020-03-21T00:37:46.3673179Z     }
2020-03-21T00:37:46.3673179Z     }
2020-03-21T00:37:46.3673626Z }', src/tools/compiletest/src/runtest.rs:3133:13
2020-03-21T00:37:46.3673847Z 
2020-03-21T00:37:46.3674289Z ---- [mir-opt] mir-opt/unreachable.rs stdout ----
2020-03-21T00:37:46.3674645Z [ERROR compiletest::runtest] Some("     bb3: {")
2020-03-21T00:37:46.3675440Z thread '[mir-opt] mir-opt/unreachable.rs' panicked at 'Did not find expected line, error: Mismatch in lines
2020-03-21T00:37:46.3675902Z Current block:      bb3: {
2020-03-21T00:37:46.3676459Z Actual Line: "        nop;"
2020-03-21T00:37:46.3676747Z Expected Line: "         StorageLive(_5);"
2020-03-21T00:37:46.3677112Z Test Name: rustc.main.UnreachablePropagation.before.mir
2020-03-21T00:37:46.3677546Z ... (elided)
2020-03-21T00:37:46.3677741Z      bb0: {
2020-03-21T00:37:46.3677948Z          StorageLive(_1);
2020-03-21T00:37:46.3678450Z          _1 = const empty() -> bb1;
2020-03-21T00:37:46.3678450Z          _1 = const empty() -> bb1;
2020-03-21T00:37:46.3678667Z      }
2020-03-21T00:37:46.3678853Z      bb1: {
2020-03-21T00:37:46.3679074Z          _2 = discriminant(_1);
2020-03-21T00:37:46.3679638Z          switchInt(move _2) -> [1isize: bb3, otherwise: bb2];
2020-03-21T00:37:46.3680121Z      bb2: {
2020-03-21T00:37:46.3680313Z          _0 = ();
2020-03-21T00:37:46.3680548Z          StorageDead(_1);
2020-03-21T00:37:46.3680760Z          return;
2020-03-21T00:37:46.3680760Z          return;
2020-03-21T00:37:46.3680932Z      }
2020-03-21T00:37:46.3681304Z      bb3: {
2020-03-21T00:37:46.3681517Z          StorageLive(_3);
2020-03-21T00:37:46.3681803Z          _3 = move ((_1 as Some).0: Empty);
2020-03-21T00:37:46.3682087Z          StorageLive(_4);
2020-03-21T00:37:46.3682339Z          StorageLive(_5);
2020-03-21T00:37:46.3682565Z          StorageLive(_6);
2020-03-21T00:37:46.3682792Z          _6 = const true;
2020-03-21T00:37:46.3683389Z          switchInt(_6) -> [false: bb4, otherwise: bb5];
2020-03-21T00:37:46.3685204Z      bb4: {
2020-03-21T00:37:46.3685442Z          _4 = const 42i32;
2020-03-21T00:37:46.3688145Z          _5 = ();
2020-03-21T00:37:46.3688882Z          goto -> bb6;
---
2020-03-21T00:37:46.3695057Z          StorageLive(_7);
2020-03-21T00:37:46.3695363Z          unreachable;
2020-03-21T00:37:46.3695549Z      }
2020-03-21T00:37:46.3695705Z  }
2020-03-21T00:37:46.3695855Z Actual:
2020-03-21T00:37:46.3696389Z fn  main() -> () {
2020-03-21T00:37:46.3696612Z     let mut _0: ();
2020-03-21T00:37:46.3696899Z     let mut _1: std::option::Option<Empty>;
2020-03-21T00:37:46.3697207Z     let mut _2: isize;
2020-03-21T00:37:46.3697434Z     let _3: Empty;
2020-03-21T00:37:46.3697646Z     let _5: ();
2020-03-21T00:37:46.3697882Z     let mut _6: bool;
2020-03-21T00:37:46.3698109Z     let mut _7: !;
2020-03-21T00:37:46.3698532Z         debug _x => _3;
2020-03-21T00:37:46.3698770Z         let mut _4: i32;
2020-03-21T00:37:46.3699348Z         scope 2 {
2020-03-21T00:37:46.3699348Z         scope 2 {
2020-03-21T00:37:46.3699574Z             debug _y => _4;
2020-03-21T00:37:46.3699953Z     }
2020-03-21T00:37:46.3700118Z     bb0: {
2020-03-21T00:37:46.3700338Z         StorageLive(_1);
2020-03-21T00:37:46.3700856Z         _1 = const empty() -> bb1;
2020-03-21T00:37:46.3700856Z         _1 = const empty() -> bb1;
2020-03-21T00:37:46.3701226Z     }
2020-03-21T00:37:46.3701411Z     bb1: {
2020-03-21T00:37:46.3701770Z         _2 = discriminant(_1);
2020-03-21T00:37:46.3702835Z         switchInt(move _2) -> [1isize: bb3, otherwise: bb2];
2020-03-21T00:37:46.3703327Z     bb2: {
2020-03-21T00:37:46.3703514Z         _0 = ();
2020-03-21T00:37:46.3703724Z         StorageDead(_1);
2020-03-21T00:37:46.3703950Z         return;
2020-03-21T00:37:46.3703950Z         return;
2020-03-21T00:37:46.3704119Z     }
2020-03-21T00:37:46.3704283Z     bb3: {
2020-03-21T00:37:46.3704500Z         StorageLive(_3);
2020-03-21T00:37:46.3704785Z         _3 = move ((_1 as Some).0: Empty);
2020-03-21T00:37:46.3705067Z         StorageLive(_4);
2020-03-21T00:37:46.3705296Z         nop;
2020-03-21T00:37:46.3705498Z         StorageLive(_6);
2020-03-21T00:37:46.3705724Z         _6 = const true;
2020-03-21T00:37:46.3706284Z         switchInt(_6) -> [false: bb4, otherwise: bb5];
2020-03-21T00:37:46.3706745Z     bb4: {
2020-03-21T00:37:46.3706951Z         _4 = const 42i32;
2020-03-21T00:37:46.3707186Z         _5 = ();
2020-03-21T00:37:46.3707563Z         goto -> bb6;
---
2020-03-21T00:37:46.3709924Z         unreachable;
2020-03-21T00:37:46.3710119Z     }
2020-03-21T00:37:46.3710567Z }', src/tools/compiletest/src/runtest.rs:3133:13
2020-03-21T00:37:46.3710798Z 
2020-03-21T00:37:46.3711235Z ---- [mir-opt] mir-opt/unreachable_asm.rs stdout ----
2020-03-21T00:37:46.3711615Z [ERROR compiletest::runtest] Some("     bb6: {")
2020-03-21T00:37:46.3712383Z thread '[mir-opt] mir-opt/unreachable_asm.rs' panicked at 'Did not find expected line, error: Mismatch in lines
2020-03-21T00:37:46.3712919Z Current block:      bb6: {
2020-03-21T00:37:46.3713197Z Actual Line: "        nop;"
2020-03-21T00:37:46.3713722Z Expected Line: "         StorageDead(_5);"
2020-03-21T00:37:46.3714063Z Test Name: rustc.main.UnreachablePropagation.before.mir
2020-03-21T00:37:46.3714513Z ... (elided)
2020-03-21T00:37:46.3714694Z      bb4: {
2020-03-21T00:37:46.3714920Z          _4 = const 42i32;
2020-03-21T00:37:46.3715135Z          _5 = ();
2020-03-21T00:37:46.3715135Z          _5 = ();
2020-03-21T00:37:46.3715573Z          goto -> bb6;
2020-03-21T00:37:46.3715778Z      }
2020-03-21T00:37:46.3715947Z      bb5: {
2020-03-21T00:37:46.3716297Z          _4 = const 21i32;
2020-03-21T00:37:46.3716514Z          _5 = ();
2020-03-21T00:37:46.3716939Z          goto -> bb6;
2020-03-21T00:37:46.3717129Z      }
2020-03-21T00:37:46.3717298Z      bb6: {
2020-03-21T00:37:46.3717524Z          StorageDead(_6);
2020-03-21T00:37:46.3717754Z          StorageDead(_5);
2020-03-21T00:37:46.3717981Z          StorageLive(_7);
2020-03-21T00:37:46.3718609Z          asm!(InlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []);
2020-03-21T00:37:46.3719694Z          StorageDead(_7);
2020-03-21T00:37:46.3719940Z          StorageLive(_8);
2020-03-21T00:37:46.3720160Z          unreachable;
2020-03-21T00:37:46.3720343Z      }
2020-03-21T00:37:46.3720343Z      }
2020-03-21T00:37:46.3720506Z  }
2020-03-21T00:37:46.3720653Z Actual:
2020-03-21T00:37:46.3721051Z fn  main() -> () {
2020-03-21T00:37:46.3721286Z     let mut _0: ();
2020-03-21T00:37:46.3721575Z     let mut _1: std::option::Option<Empty>;
2020-03-21T00:37:46.3721872Z     let mut _2: isize;
2020-03-21T00:37:46.3722098Z     let _3: Empty;
2020-03-21T00:37:46.3722456Z     let _5: ();
2020-03-21T00:37:46.3722677Z     let mut _6: bool;
2020-03-21T00:37:46.3722895Z     let _7: ();
2020-03-21T00:37:46.3723123Z     let mut _8: !;
2020-03-21T00:37:46.3723635Z         debug _x => _3;
2020-03-21T00:37:46.3723894Z         let mut _4: i32;
2020-03-21T00:37:46.3724119Z         scope 2 {
2020-03-21T00:37:46.3724119Z         scope 2 {
2020-03-21T00:37:46.3724339Z             debug _y => _4;
2020-03-21T00:37:46.3724854Z             }
2020-03-21T00:37:46.3725025Z         }
2020-03-21T00:37:46.3725182Z     }
2020-03-21T00:37:46.3725363Z     bb0: {
2020-03-21T00:37:46.3725363Z     bb0: {
2020-03-21T00:37:46.3725567Z         StorageLive(_1);
2020-03-21T00:37:46.3726067Z         _1 = const empty() -> bb1;
2020-03-21T00:37:46.3726298Z     }
2020-03-21T00:37:46.3726462Z     bb1: {
2020-03-21T00:37:46.3726679Z         _2 = discriminant(_1);
2020-03-21T00:37:46.3727267Z         switchInt(move _2) -> [1isize: bb3, otherwise: bb2];
2020-03-21T00:37:46.3727726Z     bb2: {
2020-03-21T00:37:46.3728109Z         _0 = ();
2020-03-21T00:37:46.3728342Z         StorageDead(_1);
2020-03-21T00:37:46.3728550Z         return;
2020-03-21T00:37:46.3728550Z         return;
2020-03-21T00:37:46.3728718Z     }
2020-03-21T00:37:46.3728897Z     bb3: {
2020-03-21T00:37:46.3729109Z         StorageLive(_3);
2020-03-21T00:37:46.3729394Z         _3 = move ((_1 as Some).0: Empty);
2020-03-21T00:37:46.3729690Z         StorageLive(_4);
2020-03-21T00:37:46.3729892Z         nop;
2020-03-21T00:37:46.3730093Z         StorageLive(_6);
2020-03-21T00:37:46.3730331Z         _6 = const true;
2020-03-21T00:37:46.3730910Z         switchInt(_6) -> [false: bb4, otherwise: bb5];
2020-03-21T00:37:46.3731351Z     bb4: {
2020-03-21T00:37:46.3731742Z         _4 = const 42i32;
2020-03-21T00:37:46.3731955Z         _5 = ();
2020-03-21T00:37:46.3732369Z         goto -> bb6;
2020-03-21T00:37:46.3732369Z         goto -> bb6;
2020-03-21T00:37:46.3732578Z     }
2020-03-21T00:37:46.3732742Z     bb5: {
2020-03-21T00:37:46.3732947Z         _4 = const 21i32;
2020-03-21T00:37:46.3733172Z         _5 = ();
2020-03-21T00:37:46.3733545Z         goto -> bb6;
2020-03-21T00:37:46.3733728Z     }
2020-03-21T00:37:46.3733892Z     bb6: {
2020-03-21T00:37:46.3734113Z         StorageDead(_6);
2020-03-21T00:37:46.3734496Z         nop;
2020-03-21T00:37:46.3734672Z         nop;
2020-03-21T00:37:46.3735243Z         asm!(InlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []);
2020-03-21T00:37:46.3735975Z         nop;
2020-03-21T00:37:46.3736193Z         StorageLive(_8);
2020-03-21T00:37:46.3736409Z         unreachable;
2020-03-21T00:37:46.3736587Z     }
2020-03-21T00:37:46.3736587Z     }
2020-03-21T00:37:46.3737100Z }', src/tools/compiletest/src/runtest.rs:3133:13
2020-03-21T00:37:46.3737322Z 
2020-03-21T00:37:46.3737766Z ---- [mir-opt] mir-opt/unreachable_asm_2.rs stdout ----
2020-03-21T00:37:46.3738423Z [ERROR compiletest::runtest] Some("     bb4: {")
2020-03-21T00:37:46.3739305Z thread '[mir-opt] mir-opt/unreachable_asm_2.rs' panicked at 'Did not find expected line, error: Mismatch in lines
2020-03-21T00:37:46.3739765Z Current block:      bb4: {
2020-03-21T00:37:46.3740024Z Actual Line: "        nop;"
2020-03-21T00:37:46.3740335Z Expected Line: "         StorageLive(_8);"
2020-03-21T00:37:46.3740671Z Test Name: rustc.main.UnreachablePropagation.before.mir
2020-03-21T00:37:46.3741119Z ... (elided)
2020-03-21T00:37:46.3741301Z      bb3: {
2020-03-21T00:37:46.3741654Z ... (elided)
2020-03-21T00:37:46.3741654Z ... (elided)
2020-03-21T00:37:46.3742408Z          switchInt(_6) -> [false: bb4, otherwise: bb5];
2020-03-21T00:37:46.3742871Z      bb4: {
2020-03-21T00:37:46.3743096Z          StorageLive(_8);
2020-03-21T00:37:46.3743096Z          StorageLive(_8);
2020-03-21T00:37:46.3743697Z          asm!(InlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []);
2020-03-21T00:37:46.3744516Z          StorageDead(_8);
2020-03-21T00:37:46.3744748Z          _4 = const 42i32;
2020-03-21T00:37:46.3744961Z          _5 = ();
2020-03-21T00:37:46.3745403Z          goto -> bb6;
2020-03-21T00:37:46.3745403Z          goto -> bb6;
2020-03-21T00:37:46.3745608Z      }
2020-03-21T00:37:46.3746057Z          bb5: {
2020-03-21T00:37:46.3746314Z          StorageLive(_7);
2020-03-21T00:37:46.3746931Z          asm!(InlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []);
2020-03-21T00:37:46.3747724Z          StorageDead(_7);
2020-03-21T00:37:46.3747971Z          _4 = const 21i32;
2020-03-21T00:37:46.3748187Z          _5 = ();
2020-03-21T00:37:46.3748795Z          goto -> bb6;
---
2020-03-21T00:37:46.3749869Z          StorageLive(_9);
2020-03-21T00:37:46.3750089Z          unreachable;
2020-03-21T00:37:46.3750272Z      }
2020-03-21T00:37:46.3750432Z  }
2020-03-21T00:37:46.3750580Z Actual:
2020-03-21T00:37:46.3751145Z fn  main() -> () {
2020-03-21T00:37:46.3751387Z     let mut _0: ();
2020-03-21T00:37:46.3751683Z     let mut _1: std::option::Option<Empty>;
2020-03-21T00:37:46.3751973Z     let mut _2: isize;
2020-03-21T00:37:46.3752215Z     let _3: Empty;
2020-03-21T00:37:46.3752425Z     let _5: ();
2020-03-21T00:37:46.3752644Z     let mut _6: bool;
2020-03-21T00:37:46.3752862Z     let _7: ();
2020-03-21T00:37:46.3753079Z     let _8: ();
2020-03-21T00:37:46.3753290Z     let mut _9: !;
2020-03-21T00:37:46.3753710Z         debug _x => _3;
2020-03-21T00:37:46.3753946Z         let mut _4: i32;
2020-03-21T00:37:46.3754169Z         scope 2 {
2020-03-21T00:37:46.3754169Z         scope 2 {
2020-03-21T00:37:46.3754407Z             debug _y => _4;
2020-03-21T00:37:46.3754830Z             }
2020-03-21T00:37:46.3755045Z             scope 4 {
2020-03-21T00:37:46.3755242Z             }
2020-03-21T00:37:46.3755415Z         }
2020-03-21T00:37:46.3755415Z         }
2020-03-21T00:37:46.3755572Z     }
2020-03-21T00:37:46.3755755Z     bb0: {
2020-03-21T00:37:46.3755958Z         StorageLive(_1);
2020-03-21T00:37:46.3756416Z         _1 = const empty() -> bb1;
2020-03-21T00:37:46.3756647Z     }
2020-03-21T00:37:46.3756974Z     bb1: {
2020-03-21T00:37:46.3757204Z         _2 = discriminant(_1);
2020-03-21T00:37:46.3757828Z         switchInt(move _2) -> [1isize: bb3, otherwise: bb2];
2020-03-21T00:37:46.3758287Z     bb2: {
2020-03-21T00:37:46.3758474Z         _0 = ();
2020-03-21T00:37:46.3758702Z         StorageDead(_1);
2020-03-21T00:37:46.3758910Z         return;
2020-03-21T00:37:46.3758910Z         return;
2020-03-21T00:37:46.3759078Z     }
2020-03-21T00:37:46.3759257Z     bb3: {
2020-03-21T00:37:46.3759461Z         StorageLive(_3);
2020-03-21T00:37:46.3759866Z         _3 = move ((_1 as Some).0: Empty);
2020-03-21T00:37:46.3760164Z         StorageLive(_4);
2020-03-21T00:37:46.3760365Z         nop;
2020-03-21T00:37:46.3760568Z         StorageLive(_6);
2020-03-21T00:37:46.3760808Z         _6 = const true;
2020-03-21T00:37:46.3761364Z         switchInt(_6) -> [false: bb4, otherwise: bb5];
2020-03-21T00:37:46.3761817Z     bb4: {
2020-03-21T00:37:46.3762013Z         nop;
2020-03-21T00:37:46.3762013Z         nop;
2020-03-21T00:37:46.3762587Z         asm!(InlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []);
2020-03-21T00:37:46.3763365Z         nop;
2020-03-21T00:37:46.3763567Z         _4 = const 42i32;
2020-03-21T00:37:46.3763780Z         _5 = ();
2020-03-21T00:37:46.3764173Z         goto -> bb6;
2020-03-21T00:37:46.3764173Z         goto -> bb6;
2020-03-21T00:37:46.3764357Z     }
2020-03-21T00:37:46.3764521Z     bb5: {
2020-03-21T00:37:46.3764716Z         nop;
2020-03-21T00:37:46.3765295Z         asm!(InlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []);
2020-03-21T00:37:46.3766071Z         nop;
2020-03-21T00:37:46.3766275Z         _4 = const 21i32;
2020-03-21T00:37:46.3766485Z         _5 = ();
2020-03-21T00:37:46.3766947Z         goto -> bb6;
---
2020-03-21T00:37:46.3768142Z         unreachable;
2020-03-21T00:37:46.3768338Z     }
2020-03-21T00:37:46.3768813Z }', src/tools/compiletest/src/runtest.rs:3133:13
2020-03-21T00:37:46.3769036Z 
2020-03-21T00:37:46.3769489Z ---- [mir-opt] mir-opt/unreachable_diverging.rs stdout ----
2020-03-21T00:37:46.3769837Z [ERROR compiletest::runtest] None
2020-03-21T00:37:46.3770589Z thread '[mir-opt] mir-opt/unreachable_diverging.rs' panicked at 'Did not find expected line, error: Mismatch in lines
2020-03-21T00:37:46.3771035Z Current block: None
2020-03-21T00:37:46.3771288Z Actual Line: "        nop;"
2020-03-21T00:37:46.3771572Z Expected Line: "         StorageLive(_5);"
2020-03-21T00:37:46.3771915Z Test Name: rustc.main.UnreachablePropagation.before.mir
2020-03-21T00:37:46.3772367Z ... (elided)
2020-03-21T00:37:46.3772550Z      bb3: {
2020-03-21T00:37:46.3772774Z          StorageLive(_4);
2020-03-21T00:37:46.3772774Z          StorageLive(_4);
2020-03-21T00:37:46.3773064Z          _4 = move ((_2 as Some).0: Empty);
2020-03-21T00:37:46.3773351Z          StorageLive(_5);
2020-03-21T00:37:46.3773599Z          StorageLive(_6);
2020-03-21T00:37:46.3773812Z          _6 = _1;
2020-03-21T00:37:46.3774327Z          switchInt(_6) -> [false: bb4, otherwise: bb5];
2020-03-21T00:37:46.3774798Z      bb4: {
2020-03-21T00:37:46.3774990Z          _5 = ();
2020-03-21T00:37:46.3775371Z          goto -> bb6;
2020-03-21T00:37:46.3775574Z      }
---
2020-03-21T00:37:46.3777556Z          StorageLive(_7);
2020-03-21T00:37:46.3777776Z          unreachable;
2020-03-21T00:37:46.3777957Z      }
2020-03-21T00:37:46.3778118Z  }
2020-03-21T00:37:46.3778266Z Actual:
2020-03-21T00:37:46.3778619Z fn  main() -> () {
2020-03-21T00:37:46.3778854Z     let mut _0: ();
2020-03-21T00:37:46.3779075Z     let _1: bool;
2020-03-21T00:37:46.3779352Z     let mut _2: std::option::Option<Empty>;
2020-03-21T00:37:46.3779657Z     let mut _3: isize;
2020-03-21T00:37:46.3779877Z     let _5: ();
2020-03-21T00:37:46.3780096Z     let mut _6: bool;
2020-03-21T00:37:46.3780321Z     let mut _7: !;
2020-03-21T00:37:46.3780844Z         debug x => _1;
2020-03-21T00:37:46.3781069Z         let _4: Empty;
2020-03-21T00:37:46.3781302Z         scope 2 {
2020-03-21T00:37:46.3781525Z             debug bomb => _4;
---
2020-03-21T00:37:46.3782637Z         _1 = const true;
2020-03-21T00:37:46.3782862Z         StorageLive(_2);
2020-03-21T00:37:46.3783353Z         _2 = const empty() -> bb1;
2020-03-21T00:37:46.3783567Z     }
2020-03-21T00:37:46.3783749Z     bb1: {
2020-03-21T00:37:46.3783965Z         _3 = discriminant(_2);
2020-03-21T00:37:46.3784522Z         switchInt(move _3) -> [1isize: bb3, otherwise: bb2];
2020-03-21T00:37:46.3785000Z     bb2: {
2020-03-21T00:37:46.3785188Z         _0 = ();
2020-03-21T00:37:46.3785413Z         StorageDead(_1);
2020-03-21T00:37:46.3785638Z         StorageDead(_2);
2020-03-21T00:37:46.3785638Z         StorageDead(_2);
2020-03-21T00:37:46.3785853Z         return;
2020-03-21T00:37:46.3786037Z     }
2020-03-21T00:37:46.3786201Z     bb3: {
2020-03-21T00:37:46.3786402Z         StorageLive(_4);
2020-03-21T00:37:46.3786685Z         _4 = move ((_2 as Some).0: Empty);
2020-03-21T00:37:46.3786958Z         nop;
2020-03-21T00:37:46.3787160Z         StorageLive(_6);
2020-03-21T00:37:46.3787369Z         _6 = _1;
2020-03-21T00:37:46.3788000Z         switchInt(_6) -> [false: bb4, otherwise: bb5];
2020-03-21T00:37:46.3788455Z     bb4: {
2020-03-21T00:37:46.3788658Z         _5 = ();
2020-03-21T00:37:46.3789056Z         goto -> bb6;
2020-03-21T00:37:46.3789240Z     }
---
2020-03-21T00:37:46.3796825Z 
2020-03-21T00:37:46.3797373Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
2020-03-21T00:37:46.3797673Z 
2020-03-21T00:37:46.3797802Z 
2020-03-21T00:37:46.3802104Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/mir-opt" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "mir-opt" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-7/bin/FileCheck" "--nodejs" "/usr/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "7.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2020-03-21T00:37:46.3805332Z 
2020-03-21T00:37:46.3805447Z 
2020-03-21T00:37:46.3809187Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --exclude src/tools/tidy
2020-03-21T00:37:46.3809645Z Build completed unsuccessfully in 1:05:22
2020-03-21T00:37:46.3809645Z Build completed unsuccessfully in 1:05:22
2020-03-21T00:37:46.3809931Z == clock drift check ==
2020-03-21T00:37:46.3810211Z   local time: Sat Mar 21 00:37:46 UTC 2020
2020-03-21T00:37:47.5542117Z   network time: Sat, 21 Mar 2020 00:37:46 GMT
2020-03-21T00:37:47.5542803Z == end clock drift check ==
2020-03-21T00:37:48.8343089Z 
2020-03-21T00:37:48.8394310Z ##[error]Bash exited with code '1'.
2020-03-21T00:37:48.8459988Z ##[section]Finishing: Run build
2020-03-21T00:37:48.8510719Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70004/merge to s
2020-03-21T00:37:48.8515889Z Task         : Get sources
2020-03-21T00:37:48.8516193Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-21T00:37:48.8516493Z Version      : 1.0.0
2020-03-21T00:37:48.8516693Z Author       : Microsoft
2020-03-21T00:37:48.8516693Z Author       : Microsoft
2020-03-21T00:37:48.8517012Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-03-21T00:37:48.8517391Z ==============================================================================
2020-03-21T00:37:49.2111507Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-03-21T00:37:49.2154517Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/70004/merge to s
2020-03-21T00:37:49.2233402Z Cleaning up task key
2020-03-21T00:37:49.2234510Z Start cleaning up orphan processes.
2020-03-21T00:37:49.2405671Z Terminate orphan process: pid (4296) (python)
2020-03-21T00:37:49.2565164Z ##[section]Finishing: Finalize Job

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

@eddyb
Copy link
Member

eddyb commented Mar 21, 2020

Maybe do this during codegen of StorageLive and StorageDead? That way const eval won't notice the change, and layout info is already computed previously.

Hmm, do we use allocas for ZSTs? We probably shouldn't, even when they're borrowed.

@RalfJung
Copy link
Member

RalfJung commented Mar 21, 2020

It seems like the semantics for Mir used for constant contexts diverge from Mir intended to execute that run-time. I'm not sure how intentional this is, but it doesn't seem great.

I don't think Miri depends on whether this is CTFE or run-time code.
However, the semantics of locals are a bit odd to accommodate the fact that rustc does not consistent emit StorageLive/StorageDead for all locals. Specifically, when a stack frame is pushed, Miri scans the code and marks all locals as live that have no Storage* instruction anywhere. In other words, a local that has no Storage* is considered live throughout the entire function; for locals with any Storage* anywhere (including in dead code), those determine liveness.

We should make sure our dataflow analyses agree! This is observable to the program by checking address identity: by removing Storage* for a local, you are guaranteeing that that local will have the same address throughout the entire call. Thus we can no longer perform optimizations that would change that address.

This is just an optimization to avoid having to scan the entire body, as that's slow for some big constants:

// statics and constants don't have `Storage*` statements, no need to look for them
Some(DefKind::Static) | Some(DefKind::Const) | Some(DefKind::AssocConst) => {}

It should not change anything, as those do not have Storage* anyway. That is a difference in MIR building between constants and run-time, nor a difference in Miri semantics. (Another difference is that MIR in constants gets arithmetic overflow checks even in release mode. Not sure if there are more differences.)

@eddyb
Copy link
Member

eddyb commented Mar 21, 2020

It should not change anything, as those do not have Storage* anyway. That is a difference in MIR building between constants and run-time, nor a difference in Miri semantics.

That's not true though, except at the outermost scope (and there we might still emit StorageLive w/o StorageDead). If you have let or temporaries nested in statements in blocks, you should be seeing Storage* in constants.

@RalfJung
Copy link
Member

RalfJung commented Mar 21, 2020

I guess this means MIR building changed since @oli-obk introduced this optimization.

@eddyb
Copy link
Member

eddyb commented Mar 21, 2020

I guess this means MIR building changed since @oli-obk introduced this optimization.

What's more likely IMO is @oli-obk only tried simple examples, and nothing actually needing Storage*.

If you remind me (e.g. later on Zulip) I can try to craft an example that produced Storage* in constants going back to Rust versions before miri.

(oops, if you saw @RalfJung's comment being edited, it's because apparently, "Quote Reply" on the new GitHub mobile app edits the original comment?! just reported it, I'll try to avoid it until it's fixed)

@JohnCSimon JohnCSimon added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 28, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Apr 9, 2020
… r=tmandry

Add utility to find locals that don't use `StorageLive` annotations and use it for `MaybeStorageLive`

Addresses rust-lang#70004 (comment) (cc @RalfJung).

The only dataflow analysis that is incorrect in this case is `MaybeStorageLive`. `transform/generator.rs` implemented custom handling for this class of locals, but other consumers of this analysis (there's one in [clippy](https://github.com/rust-lang/rust-clippy/blob/513b46793e98ce5b412d388a91f6371d6a9b290b/clippy_lints/src/redundant_clone.rs#L402)) would be incorrect.

r? @tmandry
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 10, 2020
…=tmandry

Add utility to find locals that don't use `StorageLive` annotations and use it for `MaybeStorageLive`

Addresses rust-lang#70004 (comment) (cc @RalfJung).

The only dataflow analysis that is incorrect in this case is `MaybeStorageLive`. `transform/generator.rs` implemented custom handling for this class of locals, but other consumers of this analysis (there's one in [clippy](https://github.com/rust-lang/rust-clippy/blob/513b46793e98ce5b412d388a91f6371d6a9b290b/clippy_lints/src/redundant_clone.rs#L402)) would be incorrect.

r? @tmandry
@nikomatsakis
Copy link
Contributor

Closing this pull request as Zoxc is stepping back from compiler development; see rust-lang/team#316.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.