Skip to content

Commit a96ba96

Browse files
committed
Auto merge of #62069 - Centril:rollup-m8n4uw7, r=Centril
Rollup of 5 pull requests Successful merges: - #62047 (Trigger `unused_attribute` lint on `#[cfg_attr($pred,)]`) - #62049 (Fix one missing `dyn`.) - #62051 (Lint empty `#[derive()]` as unused attribute.) - #62057 (Deny explicit_outlives_requirements in the compiler) - #62068 (Fix meta-variable binding errors in macros) Failed merges: r? @ghost
2 parents de02101 + 74380b3 commit a96ba96

File tree

38 files changed

+117
-91
lines changed

38 files changed

+117
-91
lines changed

src/libcore/fmt/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2070,19 +2070,19 @@ macro_rules! tuple {
20702070
() => ();
20712071
( $($name:ident,)+ ) => (
20722072
#[stable(feature = "rust1", since = "1.0.0")]
2073-
impl<$($name:Debug),*> Debug for ($($name,)*) where last_type!($($name,)+): ?Sized {
2073+
impl<$($name:Debug),+> Debug for ($($name,)+) where last_type!($($name,)+): ?Sized {
20742074
#[allow(non_snake_case, unused_assignments)]
20752075
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
20762076
let mut builder = f.debug_tuple("");
2077-
let ($(ref $name,)*) = *self;
2077+
let ($(ref $name,)+) = *self;
20782078
$(
20792079
builder.field(&$name);
2080-
)*
2080+
)+
20812081

20822082
builder.finish()
20832083
}
20842084
}
2085-
peel! { $($name,)* }
2085+
peel! { $($name,)+ }
20862086
)
20872087
}
20882088

src/libcore/hash/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -617,11 +617,11 @@ mod impls {
617617

618618
( $($name:ident)+) => (
619619
#[stable(feature = "rust1", since = "1.0.0")]
620-
impl<$($name: Hash),*> Hash for ($($name,)*) where last_type!($($name,)+): ?Sized {
620+
impl<$($name: Hash),+> Hash for ($($name,)+) where last_type!($($name,)+): ?Sized {
621621
#[allow(non_snake_case)]
622622
fn hash<S: Hasher>(&self, state: &mut S) {
623-
let ($(ref $name,)*) = *self;
624-
$($name.hash(state);)*
623+
let ($(ref $name,)+) = *self;
624+
$($name.hash(state);)+
625625
}
626626
}
627627
);

src/libcore/iter/traits/accum.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ macro_rules! integer_sum_product {
7272
($($a:ty)*) => (
7373
integer_sum_product!(@impls 0, 1,
7474
#[stable(feature = "iter_arith_traits", since = "1.12.0")],
75-
$($a)+);
75+
$($a)*);
7676
integer_sum_product!(@impls Wrapping(0), Wrapping(1),
7777
#[stable(feature = "wrapping_iter_arith", since = "1.14.0")],
78-
$(Wrapping<$a>)+);
78+
$(Wrapping<$a>)*);
7979
);
8080
}
8181

