Skip to content

Commit affb8ee

Browse files
committed
Remove more anonymous trait method parameters
1 parent 13157c4 commit affb8ee

34 files changed

+54
-52
lines changed

src/librustc/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ use std::mem::transmute;
614614
struct Foo<T>(Vec<T>);
615615
616616
trait MyTransmutableType: Sized {
617-
fn transmute(Vec<Self>) -> Foo<Self>;
617+
fn transmute(_: Vec<Self>) -> Foo<Self>;
618618
}
619619
620620
impl MyTransmutableType for u8 {

src/librustc_resolve/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ impl Something {} // ok!
837837
trait Foo {
838838
type N;
839839
840-
fn bar(Self::N); // ok!
840+
fn bar(_: Self::N); // ok!
841841
}
842842
843843
// or:

src/librustc_typeck/diagnostics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2476,7 +2476,7 @@ trait T2 {
24762476
type Bar;
24772477
24782478
// error: Baz is used but not declared
2479-
fn return_bool(&self, &Self::Bar, &Self::Baz) -> bool;
2479+
fn return_bool(&self, _: &Self::Bar, _: &Self::Baz) -> bool;
24802480
}
24812481
```
24822482
@@ -2498,7 +2498,7 @@ trait T2 {
24982498
type Baz; // we declare `Baz` in our trait.
24992499
25002500
// and now we can use it here:
2501-
fn return_bool(&self, &Self::Bar, &Self::Baz) -> bool;
2501+
fn return_bool(&self, _: &Self::Bar, _: &Self::Baz) -> bool;
25022502
}
25032503
```
25042504
"##,

src/test/compile-fail/associated-types-ICE-when-projecting-out-of-err.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub trait Sized {
2525
trait Add<RHS=Self> {
2626
type Output;
2727

28-
fn add(self, RHS) -> Self::Output;
28+
fn add(self, _: RHS) -> Self::Output;
2929
}
3030

3131
fn ice<A>(a: A) {

src/test/compile-fail/issue-13853-5.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
trait Deserializer<'a> { }
1212

1313
trait Deserializable {
14-
fn deserialize_token<'a, D: Deserializer<'a>>(D, &'a str) -> Self;
14+
fn deserialize_token<'a, D: Deserializer<'a>>(_: D, _: &'a str) -> Self;
1515
}
1616

1717
impl<'a, T: Deserializable> Deserializable for &'a str {

src/test/compile-fail/issue-18400.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
// except according to those terms.
1010

1111
trait Set<T> {
12-
fn contains(&self, T) -> bool;
13-
fn set(&mut self, T);
12+
fn contains(&self, _: T) -> bool;
13+
fn set(&mut self, _: T);
1414
}
1515

1616
impl<'a, T, S> Set<&'a [T]> for S where

src/test/compile-fail/issue-20831-debruijn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub trait Subscriber {
2222

2323
pub trait Publisher<'a> {
2424
type Output;
25-
fn subscribe(&mut self, Box<Subscriber<Input=Self::Output> + 'a>);
25+
fn subscribe(&mut self, _: Box<Subscriber<Input=Self::Output> + 'a>);
2626
}
2727

2828
pub trait Processor<'a> : Subscriber + Publisher<'a> { }

src/test/compile-fail/issue-35869.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
#![feature(conservative_impl_trait)]
1212

1313
trait Foo {
14-
fn foo(fn(u8) -> ()); //~ NOTE type in trait
15-
fn bar(Option<u8>); //~ NOTE type in trait
16-
fn baz((u8, u16)); //~ NOTE type in trait
14+
fn foo(_: fn(u8) -> ()); //~ NOTE type in trait
15+
fn bar(_: Option<u8>); //~ NOTE type in trait
16+
fn baz(_: (u8, u16)); //~ NOTE type in trait
1717
fn qux() -> u8; //~ NOTE type in trait
1818
}
1919

src/test/compile-fail/type-params-in-different-spaces-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// type parameters on a trait correctly.
1313

1414
trait Tr<T> : Sized {
15-
fn op(T) -> Self;
15+
fn op(_: T) -> Self;
1616
}
1717

1818
trait A: Tr<Self> {

src/test/compile-fail/variance-trait-bounds.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ trait Getter<T> {
1919
}
2020

2121
trait Setter<T> {
22-
fn get(&self, T);
22+
fn get(&self, _: T);
2323
}
2424

2525
#[rustc_variance]

0 commit comments

Comments
 (0)