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

Remove interior mutability in mir predecessors cache #64736

Merged
merged 47 commits into from
Dec 2, 2019

Conversation

Nashenas88
Copy link
Contributor

No description provided.

@rust-highfive
Copy link
Collaborator

r? @eddyb

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 24, 2019
@Nashenas88
Copy link
Contributor Author

r? @oli-obk

@rust-highfive rust-highfive assigned oli-obk and unassigned eddyb Sep 24, 2019
src/librustc/mir/mod.rs Outdated Show resolved Hide resolved
src/librustc/mir/mod.rs Outdated Show resolved Hide resolved
src/librustc/mir/mod.rs Outdated Show resolved Hide resolved
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 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.
2019-09-24T13:10:24.1463816Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-09-24T13:10:24.1657059Z ##[command]git config gc.auto 0
2019-09-24T13:10:24.1748206Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-09-24T13:10:24.6919427Z ##[command]git config --get-all http.proxy
2019-09-24T13:10:24.6924411Z ##[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/64736/merge:refs/remotes/pull/64736/merge
---
2019-09-24T13:17:33.4353433Z    Compiling serde_json v1.0.40
2019-09-24T13:17:35.2442011Z    Compiling tidy v0.1.0 (/checkout/src/tools/tidy)
2019-09-24T13:17:46.0510383Z     Finished release [optimized] target(s) in 1m 29s
2019-09-24T13:17:46.0605631Z tidy check
2019-09-24T13:17:46.3993955Z tidy error: /checkout/src/librustc/mir/mod.rs:233: TODO is deprecated; use FIXME
2019-09-24T13:17:48.1038100Z some tidy checks failed
2019-09-24T13:17:48.1042233Z 
2019-09-24T13:17:48.1042233Z 
2019-09-24T13:17:48.1043351Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor"
2019-09-24T13:17:48.1047127Z 
2019-09-24T13:17:48.1053982Z 
2019-09-24T13:17:48.1054108Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2019-09-24T13:17:48.1055024Z Build completed unsuccessfully in 0:01:32
2019-09-24T13:17:48.1055024Z Build completed unsuccessfully in 0:01:32
2019-09-24T13:17:48.1107557Z == clock drift check ==
2019-09-24T13:17:48.1124722Z   local time: Tue Sep 24 13:17:48 UTC 2019
2019-09-24T13:17:48.2620173Z   network time: Tue, 24 Sep 2019 13:17:48 GMT
2019-09-24T13:17:48.2622742Z == end clock drift check ==
2019-09-24T13:17:49.6692301Z ##[error]Bash exited with code '1'.
2019-09-24T13:17:49.6728211Z ##[section]Starting: Checkout
2019-09-24T13:17:49.6730073Z ==============================================================================
2019-09-24T13:17:49.6730120Z Task         : Get sources
2019-09-24T13:17:49.6730180Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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 @TimNN. (Feature Requests)

src/librustc/mir/mod.rs Outdated Show resolved Hide resolved
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 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.
2019-09-25T01:30:38.4764890Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-09-25T01:30:38.4946454Z ##[command]git config gc.auto 0
2019-09-25T01:30:39.0132450Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-09-25T01:30:39.0134883Z ##[command]git config --get-all http.proxy
2019-09-25T01:30:39.0137915Z ##[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/64736/merge:refs/remotes/pull/64736/merge
---
2019-09-25T01:38:58.2729467Z    Compiling serde_json v1.0.40
2019-09-25T01:39:00.6653862Z    Compiling tidy v0.1.0 (/checkout/src/tools/tidy)
2019-09-25T01:39:11.3646400Z     Finished release [optimized] target(s) in 1m 32s
2019-09-25T01:39:11.3737582Z tidy check
2019-09-25T01:39:11.7109249Z tidy error: /checkout/src/librustc/mir/mod.rs:257: TODO is deprecated; use FIXME
2019-09-25T01:39:13.4020179Z some tidy checks failed
2019-09-25T01:39:13.4022898Z 
2019-09-25T01:39:13.4022898Z 
2019-09-25T01:39:13.4024798Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor"
2019-09-25T01:39:13.4025573Z 
2019-09-25T01:39:13.4025705Z 
2019-09-25T01:39:13.4037475Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2019-09-25T01:39:13.4037870Z Build completed unsuccessfully in 0:01:35
2019-09-25T01:39:13.4037870Z Build completed unsuccessfully in 0:01:35
2019-09-25T01:39:13.4094495Z == clock drift check ==
2019-09-25T01:39:13.4109191Z   local time: Wed Sep 25 01:39:13 UTC 2019
2019-09-25T01:39:13.6894193Z   network time: Wed, 25 Sep 2019 01:39:13 GMT
2019-09-25T01:39:13.6897026Z == end clock drift check ==
2019-09-25T01:39:15.2912747Z ##[error]Bash exited with code '1'.
2019-09-25T01:39:15.3068814Z ##[section]Starting: Checkout
2019-09-25T01:39:15.3070576Z ==============================================================================
2019-09-25T01:39:15.3070789Z Task         : Get sources
2019-09-25T01:39:15.3070851Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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 @TimNN. (Feature Requests)