src/libcore/macros.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ macro_rules! panic {
1515
$crate::panic!($msg)
1616
);
1717
($fmt:expr, $($arg:tt)+) => ({
18-
$crate::panicking::panic_fmt(format_args!($fmt, $($arg)*),
18+
$crate::panicking::panic_fmt(format_args!($fmt, $($arg)+),
1919
&(file!(), line!(), __rust_unstable_column!()))
2020
});
2121
}
@@ -558,7 +558,7 @@ macro_rules! unreachable {
558558
#[stable(feature = "rust1", since = "1.0.0")]
559559
macro_rules! unimplemented {
560560
() => (panic!("not yet implemented"));
561-
($($arg:tt)+) => (panic!("not yet implemented: {}", format_args!($($arg)*)));
561+
($($arg:tt)+) => (panic!("not yet implemented: {}", format_args!($($arg)+)));
562562
}
563563

564564
/// Indicates unfinished code.
@@ -617,7 +617,7 @@ macro_rules! unimplemented {
617617
#[unstable(feature = "todo_macro", issue = "59277")]
618618
macro_rules! todo {
619619
() => (panic!("not yet implemented"));
620-
($($arg:tt)+) => (panic!("not yet implemented: {}", format_args!($($arg)*)));
620+
($($arg:tt)+) => (panic!("not yet implemented: {}", format_args!($($arg)+)));
621621
}
622622

623623
/// Creates an array of [`MaybeUninit`].

src/libcore/marker.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ pub trait Sized {
103103
/// `Unsize` is implemented for:
104104
///
105105
/// - `[T; N]` is `Unsize<[T]>`
106-
/// - `T` is `Unsize<Trait>` when `T: Trait`
106+
/// - `T` is `Unsize<dyn Trait>` when `T: Trait`
107107
/// - `Foo<..., T, ...>` is `Unsize<Foo<..., U, ...>>` if:
108108
/// - `T: Unsize<U>`
109109
/// - Foo is a struct

src/libcore/ptr/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -2725,12 +2725,12 @@ macro_rules! fnptr_impls_safety_abi {
27252725

27262726
macro_rules! fnptr_impls_args {
27272727
($($Arg: ident),+) => {
2728-
fnptr_impls_safety_abi! { extern "Rust" fn($($Arg),*) -> Ret, $($Arg),* }
2729-
fnptr_impls_safety_abi! { extern "C" fn($($Arg),*) -> Ret, $($Arg),* }
2730-
fnptr_impls_safety_abi! { extern "C" fn($($Arg),* , ...) -> Ret, $($Arg),* }
2731-
fnptr_impls_safety_abi! { unsafe extern "Rust" fn($($Arg),*) -> Ret, $($Arg),* }
2732-
fnptr_impls_safety_abi! { unsafe extern "C" fn($($Arg),*) -> Ret, $($Arg),* }
2733-
fnptr_impls_safety_abi! { unsafe extern "C" fn($($Arg),* , ...) -> Ret, $($Arg),* }
2728+
fnptr_impls_safety_abi! { extern "Rust" fn($($Arg),+) -> Ret, $($Arg),+ }
2729+
fnptr_impls_safety_abi! { extern "C" fn($($Arg),+) -> Ret, $($Arg),+ }
2730+
fnptr_impls_safety_abi! { extern "C" fn($($Arg),+ , ...) -> Ret, $($Arg),+ }
2731+
fnptr_impls_safety_abi! { unsafe extern "Rust" fn($($Arg),+) -> Ret, $($Arg),+ }
2732+
fnptr_impls_safety_abi! { unsafe extern "C" fn($($Arg),+) -> Ret, $($Arg),+ }
2733+
fnptr_impls_safety_abi! { unsafe extern "C" fn($($Arg),+ , ...) -> Ret, $($Arg),+ }
27342734
};
27352735
() => {
27362736
// No variadic functions with 0 parameters

src/libproc_macro/bridge/rpc.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ macro_rules! rpc_encode_decode {
5959
}
6060
};
6161
(enum $name:ident $(<$($T:ident),+>)? { $($variant:ident $(($field:ident))*),* $(,)? }) => {
62-
impl<S, $($($T: Encode<S>),+)?> Encode<S> for $name $(<$($T),+>)* {
62+
impl<S, $($($T: Encode<S>),+)?> Encode<S> for $name $(<$($T),+>)? {
6363
fn encode(self, w: &mut Writer, s: &mut S) {
6464
// HACK(eddyb): `Tag` enum duplicated between the
6565
// two impls as there's no other place to stash it.
@@ -79,8 +79,8 @@ macro_rules! rpc_encode_decode {
7979
}
8080
}
8181

82-
impl<S, $($($T: for<'s> DecodeMut<'a, 's, S>),+)*> DecodeMut<'a, '_, S>
83-
for $name $(<$($T),+>)*
82+
impl<S, $($($T: for<'s> DecodeMut<'a, 's, S>),+)?> DecodeMut<'a, '_, S>
83+
for $name $(<$($T),+>)?
8484
{
8585
fn decode(r: &mut Reader<'a>, s: &mut S) -> Self {
8686
// HACK(eddyb): `Tag` enum duplicated between the

src/librustc/hir/itemlikevisit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub trait ItemLikeVisitor<'hir> {
5151
fn visit_impl_item(&mut self, impl_item: &'hir ImplItem);
5252
}
5353

54-
pub struct DeepVisitor<'v, V: 'v> {
54+
pub struct DeepVisitor<'v, V> {
5555
visitor: &'v mut V,
5656
}
5757

src/librustc/infer/nll_relate/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ impl<'me, 'tcx> TypeVisitor<'tcx> for ScopeInstantiator<'me, 'tcx> {
800800
/// [blog post]: https://is.gd/0hKvIr
801801
struct TypeGeneralizer<'me, 'tcx, D>
802802
where
803-
D: TypeRelatingDelegate<'tcx> + 'me,
803+
D: TypeRelatingDelegate<'tcx>,
804804
{
805805
infcx: &'me InferCtxt<'me, 'tcx>,
806806

src/librustc/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#![deny(rust_2018_idioms)]
3232
#![deny(internal)]
3333
#![deny(unused_lifetimes)]
34-
#![allow(explicit_outlives_requirements)]
3534

3635
#![feature(arbitrary_self_types)]
3736
#![feature(box_patterns)]

src/librustc/middle/weak_lang_items.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ impl<'tcx> TyCtxt<'tcx> {
147147
let lang_items = self.lang_items();
148148
let did = Some(item_def_id);
149149

150-
$(lang_items.$name() == did)||+
150+
$(lang_items.$name() == did)||*
151151
}
152152
}
153153

src/librustc/ty/context.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ pub struct CommonConsts<'tcx> {
231231
pub err: &'tcx Const<'tcx>,
232232
}
233233

234-
pub struct LocalTableInContext<'a, V: 'a> {
234+
pub struct LocalTableInContext<'a, V> {
235235
local_id_root: Option<DefId>,
236236
data: &'a ItemLocalMap<V>
237237
}
@@ -294,7 +294,7 @@ impl<'a, V> ::std::ops::Index<hir::HirId> for LocalTableInContext<'a, V> {
294294
}
295295
}
296296

297-
pub struct LocalTableInContextMut<'a, V: 'a> {
297+
pub struct LocalTableInContextMut<'a, V> {
298298
local_id_root: Option<DefId>,
299299
data: &'a mut ItemLocalMap<V>
300300
}
@@ -2171,7 +2171,7 @@ impl<'tcx> TyCtxt<'tcx> {
21712171

21722172

21732173
/// An entry in an interner.
2174-
struct Interned<'tcx, T: 'tcx+?Sized>(&'tcx T);
2174+
struct Interned<'tcx, T: ?Sized>(&'tcx T);
21752175

21762176
impl<'tcx, T: 'tcx+?Sized> Clone for Interned<'tcx, T> {
21772177
fn clone(&self) -> Self {

src/librustc/ty/query/plumbing.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ macro_rules! profq_query_msg {
8989

9090
/// A type representing the responsibility to execute the job in the `job` field.
9191
/// This will poison the relevant query if dropped.
92-
pub(super) struct JobOwner<'a, 'tcx, Q: QueryDescription<'tcx> + 'a> {
92+
pub(super) struct JobOwner<'a, 'tcx, Q: QueryDescription<'tcx>> {
9393
cache: &'a Lock<QueryCache<'tcx, Q>>,
9494
key: Q::Key,
9595
job: Lrc<QueryJob<'tcx>>,
@@ -230,7 +230,7 @@ pub struct CycleError<'tcx> {
230230
}
231231

232232
/// The result of `try_get_lock`
233-
pub(super) enum TryGetJob<'a, 'tcx, D: QueryDescription<'tcx> + 'a> {
233+
pub(super) enum TryGetJob<'a, 'tcx, D: QueryDescription<'tcx>> {
234234
/// The query is not yet started. Contains a guard to the cache eventually used to start it.
235235
NotYetStarted(JobOwner<'a, 'tcx, D>),
236236

src/librustc_codegen_llvm/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ macro_rules! builder_methods_for_value_instructions {
110110
unsafe {
111111
llvm::$llvm_capi(self.llbuilder, $($arg,)* UNNAMED)
112112
}
113-
})*
113+
})+
114114
}
115115
}
116116

src/librustc_codegen_llvm/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#![deny(rust_2018_idioms)]
2525
#![deny(internal)]
2626
#![deny(unused_lifetimes)]
27-
#![allow(explicit_outlives_requirements)]
2827

2928
use back::write::{create_target_machine, create_informational_target_machine};
3029
use syntax_pos::symbol::Symbol;

src/librustc_codegen_ssa/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#![deny(rust_2018_idioms)]
1616
#![deny(internal)]
1717
#![deny(unused_lifetimes)]
18-
#![allow(explicit_outlives_requirements)]
1918

2019
#![recursion_limit="256"]
2120

src/librustc_data_structures/indexed_vec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ macro_rules! newtype_index {
423423
(@derives [$($derives:ident,)*]
424424
@attrs [$(#[$attrs:meta])*]
425425
@type [$type:ident]
426-
@max [$_max:expr]
426+
@max [$max:expr]
427427
@vis [$v:vis]
428428
@debug_format [$debug_format:tt]
429429
$(#[doc = $doc:expr])*

src/librustc_lint/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ fn get_type_suggestion(t: Ty<'_>, val: u128, negative: bool) -> Option<String> {
219219
return Some(format!("{:?}", $itypes))
220220
})*
221221
None
222-
},)*
222+
},)+
223223
_ => None
224224
}
225225
}

src/librustc_mir/dataflow/graphviz.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ impl<'a, 'tcx, BD> MirWithFlowState<'tcx> for DataflowBuilder<'a, 'tcx, BD>
3030
fn flow_state(&self) -> &DataflowState<'tcx, Self::BD> { &self.flow_state.flow_state }
3131
}
3232

33-
struct Graph<'a, 'tcx, MWF:'a, P> where
33+
struct Graph<'a, 'tcx, MWF, P> where
3434
MWF: MirWithFlowState<'tcx>
3535
{
3636
mbcx: &'a MWF,

src/librustc_mir/dataflow/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ where
181181

182182
struct PropagationContext<'b, 'a, 'tcx, O>
183183
where
184-
O: 'b + BitDenotation<'tcx>,
184+
O: BitDenotation<'tcx>,
185185
{
186186
builder: &'b mut DataflowAnalysis<'a, 'tcx, O>,
187187
}

src/librustc_mir/interpret/intern.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use super::{
2121
};
2222
use crate::const_eval::{CompileTimeInterpreter, CompileTimeEvalContext};
2323

24-
struct InternVisitor<'rt, 'mir: 'rt, 'tcx: 'rt + 'mir> {
24+
struct InternVisitor<'rt, 'mir, 'tcx> {
2525
/// previously encountered safe references
2626
ref_tracking: &'rt mut RefTracking<(MPlaceTy<'tcx>, Mutability, InternMode)>,
2727
ecx: &'rt mut CompileTimeEvalContext<'mir, 'tcx>,

src/librustc_mir/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
3030
#![deny(rust_2018_idioms)]
3131
#![deny(internal)]
3232
#![deny(unused_lifetimes)]
33-
#![allow(explicit_outlives_requirements)]
3433

3534
#[macro_use] extern crate log;
3635
#[macro_use]

src/librustc_mir/util/elaborate_drops.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ pub trait DropElaborator<'a, 'tcx>: fmt::Debug {
9292
#[derive(Debug)]
9393
struct DropCtxt<'l, 'b, 'tcx, D>
9494
where
95-
D: DropElaborator<'b, 'tcx> + 'l,
95+
D: DropElaborator<'b, 'tcx>,
9696
{
9797
elaborator: &'l mut D,
9898

src/librustc_target/spec/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -119,19 +119,19 @@ macro_rules! flavor_mappings {
119119
($((($($flavor:tt)*), $string:expr),)*) => (
120120
impl LinkerFlavor {
121121
pub const fn one_of() -> &'static str {
122-
concat!("one of: ", $($string, " ",)+)
122+
concat!("one of: ", $($string, " ",)*)
123123
}
124124

125125
pub fn from_str(s: &str) -> Option<Self> {
126126
Some(match s {
127-
$($string => $($flavor)*,)+
127+
$($string => $($flavor)*,)*
128128
_ => return None,
129129
})
130130
}
131131

132132
pub fn desc(&self) -> &str {
133133
match *self {
134-
$($($flavor)* => $string,)+
134+
$($($flavor)* => $string,)*
135135
}
136136
}
137137
}

src/librustc_typeck/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ This API is completely unstable and subject to change.
7575
#![deny(rust_2018_idioms)]
7676
#![deny(internal)]
7777
#![deny(unused_lifetimes)]
78-
#![allow(explicit_outlives_requirements)]
7978

8079
#[macro_use] extern crate log;
8180
#[macro_use] extern crate syntax;

src/libserialize/serialize.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -739,33 +739,33 @@ macro_rules! count {
739739
macro_rules! tuple {
740740
() => ();
741741
( $($name:ident,)+ ) => (
742-
impl<$($name:Decodable),*> Decodable for ($($name,)*) {
742+
impl<$($name:Decodable),+> Decodable for ($($name,)+) {
743743
#[allow(non_snake_case)]
744-
fn decode<D: Decoder>(d: &mut D) -> Result<($($name,)*), D::Error> {
745-
let len: usize = count!($($name)*);
744+
fn decode<D: Decoder>(d: &mut D) -> Result<($($name,)+), D::Error> {
745+
let len: usize = count!($($name)+);
746746
d.read_tuple(len, |d| {
747747
let mut i = 0;
748748
let ret = ($(d.read_tuple_arg({ i+=1; i-1 }, |d| -> Result<$name, D::Error> {
749749
Decodable::decode(d)
750-
})?,)*);
750+
})?,)+);
751751
Ok(ret)
752752
})
753753
}
754754
}
755-
impl<$($name:Encodable),*> Encodable for ($($name,)*) {
755+
impl<$($name:Encodable),+> Encodable for ($($name,)+) {
756756
#[allow(non_snake_case)]
757757
fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
758-
let ($(ref $name,)*) = *self;
758+
let ($(ref $name,)+) = *self;
759759
let mut n = 0;
760-
$(let $name = $name; n += 1;)*
760+
$(let $name = $name; n += 1;)+
761761
s.emit_tuple(n, |s| {
762762
let mut i = 0;
763-
$(s.emit_tuple_arg({ i+=1; i-1 }, |s| $name.encode(s))?;)*
763+
$(s.emit_tuple_arg({ i+=1; i-1 }, |s| $name.encode(s))?;)+
764764
Ok(())
765765
})
766766
}
767767
}
768-
peel! { $($name,)* }
768+
peel! { $($name,)+ }
769769
)
770770
}
771771

0 commit comments

Comments
 (0)