Uh oh!
There was an error while loading. Please reload this page.
rustc_target: pass contexts by reference, not value. - #55665
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
oli-obk
commented
Nov 3, 2018
@bors r+ |
bors
commented
Nov 3, 2018
📌 Commit d42d783863bda3a192e32e7c89d7779b4a76b093 has been approved by |
bors
commented
Nov 4, 2018
☔ The latest upstream changes (presumably #55393) made this pull request unmergeable. Please resolve the merge conflicts. |
eddyb
commented
Nov 4, 2018
bors
commented
Nov 4, 2018
📌 Commit d00d42d has been approved by |
bors
commented
Nov 4, 2018
rustc_target: pass contexts by reference, not value. `LayoutOf` now takes `&self` instead of `self`, and so does every method generic over a context that implements `LayoutOf` and/or other traits, like `HasDataLayout`, `HasTyCtxt`, etc. Originally using by-value `Copy` types was relevant because `TyCtxt` was one of those types, but now `TyCtxt::layout_of` is separate from `LayoutOf`, and `TyCtxt` is not an often used layout context. Passing these context by reference is a lot nicer for miri, which has `self: &mut EvalContext`, and needed `f(&self)` (that is, creating `&&mut EvalContext` references) for layout purposes. Now, the `&mut EvalContext` can be passed to a function expecting `&C`, directly. This should help with #54012 / #55627 (to not need `where &'a T::Cx: LayoutOf` bounds). r? @nikomatsakis or @oli-obk or @nagisa cc @sunfishcode
bors
commented
Nov 4, 2018
☀️ Test successful - status-appveyor, status-travis |
rust-highfive
commented
Nov 4, 2018
📣 Toolstate changed by #55665! Tested on commit e6c5cf9. 💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth@llogiq@mcarton@oli-obk, @rust-lang/infra). |
Tested on commit rust-lang/rust@e6c5cf9. Direct link to PR: <rust-lang/rust#55665> 💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth@llogiq@mcarton@oli-obk, @rust-lang/infra). 💔 clippy-driver on linux: test-pass → build-fail (cc @Manishearth@llogiq@mcarton@oli-obk, @rust-lang/infra). 💔 rls on windows: test-pass → build-fail (cc @nrc@Xanewok, @rust-lang/infra). 💔 rls on linux: test-pass → build-fail (cc @nrc@Xanewok, @rust-lang/infra).
3411: rustup rust-lang/rust#55665 (pass contexts by reference) r=matthiaskrgr a=matthiaskrgr Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
Fixes clippy toolstate. Changes: ```` rustup rust-lang#55665 (pass contexts by reference) Fix typo Improve clippy_dev help text RIIR update lints: Generate lint group registrations Test clippy_dev on CI and fix test RIIR update lints: Generate modules section ````
submodules: update clippy from 71ec4ff to d8b4269 Fixes clippy toolstate. Changes: ```` rustup #55665 (pass contexts by reference) Fix typo Improve clippy_dev help text RIIR update lints: Generate lint group registrations Test clippy_dev on CI and fix test RIIR update lints: Generate modules section ````
Fixes clippy toolstate. Changes: ```` rustup rust-lang/rust#55665 (pass contexts by reference) Fix typo Improve clippy_dev help text RIIR update lints: Generate lint group registrations Test clippy_dev on CI and fix test RIIR update lints: Generate modules section ````
LayoutOfnow takes&selfinstead ofself, and so does every method generic over a context that implementsLayoutOfand/or other traits, likeHasDataLayout,HasTyCtxt, etc.Originally using by-value
Copytypes was relevant becauseTyCtxtwas one of those types, but nowTyCtxt::layout_ofis separate fromLayoutOf, andTyCtxtis not an often used layout context.Passing these context by reference is a lot nicer for miri, which has
self: &mut EvalContext, and neededf(&self)(that is, creating&&mut EvalContextreferences) for layout purposes.Now, the
&mut EvalContextcan be passed to a function expecting&C, directly.This should help with #54012 / #55627 (to not need
where &'a T::Cx: LayoutOfbounds).r? @nikomatsakis or @oli-obk or @nagisa cc @sunfishcode