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 19 pull requests #55902

Closed
wants to merge 61 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
e753d21
miri: accept extern types in structs if they are the only field
RalfJung Nov 4, 2018
aca76d4
test for offset and alignment of the sized part, instead of field count
RalfJung Nov 4, 2018
bb17f71
also test with PhantomData
RalfJung Nov 4, 2018
5ebd077
make it more obvious that the size is not relevant
RalfJung Nov 5, 2018
a6622c2
note some FIXMEs
RalfJung Nov 5, 2018
1224e01
Format BtreeMap::range_mut example
kngwyu Nov 6, 2018
ba0bab3
make sure we only guess field alignment at offset 0
RalfJung Nov 6, 2018
ece4f47
For diagnostics, set spans of drops of temps to be that of the statem…
pnkfelix Nov 8, 2018
3011ecd
Narrow span of temp holding the value of a Block expression to the bl…
pnkfelix Nov 8, 2018
556f583
Regression test for issue #54382
pnkfelix Nov 8, 2018
e7e1a52
Refactor code so that block_context observations has nicely named (an…
pnkfelix Nov 8, 2018
dd63982
Revise the temp creation for blocks in `stmt_expr` to setup `BlockTai…
pnkfelix Nov 8, 2018
3977133
Allow unsized types in mem::drop and mem::forget
Nov 8, 2018
06cf9ae
Fix return type of forget intrinsic
Nov 8, 2018
f211581
Use T: ?Sized in intrinsics::forget
Nov 8, 2018
401cb6b
don't inline `pub use some_crate` unless directly asked to
QuietMisdreavus Nov 9, 2018
893f539
Fixes #55775 -- fixed regression in Command::exec's handling of PATH.
Nov 8, 2018
5e7b7f2
make PhantomData #[structural_match].
Centril Nov 10, 2018
852ff1f
add FromIterator<A> to Box<[A]>
lcnr Nov 10, 2018
3b3b60c
Avoid converting bytes to UTF-8 strings to print, just pass bytes to …
spastorino Nov 10, 2018
c148714
Rewrite `...` as `..=` as a MachineApplicable 2018 idiom lint
varkor Nov 10, 2018
c63df7c
Use non-short suggestion for parenthesised ..=
varkor Nov 10, 2018
20ef40a
Fix a typo in std::panic
dwijnand Nov 11, 2018
5030794
Merge branch 'master' of https://github.com/rust-lang/rust
lcnr Nov 11, 2018
ab55d9b
change attribute to stable
lcnr Nov 11, 2018
a62af85
Fix typos.
waywardmonkeys Nov 11, 2018
93b5112
Added comment for From trait implementation: boxed string slice to St…
denisvasilik Nov 10, 2018
f0bfbd3
Added comments for trait implementations.
denisvasilik Nov 11, 2018
dc0fd65
Whitespace cleanup according to Rust's style guidelines.
denisvasilik Nov 11, 2018
6f3add3
Minor style guide corrections.
denisvasilik Nov 11, 2018
04cc0d6
save-analysis: Don't panic for macro-generated use globs
Xanewok Nov 11, 2018
4fdae85
Reference count `crate_inherent_impls`s return value.
hugwijst Nov 12, 2018
c211238
Fix TLS errors when downloading stage0
dlrobertson Nov 12, 2018
ace20b9
for uniformity, also move memory_deallocated to AllocationExtra
RalfJung Nov 12, 2018
075983c
global allocators: add a few comments
RalfJung Nov 12, 2018
3c88cfe
remove unused import
RalfJung Nov 12, 2018
4d2934e
Add forget_unsized only
Nov 12, 2018
56d3a82
Update docs
Nov 12, 2018
ab8a947
Move `static_assert!` into librustc_data_structures.
nnethercote Nov 8, 2018
49f482f
Move a `static_assert!` to a better spot.
nnethercote Nov 8, 2018
fb3dd9f
Add a static assertion about the size of `ast::Expr`.
nnethercote Nov 8, 2018
e01e0b0
Move two `static_assert!`s to better spots.
nnethercote Nov 12, 2018
1a61f26
Rollup merge of #55672 - RalfJung:miri-extern-types, r=eddyb
pietroalbini Nov 12, 2018
d1af662
Rollup merge of #55711 - kngwyu:btreemap-rangemut-doc, r=Mark-Simulacrum
pietroalbini Nov 12, 2018
1449acc
Rollup merge of #55754 - spastorino:fix-process-output-docs, r=alexcr…
pietroalbini Nov 12, 2018
746ef18
Rollup merge of #55781 - pnkfelix:issue-54382-more-precise-spans-for-…
pietroalbini Nov 12, 2018
ffa7767
Rollup merge of #55785 - stjepang:unsized-drop-forget, r=alexcrichton
pietroalbini Nov 12, 2018
e9376b7
Rollup merge of #55793 - alex:command-exec-path-regression, r=alexcri…
pietroalbini Nov 12, 2018
ed39b93
Rollup merge of #55804 - QuietMisdreavus:eager-crate-inline, r=pnkfelix
pietroalbini Nov 12, 2018
985a785
Rollup merge of #55805 - nnethercote:mv-static_assert, r=Mark-Simulacrum
pietroalbini Nov 12, 2018
68afefc
Rollup merge of #55837 - Centril:spökdata-skall-vara-strukturellt-mat…
pietroalbini Nov 12, 2018
ff06c9d
Rollup merge of #55840 - dlrobertson:fix_stage0_download, r=alexcrichton
pietroalbini Nov 12, 2018
345fbb0
Rollup merge of #55843 - Axary:master, r=sfackler
pietroalbini Nov 12, 2018
70d6c53
Rollup merge of #55852 - varkor:dotdotequals-lint, r=zackmdavis
pietroalbini Nov 12, 2018
3b4590a
Rollup merge of #55863 - dwijnand:patch-1, r=bluss
pietroalbini Nov 12, 2018
2201037
Rollup merge of #55870 - waywardmonkeys:typo-fixes, r=wesleywiser
pietroalbini Nov 12, 2018
0c6fc22
Rollup merge of #55874 - denisvasilik:docs, r=alexcrichton
pietroalbini Nov 12, 2018
35bb8bc
Rollup merge of #55879 - Xanewok:dont-panic-with-globs, r=nrc
pietroalbini Nov 12, 2018
ec3983f
Rollup merge of #55882 - hugwijst:rc_return_crate_inherent_impls, r=M…
pietroalbini Nov 12, 2018
db89347
Rollup merge of #55888 - RalfJung:alloc-extra, r=oli-obk
pietroalbini Nov 12, 2018
0532755
Rollup merge of #55889 - RalfJung:global-alloc, r=alexcrichton
pietroalbini Nov 12, 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
4 changes: 2 additions & 2 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ def _download(path, url, probably_big, verbose, exception):
# see http://serverfault.com/questions/301128/how-to-download
if sys.platform == 'win32':
run(["PowerShell.exe", "/nologo", "-Command",
"(New-Object System.Net.WebClient)"
".DownloadFile('{}', '{}')".format(url, path)],
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;",
"(New-Object System.Net.WebClient).DownloadFile('{}', '{}')".format(url, path)],
verbose=verbose,
exception=exception)
else:
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ impl Step for StdLink {

/// Link all libstd rlibs/dylibs into the sysroot location.
///
/// Links those artifacts generated by `compiler` to a the `stage` compiler's
/// Links those artifacts generated by `compiler` to the `stage` compiler's
/// sysroot for the specified `host` and `target`.
///
/// Note that this assumes that `compiler` has already generated the libstd
Expand Down
3 changes: 3 additions & 0 deletions src/doc/rustdoc/src/the-doc-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ mod bar {

Now we'll have a `Re-exports` line, and `Bar` will not link to anywhere.

One special case: In Rust 2018 and later, if you `pub use` one of your dependencies, `rustdoc` will
not eagerly inline it as a module unless you add `#[doc(inline)}`.

## `#[doc(hidden)]`

Any item annotated with `#[doc(hidden)]` will not appear in the documentation, unless
Expand Down
2 changes: 1 addition & 1 deletion src/etc/lldb_batchmode.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# containing LLDB commands (one command per line), this script will execute the commands one after
# the other.
# LLDB also has the -s and -S commandline options which also execute a list of commands from a text
# file. However, this command are execute `immediately`: a the command of a `run` or `continue`
# file. However, this command are execute `immediately`: the command of a `run` or `continue`
# command will be executed immediately after the `run` or `continue`, without waiting for the next
# breakpoint to be hit. This a command sequence like the following will not yield reliable results:
#
Expand Down
4 changes: 4 additions & 0 deletions src/liballoc/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ use core::usize;
pub use core::alloc::*;

extern "Rust" {
// These are the magic symbols to call the global allocator. rustc generates
// them from the `#[global_allocator]` attribute if there is one, or uses the
// default implementations in libstd (`__rdl_alloc` etc in `src/libstd/alloc.rs`)
// otherwise.
#[allocator]
#[rustc_allocator_nounwind]
fn __rust_alloc(size: usize, align: usize) -> *mut u8;
Expand Down
10 changes: 9 additions & 1 deletion src/liballoc/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,15 @@ use core::convert::From;
use core::fmt;
use core::future::Future;
use core::hash::{Hash, Hasher};
use core::iter::FusedIterator;
use core::iter::{Iterator, FromIterator, FusedIterator};
use core::marker::{Unpin, Unsize};
use core::mem;
use core::pin::Pin;
use core::ops::{CoerceUnsized, DispatchFromDyn, Deref, DerefMut, Generator, GeneratorState};
use core::ptr::{self, NonNull, Unique};
use core::task::{LocalWaker, Poll};

use vec::Vec;
use raw_vec::RawVec;
use str::from_boxed_utf8_unchecked;

Expand Down Expand Up @@ -699,6 +700,13 @@ impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Box<U>> for Box<T> {}
#[unstable(feature = "dispatch_from_dyn", issue = "0")]
impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Box<U>> for Box<T> {}

#[stable(feature = "boxed_slice_from_iter", since = "1.32.0")]
impl<A> FromIterator<A> for Box<[A]> {
fn from_iter<T: IntoIterator<Item = A>>(iter: T) -> Self {
iter.into_iter().collect::<Vec<_>>().into_boxed_slice()
}
}

#[stable(feature = "box_slice_clone", since = "1.3.0")]
impl<T: Clone> Clone for Box<[T]> {
fn clone(&self) -> Self {
Expand Down
8 changes: 8 additions & 0 deletions src/liballoc/boxed_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,11 @@ fn str_slice() {
let boxed: Box<str> = Box::from(s);
assert_eq!(&*boxed, s)
}

#[test]
fn boxed_slice_from_iter() {
let iter = 0..100;
let boxed: Box<[u32]> = iter.collect();
assert_eq!(boxed.len(), 100);
assert_eq!(boxed[7], 7);
}
7 changes: 4 additions & 3 deletions src/liballoc/collections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -853,9 +853,10 @@ impl<K: Ord, V> BTreeMap<K, V> {
/// ```
/// use std::collections::BTreeMap;
///
/// let mut map: BTreeMap<&str, i32> = ["Alice", "Bob", "Carol", "Cheryl"].iter()
/// .map(|&s| (s, 0))
/// .collect();
/// let mut map: BTreeMap<&str, i32> = ["Alice", "Bob", "Carol", "Cheryl"]
/// .iter()
/// .map(|&s| (s, 0))
/// .collect();
/// for (_, balance) in map.range_mut("B".."Cheryl") {
/// *balance += 100;
/// }
Expand Down
41 changes: 41 additions & 0 deletions src/liballoc/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2206,13 +2206,40 @@ impl<'a> From<&'a str> for String {
#[cfg(not(test))]
#[stable(feature = "string_from_box", since = "1.18.0")]
impl From<Box<str>> for String {
/// Converts the given boxed `str` slice to a `String`.
/// It is notable that the `str` slice is owned.
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s1: String = String::from("hello world");
/// let s2: Box<str> = s1.into_boxed_str();
/// let s3: String = String::from(s2);
///
/// assert_eq!("hello world", s3)
/// ```
fn from(s: Box<str>) -> String {
s.into_string()
}
}

#[stable(feature = "box_from_str", since = "1.20.0")]
impl From<String> for Box<str> {
/// Converts the given `String` to a boxed `str` slice that is owned.
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s1: String = String::from("hello world");
/// let s2: Box<str> = Box::from(s1);
/// let s3: String = String::from(s2);
///
/// assert_eq!("hello world", s3)
/// ```
fn from(s: String) -> Box<str> {
s.into_boxed_str()
}
Expand Down Expand Up @@ -2272,6 +2299,20 @@ impl<'a> FromIterator<String> for Cow<'a, str> {

#[stable(feature = "from_string_for_vec_u8", since = "1.14.0")]
impl From<String> for Vec<u8> {
/// Converts the given `String` to a vector `Vec` that holds values of type `u8`.
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s1 = String::from("hello world");
/// let v1 = Vec::from(s1);
///
/// for b in v1 {
/// println!("{}", b);
/// }
/// ```
fn from(string: String) -> Vec<u8> {
string.into_bytes()
}
Expand Down
4 changes: 4 additions & 0 deletions src/libcore/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,10 @@ extern "rust-intrinsic" {
/// initialize memory previous set to the result of `uninit`.
pub fn uninit<T>() -> T;

/// Moves a value out of scope without running drop glue.
#[cfg(not(stage0))]
pub fn forget<T: ?Sized>(_: T);

/// Reinterprets the bits of a value of one type as another type.
///
/// Both types must have the same size. Neither the original, nor the result,
Expand Down
2 changes: 2 additions & 0 deletions src/libcore/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
#![feature(staged_api)]
#![feature(stmt_expr_attributes)]
#![feature(unboxed_closures)]
#![feature(unsized_locals)]
#![feature(untagged_unions)]
#![feature(unwind_attributes)]
#![feature(doc_alias)]
Expand All @@ -129,6 +130,7 @@
#![feature(const_transmute)]
#![feature(reverse_bits)]
#![feature(non_exhaustive)]
#![feature(structural_match)]

#[prelude_import]
#[allow(unused)]
Expand Down
1 change: 1 addition & 0 deletions src/libcore/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ macro_rules! impls{
///
/// [drop check]: ../../nomicon/dropck.html
#[lang = "phantom_data"]
#[structural_match]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct PhantomData<T:?Sized>;

Expand Down
13 changes: 13 additions & 0 deletions src/libcore/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,19 @@ pub fn forget<T>(t: T) {
ManuallyDrop::new(t);
}

/// Like [`forget`], but also accepts unsized values.
///
/// This function is just a shim intended to be removed when the `unsized_locals` feature gets
/// stabilized.
///
/// [`forget`]: fn.forget.html
#[inline]
#[cfg(not(stage0))]
#[unstable(feature = "forget_unsized", issue = "0")]
pub fn forget_unsized<T: ?Sized>(t: T) {
unsafe { intrinsics::forget(t) }
}

/// Returns the size of a type in bytes.
///
/// More specifically, this is the offset in bytes between successive elements
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1896,7 +1896,7 @@ mod traits {
#[inline]
fn index_mut(self, slice: &mut str) -> &mut Self::Output {
// is_char_boundary checks that the index is in [0, .len()]
// canot reuse `get` as above, because of NLL trouble
// cannot reuse `get` as above, because of NLL trouble
if self.start <= self.end &&
slice.is_char_boundary(self.start) &&
slice.is_char_boundary(self.end) {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/infer/outlives/obligations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
///
/// See the `region_obligations` field of `InferCtxt` for some
/// comments about how this function fits into the overall expected
/// flow of the the inferencer. The key point is that it is
/// flow of the inferencer. The key point is that it is
/// invoked after all type-inference variables have been bound --
/// towards the end of regionck. This also ensures that the
/// region-bound-pairs are available (see comments above regarding
Expand Down
7 changes: 5 additions & 2 deletions src/librustc/lint/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1020,9 +1020,12 @@ impl<'a> ast_visit::Visitor<'a> for EarlyContext<'a> {
}

fn visit_pat(&mut self, p: &'a ast::Pat) {
run_lints!(self, check_pat, p);
let mut visit_subpats = true;
run_lints!(self, check_pat, p, &mut visit_subpats);
self.check_id(p.id);
ast_visit::walk_pat(self, p);
if visit_subpats {
ast_visit::walk_pat(self, p);
}
}

fn visit_expr(&mut self, e: &'a ast::Expr) {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/lint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ pub trait EarlyLintPass: LintPass {
fn check_block_post(&mut self, _: &EarlyContext<'_>, _: &ast::Block) { }
fn check_stmt(&mut self, _: &EarlyContext<'_>, _: &ast::Stmt) { }
fn check_arm(&mut self, _: &EarlyContext<'_>, _: &ast::Arm) { }
fn check_pat(&mut self, _: &EarlyContext<'_>, _: &ast::Pat) { }
fn check_pat(&mut self, _: &EarlyContext<'_>, _: &ast::Pat, _: &mut bool) { }
fn check_expr(&mut self, _: &EarlyContext<'_>, _: &ast::Expr) { }
fn check_expr_post(&mut self, _: &EarlyContext<'_>, _: &ast::Expr) { }
fn check_ty(&mut self, _: &EarlyContext<'_>, _: &ast::Ty) { }
Expand Down
10 changes: 0 additions & 10 deletions src/librustc/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,6 @@ macro_rules! span_bug {
})
}

#[macro_export]
macro_rules! static_assert {
($name:ident: $test:expr) => {
// Use the bool to access an array such that if the bool is false, the access
// is out-of-bounds.
#[allow(dead_code)]
static $name: () = [()][!$test as usize];
}
}

#[macro_export]
macro_rules! __impl_stable_hash_field {
($field:ident, $ctx:expr, $hasher:expr) => ($field.hash_stable($ctx, $hasher));
Expand Down
11 changes: 11 additions & 0 deletions src/librustc/mir/interpret/allocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ pub trait AllocationExtra<Tag>: ::std::fmt::Debug + Default + Clone {
) -> EvalResult<'tcx> {
Ok(())
}

/// Hook for performing extra checks on a memory deallocation.
/// `size` will be the size of the allocation.
#[inline]
fn memory_deallocated(
_alloc: &mut Allocation<Tag, Self>,
_ptr: Pointer<Tag>,
_size: Size,
) -> EvalResult<'tcx> {
Ok(())
}
}

impl AllocationExtra<()> for () {}
Expand Down
10 changes: 5 additions & 5 deletions src/librustc/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1719,14 +1719,14 @@ pub struct Statement<'tcx> {
pub kind: StatementKind<'tcx>,
}

// `Statement` is used a lot. Make sure it doesn't unintentionally get bigger.
#[cfg(target_arch = "x86_64")]
static_assert!(MEM_SIZE_OF_STATEMENT: mem::size_of::<Statement<'_>>() == 56);

impl<'tcx> Statement<'tcx> {
/// Changes a statement to a nop. This is both faster than deleting instructions and avoids
/// invalidating statement indices in `Location`s.
pub fn make_nop(&mut self) {
// `Statement` contributes significantly to peak memory usage. Make
// sure it doesn't get bigger.
static_assert!(STATEMENT_IS_AT_MOST_56_BYTES: mem::size_of::<Statement<'_>>() <= 56);

self.kind = StatementKind::Nop
}

Expand Down Expand Up @@ -2611,7 +2611,7 @@ pub fn fmt_const_val(f: &mut impl Write, const_val: &ty::Const<'_>) -> fmt::Resu
_ => {}
}
}
// print function definitons
// print function definitions
if let FnDef(did, _) = ty.sty {
return write!(f, "{}", item_path_str(did));
}
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/mir/traversal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl<'a, 'tcx> Postorder<'a, 'tcx> {
//
// It does the actual traversal of the graph, while the `next` method on the iterator
// just pops off of the stack. `visit_stack` is a stack containing pairs of nodes and
// iterators over the sucessors of those nodes. Each iteration attempts to get the next
// iterators over the successors of those nodes. Each iteration attempts to get the next
// node from the top of the stack, then pushes that node and an iterator over the
// successors to the top of the stack. This loop only grows `visit_stack`, stopping when
// we reach a child that has no children that we haven't already visited.
Expand All @@ -163,7 +163,7 @@ impl<'a, 'tcx> Postorder<'a, 'tcx> {
// The state of the stack starts out with just the root node (`A` in this case);
// [(A, [B, C])]
//
// When the first call to `traverse_sucessor` happens, the following happens:
// When the first call to `traverse_successor` happens, the following happens:
//
// [(B, [D]), // `B` taken from the successors of `A`, pushed to the
// // top of the stack along with the successors of `B`
Expand Down
6 changes: 0 additions & 6 deletions src/librustc/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -823,12 +823,6 @@ impl<'a, 'gcx> HashStable<StableHashingContext<'a>> for TypeckTables<'gcx> {

impl<'tcx> CommonTypes<'tcx> {
fn new(interners: &CtxtInterners<'tcx>) -> CommonTypes<'tcx> {
// Ensure our type representation does not grow
#[cfg(target_pointer_width = "64")]
static_assert!(ASSERT_TY_KIND: ::std::mem::size_of::<ty::TyKind<'_>>() <= 24);
#[cfg(target_pointer_width = "64")]
static_assert!(ASSERT_TYS: ::std::mem::size_of::<ty::TyS<'_>>() <= 32);

let mk = |sty| CtxtInterners::intern_ty(interners, interners, sty);
let mk_region = |r| {
if let Some(r) = interners.region.borrow().get(&r) {
Expand Down
4 changes: 4 additions & 0 deletions src/librustc/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,10 @@ pub struct TyS<'tcx> {
outer_exclusive_binder: ty::DebruijnIndex,
}

// `TyS` is used a lot. Make sure it doesn't unintentionally get bigger.
#[cfg(target_arch = "x86_64")]
static_assert!(MEM_SIZE_OF_TY_S: ::std::mem::size_of::<TyS<'_>>() == 32);

impl<'tcx> Ord for TyS<'tcx> {
fn cmp(&self, other: &TyS<'tcx>) -> Ordering {
self.sty.cmp(&other.sty)
Expand Down
3 changes: 2 additions & 1 deletion src/librustc/ty/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ define_queries! { <'tcx>
/// Gets a complete map from all types to their inherent impls.
/// Not meant to be used directly outside of coherence.
/// (Defined only for LOCAL_CRATE)
[] fn crate_inherent_impls: crate_inherent_impls_dep_node(CrateNum) -> CrateInherentImpls,
[] fn crate_inherent_impls: crate_inherent_impls_dep_node(CrateNum)
-> Lrc<CrateInherentImpls>,

/// Checks all types in the krate for overlap in their inherent impls. Reports errors.
/// Not meant to be used directly outside of coherence.
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/ty/query/plumbing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ pub(super) struct JobOwner<'a, 'tcx: 'a, Q: QueryDescription<'tcx> + 'a> {
}

impl<'a, 'tcx, Q: QueryDescription<'tcx>> JobOwner<'a, 'tcx, Q> {
/// Either gets a JobOwner corresponding the the query, allowing us to
/// Either gets a JobOwner corresponding the query, allowing us to
/// start executing the query, or it returns with the result of the query.
/// If the query is executing elsewhere, this will wait for it.
/// If the query panicked, this will silently panic.
Expand Down Expand Up @@ -314,7 +314,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
/// Try to read a node index for the node dep_node.
/// A node will have an index, when it's already been marked green, or when we can mark it
/// green. This function will mark the current task as a reader of the specified node, when
/// the a node index can be found for that node.
/// a node index can be found for that node.
pub(super) fn try_mark_green_and_read(self, dep_node: &DepNode) -> Option<DepNodeIndex> {
match self.dep_graph.node_color(dep_node) {
Some(DepNodeColor::Green(dep_node_index)) => {
Expand Down
Loading