Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
4e7d53d
Search codegen backends based on target libdir instead of sysroot.
o01eg Dec 24, 2018
fcad209
Add closure cannot be moved note.
davidtwco Dec 24, 2018
fff905b
panic when calling MaybeUninhabited::into_inner on uninhabited type
RalfJung Dec 27, 2018
c118b17
use a better way to get at the type parameter
RalfJung Dec 27, 2018
2149d73
Remove unnecessary borrow generation
matthewjasper Dec 1, 2018
49e52e7
Remove unused types from rustc::mir::interpret
matthewjasper Dec 29, 2018
4e77c3a
test: Add test for issues 45510 and 18952.
cjgillot Nov 4, 2018
6de9c13
rustfmt: librust_typeck/check/callee.rs
cjgillot Nov 4, 2018
1827d52
rustc_typeck: Implement resolution advised in issue 45510.
cjgillot Nov 4, 2018
f518cf9
Move tests to ui.
cjgillot Nov 8, 2018
2f42a18
Fix failing diagnostic test.
cjgillot Nov 21, 2018
2530ce9
Add comment.
cjgillot Nov 21, 2018
91c155b
Change return types and check return values in tests.
cjgillot Nov 27, 2018
afb7c06
Remove unused nll debug flags
matthewjasper Dec 30, 2018
3512a72
Implement the re-rebalance coherence rfc
weiznich Nov 20, 2018
b8ee6fa
Add some tests
weiznich Nov 21, 2018
e869e5f
Add some docs about the new feature to the unstable book
weiznich Nov 21, 2018
cae96b1
Fix tidy
weiznich Nov 21, 2018
eee09d5
Update src/doc/unstable-book/src/language-features/re-rebalance-coher…
varkor Nov 22, 2018
6912b2d
Directly check if input_ty is a type parameter and therefore a
weiznich Nov 23, 2018
44089c8
Fix failing compile tests
weiznich Dec 14, 2018
ad7d015
Update some new tests to changed error messages
weiznich Dec 14, 2018
8a5d45d
Unify tests
weiznich Dec 28, 2018
da08a81
Fix typo
weiznich Dec 28, 2018
6caa4ce
Add missing files
weiznich Dec 29, 2018
794b81e
Rename and fix nolink-with-link-args test
Smibu Dec 31, 2018
f4826ab
Fix backtraces on Windows
Zoxc Dec 31, 2018
d2c91a1
Fix broken links to second edition TRPL.
frewsxcv Jan 1, 2019
b903cb9
Move the `Unevaluated` constant arm upwards in the type structure
oli-obk Dec 11, 2018
88df3a2
Mingw is special wrt type sizes
oli-obk Dec 12, 2018
1351328
Simplify and fix some diagnostics around arrays
oli-obk Dec 12, 2018
f36c655
Add `unwrap_usize` to `LazyConst`, too
oli-obk Dec 13, 2018
bb9f717
`const_to_op` is now `lazy_const_to_op`
oli-obk Dec 13, 2018
37a0df3
`<&'tcx ty::Const as Deref>::deref`
oli-obk Dec 13, 2018
17db209
Simplify bit inspection of a constant
oli-obk Dec 13, 2018
d96c4a9
Undo a few - now unnecessary - changes
oli-obk Dec 13, 2018
089c403
Pacify tidy
oli-obk Dec 13, 2018
cb933ef
rebase fallout
oli-obk Dec 15, 2018
3d924a6
Git is drunk
oli-obk Dec 23, 2018
48aa819
what is going on?
oli-obk Dec 27, 2018
e42b21b
Properly lift `Allocations`
oli-obk Dec 28, 2018
72bcf92
Macrofy more `Lift` impls
oli-obk Dec 28, 2018
9654ae9
Remove unused function
oli-obk Dec 28, 2018
03b8928
Check the correct arena
oli-obk Dec 28, 2018
185636e
Update reference of rlibc crate to compiler-builtins crate
king6cong Jan 2, 2019
0fd5003
src/jemalloc is gone, remove its mention from COPYRIGHT
SimonSapin Jan 2, 2019
2a02d6d
Make sure feature gate errors are recoverable (take 2)
petrochenkov Jan 2, 2019
0a6fb84
make `panictry!` private to libsyntax
euclio Dec 4, 2018
0b6d217
Update compiler_builtins 0.1.2 -> 0.1.3
Jan 2, 2019
3852dc8
Add Clippy to config.toml.example
mati865 Jan 2, 2019
ea7fef1
bootstrap: Link LLVM as a dylib with ThinLTO
alexcrichton Dec 18, 2018
a175969
Avoid using open_global_now
alexcrichton Dec 18, 2018
82a1bb3
Remove no longer working test
alexcrichton Dec 19, 2018
fa4f014
Remove now stray comment
alexcrichton Dec 19, 2018
c0662a0
Update the stdsimd submodule
alexcrichton Jan 2, 2019
71fed3a
Don't package up libLLVM.so with libstd
alexcrichton Jan 2, 2019
a944ecf
Fix 'be be' constructs
d-e-s-o Jan 3, 2019
32118a9
More test deduplication
weiznich Jan 3, 2019
677eef5
Rollup merge of #55986 - cjgillot:issue-45510, r=nikomatsakis
Mark-Simulacrum Jan 3, 2019
be8a496
Rollup merge of #56145 - weiznich:re_rebalance_coherence, r=nikomatsakis
Mark-Simulacrum Jan 3, 2019
fee93ea
Rollup merge of #56723 - oli-obk:lazy_const, r=nikomatsakis
Mark-Simulacrum Jan 3, 2019
3baae65
Rollup merge of #56897 - euclio:parse-fatal, r=estebank
Mark-Simulacrum Jan 3, 2019
c90bf0e
Rollup merge of #57099 - davidtwco:issue-57098, r=nikomatsakis
Mark-Simulacrum Jan 3, 2019
4473e32
Rollup merge of #57101 - o01eg:fix-57014, r=alexcrichton
Mark-Simulacrum Jan 3, 2019
2701289
Rollup merge of #57145 - RalfJung:panic-if-uninhabited, r=alexcrichton
Mark-Simulacrum Jan 3, 2019
88818d6
Rollup merge of #57219 - matthewjasper:mir-cleanup, r=nikomatsakis
Mark-Simulacrum Jan 3, 2019
ac58493
Rollup merge of #57233 - Smibu:rename-and-fix-nolink-test, r=alexcric…
Mark-Simulacrum Jan 3, 2019
400d453
Rollup merge of #57238 - Zoxc:bt-fix, r=alexcrichton
Mark-Simulacrum Jan 3, 2019
028774c
Rollup merge of #57249 - frewsxcv:frewsxcv-second-edition, r=KodrAus
Mark-Simulacrum Jan 3, 2019
e78b596
Rollup merge of #57259 - king6cong:master, r=alexcrichton
Mark-Simulacrum Jan 3, 2019
0496b18
Rollup merge of #57267 - rust-lang:SimonSapin-patch-1, r=varkor
Mark-Simulacrum Jan 3, 2019
f05bd30
Rollup merge of #57272 - petrochenkov:featrecov, r=estebank
Mark-Simulacrum Jan 3, 2019
cf56d3f
Rollup merge of #57273 - alexcrichton:update-stdsimd, r=nikomatsakis
Mark-Simulacrum Jan 3, 2019
6e80fb1
Rollup merge of #57275 - jethrogb:jb/update-compiler_builtins, r=alex…
Mark-Simulacrum Jan 3, 2019
e8472e4
Rollup merge of #57278 - mati865:config_clippy, r=alexcrichton
Mark-Simulacrum Jan 3, 2019
5508d36
Rollup merge of #57286 - alexcrichton:less-thin-2-2, r=nikomatsakis
Mark-Simulacrum Jan 3, 2019
6adc37e
Rollup merge of #57295 - d-e-s-o:topic/be-be, r=zackmdavis
Mark-Simulacrum Jan 3, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
<&'tcx ty::Const as Deref>::deref
  • Loading branch information
