Skip to content

Commit

Permalink
Auto merge of #58389 - Centril:rollup, r=Centril
Browse files Browse the repository at this point in the history
Rollup of 11 pull requests

Successful merges:

 - #58105 (libarena => 2018)
 - #58111 (libterm => 2018)
 - #58287 (rustc-std-workspace-core => 2018)
 - #58288 (rustc-workspace-hack => 2018)
 - #58300 (librustc_typeck => 2018)
 - #58313 (Use `?` in librustc macros)
 - #58318 (libserialize => 2018)
 - #58322 (librustc_codegen_ssa => 2018)
 - #58342 (Revert removed #![feature(nll)])
 - #58367 (Remove two dead functions.)
 - #58382 (docs: remove "experimental" wording from std::os::unix)

Failed merges:

r? @ghost
  • Loading branch information
bors committed Feb 12, 2019
2 parents ba2853b + 33d2c9f commit 75f9159
Show file tree
Hide file tree
Showing 102 changed files with 2,104 additions and 2,145 deletions.
3 changes: 2 additions & 1 deletion src/libarena/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
authors = ["The Rust Project Developers"]
name = "arena"
version = "0.0.0"
edition = "2018"

[lib]
name = "arena"
path = "lib.rs"
crate-type = ["dylib"]

[dependencies]
rustc_data_structures = { path = "../librustc_data_structures" }
rustc_data_structures = { path = "../librustc_data_structures" }
18 changes: 9 additions & 9 deletions src/libarena/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/",
test(no_crate_inject, attr(deny(warnings))))]

#![deny(rust_2018_idioms)]

#![feature(alloc)]
#![feature(core_intrinsics)]
#![feature(dropck_eyepatch)]
#![feature(nll)]
#![feature(raw_vec_internals)]
#![cfg_attr(test, feature(test))]

#![allow(deprecated)]

extern crate alloc;
extern crate rustc_data_structures;

use rustc_data_structures::sync::MTLock;