src/librustc/mir/mod.rs Outdated Show resolved Hide resolved
@rust-highfive
Copy link
Collaborator

The job mingw-check 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.
2019-09-28T14:48:52.3840422Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-09-28T14:48:52.4004230Z ##[command]git config gc.auto 0
2019-09-28T14:48:52.4074224Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-09-28T14:48:52.4134507Z ##[command]git config --get-all http.proxy
2019-09-28T14:48:52.4264941Z ##[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/64736/merge:refs/remotes/pull/64736/merge
---
2019-09-28T14:58:07.7080313Z     Checking rustc_passes v0.0.0 (/checkout/src/librustc_passes)
2019-09-28T14:58:08.4099143Z     Checking rustc_lint v0.0.0 (/checkout/src/librustc_lint)
2019-09-28T14:58:10.0053410Z     Checking rustc_mir v0.0.0 (/checkout/src/librustc_mir)
2019-09-28T14:58:11.0805537Z error[E0412]: cannot find type `Body` in this scope
2019-09-28T14:58:11.0807249Z  --> src/librustc_mir/transform/ensure_predecessors_cache.rs:7:79
2019-09-28T14:58:11.0807499Z   |
2019-09-28T14:58:11.0808222Z 7 |     fn run_pass(&self, tcx: TyCtxt<'tcx>, source: MirSource<'tcx>, body: &mut Body<'tcx>) {
2019-09-28T14:58:11.0809129Z help: possible candidates are found in other modules, you can import them into scope
2019-09-28T14:58:11.0809398Z   |
2019-09-28T14:58:11.0809668Z 1 | use rustc::hir::Body;
2019-09-28T14:58:11.0809909Z   |
---
2019-09-28T14:58:20.7433303Z == clock drift check ==
2019-09-28T14:58:20.7450229Z   local time: Sat Sep 28 14:58:20 UTC 2019
2019-09-28T14:58:20.8330202Z   network time: Sat, 28 Sep 2019 14:58:20 GMT
2019-09-28T14:58:20.8330420Z == end clock drift check ==
2019-09-28T14:58:22.0584778Z ##[error]Bash exited with code '1'.
2019-09-28T14:58:22.0624129Z ##[section]Starting: Checkout
2019-09-28T14:58:22.0626097Z ==============================================================================
2019-09-28T14:58:22.0626165Z Task         : Get sources
2019-09-28T14:58:22.0626210Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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 @TimNN. (Feature Requests)

src/librustc/mir/visit.rs Outdated Show resolved Hide resolved
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 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.
2019-09-28T15:19:52.3296849Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-09-28T15:19:52.3504968Z ##[command]git config gc.auto 0
2019-09-28T15:19:52.3588205Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-09-28T15:19:52.3651080Z ##[command]git config --get-all http.proxy
2019-09-28T15:19:52.3792332Z ##[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/64736/merge:refs/remotes/pull/64736/merge
---
2019-09-28T15:26:58.1602292Z    Compiling serde_json v1.0.40
2019-09-28T15:27:00.0563192Z    Compiling tidy v0.1.0 (/checkout/src/tools/tidy)
2019-09-28T15:27:11.3834856Z     Finished release [optimized] target(s) in 1m 30s
2019-09-28T15:27:11.3919434Z tidy check
2019-09-28T15:27:11.8427510Z tidy error: /checkout/src/librustc_mir/transform/simplify.rs:280: line longer than 100 chars
2019-09-28T15:27:12.0614326Z tidy error: /checkout/src/librustc/mir/visit.rs:850: TODO is deprecated; use FIXME
2019-09-28T15:27:12.0646391Z tidy error: /checkout/src/librustc/mir/mod.rs:216: line longer than 100 chars
2019-09-28T15:27:12.0646990Z tidy error: /checkout/src/librustc/mir/mod.rs:266: TODO is deprecated; use FIXME
2019-09-28T15:27:13.3602466Z some tidy checks failed
2019-09-28T15:27:13.3612593Z 
2019-09-28T15:27:13.3612593Z 
2019-09-28T15:27:13.3614305Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor"
2019-09-28T15:27:13.3614712Z 
2019-09-28T15:27:13.3614739Z 
2019-09-28T15:27:13.3614816Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2019-09-28T15:27:13.3614907Z Build completed unsuccessfully in 0:01:33
2019-09-28T15:27:13.3614907Z Build completed unsuccessfully in 0:01:33
2019-09-28T15:27:13.3659794Z == clock drift check ==
2019-09-28T15:27:13.3678089Z   local time: Sat Sep 28 15:27:13 UTC 2019
2019-09-28T15:27:13.4871413Z   network time: Sat, 28 Sep 2019 15:27:13 GMT
2019-09-28T15:27:13.4875180Z == end clock drift check ==
2019-09-28T15:27:14.8721107Z ##[error]Bash exited with code '1'.
2019-09-28T15:27:14.8759701Z ##[section]Starting: Checkout
2019-09-28T15:27:14.8761652Z ==============================================================================
2019-09-28T15:27:14.8761727Z Task         : Get sources
2019-09-28T15:27:14.8761776Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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 @TimNN. (Feature Requests)

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 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.
2019-09-28T17:50:31.1960629Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-09-28T17:50:31.2208002Z ##[command]git config gc.auto 0
2019-09-28T17:50:31.2303218Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-09-28T17:50:31.2369092Z ##[command]git config --get-all http.proxy
2019-09-28T17:50:31.2534629Z ##[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/64736/merge:refs/remotes/pull/64736/merge
---
2019-09-28T17:57:36.7694095Z    Compiling serde_json v1.0.40
2019-09-28T17:57:38.6574426Z    Compiling tidy v0.1.0 (/checkout/src/tools/tidy)
2019-09-28T17:57:50.1401209Z     Finished release [optimized] target(s) in 1m 31s
2019-09-28T17:57:50.1500237Z tidy check
2019-09-28T17:57:50.6418353Z tidy error: /checkout/src/librustc_mir/transform/simplify.rs:280: line longer than 100 chars
2019-09-28T17:57:50.9335490Z tidy error: /checkout/src/librustc/mir/mod.rs:216: line longer than 100 chars
2019-09-28T17:57:50.9335672Z tidy error: /checkout/src/librustc/mir/mod.rs:266: TODO is deprecated; use FIXME
2019-09-28T17:57:52.2541490Z some tidy checks failed
2019-09-28T17:57:52.2547453Z 
2019-09-28T17:57:52.2547453Z 
2019-09-28T17:57:52.2548768Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor"
2019-09-28T17:57:52.2548921Z 
2019-09-28T17:57:52.2548946Z 
2019-09-28T17:57:52.2562467Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2019-09-28T17:57:52.2562554Z Build completed unsuccessfully in 0:01:34
2019-09-28T17:57:52.2562554Z Build completed unsuccessfully in 0:01:34
2019-09-28T17:57:52.2619295Z == clock drift check ==
2019-09-28T17:57:52.2634247Z   local time: Sat Sep 28 17:57:52 UTC 2019
2019-09-28T17:57:52.4165715Z   network time: Sat, 28 Sep 2019 17:57:52 GMT
2019-09-28T17:57:52.4171278Z == end clock drift check ==
2019-09-28T17:57:53.7891128Z ##[error]Bash exited with code '1'.
2019-09-28T17:57:53.7934730Z ##[section]Starting: Checkout
2019-09-28T17:57:53.7936711Z ==============================================================================
2019-09-28T17:57:53.7936768Z Task         : Get sources
2019-09-28T17:57:53.7936814Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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 @TimNN. (Feature Requests)

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 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.
2019-09-28T18:24:26.8468548Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-09-28T18:24:26.8657367Z ##[command]git config gc.auto 0
2019-09-28T18:24:26.8757995Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-09-28T18:24:27.8247639Z ##[command]git config --get-all http.proxy
2019-09-28T18:24:27.8253013Z ##[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/64736/merge:refs/remotes/pull/64736/merge
---
2019-09-28T18:57:10.8209576Z Assembling stage1 compiler (x86_64-unknown-linux-gnu)
2019-09-28T18:57:10.8243128Z Building stage1 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-28T18:57:11.2846123Z    Compiling cc v1.0.35
2019-09-28T18:57:11.2847256Z    Compiling core v0.0.0 (/checkout/src/libcore)
2019-09-28T18:57:17.1244827Z thread 'rustc' panicked at 'assertion failed: self.predecessors_cache.is_some()', src/librustc/mir/mod.rs:239:9
2019-09-28T18:57:17.1245441Z 
2019-09-28T18:57:17.1245491Z error: internal compiler error: unexpected panic
2019-09-28T18:57:17.1245546Z 
2019-09-28T18:57:17.1251403Z note: the compiler unexpectedly panicked. this is a bug.
2019-09-28T18:57:17.1251403Z note: the compiler unexpectedly panicked. this is a bug.
2019-09-28T18:57:17.1251484Z 
2019-09-28T18:57:17.1252670Z note: we would appreciate a bug report: ***/blob/master/CONTRIBUTING.md#bug-reports
2019-09-28T18:57:17.1253034Z note: rustc 1.40.0-dev running on x86_64-unknown-linux-gnu
2019-09-28T18:57:17.1253068Z 
2019-09-28T18:57:17.1253068Z 
2019-09-28T18:57:17.1253544Z note: compiler flags: -Z external-macro-backtrace -Z binary-dep-depinfo -Z force-unstable-if-unmarked -C opt-level=2 -C codegen-units=1 -C debuginfo=0 -C link-args=-Wl,-rpath,$ORIGIN/../lib -C prefer-dynamic -C debug-assertions=n --crate-type lib
2019-09-28T18:57:17.1253665Z note: some of the compiler flags provided by cargo are hidden
2019-09-28T18:57:17.1253953Z 
2019-09-28T18:57:17.2790891Z error: could not compile `core`.
2019-09-28T18:57:17.2818668Z warning: build failed, waiting for other jobs to finish...
---
2019-09-28T18:57:17.7994863Z == clock drift check ==
2019-09-28T18:57:17.8012614Z   local time: Sat Sep 28 18:57:17 UTC 2019
2019-09-28T18:57:17.8901086Z   network time: Sat, 28 Sep 2019 18:57:17 GMT
2019-09-28T18:57:17.8901205Z == end clock drift check ==
2019-09-28T18:57:18.5931596Z ##[error]Bash exited with code '1'.
2019-09-28T18:57:18.5997665Z ##[section]Starting: Checkout
2019-09-28T18:57:18.5999879Z ==============================================================================
2019-09-28T18:57:18.5999960Z Task         : Get sources
2019-09-28T18:57:18.6000013Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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 @TimNN. (Feature Requests)

@bors
Copy link
Contributor

bors commented Sep 29, 2019

☔ The latest upstream changes (presumably #64886) made this pull request unmergeable. Please resolve the merge conflicts.

src/librustc_mir/shim.rs Outdated Show resolved Hide resolved
src/librustc_mir/transform/ensure_predecessors_cache.rs Outdated Show resolved Hide resolved
src/librustc/mir/mod.rs Outdated Show resolved Hide resolved
src/librustc_mir/transform/add_call_guards.rs Outdated Show resolved Hide resolved
src/librustc_mir/shim.rs Outdated Show resolved Hide resolved
src/librustc_mir/transform/mod.rs Outdated Show resolved Hide resolved
@Nashenas88 Nashenas88 force-pushed the mir_predecessors_cache_cleanup branch from c52d128 to 176fcc9 Compare October 4, 2019 04:55
@Nashenas88 Nashenas88 marked this pull request as ready for review October 4, 2019 14:23
@Nashenas88 Nashenas88 force-pushed the mir_predecessors_cache_cleanup branch from e549f6f to 3eaad56 Compare December 2, 2019 14:40
@Nashenas88
Copy link
Contributor Author

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Dec 2, 2019

📌 Commit 3eaad56 has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 2, 2019
@bors
Copy link
Contributor

bors commented Dec 2, 2019

⌛ Testing commit 3eaad56 with merge fdc0011...

bors added a commit that referenced this pull request Dec 2, 2019
…li-obk

Remove interior mutability in mir predecessors cache
@bors
Copy link
Contributor

bors commented Dec 2, 2019

☀️ Test successful - checks-azure
Approved by: oli-obk
Pushing fdc0011 to master...

}

impl BodyCache<'tcx> {
pub fn ensure_predecessors(&mut self) {
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't need to take self by mut ref.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does. Cache's ensure_predecessors takes self by mut ref (https://github.com/rust-lang/rust/pull/64736/files/3eaad564d25402013bdf5591c453c916b49cdf93#diff-f1f20e32c0d3522f2f33135df0f4696bR47), and that requires that self.cache here below is taken by mut ref. That's only possible if you have &mut self. Or is there some detail I'm overlooking?

flip1995 added a commit to flip1995/rust-clippy that referenced this pull request Dec 2, 2019
bors added a commit to rust-lang/rust-clippy that referenced this pull request Dec 2, 2019
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 2, 2019
Changes:
````
Normalize custom ICE test
Rustup to rust-lang#64736
Use assert_crate_local for a more explicit error
Rustup to rust-lang#66789
account for external macro in MISSING_INLINE_IN_PUBLIC_ITEMS lint
build(tests/fmt): use shared target dir
chore: fix and split some ui tests on 32bit system
build: set up build job for i686 targets
remove needless my_lint ui test
git quiet
deploy: cd to out/ before adding files to git
Less needless_doctest_main false positives
fmt
Feed the dog
Use rustc_env instead of exec_env for test
Make triggering this lint less likely 📎
Use exec_env to set backtrace level and normalize output
Update custom ICE function with latest rustc
Use Clippy version in ICE message
Add custom ICE message that points to Clippy repo
Fix master deployment
Run update_lints
Add projections check to EUV for escape analysis
Use infer_ctxt
Move use_self to nursery
Use `println!` on success instead of `eprintln!`
Revert "Disable chalk integration test. Output too large"
Remove the old integration-tests.sh script
Use rust implementation for integration tests in CI
Rust implementation of integration test
Don't error on clippy.toml of dependencies
Fix categorizations
Fix arguments on ExprUseVisitor::new
euv moved from middle to typeck
cmt_ -> Place
build: check if RTIM is not installed
make use of Result::map_or
trigger string_lit_as_bytes when literal has escapes
Remove negative float literal checks.
Enable deny-warnings feature everywhere in CI
Remove unused debugging feature
implemented `as_conversions` lint
fixing a typo
[comparison_chain] rust-lang#4827 Check `core::cmp::Ord` is implemented
add a good example for the approx_const lint
Add suggested good cases in docs for lifetimes lint
````
@Nashenas88 Nashenas88 deleted the mir_predecessors_cache_cleanup branch December 3, 2019 02:16
result[tgt].push(bb);
}
#[derive(Clone, Debug, HashStable, RustcEncodable, RustcDecodable, TypeFoldable)]
pub struct BodyCache<'tcx> {
Copy link
Member

Choose a reason for hiding this comment

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

This should probably be named BodyAndCache to alleviate confusion.

}
}