oli-obk committed Jan 1, 2019
commit 37a0df3e9db1b934dfb698fc1d7cbf506532004f
2 changes: 1 addition & 1 deletion src/librustc/mir/interpret/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl ErrorHandled {
}

pub type ConstEvalRawResult<'tcx> = Result<RawConst<'tcx>, ErrorHandled>;
pub type ConstEvalResult<'tcx> = Result<&'tcx ty::Const<'tcx>, ErrorHandled>;
pub type ConstEvalResult<'tcx> = Result<ty::Const<'tcx>, ErrorHandled>;

#[derive(Clone, Debug, RustcEncodable, RustcDecodable)]
pub struct ConstEvalErr<'tcx> {
Expand Down
8 changes: 4 additions & 4 deletions src/librustc/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1666,7 +1666,7 @@ impl<'tcx> TerminatorKind<'tcx> {
),
ty: switch_ty,
};
fmt_const_val(&mut s, &c).unwrap();
fmt_const_val(&mut s, c).unwrap();
s.into()
}).chain(iter::once("otherwise".into()))
.collect()
Expand Down Expand Up @@ -2155,7 +2155,7 @@ impl<'tcx> Operand<'tcx> {
ty,
user_ty: None,
literal: tcx.intern_lazy_const(
ty::LazyConst::Evaluated(ty::Const::zero_sized(tcx, ty)),
ty::LazyConst::Evaluated(ty::Const::zero_sized(ty)),
),
})
}
Expand Down Expand Up @@ -2663,14 +2663,14 @@ impl<'tcx> Debug for Constant<'tcx> {

/// Write a `ConstValue` in a way closer to the original source code than the `Debug` output.
pub fn fmt_lazy_const_val(f: &mut impl Write, const_val: &ty::LazyConst<'_>) -> fmt::Result {
match const_val {
match *const_val {
ty::LazyConst::Unevaluated(..) => write!(f, "{:?}", const_val),
ty::LazyConst::Evaluated(c) => fmt_const_val(f, c),
}
}

/// Write a `ConstValue` in a way closer to the original source code than the `Debug` output.
pub fn fmt_const_val(f: &mut impl Write, const_val: &ty::Const<'_>) -> fmt::Result {
pub fn fmt_const_val(f: &mut impl Write, const_val: ty::Const<'_>) -> fmt::Result {
use ty::TyKind::*;
let value = const_val.val;
let ty = const_val.ty;
Expand Down
16 changes: 0 additions & 16 deletions src/librustc/ty/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,6 @@ pub fn decode_canonical_var_infos<'a, 'tcx, D>(decoder: &mut D)
.intern_canonical_var_infos(interned?.as_slice()))
}

#[inline]
pub fn decode_const<'a, 'tcx, D>(decoder: &mut D)
-> Result<&'tcx ty::Const<'tcx>, D::Error>
where D: TyDecoder<'a, 'tcx>,
'tcx: 'a,
{
Ok(decoder.tcx().mk_const(Decodable::decode(decoder)?))
}

#[inline]
pub fn decode_lazy_const<'a, 'tcx, D>(decoder: &mut D)
-> Result<&'tcx ty::LazyConst<'tcx>, D::Error>
Expand Down Expand Up @@ -398,13 +389,6 @@ macro_rules! implement_ty_decoder {
}
}

impl<$($typaram),*> SpecializedDecoder<&'tcx $crate::ty::Const<'tcx>>
for $DecoderName<$($typaram),*> {
fn specialized_decode(&mut self) -> Result<&'tcx ty::Const<'tcx>, Self::Error> {
decode_const(self)
}
}

impl<$($typaram),*> SpecializedDecoder<&'tcx $crate::ty::LazyConst<'tcx>>
for $DecoderName<$($typaram),*> {
fn specialized_decode(&mut self) -> Result<&'tcx ty::LazyConst<'tcx>, Self::Error> {
Expand Down
27 changes: 3 additions & 24 deletions src/librustc/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ pub struct CtxtInterners<'tcx> {
region: InternedSet<'tcx, RegionKind>,
existential_predicates: InternedSet<'tcx, List<ExistentialPredicate<'tcx>>>,
predicates: InternedSet<'tcx, List<Predicate<'tcx>>>,
const_: InternedSet<'tcx, Const<'tcx>>,
clauses: InternedSet<'tcx, List<Clause<'tcx>>>,
goal: InternedSet<'tcx, GoalKind<'tcx>>,
goal_list: InternedSet<'tcx, List<Goal<'tcx>>>,
Expand All @@ -140,7 +139,6 @@ impl<'gcx: 'tcx, 'tcx> CtxtInterners<'tcx> {
existential_predicates: Default::default(),
canonical_var_infos: Default::default(),
predicates: Default::default(),
const_: Default::default(),
clauses: Default::default(),
goal: Default::default(),
goal_list: Default::default(),
Expand Down Expand Up @@ -1071,24 +1069,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
}
}

pub fn alloc_const_slice(self, values: &[&'tcx ty::Const<'tcx>])
-> &'tcx [&'tcx ty::Const<'tcx>] {
if values.is_empty() {
&[]
} else {
self.interners.arena.alloc_slice(values)
}
}

pub fn alloc_name_const_slice(self, values: &[(ast::Name, &'tcx ty::Const<'tcx>)])
-> &'tcx [(ast::Name, &'tcx ty::Const<'tcx>)] {
if values.is_empty() {
&[]
} else {
self.interners.arena.alloc_slice(values)
}
}

