about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-11-04 18:56:43 +0000
committerbors <bors@rust-lang.org>2018-11-04 18:56:43 +0000
commite6c5cf923489f4aed6c9e36a170fab9b6179d8da (patch)
tree2f239aed2009e385798d2d85117132c058244c71 /src/rustllvm/RustWrapper.cpp
parentca4fa6f567b5d8a01f7db864539a43457119a45c (diff)
parentd00d42d079236893f0a8b2cd726c6957d96ec296 (diff)
downloadrust-e6c5cf923489f4aed6c9e36a170fab9b6179d8da.tar.gz
rust-e6c5cf923489f4aed6c9e36a170fab9b6179d8da.zip
Auto merge of #55665 - eddyb:by-ref-layout-of, r=oli-obk
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
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions