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

Rollup of 25 pull requests #56051

Merged
merged 67 commits into from
Nov 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
f3e9b1a
in which the E0618 "expected function" diagnostic gets a makeover
zackmdavis Nov 11, 2018
b7c319c
do not panic just because cargo failed
RalfJung Nov 11, 2018
0671bdb
reword #[test] attribute error on fn items
zeegomo Nov 11, 2018
0c08529
A few tweaks to iterations/collecting
ljedrz Nov 5, 2018
562be7e
Forward the ABI of the non-zero sized fields of an union if they have…
ogoffart Nov 8, 2018
cfbae3e
core/tests/num: Simplify `test_int_from_str_overflow()` test code
Turbo87 Nov 13, 2018
57a7c85
miri: backtraces with instances
RalfJung Nov 14, 2018
2ec6f34
Update CI-clang to 7.0.0 for Linux dists.
michaelwoerister Nov 14, 2018
f6b8eb7
Update CI-clang to 7.0.0 for macOS dists.
michaelwoerister Nov 14, 2018
fb5135a
prettier miri backtrace printing
RalfJung Nov 14, 2018
1ca505a
capture_disjoint_fields(rust-lang#53488)
blitzerr Nov 14, 2018
c040a48
Remove extern and some return value as an attempt to make the test pa…
ogoffart Nov 14, 2018
b396505
put file and line into miri backtrace
RalfJung Nov 14, 2018
aa3d7a4
properly calculate spans for intra-doc link resolution errors
QuietMisdreavus Nov 15, 2018
a1f83e7
Stress test for MPSC
stepancheg Nov 15, 2018
7f4bc22
Clean up some non-mod-rs stuff.
ehuss Oct 16, 2018
6779bb4
capture_disjoint_fields(rust-lang#53488)
blitzerr Nov 15, 2018
c5bc83b
expose MutValueVisitor
RalfJung Nov 13, 2018
e4d03f8
miri value visitor: provide place when visiting a primitive
RalfJung Nov 13, 2018
62cf9ab
rename FrameInfo span field to call_site
RalfJung Nov 15, 2018
e6e5635
ty: return impl Iterator from Predicate::walk_tys
ljedrz Nov 14, 2018
ffb6ba0
validation: better error when the enum discriminant is Undef
RalfJung Nov 12, 2018
a3770c2
do not accept out-of-bounds pointers in enum discriminants, they migh…
RalfJung Nov 12, 2018
b8915f2
fix other affected tests
RalfJung Nov 12, 2018
81303d7
Add powerpc-unknown-linux-musl target
smaeul Sep 10, 2018
346e976
Fix powerpc64 ELFv2 big-endian struct-passing ABI
smaeul Sep 16, 2018
2bb5029
Use the ELFv2 ABI on powerpc64 musl
smaeul Aug 9, 2018
4f9c860
Add powerpc64-unknown-linux-musl target
smaeul Aug 8, 2018
8c8ff6a
test/linkage-visibility: Ignore on musl targets
smaeul Sep 16, 2018
03aaa4b
remove unused dependency
andjo403 Nov 10, 2018
303dbcc
CTFE: dynamically make sure we do not call non-const-fn
RalfJung Nov 16, 2018
c1221e2
Replace data.clone() by Arc::clone(&data) in mutex doc.
CBenoit Nov 16, 2018
0c0478d
adjust remaining tests
RalfJung Nov 16, 2018
41434e0
avoid shared ref in UnsafeCell::get
RalfJung Nov 16, 2018
a7b312f
erase the tag on casts involving (raw) pointers
RalfJung Nov 17, 2018
25d46f3
add comment explaining why what we do is legal
RalfJung Nov 17, 2018
2b7c3fb
add test for #[test] attribute only allowed on non associated functions
zeegomo Nov 17, 2018
8e13e43
tidy check fix
zeegomo Nov 17, 2018
5fc63ce
docs: Add missing backtick in object_safety.rs docs
Xanewok Nov 17, 2018
cdb1a79
Add VecDeque::resize_with
scottmcm Nov 17, 2018
a5b4cb2
remove "approx env bounds" if we already know from trait
nikomatsakis Nov 18, 2018
36e1d9f
Rollup merge of #55562 - smaeul:powerpc-linux-musl, r=alexcrichton
pietroalbini Nov 18, 2018
21ff709
Rollup merge of #55564 - smaeul:test-fixes-2, r=alexcrichton
pietroalbini Nov 18, 2018
9c3e8d3
Rollup merge of #55827 - ljedrz:various_stashed, r=alexcrichton
pietroalbini Nov 18, 2018
4a52c56
Rollup merge of #55834 - ogoffart:union-abi, r=eddyb
pietroalbini Nov 18, 2018
7130947
Rollup merge of #55857 - andjo403:rmdep, r=Mark-Simulacrum
pietroalbini Nov 18, 2018
9577734
Rollup merge of #55862 - zackmdavis:but_will_they_come_when_you_call_…
pietroalbini Nov 18, 2018
3aeac24
Rollup merge of #55867 - RalfJung:dont-panic, r=Mark-Simulacrum
pietroalbini Nov 18, 2018
131a755
Rollup merge of #55894 - RalfJung:validation-enums, r=oli-obk
pietroalbini Nov 18, 2018
c87c31b
Rollup merge of #55916 - RalfJung:mut-visitor, r=oli-obk
pietroalbini Nov 18, 2018
5e2ff63
Rollup merge of #55919 - Turbo87:num-tests, r=dtolnay
pietroalbini Nov 18, 2018
715d83f
Rollup merge of #55923 - Zeegomo:master, r=estebank
pietroalbini Nov 18, 2018
8607325
Increase `Duration` approximate equal threshold to 1us
alexcrichton Nov 19, 2018
fc30ab4
Rollup merge of #55949 - ljedrz:return_impl_Iterator_from_Predicate_w…
pietroalbini Nov 18, 2018
32e4eb9
Rollup merge of #55952 - michaelwoerister:newer-clang, r=alexcrichton
pietroalbini Nov 18, 2018
989d06a
Rollup merge of #55953 - blitzerr:master, r=nikomatsakis
pietroalbini Nov 18, 2018
f13d166
Rollup merge of #55962 - QuietMisdreavus:tricky-spans, r=GuillaumeGomez
pietroalbini Nov 18, 2018
318a38e
Rollup merge of #55963 - stepancheg:mpsc-take-2, r=alexcrichton
pietroalbini Nov 18, 2018
6ecbb05
Rollup merge of #55968 - ehuss:non-mod-rs-tests, r=petrochenkov
pietroalbini Nov 18, 2018
cc6473d
Rollup merge of #55970 - RalfJung:miri-backtrace, r=@oli-obk
pietroalbini Nov 18, 2018
c0d48ce
Rollup merge of #56007 - RalfJung:non-const-call, r=oli-obk
pietroalbini Nov 18, 2018
05ae505
Rollup merge of #56011 - CBenoit:master, r=QuietMisdreavus
pietroalbini Nov 18, 2018
2a68c00
Rollup merge of #56012 - RalfJung:unsafe-cell, r=nikomatsakis
pietroalbini Nov 18, 2018
f5dc12e
Rollup merge of #56016 - scottmcm:vecdeque-resize-with, r=joshtriplett
pietroalbini Nov 18, 2018
27519c1
Rollup merge of #56027 - Xanewok:docs-backtick, r=QuietMisdreavus
pietroalbini Nov 18, 2018
10565c4
Rollup merge of #56043 - nikomatsakis:issue-55756-via-outlives, r=eddyb
pietroalbini Nov 18, 2018
8cea658
Rollup merge of #56059 - alexcrichton:fix-tests, r=sfackler
kennytm Nov 19, 2018
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
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ install:
chmod +x /usr/local/bin/sccache &&
travis_retry curl -fo /usr/local/bin/stamp https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2017-03-17-stamp-x86_64-apple-darwin &&
chmod +x /usr/local/bin/stamp &&
travis_retry curl -f http://releases.llvm.org/6.0.0/clang+llvm-6.0.0-x86_64-apple-darwin.tar.xz | tar xJf - &&
export CC=`pwd`/clang+llvm-6.0.0-x86_64-apple-darwin/bin/clang &&
export CXX=`pwd`/clang+llvm-6.0.0-x86_64-apple-darwin/bin/clang++ &&
travis_retry curl -f http://releases.llvm.org/7.0.0/clang+llvm-7.0.0-x86_64-apple-darwin.tar.xz | tar xJf - &&
export CC=`pwd`/clang+llvm-7.0.0-x86_64-apple-darwin/bin/clang &&
export CXX=`pwd`/clang+llvm-7.0.0-x86_64-apple-darwin/bin/clang++ &&
export AR=ar
;;
esac
Expand Down
1 change: 0 additions & 1 deletion src/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2191,7 +2191,6 @@ dependencies = [
"graphviz 0.0.0",
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-rayon-core 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use std::fs::{self, File};
use std::io::BufReader;
use std::io::prelude::*;
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};
use std::process::{Command, Stdio, exit};
use std::str;

use build_helper::{output, mtime, up_to_date};
Expand Down Expand Up @@ -1098,7 +1098,7 @@ pub fn run_cargo(builder: &Builder,
});

if !ok {
panic!("cargo must succeed");
exit(1);
}

// Ok now we need to actually find all the files listed in `toplevel`. We've
Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/dist-i686-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ RUN ./build-gcc.sh
COPY dist-x86_64-linux/build-python.sh /tmp/
RUN ./build-python.sh

# Now build LLVM+Clang 6, afterwards configuring further compilations to use the
# Now build LLVM+Clang 7, afterwards configuring further compilations to use the
# clang/clang++ compilers.
COPY dist-x86_64-linux/build-clang.sh /tmp/
RUN ./build-clang.sh
Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/dist-x86_64-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ RUN ./build-gcc.sh
COPY dist-x86_64-linux/build-python.sh /tmp/
RUN ./build-python.sh

# Now build LLVM+Clang 6, afterwards configuring further compilations to use the
# Now build LLVM+Clang 7, afterwards configuring further compilations to use the
# clang/clang++ compilers.
COPY dist-x86_64-linux/build-clang.sh /tmp/
RUN ./build-clang.sh
Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/dist-x86_64-linux/build-clang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set -ex

source shared.sh

LLVM=6.0.0
LLVM=7.0.0

mkdir clang
cd clang
Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/scripts/musl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ hide_output make clean

cd ..

LLVM=60
LLVM=70

# may have been downloaded in a previous run
if [ ! -d libunwind-release_$LLVM ]; then
Expand Down
40 changes: 39 additions & 1 deletion src/liballoc/collections/vec_deque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

use core::cmp::Ordering;
use core::fmt;
use core::iter::{repeat, FromIterator, FusedIterator};
use core::iter::{repeat, repeat_with, FromIterator, FusedIterator};
use core::mem;
use core::ops::Bound::{Excluded, Included, Unbounded};
use core::ops::{Index, IndexMut, RangeBounds};
Expand Down Expand Up @@ -1920,6 +1920,44 @@ impl<T: Clone> VecDeque<T> {
self.truncate(new_len);
}
}