Expand Down Expand Up @@ -476,7 +476,7 @@ impl SyncDroplessArena {
#[cfg(test)]
mod tests {
extern crate test;
use self::test::Bencher;
use test::Bencher;
use super::TypedArena;
use std::cell::Cell;

Expand Down Expand Up @@ -511,15 +511,15 @@ mod tests {

impl<'a> Wrap<'a> {
fn alloc_inner<F: Fn() -> Inner>(&self, f: F) -> &Inner {
let r: &EI = self.0.alloc(EI::I(f()));
let r: &EI<'_> = self.0.alloc(EI::I(f()));
if let &EI::I(ref i) = r {
i
} else {
panic!("mismatch");
}
}
fn alloc_outer<F: Fn() -> Outer<'a>>(&self, f: F) -> &Outer {
let r: &EI = self.0.alloc(EI::O(f()));
fn alloc_outer<F: Fn() -> Outer<'a>>(&self, f: F) -> &Outer<'_> {
let r: &EI<'_> = self.0.alloc(EI::O(f()));
if let &EI::O(ref o) = r {
o
} else {
Expand Down Expand Up @@ -609,7 +609,7 @@ mod tests {
count: &'a Cell<u32>,
}

impl<'a> Drop for DropCounter<'a> {
impl Drop for DropCounter<'_> {
fn drop(&mut self) {
self.count.set(self.count.get() + 1);
}
Expand All @@ -619,7 +619,7 @@ mod tests {
fn test_typed_arena_drop_count() {
let counter = Cell::new(0);
{
let arena: TypedArena<DropCounter> = TypedArena::default();
let arena: TypedArena<DropCounter<'_>> = TypedArena::default();
for _ in 0..100 {
// Allocate something with drop glue to make sure it doesn't leak.
arena.alloc(DropCounter { count: &counter });
Expand All @@ -631,7 +631,7 @@ mod tests {
#[test]
fn test_typed_arena_drop_on_clear() {
let counter = Cell::new(0);
let mut arena: TypedArena<DropCounter> = TypedArena::default();
let mut arena: TypedArena<DropCounter<'_>> = TypedArena::default();
for i in 0..10 {
for _ in 0..100 {
// Allocate something with drop glue to make sure it doesn't leak.
Expand Down
1 change: 1 addition & 0 deletions src/libfmt_macros/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#![deny(rust_2018_idioms)]

#![feature(nll)]
#![feature(rustc_private)]

pub use Piece::*;
Expand Down
1 change: 1 addition & 0 deletions src/libgraphviz/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@

#![deny(rust_2018_idioms)]

#![feature(nll)]
#![feature(str_escape)]

use LabelText::*;
Expand Down
1 change: 1 addition & 0 deletions src/libpanic_abort/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#![feature(core_intrinsics)]
#![feature(libc)]
#![feature(nll)]
#![feature(panic_runtime)]
#![feature(staged_api)]
#![feature(rustc_attrs)]
Expand Down
1 change: 1 addition & 0 deletions src/libproc_macro/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#![deny(rust_2018_idioms)]

#![feature(nll)]
#![feature(staged_api)]
#![feature(const_fn)]
#![feature(extern_types)]
Expand Down
1 change: 1 addition & 0 deletions src/libprofiler_builtins/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
reason = "internal implementation detail of rustc right now",
issue = "0")]
#![allow(unused_features)]
#![feature(nll)]
#![feature(staged_api)]
#![deny(rust_2018_idioms)]
8 changes: 0 additions & 8 deletions src/librustc/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1291,14 +1291,6 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
value.visit_with(&mut r)
}

pub fn resolve_type_and_region_vars_if_possible<T>(&self, value: &T) -> T
where
T: TypeFoldable<'tcx>,
{
let mut r = resolve::OpportunisticTypeAndRegionResolver::new(self);
value.fold_with(&mut r)
}

pub fn fully_resolve<T: TypeFoldable<'tcx>>(&self, value: &T) -> FixupResult<T> {
/*!
* Attempts to resolve all type/region variables in
Expand Down
56 changes: 26 additions & 30 deletions src/librustc/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,38 +62,36 @@ macro_rules! __impl_stable_hash_field {
#[macro_export]
macro_rules! impl_stable_hash_for {
// Enums
// FIXME(mark-i-m): Some of these should be `?` rather than `*`. See the git blame and change
// them back when `?` is supported again.
(enum $enum_name:path {
$( $variant:ident
// this incorrectly allows specifying both tuple-like and struct-like fields, as in `Variant(a,b){c,d}`,
// when it should be only one or the other
$( ( $($field:ident $(-> $delegate:tt)*),* ) )*
$( { $($named_field:ident $(-> $named_delegate:tt)*),* } )*
),* $(,)*
$( ( $($field:ident $(-> $delegate:tt)?),* ) )?
$( { $($named_field:ident $(-> $named_delegate:tt)?),* } )?
),* $(,)?
}) => {
impl_stable_hash_for!(
impl<> for enum $enum_name [ $enum_name ] { $( $variant
$( ( $($field $(-> $delegate)*),* ) )*
$( { $($named_field $(-> $named_delegate)*),* } )*
$( ( $($field $(-> $delegate)?),* ) )?
$( { $($named_field $(-> $named_delegate)?),* } )?
),* }
);
};
// We want to use the enum name both in the `impl ... for $enum_name` as well as for
// importing all the variants. Unfortunately it seems we have to take the name
// twice for this purpose
(impl<$($lt:lifetime $(: $lt_bound:lifetime)* ),* $(,)* $($T:ident),* $(,)*>
(impl<$($lt:lifetime $(: $lt_bound:lifetime)? ),* $(,)? $($T:ident),* $(,)?>
for enum $enum_name:path
[ $enum_path:path ]
{
$( $variant:ident
// this incorrectly allows specifying both tuple-like and struct-like fields, as in `Variant(a,b){c,d}`,
// when it should be only one or the other
$( ( $($field:ident $(-> $delegate:tt)*),* ) )*
$( { $($named_field:ident $(-> $named_delegate:tt)*),* } )*
),* $(,)*
$( ( $($field:ident $(-> $delegate:tt)?),* ) )?
$( { $($named_field:ident $(-> $named_delegate:tt)?),* } )?
),* $(,)?
}) => {
impl<'a, $($lt $(: $lt_bound)*,)* $($T,)*>
impl<'a, $($lt $(: $lt_bound)?,)* $($T,)*>
::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a>>
for $enum_name
where $($T: ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a>>),*
Expand All @@ -107,26 +105,25 @@ macro_rules! impl_stable_hash_for {

match *self {
$(
$variant $( ( $(ref $field),* ) )* $( { $(ref $named_field),* } )* => {
$($( __impl_stable_hash_field!($field, __ctx, __hasher $(, $delegate)*) );*)*
$($( __impl_stable_hash_field!($named_field, __ctx, __hasher $(, $named_delegate)*) );*)*
$variant $( ( $(ref $field),* ) )? $( { $(ref $named_field),* } )? => {
$($( __impl_stable_hash_field!($field, __ctx, __hasher $(, $delegate)?) );*)?
$($( __impl_stable_hash_field!($named_field, __ctx, __hasher $(, $named_delegate)?) );*)?
}
)*
}
}
}
};
// Structs
// FIXME(mark-i-m): same here.
(struct $struct_name:path { $($field:ident $(-> $delegate:tt)*),* $(,)* }) => {
(struct $struct_name:path { $($field:ident $(-> $delegate:tt)?),* $(,)? }) => {
impl_stable_hash_for!(
impl<'tcx> for struct $struct_name { $($field $(-> $delegate)*),* }
impl<'tcx> for struct $struct_name { $($field $(-> $delegate)?),* }
);
};
(impl<$($lt:lifetime $(: $lt_bound:lifetime)* ),* $(,)* $($T:ident),* $(,)*> for struct $struct_name:path {
$($field:ident $(-> $delegate:tt)*),* $(,)*
(impl<$($lt:lifetime $(: $lt_bound:lifetime)? ),* $(,)? $($T:ident),* $(,)?> for struct $struct_name:path {
$($field:ident $(-> $delegate:tt)?),* $(,)?
}) => {
impl<'a, $($lt $(: $lt_bound)*,)* $($T,)*>
impl<'a, $($lt $(: $lt_bound)?,)* $($T,)*>
::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a>> for $struct_name
where $($T: ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a>>),*
{
Expand All @@ -138,21 +135,20 @@ macro_rules! impl_stable_hash_for {
$(ref $field),*
} = *self;

$( __impl_stable_hash_field!($field, __ctx, __hasher $(, $delegate)*) );*
$( __impl_stable_hash_field!($field, __ctx, __hasher $(, $delegate)?) );*
}
}
};
// Tuple structs
// We cannot use normale parentheses here, the parser won't allow it
// FIXME(mark-i-m): same here.
(tuple_struct $struct_name:path { $($field:ident $(-> $delegate:tt)*),* $(,)* }) => {
// We cannot use normal parentheses here, the parser won't allow it
(tuple_struct $struct_name:path { $($field:ident $(-> $delegate:tt)?),* $(,)? }) => {
impl_stable_hash_for!(
impl<'tcx> for tuple_struct $struct_name { $($field $(-> $delegate)*),* }
impl<'tcx> for tuple_struct $struct_name { $($field $(-> $delegate)?),* }
);
};
(impl<$($lt:lifetime $(: $lt_bound:lifetime)* ),* $(,)* $($T:ident),* $(,)*>
for tuple_struct $struct_name:path { $($field:ident $(-> $delegate:tt)*),* $(,)* }) => {
impl<'a, $($lt $(: $lt_bound)*,)* $($T,)*>
(impl<$($lt:lifetime $(: $lt_bound:lifetime)? ),* $(,)? $($T:ident),* $(,)?>
for tuple_struct $struct_name:path { $($field:ident $(-> $delegate:tt)?),* $(,)? }) => {
impl<'a, $($lt $(: $lt_bound)?,)* $($T,)*>
::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a>> for $struct_name
where $($T: ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a>>),*
{
Expand All @@ -164,7 +160,7 @@ macro_rules! impl_stable_hash_for {
$(ref $field),*
) = *self;

$( __impl_stable_hash_field!($field, __ctx, __hasher $(, $delegate)*) );*
$( __impl_stable_hash_field!($field, __ctx, __hasher $(, $delegate)?) );*
}
}
};
Expand Down
Loading

0 comments on commit 75f9159

Please sign in to comment.