Skip to content

Commit 75f9159

Browse files
committed
Auto merge of #58389 - Centril:rollup, r=Centril
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
2 parents ba2853b + 33d2c9f commit 75f9159

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+2104
-2145
lines changed

src/libarena/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
authors = ["The Rust Project Developers"]
33
name = "arena"
44
version = "0.0.0"
5+
edition = "2018"
56

67
[lib]
78
name = "arena"
89
path = "lib.rs"
910
crate-type = ["dylib"]
1011

1112
[dependencies]
12-
rustc_data_structures = { path = "../librustc_data_structures" }
13+
rustc_data_structures = { path = "../librustc_data_structures" }

src/libarena/lib.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/",
1212
test(no_crate_inject, attr(deny(warnings))))]
1313

14+
#![deny(rust_2018_idioms)]
15+
1416
#![feature(alloc)]
1517
#![feature(core_intrinsics)]
1618
#![feature(dropck_eyepatch)]
17-
#![feature(nll)]
1819
#![feature(raw_vec_internals)]
1920
#![cfg_attr(test, feature(test))]
2021

2122
#![allow(deprecated)]
2223

2324
extern crate alloc;
24-
extern crate rustc_data_structures;
2525

2626
use rustc_data_structures::sync::MTLock;
2727

@@ -476,7 +476,7 @@ impl SyncDroplessArena {
476476
#[cfg(test)]
477477
mod tests {
478478
extern crate test;
479-
use self::test::Bencher;
479+
use test::Bencher;
480480
use super::TypedArena;
481481
use std::cell::Cell;
482482

@@ -511,15 +511,15 @@ mod tests {
511511

512512
impl<'a> Wrap<'a> {
513513
fn alloc_inner<F: Fn() -> Inner>(&self, f: F) -> &Inner {
514-
let r: &EI = self.0.alloc(EI::I(f()));
514+
let r: &EI<'_> = self.0.alloc(EI::I(f()));
515515
if let &EI::I(ref i) = r {
516516
i
517517
} else {
518518
panic!("mismatch");
519519
}
520520
}
521-
fn alloc_outer<F: Fn() -> Outer<'a>>(&self, f: F) -> &Outer {
522-
let r: &EI = self.0.alloc(EI::O(f()));
521+
fn alloc_outer<F: Fn() -> Outer<'a>>(&self, f: F) -> &Outer<'_> {
522+
let r: &EI<'_> = self.0.alloc(EI::O(f()));
523523
if let &EI::O(ref o) = r {
524524
o
525525
} else {
@@ -609,7 +609,7 @@ mod tests {
609609
count: &'a Cell<u32>,
610610
}
611611

612-
impl<'a> Drop for DropCounter<'a> {
612+
impl Drop for DropCounter<'_> {
613613
fn drop(&mut self) {
614614
self.count.set(self.count.get() + 1);
615615
}
@@ -619,7 +619,7 @@ mod tests {
619619
fn test_typed_arena_drop_count() {
620620
let counter = Cell::new(0);
621621
{
622-
let arena: TypedArena<DropCounter> = TypedArena::default();
622+
let arena: TypedArena<DropCounter<'_>> = TypedArena::default();
623623
for _ in 0..100 {
624624
// Allocate something with drop glue to make sure it doesn't leak.
625625
arena.alloc(DropCounter { count: &counter });
@@ -631,7 +631,7 @@ mod tests {
631631
#[test]
632632
fn test_typed_arena_drop_on_clear() {
633633
let counter = Cell::new(0);
634-
let mut arena: TypedArena<DropCounter> = TypedArena::default();
634+
let mut arena: TypedArena<DropCounter<'_>> = TypedArena::default();
635635
for i in 0..10 {
636636
for _ in 0..100 {
637637
// Allocate something with drop glue to make sure it doesn't leak.

src/libfmt_macros/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#![deny(rust_2018_idioms)]
1212

13+
#![feature(nll)]
1314
#![feature(rustc_private)]
1415

1516
pub use Piece::*;

src/libgraphviz/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@
276276

277277
#![deny(rust_2018_idioms)]
278278

279+
#![feature(nll)]
279280
#![feature(str_escape)]
280281

281282
use LabelText::*;

src/libpanic_abort/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#![feature(core_intrinsics)]
1616
#![feature(libc)]
17+
#![feature(nll)]
1718
#![feature(panic_runtime)]
1819
#![feature(staged_api)]
1920
#![feature(rustc_attrs)]

src/libproc_macro/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#![deny(rust_2018_idioms)]
1919

20+
#![feature(nll)]
2021
#![feature(staged_api)]
2122
#![feature(const_fn)]
2223
#![feature(extern_types)]

src/libprofiler_builtins/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
reason = "internal implementation detail of rustc right now",
66
issue = "0")]
77
#![allow(unused_features)]
8+
#![feature(nll)]
89
#![feature(staged_api)]
910
#![deny(rust_2018_idioms)]

src/librustc/infer/mod.rs

-8
Original file line numberDiff line numberDiff line change
@@ -1291,14 +1291,6 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
12911291
value.visit_with(&mut r)
12921292
}
12931293

1294-
pub fn resolve_type_and_region_vars_if_possible<T>(&self, value: &T) -> T
1295-
where
1296-
T: TypeFoldable<'tcx>,
1297-
{
1298-
let mut r = resolve::OpportunisticTypeAndRegionResolver::new(self);
1299-
value.fold_with(&mut r)
1300-
}
1301-
13021294
pub fn fully_resolve<T: TypeFoldable<'tcx>>(&self, value: &T) -> FixupResult<T> {
13031295
/*!
13041296
* Attempts to resolve all type/region variables in

src/librustc/macros.rs

+26-30
Original file line numberDiff line numberDiff line change
@@ -62,38 +62,36 @@ macro_rules! __impl_stable_hash_field {
6262
#[macro_export]
6363
macro_rules! impl_stable_hash_for {
6464
// Enums
65-
// FIXME(mark-i-m): Some of these should be `?` rather than `*`. See the git blame and change
66-
// them back when `?` is supported again.
6765
(enum $enum_name:path {
6866
$( $variant:ident
6967
// this incorrectly allows specifying both tuple-like and struct-like fields, as in `Variant(a,b){c,d}`,
7068
// when it should be only one or the other
71-
$( ( $($field:ident $(-> $delegate:tt)*),* ) )*
72-
$( { $($named_field:ident $(-> $named_delegate:tt)*),* } )*
73-
),* $(,)*
69+
$( ( $($field:ident $(-> $delegate:tt)?),* ) )?
70+
$( { $($named_field:ident $(-> $named_delegate:tt)?),* } )?
71+
),* $(,)?
7472
}) => {
7573
impl_stable_hash_for!(
7674
impl<> for enum $enum_name [ $enum_name ] { $( $variant
77-
$( ( $($field $(-> $delegate)*),* ) )*
78-
$( { $($named_field $(-> $named_delegate)*),* } )*
75+
$( ( $($field $(-> $delegate)?),* ) )?
76+
$( { $($named_field $(-> $named_delegate)?),* } )?
7977
),* }
8078
);
8179
};
8280
// We want to use the enum name both in the `impl ... for $enum_name` as well as for
8381
// importing all the variants. Unfortunately it seems we have to take the name
8482
// twice for this purpose
85-
(impl<$($lt:lifetime $(: $lt_bound:lifetime)* ),* $(,)* $($T:ident),* $(,)*>
83+
(impl<$($lt:lifetime $(: $lt_bound:lifetime)? ),* $(,)? $($T:ident),* $(,)?>
8684
for enum $enum_name:path
8785
[ $enum_path:path ]
8886
{
8987
$( $variant:ident
9088
// this incorrectly allows specifying both tuple-like and struct-like fields, as in `Variant(a,b){c,d}`,
9189
// when it should be only one or the other
92-
$( ( $($field:ident $(-> $delegate:tt)*),* ) )*
93-
$( { $($named_field:ident $(-> $named_delegate:tt)*),* } )*
94-
),* $(,)*
90+
$( ( $($field:ident $(-> $delegate:tt)?),* ) )?
91+
$( { $($named_field:ident $(-> $named_delegate:tt)?),* } )?
92+
),* $(,)?
9593
}) => {
96-
impl<'a, $($lt $(: $lt_bound)*,)* $($T,)*>
94+
impl<'a, $($lt $(: $lt_bound)?,)* $($T,)*>
9795
::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a>>
9896
for $enum_name
9997
where $($T: ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a>>),*
@@ -107,26 +105,25 @@ macro_rules! impl_stable_hash_for {
107105

108106
match *self {
109107
$(
110-
$variant $( ( $(ref $field),* ) )* $( { $(ref $named_field),* } )* => {
111-
$($( __impl_stable_hash_field!($field, __ctx, __hasher $(, $delegate)*) );*)*
112-
$($( __impl_stable_hash_field!($named_field, __ctx, __hasher $(, $named_delegate)*) );*)*
108+
$variant $( ( $(ref $field),* ) )? $( { $(ref $named_field),* } )? => {
109+
$($( __impl_stable_hash_field!($field, __ctx, __hasher $(, $delegate)?) );*)?
110+
$($( __impl_stable_hash_field!($named_field, __ctx, __hasher $(, $named_delegate)?) );*)?
113111
}
114112
)*
115113
}
116114
}
117115
}
118116
};
119117
// Structs
120-
// FIXME(mark-i-m): same here.
121-
(struct $struct_name:path { $($field:ident $(-> $delegate:tt)*),* $(,)* }) => {
118+
(struct $struct_name:path { $($field:ident $(-> $delegate:tt)?),* $(,)? }) => {
122119
impl_stable_hash_for!(
123-
impl<'tcx> for struct $struct_name { $($field $(-> $delegate)*),* }
120+
impl<'tcx> for struct $struct_name { $($field $(-> $delegate)?),* }
124121
);
125122
};
126-
(impl<$($lt:lifetime $(: $lt_bound:lifetime)* ),* $(,)* $($T:ident),* $(,)*> for struct $struct_name:path {
127-
$($field:ident $(-> $delegate:tt)*),* $(,)*
123+
(impl<$($lt:lifetime $(: $lt_bound:lifetime)? ),* $(,)? $($T:ident),* $(,)?> for struct $struct_name:path {
124+
$($field:ident $(-> $delegate:tt)?),* $(,)?
128125
}) => {
129-
impl<'a, $($lt $(: $lt_bound)*,)* $($T,)*>
126+
impl<'a, $($lt $(: $lt_bound)?,)* $($T,)*>
130127
::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a>> for $struct_name
131128
where $($T: ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a>>),*
132129
{
@@ -138,21 +135,20 @@ macro_rules! impl_stable_hash_for {
138135
$(ref $field),*
139136
} = *self;
140137

141-
$( __impl_stable_hash_field!($field, __ctx, __hasher $(, $delegate)*) );*
138+
$( __impl_stable_hash_field!($field, __ctx, __hasher $(, $delegate)?) );*
142139
}
143140
}
144141
};
145142
// Tuple structs
146-
// We cannot use normale parentheses here, the parser won't allow it
147-
// FIXME(mark-i-m): same here.
148-
(tuple_struct $struct_name:path { $($field:ident $(-> $delegate:tt)*),* $(,)* }) => {
143+
// We cannot use normal parentheses here, the parser won't allow it
144+
(tuple_struct $struct_name:path { $($field:ident $(-> $delegate:tt)?),* $(,)? }) => {
149145
impl_stable_hash_for!(
150-
impl<'tcx> for tuple_struct $struct_name { $($field $(-> $delegate)*),* }
146+
impl<'tcx> for tuple_struct $struct_name { $($field $(-> $delegate)?),* }
151147
);
152148
};
153-
(impl<$($lt:lifetime $(: $lt_bound:lifetime)* ),* $(,)* $($T:ident),* $(,)*>
154-
for tuple_struct $struct_name:path { $($field:ident $(-> $delegate:tt)*),* $(,)* }) => {
155-
impl<'a, $($lt $(: $lt_bound)*,)* $($T,)*>
149+
(impl<$($lt:lifetime $(: $lt_bound:lifetime)? ),* $(,)? $($T:ident),* $(,)?>
150+
for tuple_struct $struct_name:path { $($field:ident $(-> $delegate:tt)?),* $(,)? }) => {
151+
impl<'a, $($lt $(: $lt_bound)?,)* $($T,)*>
156152
::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a>> for $struct_name
157153
where $($T: ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a>>),*
158154
{
@@ -164,7 +160,7 @@ macro_rules! impl_stable_hash_for {
164160
$(ref $field),*
165161
) = *self;
166162

167-
$( __impl_stable_hash_field!($field, __ctx, __hasher $(, $delegate)*) );*
163+
$( __impl_stable_hash_field!($field, __ctx, __hasher $(, $delegate)?) );*
168164
}
169165
}
170166
};

0 commit comments

Comments
 (0)