/// Modifies the `VecDeque` in-place so that `len()` is equal to `new_len`,
/// either by removing excess elements from the back or by appending
/// elements generated by calling `generator` to the back.
///
/// # Examples
///
/// ```
/// #![feature(vec_resize_with)]
///
/// use std::collections::VecDeque;
///
/// let mut buf = VecDeque::new();
/// buf.push_back(5);
/// buf.push_back(10);
/// buf.push_back(15);
/// assert_eq!(buf, [5, 10, 15]);
///
/// buf.resize_with(5, Default::default);
/// assert_eq!(buf, [5, 10, 15, 0, 0]);
///
/// buf.resize_with(2, || unreachable!());
/// assert_eq!(buf, [5, 10]);
///
/// let mut state = 100;
/// buf.resize_with(5, || { state += 1; state });
/// assert_eq!(buf, [5, 10, 101, 102, 103]);
/// ```
#[unstable(feature = "vec_resize_with", issue = "41758")]
pub fn resize_with(&mut self, new_len: usize, generator: impl FnMut()->T) {
let len = self.len();

if new_len > len {
self.extend(repeat_with(generator).take(new_len - len))
} else {
self.truncate(new_len);
}
}
}

/// Returns the index in the underlying buffer for a given logical element index.
Expand Down
4 changes: 3 additions & 1 deletion src/libcore/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1509,7 +1509,9 @@ impl<T: ?Sized> UnsafeCell<T> {
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
pub const fn get(&self) -> *mut T {
&self.value as *const T as *mut T
// We can just cast the pointer from `UnsafeCell<T>` to `T` because of
// #[repr(transparent)]
self as *const UnsafeCell<T> as *const T as *mut T
}
}