pub fn intern_const_alloc(
self,
alloc: Allocation,
Expand Down Expand Up @@ -1833,9 +1813,9 @@ impl<'a, 'tcx> Lift<'tcx> for &'a LazyConst<'a> {
}
}

impl<'a, 'tcx> Lift<'tcx> for &'a Const<'a> {
type Lifted = &'tcx Const<'tcx>;
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'b, 'gcx, 'tcx>) -> Option<&'tcx Const<'tcx>> {
impl<'a, 'tcx> Lift<'tcx> for &'a mir::interpret::Allocation {
type Lifted = &'tcx mir::interpret::Allocation;
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'b, 'gcx, 'tcx>) -> Option<Self::Lifted> {
if tcx.interners.arena.in_arena(*self as *const _) {
return Some(unsafe { mem::transmute(*self) });
}
Expand Down Expand Up @@ -2516,7 +2496,6 @@ pub fn keep_local<'tcx, T: ty::TypeFoldable<'tcx>>(x: &T) -> bool {

direct_interners!('tcx,
region: mk_region(|r: &RegionKind| r.keep_in_local_tcx()) -> RegionKind,
const_: mk_const(|c: &Const<'_>| keep_local(&c.ty) || keep_local(&c.val)) -> Const<'tcx>,
goal: mk_goal(|c: &GoalKind<'_>| keep_local(c)) -> GoalKind<'tcx>
);

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ty/query/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl<'tcx> Key for ty::PolyTraitRef<'tcx>{
}
}

impl<'tcx> Key for &'tcx ty::Const<'tcx> {
impl<'tcx> Key for ty::Const<'tcx> {
fn query_crate(&self) -> CrateNum {
LOCAL_CRATE
}
Expand Down
37 changes: 33 additions & 4 deletions src/librustc/ty/structural_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ CloneTypeFoldableAndLiftImpls! {
::ty::UniverseIndex,
::ty::Variance,
::syntax_pos::Span,
ConstValue<'tcx>,
}

///////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -492,6 +491,26 @@ BraceStructLiftImpl! {
}
}

BraceStructLiftImpl! {
impl<'a, 'tcx> Lift<'tcx> for ty::Const<'a> {
type Lifted = ty::Const<'tcx>;
val, ty
}
}

impl<'a, 'tcx> Lift<'tcx> for ConstValue<'a> {
type Lifted = ConstValue<'tcx>;
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'b, 'gcx, 'tcx>) -> Option<Self::Lifted> {
match *self {
ConstValue::Scalar(x) => Some(ConstValue::Scalar(x)),
ConstValue::ScalarPair(x, y) => Some(ConstValue::ScalarPair(x, y)),
ConstValue::ByRef(x, alloc, z) => Some(ConstValue::ByRef(
x, alloc.lift_to_tcx(tcx)?, z,
)),
}
}
}

///////////////////////////////////////////////////////////////////////////
// TypeFoldable implementations.
//
Expand Down Expand Up @@ -1048,17 +1067,27 @@ impl<'tcx> TypeFoldable<'tcx> for &'tcx ty::LazyConst<'tcx> {
}
}