impl Index<BasicBlock> for ReadOnlyBodyCache<'a, 'tcx> {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think you need this, since you have Deref.



impl Deref for ReadOnlyBodyCache<'a, 'tcx> {
type Target = Body<'tcx>;
Copy link
Member

@eddyb eddyb Dec 3, 2019

Choose a reason for hiding this comment

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

Oof, this is a common mistake for wrappers of references.

The target should be the reference, &'a Body<'tcx>, so that you can actually get e.g. &'tcx mir::BasicBlockData<'tcx> when 'a = 'tcx.

I wonder if this PR added any lifetimes to existing code to work around that (likely not codegen because that was already wrongly using &'a Body<'tcx> instead of &'tcx Body<'tcx>).

EDIT: thankfully doesn't seem like it. I will likely fix the Deref impl in #65947.

fn create_funclets<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
mir: &'a Body<'tcx>,
fn create_funclets<'a, 'b, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
mir: &'b Body<'tcx>,
Copy link
Member

Choose a reason for hiding this comment

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

This is just &Body<'tcx>.

eddyb added a commit to eddyb/rust that referenced this pull request Dec 3, 2019
@Nashenas88 Nashenas88 mentioned this pull request Dec 3, 2019
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 30, 2020
Make `Visitor::visit_body` take a plain `&Body`

`ReadOnlyBodyAndCache` has replaced `&Body` in many parts of the code base that don't care about basic block predecessors. This includes the MIR `Visitor` trait, which I suspect resulted in many unnecessary changes in rust-lang#64736. This reverts part of that PR to reduce the number of places where we need to pass a `ReadOnlyBodyAndCache`.

In the long term, we should either give `ReadOnlyBodyAndCache` more ergonomic name and replace all uses of `&mir::Body` with it at the cost of carrying an extra pointer everywhere, or use it only in places that actually need access to the predecessor cache. Perhaps there is an even nicer alternative.

r? @Nashenas88
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request May 5, 2020
Changes:
````
Normalize custom ICE test
Rustup to rust-lang/rust#64736
Use assert_crate_local for a more explicit error
Rustup to rust-lang/rust#66789
account for external macro in MISSING_INLINE_IN_PUBLIC_ITEMS lint
build(tests/fmt): use shared target dir
chore: fix and split some ui tests on 32bit system
build: set up build job for i686 targets
remove needless my_lint ui test
git quiet
deploy: cd to out/ before adding files to git
Less needless_doctest_main false positives
fmt
Feed the dog
Use rustc_env instead of exec_env for test
Make triggering this lint less likely 📎
Use exec_env to set backtrace level and normalize output
Update custom ICE function with latest rustc
Use Clippy version in ICE message
Add custom ICE message that points to Clippy repo
Fix master deployment
Run update_lints
Add projections check to EUV for escape analysis
Use infer_ctxt
Move use_self to nursery
Use `println!` on success instead of `eprintln!`
Revert "Disable chalk integration test. Output too large"
Remove the old integration-tests.sh script
Use rust implementation for integration tests in CI
Rust implementation of integration test
Don't error on clippy.toml of dependencies
Fix categorizations
Fix arguments on ExprUseVisitor::new
euv moved from middle to typeck
cmt_ -> Place
build: check if RTIM is not installed
make use of Result::map_or
trigger string_lit_as_bytes when literal has escapes
Remove negative float literal checks.
Enable deny-warnings feature everywhere in CI
Remove unused debugging feature
implemented `as_conversions` lint
fixing a typo
[comparison_chain] rust-lang#4827 Check `core::cmp::Ord` is implemented
add a good example for the approx_const lint
Add suggested good cases in docs for lifetimes lint
````
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.