Expand Down
24 changes: 8 additions & 16 deletions src/libcore/tests/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,36 +82,28 @@ fn from_str_issue7588() {

#[test]
fn test_int_from_str_overflow() {
let mut i8_val: i8 = 127;
assert_eq!("127".parse::<i8>().ok(), Some(i8_val));
assert_eq!("127".parse::<i8>().ok(), Some(127i8));
assert_eq!("128".parse::<i8>().ok(), None);

i8_val = i8_val.wrapping_add(1);
assert_eq!("-128".parse::<i8>().ok(), Some(i8_val));
assert_eq!("-128".parse::<i8>().ok(), Some(-128i8));
assert_eq!("-129".parse::<i8>().ok(), None);

let mut i16_val: i16 = 32_767;
assert_eq!("32767".parse::<i16>().ok(), Some(i16_val));
assert_eq!("32767".parse::<i16>().ok(), Some(32_767i16));
assert_eq!("32768".parse::<i16>().ok(), None);

i16_val = i16_val.wrapping_add(1);
assert_eq!("-32768".parse::<i16>().ok(), Some(i16_val));
assert_eq!("-32768".parse::<i16>().ok(), Some(-32_768i16));
assert_eq!("-32769".parse::<i16>().ok(), None);

let mut i32_val: i32 = 2_147_483_647;
assert_eq!("2147483647".parse::<i32>().ok(), Some(i32_val));
assert_eq!("2147483647".parse::<i32>().ok(), Some(2_147_483_647i32));
assert_eq!("2147483648".parse::<i32>().ok(), None);

i32_val = i32_val.wrapping_add(1);
assert_eq!("-2147483648".parse::<i32>().ok(), Some(i32_val));
assert_eq!("-2147483648".parse::<i32>().ok(), Some(-2_147_483_648i32));
assert_eq!("-2147483649".parse::<i32>().ok(), None);

let mut i64_val: i64 = 9_223_372_036_854_775_807;
assert_eq!("9223372036854775807".parse::<i64>().ok(), Some(i64_val));
assert_eq!("9223372036854775807".parse::<i64>().ok(), Some(9_223_372_036_854_775_807i64));
assert_eq!("9223372036854775808".parse::<i64>().ok(), None);

i64_val = i64_val.wrapping_add(1);
assert_eq!("-9223372036854775808".parse::<i64>().ok(), Some(i64_val));
assert_eq!("-9223372036854775808".parse::<i64>().ok(), Some(-9_223_372_036_854_775_808i64));
assert_eq!("-9223372036854775809".parse::<i64>().ok(), None);
}

Expand Down
3 changes: 1 addition & 2 deletions src/librustc/cfg/graphviz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ impl<'a> dot::GraphWalk<'a> for &'a cfg::CFG {
type Node = Node<'a>;
type Edge = Edge<'a>;
fn nodes(&'a self) -> dot::Nodes<'a, Node<'a>> {
let mut v = Vec::new();
self.graph.each_node(|i, nd| { v.push((i, nd)); true });
let v: Vec<_> = self.graph.enumerated_nodes().collect();
v.into()
}
fn edges(&'a self) -> dot::Edges<'a, Edge<'a>> {
Expand Down
3 changes: 1 addition & 2 deletions src/librustc/hir/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1062,8 +1062,7 @@ impl<'a> LoweringContext<'a> {
attrs
.iter()
.map(|a| self.lower_attr(a))
.collect::<Vec<_>>()
.into()
.collect()
}

fn lower_attr(&mut self, attr: &Attribute) -> Attribute {
Expand Down
17 changes: 12 additions & 5 deletions src/librustc/ich/impls_ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,9 @@ impl<'gcx> HashStable<StableHashingContext<'gcx>> for ty::adjustment::AutoBorrow
}
}

impl_stable_hash_for!(struct ty::UpvarId { var_id, closure_expr_id });
impl_stable_hash_for!(struct ty::UpvarPath { hir_id });

impl_stable_hash_for!(struct ty::UpvarId { var_path, closure_expr_id });

impl_stable_hash_for!(enum ty::BorrowKind {
ImmBorrow,
Expand Down Expand Up @@ -387,10 +389,10 @@ impl_stable_hash_for!(enum mir::interpret::ErrorHandled {
TooGeneric
});

impl_stable_hash_for!(struct mir::interpret::FrameInfo {
span,
impl_stable_hash_for!(struct mir::interpret::FrameInfo<'tcx> {
call_site,
lint_root,
location
instance
});

impl_stable_hash_for!(struct ty::ClosureSubsts<'tcx> { substs });
Expand Down Expand Up @@ -451,7 +453,7 @@ impl_stable_hash_for!(
FunctionRetMismatch(a, b),
NoMirFor(s),
UnterminatedCString(ptr),
PointerOutOfBounds { ptr, access, allocation_size },
PointerOutOfBounds { ptr, check, allocation_size },
InvalidBoolOp(bop),
Unimplemented(s),
BoundsCheck { len, index },
Expand All @@ -471,6 +473,11 @@ impl_stable_hash_for!(
}
);

impl_stable_hash_for!(enum mir::interpret::InboundsCheck {
Live,
MaybeDead
});

impl_stable_hash_for!(enum mir::interpret::Lock {
NoLock,
WriteLock(dl),
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/infer/error_reporting/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
format!(" for lifetime parameter `{}` in coherence check", name)
}
infer::UpvarRegion(ref upvar_id, _) => {
let var_node_id = self.tcx.hir.hir_to_node_id(upvar_id.var_id);
let var_node_id = self.tcx.hir.hir_to_node_id(upvar_id.var_path.hir_id);
let var_name = self.tcx.hir.name(var_node_id);
format!(" for capture of `{}` by closure", var_name)
}
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/infer/error_reporting/note.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
"...so that reference does not outlive borrowed content");
}
infer::ReborrowUpvar(span, ref upvar_id) => {
let var_node_id = self.tcx.hir.hir_to_node_id(upvar_id.var_id);
let var_node_id = self.tcx.hir.hir_to_node_id(upvar_id.var_path.hir_id);
let var_name = self.tcx.hir.name(var_node_id);
err.span_note(span,
&format!("...so that closure can access `{}`", var_name));
Expand Down Expand Up @@ -174,7 +174,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
err
}
infer::ReborrowUpvar(span, ref upvar_id) => {
let var_node_id = self.tcx.hir.hir_to_node_id(upvar_id.var_id);
let var_node_id = self.tcx.hir.hir_to_node_id(upvar_id.var_path.hir_id);
let var_name = self.tcx.hir.name(var_node_id);
let mut err = struct_span_err!(self.tcx.sess,
span,
Expand Down
30 changes: 23 additions & 7 deletions src/librustc/infer/outlives/obligations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,22 +389,38 @@ where
// rule might not apply (but another rule might). For now, we err
// on the side of adding too few edges into the graph.

// Compute the bounds we can derive from the trait definition.
// These are guaranteed to apply, no matter the inference
// results.
let trait_bounds: Vec<_> = self.verify_bound
.projection_declared_bounds_from_trait(projection_ty)
.collect();

// Compute the bounds we can derive from the environment. This
// is an "approximate" match -- in some cases, these bounds
// may not apply.
let approx_env_bounds = self.verify_bound
let mut approx_env_bounds = self.verify_bound
.projection_approx_declared_bounds_from_env(projection_ty);
debug!(
"projection_must_outlive: approx_env_bounds={:?}",
approx_env_bounds
);

// Compute the bounds we can derive from the trait definition.
// These are guaranteed to apply, no matter the inference
// results.
let trait_bounds: Vec<_> = self.verify_bound
.projection_declared_bounds_from_trait(projection_ty)
.collect();
// Remove outlives bounds that we get from the environment but
// which are also deducable from the trait. This arises (cc
// #55756) in cases where you have e.g. `<T as Foo<'a>>::Item:
// 'a` in the environment but `trait Foo<'b> { type Item: 'b
// }` in the trait definition.
approx_env_bounds.retain(|bound| {
match bound.0.sty {
ty::Projection(projection_ty) => {
self.verify_bound.projection_declared_bounds_from_trait(projection_ty)
.all(|r| r != bound.1)
}

_ => panic!("expected only projection types from env, not {:?}", bound.0),
}
});

// If declared bounds list is empty, the only applicable rule is
// OutlivesProjectionComponent. If there are inference variables,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/expr_use_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> {
let var_hir_id = self.tcx().hir.node_to_hir_id(freevar.var_id());
let closure_def_id = self.tcx().hir.local_def_id(closure_expr.id);
let upvar_id = ty::UpvarId {
var_id: var_hir_id,
var_path: ty::UpvarPath { hir_id: var_hir_id },
closure_expr_id: closure_def_id.to_local(),
};
let upvar_capture = self.mc.tables.upvar_capture(upvar_id);
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/mem_categorization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
let closure_expr_def_id = self.tcx.hir.local_def_id(fn_node_id);
let var_hir_id = self.tcx.hir.node_to_hir_id(var_id);
let upvar_id = ty::UpvarId {
var_id: var_hir_id,
var_path: ty::UpvarPath { hir_id: var_hir_id },
closure_expr_id: closure_expr_def_id.to_local(),
};

Expand Down
8 changes: 8 additions & 0 deletions src/librustc/mir/interpret/allocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ use mir;
use std::ops::{Deref, DerefMut};
use rustc_data_structures::sorted_map::SortedMap;

/// Used by `check_bounds` to indicate whether the pointer needs to be just inbounds
/// or also inbounds of a *live* allocation.
#[derive(Debug, Copy, Clone, RustcEncodable, RustcDecodable)]
pub enum InboundsCheck {
Live,
MaybeDead,
}

#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable)]
pub struct Allocation<Tag=(),Extra=()> {
/// The actual bytes of the allocation.
Expand Down
Loading