impl<'tcx> TypeFoldable<'tcx> for &'tcx ty::Const<'tcx> {
impl<'tcx> TypeFoldable<'tcx> for ty::Const<'tcx> {
fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self {
let ty = self.ty.fold_with(folder);
let val = self.val.fold_with(folder);
folder.tcx().mk_const(ty::Const {
ty::Const {
ty,
val
})
}
}

fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool {
self.ty.visit_with(visitor) || self.val.visit_with(visitor)
}
}

impl<'tcx> TypeFoldable<'tcx> for ConstValue<'tcx> {
fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, _folder: &mut F) -> Self {
*self
}

fn super_visit_with<V: TypeVisitor<'tcx>>(&self, _visitor: &mut V) -> bool {
false
}
}
39 changes: 13 additions & 26 deletions src/librustc/ty/sty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2018,13 +2018,11 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
/// code is monomorphic enough for that.
pub enum LazyConst<'tcx> {
Unevaluated(DefId, &'tcx Substs<'tcx>),
Evaluated(&'tcx Const<'tcx>),
Evaluated(Const<'tcx>),
}

static_assert!(MEM_SIZE_OF_LAZY_CONST: ::std::mem::size_of::<LazyConst<'_>>() <= 24);

impl<'tcx> LazyConst<'tcx> {
pub fn map_evaluated<R>(self, f: impl FnOnce(&'tcx Const<'tcx>) -> Option<R>) -> Option<R> {
pub fn map_evaluated<R>(self, f: impl FnOnce(Const<'tcx>) -> Option<R>) -> Option<R> {
match self {
LazyConst::Evaluated(c) => f(c),
LazyConst::Unevaluated(..) => None,
Expand All @@ -2050,55 +2048,45 @@ pub struct Const<'tcx> {
}

impl<'tcx> Const<'tcx> {
#[inline]
pub fn from_const_value(
tcx: TyCtxt<'_, '_, 'tcx>,
val: ConstValue<'tcx>,
ty: Ty<'tcx>,
) -> &'tcx Self {
tcx.mk_const(Const {
val,
ty,
})
}

#[inline]
pub fn from_scalar(
tcx: TyCtxt<'_, '_, 'tcx>,
val: Scalar,
ty: Ty<'tcx>,
) -> &'tcx Self {
Self::from_const_value(tcx, ConstValue::Scalar(val), ty)
) -> Self {
Self {
val: ConstValue::Scalar(val),
ty,
}
}

#[inline]
pub fn from_bits(
tcx: TyCtxt<'_, '_, 'tcx>,
bits: u128,
ty: ParamEnvAnd<'tcx, Ty<'tcx>>,
) -> &'tcx Self {
) -> Self {
let ty = tcx.lift_to_global(&ty).unwrap();
let size = tcx.layout_of(ty).unwrap_or_else(|e| {
panic!("could not compute layout for {:?}: {:?}", ty, e)
}).size;
let shift = 128 - size.bits();
let truncated = (bits << shift) >> shift;
assert_eq!(truncated, bits, "from_bits called with untruncated value");
Self::from_scalar(tcx, Scalar::Bits { bits, size: size.bytes() as u8 }, ty.value)
Self::from_scalar(Scalar::Bits { bits, size: size.bytes() as u8 }, ty.value)
}

#[inline]
pub fn zero_sized(tcx: TyCtxt<'_, '_, 'tcx>, ty: Ty<'tcx>) -> &'tcx Self {
Self::from_scalar(tcx, Scalar::Bits { bits: 0, size: 0 }, ty)
pub fn zero_sized(ty: Ty<'tcx>) -> Self {
Self::from_scalar(Scalar::Bits { bits: 0, size: 0 }, ty)
}

#[inline]
pub fn from_bool(tcx: TyCtxt<'_, '_, 'tcx>, v: bool) -> &'tcx Self {
pub fn from_bool(tcx: TyCtxt<'_, '_, 'tcx>, v: bool) -> Self {
Self::from_bits(tcx, v as u128, ParamEnv::empty().and(tcx.types.bool))
}

#[inline]
pub fn from_usize(tcx: TyCtxt<'_, '_, 'tcx>, n: u64) -> &'tcx Self {
pub fn from_usize(tcx: TyCtxt<'_, '_, 'tcx>, n: u64) -> Self {
Self::from_bits(tcx, n as u128, ParamEnv::empty().and(tcx.types.usize))
}

Expand Down Expand Up @@ -2164,5 +2152,4 @@ impl<'tcx> Const<'tcx> {
}
}

impl<'tcx> serialize::UseSpecializedDecodable for &'tcx Const<'tcx> {}
impl<'tcx> serialize::UseSpecializedDecodable for &'tcx LazyConst<'tcx> {}
6 changes: 3 additions & 3 deletions src/librustc_codegen_ssa/mir/constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
&mut self,
bx: &Bx,
constant: &'tcx ty::LazyConst<'tcx>,
) -> Result<&'tcx ty::Const<'tcx>, ErrorHandled> {
) -> Result<ty::Const<'tcx>, ErrorHandled> {
match *constant {
ty::LazyConst::Unevaluated(def_id, ref substs) => {
let tcx = bx.tcx();
Expand All @@ -35,7 +35,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
&mut self,
bx: &Bx,
constant: &mir::Constant<'tcx>,
) -> Result<&'tcx ty::Const<'tcx>, ErrorHandled> {
) -> Result<ty::Const<'tcx>, ErrorHandled> {
let c = self.monomorphize(&constant.literal);
self.fully_evaluate(bx, c)
}
Expand All @@ -46,7 +46,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
bx: &Bx,
span: Span,
ty: Ty<'tcx>,
constant: Result<&'tcx ty::Const<'tcx>, ErrorHandled>,
constant: Result<ty::Const<'tcx>, ErrorHandled>,
) -> (Bx::Value, Ty<'tcx>) {
constant
.and_then(|c| {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_ssa/mir/operand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl<'a, 'tcx: 'a, V: CodegenObject> OperandRef<'tcx, V> {

pub fn from_const<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
bx: &mut Bx,
val: &'tcx ty::Const<'tcx>
val: ty::Const<'tcx>
) -> Result<Self, ErrorHandled> {
let layout = bx.cx().layout_of(val.ty);

Expand Down
4 changes: 2 additions & 2 deletions src/librustc_mir/build/matches/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,12 +658,12 @@ enum TestKind<'tcx> {
SwitchInt {
switch_ty: Ty<'tcx>,
options: Vec<u128>,
indices: FxHashMap<&'tcx ty::Const<'tcx>, usize>,
indices: FxHashMap<ty::Const<'tcx>, usize>,
},

// test for equality
Eq {
value: &'tcx ty::Const<'tcx>,
value: ty::Const<'tcx>,
ty: Ty<'tcx>,
},

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/build/matches/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
candidate: &Candidate<'pat, 'tcx>,
switch_ty: Ty<'tcx>,
options: &mut Vec<u128>,
indices: &mut FxHashMap<&'tcx ty::Const<'tcx>, usize>)
indices: &mut FxHashMap<ty::Const<'tcx>, usize>)
-> bool
{
let match_pair = match candidate.match_pairs.iter().find(|mp| mp.place == *test_place) {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/build/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
pub fn literal_operand(&mut self,
span: Span,
ty: Ty<'tcx>,
literal: &'tcx ty::Const<'tcx>)
literal: ty::Const<'tcx>)
-> Operand<'tcx> {
let constant = box Constant {
span,
Expand Down
Loading