diff options
34 files changed, 54 insertions, 52 deletions
diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs index 035640b9710..08184d62679 100644 --- a/src/librustc/diagnostics.rs +++ b/src/librustc/diagnostics.rs @@ -614,7 +614,7 @@ use std::mem::transmute; struct Foo<T>(Vec<T>); trait MyTransmutableType: Sized { - fn transmute(Vec<Self>) -> Foo<Self>; + fn transmute(_: Vec<Self>) -> Foo<Self>; } impl MyTransmutableType for u8 { diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index 28b5b7c440c..9193ac0fcd6 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -837,7 +837,7 @@ impl Something {} // ok! trait Foo { type N; - fn bar(Self::N); // ok! + fn bar(_: Self::N); // ok! } // or: diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index 368fada511b..2f111c9e9d1 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -2476,7 +2476,7 @@ trait T2 { type Bar; // error: Baz is used but not declared - fn return_bool(&self, &Self::Bar, &Self::Baz) -> bool; + fn return_bool(&self, _: &Self::Bar, _: &Self::Baz) -> bool; } ``` @@ -2498,7 +2498,7 @@ trait T2 { type Baz; // we declare `Baz` in our trait. // and now we can use it here: - fn return_bool(&self, &Self::Bar, &Self::Baz) -> bool; + fn return_bool(&self, _: &Self::Bar, _: &Self::Baz) -> bool; } ``` "##, diff --git a/src/test/compile-fail/associated-types-ICE-when-projecting-out-of-err.rs b/src/test/compile-fail/associated-types-ICE-when-projecting-out-of-err.rs index 5a19aecf667..74a388e7269 100644 --- a/src/test/compile-fail/associated-types-ICE-when-projecting-out-of-err.rs +++ b/src/test/compile-fail/associated-types-ICE-when-projecting-out-of-err.rs @@ -25,7 +25,7 @@ pub trait Sized { trait Add<RHS=Self> { type Output; - fn add(self, RHS) -> Self::Output; + fn add(self, _: RHS) -> Self::Output; } fn ice<A>(a: A) { diff --git a/src/test/compile-fail/issue-13853-5.rs b/src/test/compile-fail/issue-13853-5.rs index 6a017f7bb30..78b079a7c44 100644 --- a/src/test/compile-fail/issue-13853-5.rs +++ b/src/test/compile-fail/issue-13853-5.rs @@ -11,7 +11,7 @@ trait Deserializer<'a> { } trait Deserializable { - fn deserialize_token<'a, D: Deserializer<'a>>(D, &'a str) -> Self; + fn deserialize_token<'a, D: Deserializer<'a>>(_: D, _: &'a str) -> Self; } impl<'a, T: Deserializable> Deserializable for &'a str { diff --git a/src/test/compile-fail/issue-18400.rs b/src/test/compile-fail/issue-18400.rs index f8d85f93937..dd17189aeea 100644 --- a/src/test/compile-fail/issue-18400.rs +++ b/src/test/compile-fail/issue-18400.rs @@ -9,8 +9,8 @@ // except according to those terms. trait Set<T> { - fn contains(&self, T) -> bool; - fn set(&mut self, T); + fn contains(&self, _: T) -> bool; + fn set(&mut self, _: T); } impl<'a, T, S> Set<&'a [T]> for S where diff --git a/src/test/compile-fail/issue-20831-debruijn.rs b/src/test/compile-fail/issue-20831-debruijn.rs index dac16251597..323cd24d8dd 100644 --- a/src/test/compile-fail/issue-20831-debruijn.rs +++ b/src/test/compile-fail/issue-20831-debruijn.rs @@ -22,7 +22,7 @@ pub trait Subscriber { pub trait Publisher<'a> { type Output; - fn subscribe(&mut self, Box<Subscriber<Input=Self::Output> + 'a>); + fn subscribe(&mut self, _: Box<Subscriber<Input=Self::Output> + 'a>); } pub trait Processor<'a> : Subscriber + Publisher<'a> { } diff --git a/src/test/compile-fail/issue-35869.rs b/src/test/compile-fail/issue-35869.rs index d1d6390cce3..1942fd38d11 100644 --- a/src/test/compile-fail/issue-35869.rs +++ b/src/test/compile-fail/issue-35869.rs @@ -11,9 +11,9 @@ #![feature(conservative_impl_trait)] trait Foo { - fn foo(fn(u8) -> ()); //~ NOTE type in trait - fn bar(Option<u8>); //~ NOTE type in trait - fn baz((u8, u16)); //~ NOTE type in trait + fn foo(_: fn(u8) -> ()); //~ NOTE type in trait + fn bar(_: Option<u8>); //~ NOTE type in trait + fn baz(_: (u8, u16)); //~ NOTE type in trait fn qux() -> u8; //~ NOTE type in trait } diff --git a/src/test/compile-fail/type-params-in-different-spaces-2.rs b/src/test/compile-fail/type-params-in-different-spaces-2.rs index d07282763d8..7de061eaf07 100644 --- a/src/test/compile-fail/type-params-in-different-spaces-2.rs +++ b/src/test/compile-fail/type-params-in-different-spaces-2.rs @@ -12,7 +12,7 @@ // type parameters on a trait correctly. trait Tr<T> : Sized { - fn op(T) -> Self; + fn op(_: T) -> Self; } trait A: Tr<Self> { diff --git a/src/test/compile-fail/variance-trait-bounds.rs b/src/test/compile-fail/variance-trait-bounds.rs index 9b88e38e085..ff446f175b7 100644 --- a/src/test/compile-fail/variance-trait-bounds.rs +++ b/src/test/compile-fail/variance-trait-bounds.rs @@ -19,7 +19,7 @@ trait Getter<T> { } trait Setter<T> { - fn get(&self, T); + fn get(&self, _: T); } #[rustc_variance] diff --git a/src/test/run-pass/associated-types-projection-in-object-type.rs b/src/test/run-pass/associated-types-projection-in-object-type.rs index 3b146792fda..14e94dbff6c 100644 --- a/src/test/run-pass/associated-types-projection-in-object-type.rs +++ b/src/test/run-pass/associated-types-projection-in-object-type.rs @@ -26,7 +26,7 @@ pub trait Subscriber { pub trait Publisher<'a> { type Output; - fn subscribe(&mut self, Box<Subscriber<Input=Self::Output> + 'a>); + fn subscribe(&mut self, _: Box<Subscriber<Input=Self::Output> + 'a>); } pub trait Processor<'a> : Subscriber + Publisher<'a> { } diff --git a/src/test/run-pass/auxiliary/issue_3979_traits.rs b/src/test/run-pass/auxiliary/issue_3979_traits.rs index 5c306be69c4..46035731c30 100644 --- a/src/test/run-pass/auxiliary/issue_3979_traits.rs +++ b/src/test/run-pass/auxiliary/issue_3979_traits.rs @@ -13,7 +13,7 @@ #![crate_type = "lib"] pub trait Positioned { - fn SetX(&mut self, isize); + fn SetX(&mut self, _: isize); fn X(&self) -> isize; } diff --git a/src/test/run-pass/auxiliary/xcrate-trait-lifetime-param.rs b/src/test/run-pass/auxiliary/xcrate-trait-lifetime-param.rs index e8e5cc53aa3..66c0300e260 100644 --- a/src/test/run-pass/auxiliary/xcrate-trait-lifetime-param.rs +++ b/src/test/run-pass/auxiliary/xcrate-trait-lifetime-param.rs @@ -9,5 +9,5 @@ // except according to those terms. pub trait FromBuf<'a> { - fn from_buf(&'a [u8]) -> Self; + fn from_buf(_: &'a [u8]) -> Self; } diff --git a/src/test/run-pass/dropck_legal_cycles.rs b/src/test/run-pass/dropck_legal_cycles.rs index 2f8ecbe693f..b6e640ab5b5 100644 --- a/src/test/run-pass/dropck_legal_cycles.rs +++ b/src/test/run-pass/dropck_legal_cycles.rs @@ -442,7 +442,7 @@ pub fn main() { } trait Named { - fn new(&'static str) -> Self; + fn new(_: &'static str) -> Self; fn name(&self) -> &str; } @@ -932,9 +932,9 @@ trait Context { } trait PrePost<T> { - fn pre(&mut self, &T); - fn post(&mut self, &T); - fn hit_limit(&mut self, &T); + fn pre(&mut self, _: &T); + fn post(&mut self, _: &T); + fn hit_limit(&mut self, _: &T); } trait Children<'a> { diff --git a/src/test/run-pass/issue-13105.rs b/src/test/run-pass/issue-13105.rs index ca68272d2d0..f2a606a8bba 100644 --- a/src/test/run-pass/issue-13105.rs +++ b/src/test/run-pass/issue-13105.rs @@ -11,6 +11,7 @@ // pretty-expanded FIXME #23616 trait Foo { + #[allow(anonymous_parameters)] fn quux(u8) {} } diff --git a/src/test/run-pass/issue-13775.rs b/src/test/run-pass/issue-13775.rs index 3b70bea719b..c69ae6a15cd 100644 --- a/src/test/run-pass/issue-13775.rs +++ b/src/test/run-pass/issue-13775.rs @@ -11,6 +11,7 @@ // pretty-expanded FIXME #23616 trait Foo { + #[allow(anonymous_parameters)] fn bar(&self, isize) {} } diff --git a/src/test/run-pass/issue-14919.rs b/src/test/run-pass/issue-14919.rs index df5d62e7699..5d0fde01798 100644 --- a/src/test/run-pass/issue-14919.rs +++ b/src/test/run-pass/issue-14919.rs @@ -26,7 +26,7 @@ impl<'a, 'b> Matcher for CharPredMatcher<'a, 'b> { } trait IntoMatcher<'a, T> { - fn into_matcher(self, &'a str) -> T; + fn into_matcher(self, _: &'a str) -> T; } impl<'a, 'b, F> IntoMatcher<'a, CharPredMatcher<'a, 'b>> for F where F: FnMut(char) -> bool + 'b { diff --git a/src/test/run-pass/issue-19098.rs b/src/test/run-pass/issue-19098.rs index e54fdfb5b5e..e526dd2903e 100644 --- a/src/test/run-pass/issue-19098.rs +++ b/src/test/run-pass/issue-19098.rs @@ -9,7 +9,7 @@ // except according to those terms. pub trait Handler { - fn handle(&self, &mut String); + fn handle(&self, _: &mut String); } impl<F> Handler for F where F: for<'a, 'b> Fn(&'a mut String) { diff --git a/src/test/run-pass/issue-21726.rs b/src/test/run-pass/issue-21726.rs index e1d1b908e01..9fdd89e25a1 100644 --- a/src/test/run-pass/issue-21726.rs +++ b/src/test/run-pass/issue-21726.rs @@ -23,7 +23,7 @@ fn foo<'a>(s: &'a str) { trait IntoRef<'a> { type T: Clone; - fn into_ref(self, &'a str) -> Self::T; + fn into_ref(self, _: &'a str) -> Self::T; } impl<'a> IntoRef<'a> for () { diff --git a/src/test/run-pass/issue-34074.rs b/src/test/run-pass/issue-34074.rs index 169a87f0b12..17d2bee7466 100644 --- a/src/test/run-pass/issue-34074.rs +++ b/src/test/run-pass/issue-34074.rs @@ -8,9 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// Make sure several unnamed function arguments don't conflict with each other +// Make sure several unnamed function parameters don't conflict with each other trait Tr { + #[allow(anonymous_parameters)] fn f(u8, u8) {} } diff --git a/src/test/run-pass/issue-3979-generics.rs b/src/test/run-pass/issue-3979-generics.rs index 6ba566012c3..2b56799f6b0 100644 --- a/src/test/run-pass/issue-3979-generics.rs +++ b/src/test/run-pass/issue-3979-generics.rs @@ -12,7 +12,7 @@ use std::ops::Add; trait Positioned<S> { - fn SetX(&mut self, S); + fn SetX(&mut self, _: S); fn X(&self) -> S; } diff --git a/src/test/run-pass/issue-3979.rs b/src/test/run-pass/issue-3979.rs index 184682255d9..9b5f7296ab5 100644 --- a/src/test/run-pass/issue-3979.rs +++ b/src/test/run-pass/issue-3979.rs @@ -10,7 +10,7 @@ trait Positioned { - fn SetX(&mut self, isize); + fn SetX(&mut self, _: isize); fn X(&self) -> isize; } diff --git a/src/test/run-pass/issue-4107.rs b/src/test/run-pass/issue-4107.rs index fa5ed26847b..6c5f4bf36de 100644 --- a/src/test/run-pass/issue-4107.rs +++ b/src/test/run-pass/issue-4107.rs @@ -13,7 +13,7 @@ pub fn main() { let _id: &Mat2<f64> = &Matrix::identity(1.0); } -pub trait Index<Index,Result> { fn get(&self, Index) -> Result { panic!() } } +pub trait Index<Index,Result> { fn get(&self, _: Index) -> Result { panic!() } } pub trait Dimensional<T>: Index<usize, T> { } pub struct Mat2<T> { x: T } diff --git a/src/test/run-pass/issue-6128.rs b/src/test/run-pass/issue-6128.rs index 8725b137896..b52900746e3 100644 --- a/src/test/run-pass/issue-6128.rs +++ b/src/test/run-pass/issue-6128.rs @@ -14,9 +14,8 @@ use std::collections::HashMap; trait Graph<Node, Edge> { - fn f(&self, Edge); - fn g(&self, Node); - + fn f(&self, _: Edge); + fn g(&self, _: Node); } impl<E> Graph<isize, E> for HashMap<isize, isize> { diff --git a/src/test/run-pass/issue-6157.rs b/src/test/run-pass/issue-6157.rs index c7832ae41e3..2c5bc48abe8 100644 --- a/src/test/run-pass/issue-6157.rs +++ b/src/test/run-pass/issue-6157.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -pub trait OpInt { fn call(&mut self, isize, isize) -> isize; } +pub trait OpInt { fn call(&mut self, _: isize, _: isize) -> isize; } impl<F> OpInt for F where F: FnMut(isize, isize) -> isize { fn call(&mut self, a:isize, b:isize) -> isize { diff --git a/src/test/run-pass/issue-9129.rs b/src/test/run-pass/issue-9129.rs index c46e8494e73..a9f29fdb38c 100644 --- a/src/test/run-pass/issue-9129.rs +++ b/src/test/run-pass/issue-9129.rs @@ -13,7 +13,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -pub trait bomb { fn boom(&self, Ident); } +pub trait bomb { fn boom(&self, _: Ident); } pub struct S; impl bomb for S { fn boom(&self, _: Ident) { } } diff --git a/src/test/run-pass/regions-early-bound-trait-param.rs b/src/test/run-pass/regions-early-bound-trait-param.rs index 4ba04aa7091..86fcfb9e6dd 100644 --- a/src/test/run-pass/regions-early-bound-trait-param.rs +++ b/src/test/run-pass/regions-early-bound-trait-param.rs @@ -63,7 +63,7 @@ fn make_val<T:MakerTrait>() -> T { } trait RefMakerTrait<'q> { - fn mk(Self) -> &'q Self; + fn mk(_: Self) -> &'q Self; } fn make_ref<'r, T:RefMakerTrait<'r>>(t:T) -> &'r T { diff --git a/src/test/run-pass/supertrait-default-generics.rs b/src/test/run-pass/supertrait-default-generics.rs index e014ce1966b..8351cc50fd8 100644 --- a/src/test/run-pass/supertrait-default-generics.rs +++ b/src/test/run-pass/supertrait-default-generics.rs @@ -14,7 +14,7 @@ use std::ops::Add; trait Positioned<S> { - fn SetX(&mut self, S); + fn SetX(&mut self, _: S); fn X(&self) -> S; } diff --git a/src/test/run-pass/trait-inheritance-static.rs b/src/test/run-pass/trait-inheritance-static.rs index 8e565829511..aae6b76087f 100644 --- a/src/test/run-pass/trait-inheritance-static.rs +++ b/src/test/run-pass/trait-inheritance-static.rs @@ -10,7 +10,7 @@ pub trait MyNum { - fn from_int(isize) -> Self; + fn from_int(_: isize) -> Self; } pub trait NumExt: MyNum { } diff --git a/src/test/run-pass/trait-inheritance-static2.rs b/src/test/run-pass/trait-inheritance-static2.rs index 67bea3864a7..dd942fbfa08 100644 --- a/src/test/run-pass/trait-inheritance-static2.rs +++ b/src/test/run-pass/trait-inheritance-static2.rs @@ -11,7 +11,7 @@ pub trait MyEq {} pub trait MyNum { - fn from_int(isize) -> Self; + fn from_int(_: isize) -> Self; } pub trait NumExt: MyEq + MyNum { } diff --git a/src/test/run-pass/trait-object-generics.rs b/src/test/run-pass/trait-object-generics.rs index 33bee3ea06f..61d32bd6ffc 100644 --- a/src/test/run-pass/trait-object-generics.rs +++ b/src/test/run-pass/trait-object-generics.rs @@ -41,7 +41,7 @@ impl<A1, A2, A3> Impl<A1, A2, A3> { enum Type<T> { Constant(T) } trait Trait<K,V> { - fn method(&self,Type<(K,V)>) -> isize; + fn method(&self, _: Type<(K,V)>) -> isize; } impl<V> Trait<u8,V> for () { diff --git a/src/test/run-pass/where-clause-bounds-inconsistency.rs b/src/test/run-pass/where-clause-bounds-inconsistency.rs index d4823b8a33c..fa07861d799 100644 --- a/src/test/run-pass/where-clause-bounds-inconsistency.rs +++ b/src/test/run-pass/where-clause-bounds-inconsistency.rs @@ -15,10 +15,10 @@ trait Bound { } trait Trait { - fn a<T>(&self, T) where T: Bound; - fn b<T>(&self, T) where T: Bound; - fn c<T: Bound>(&self, T); - fn d<T: Bound>(&self, T); + fn a<T>(&self, _: T) where T: Bound; + fn b<T>(&self, _: T) where T: Bound; + fn c<T: Bound>(&self, _: T); + fn d<T: Bound>(&self, _: T); } impl Trait for bool { diff --git a/src/test/ui/span/issue-7575.rs b/src/test/ui/span/issue-7575.rs index 2d271f0bf17..b74036c4f5c 100644 --- a/src/test/ui/span/issue-7575.rs +++ b/src/test/ui/span/issue-7575.rs @@ -12,12 +12,12 @@ // ignore-tidy-linelength trait CtxtFn { - fn f8(self, usize) -> usize; - fn f9(usize) -> usize; //~ NOTE candidate + fn f8(self, _: usize) -> usize; + fn f9(_: usize) -> usize; //~ NOTE candidate } trait OtherTrait { - fn f9(usize) -> usize; //~ NOTE candidate + fn f9(_: usize) -> usize; //~ NOTE candidate } // Note: this trait is not implemented, but we can't really tell @@ -26,7 +26,7 @@ trait OtherTrait { // candidate. This seems not unreasonable -- perhaps the user meant to // implement it, after all. trait UnusedTrait { - fn f9(usize) -> usize; //~ NOTE candidate + fn f9(_: usize) -> usize; //~ NOTE candidate } impl CtxtFn for usize { diff --git a/src/test/ui/span/issue-7575.stderr b/src/test/ui/span/issue-7575.stderr index 858c099d374..ff62adbfbd5 100644 --- a/src/test/ui/span/issue-7575.stderr +++ b/src/test/ui/span/issue-7575.stderr @@ -8,20 +8,20 @@ error[E0599]: no method named `f9` found for type `usize` in the current scope note: candidate #1 is defined in the trait `CtxtFn` --> $DIR/issue-7575.rs:16:5 | -16 | fn f9(usize) -> usize; //~ NOTE candidate - | ^^^^^^^^^^^^^^^^^^^^^^ +16 | fn f9(_: usize) -> usize; //~ NOTE candidate + | ^^^^^^^^^^^^^^^^^^^^^^^^^ = help: to disambiguate the method call, write `CtxtFn::f9(u, 342)` instead note: candidate #2 is defined in the trait `OtherTrait` --> $DIR/issue-7575.rs:20:5 | -20 | fn f9(usize) -> usize; //~ NOTE candidate - | ^^^^^^^^^^^^^^^^^^^^^^ +20 | fn f9(_: usize) -> usize; //~ NOTE candidate + | ^^^^^^^^^^^^^^^^^^^^^^^^^ = help: to disambiguate the method call, write `OtherTrait::f9(u, 342)` instead note: candidate #3 is defined in the trait `UnusedTrait` --> $DIR/issue-7575.rs:29:5 | -29 | fn f9(usize) -> usize; //~ NOTE candidate - | ^^^^^^^^^^^^^^^^^^^^^^ +29 | fn f9(_: usize) -> usize; //~ NOTE candidate + | ^^^^^^^^^^^^^^^^^^^^^^^^^ = help: to disambiguate the method call, write `UnusedTrait::f9(u, 342)` instead = help: items from traits can only be used if the trait is implemented and in scope = note: the following traits define an item `f9`, perhaps you need to implement one of them: |
