Skip to content

Commit e0bfd19

Browse files
authored
Rollup merge of rust-lang#41693 - est31:anon_params_removal, r=eddyb
Removal pass for anonymous parameters Removes occurences of anonymous parameters from the rustc codebase, as they are to be deprecated. See issue rust-lang#41686 and RFC 1685. r? @frewsxcv
2 parents 4733ee7 + 14bbd0a commit e0bfd19

File tree

14 files changed

+45
-41
lines changed

14 files changed

+45
-41
lines changed

src/libcore/convert.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ pub trait Into<T>: Sized {
276276
pub trait From<T>: Sized {
277277
/// Performs the conversion.
278278
#[stable(feature = "rust1", since = "1.0.0")]
279-
fn from(T) -> Self;
279+
fn from(_: T) -> Self;
280280
}
281281

282282
/// An attempted conversion that consumes `self`, which may or may not be

src/libcore/hash/sip.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,8 @@ impl<S: Sip> Default for Hasher<S> {
403403

404404
#[doc(hidden)]
405405
trait Sip {
406-
fn c_rounds(&mut State);
407-
fn d_rounds(&mut State);
406+
fn c_rounds(_: &mut State);
407+
fn d_rounds(_: &mut State);
408408
}
409409

410410
#[derive(Debug, Clone, Default)]

src/libcore/ops.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2878,10 +2878,10 @@ pub trait Carrier {
28782878
type Error;
28792879

28802880
/// Create a `Carrier` from a success value.
2881-
fn from_success(Self::Success) -> Self;
2881+
fn from_success(_: Self::Success) -> Self;
28822882

28832883
/// Create a `Carrier` from an error value.
2884-
fn from_error(Self::Error) -> Self;
2884+
fn from_error(_: Self::Error) -> Self;
28852885

28862886
/// Translate this `Carrier` to another implementation of `Carrier` with the
28872887
/// same associated types.

src/librand/distributions/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub trait Sample<Support> {
5353
// trait called `Sample` and the other should be `DependentSample`.
5454
pub trait IndependentSample<Support>: Sample<Support> {
5555
/// Generate a random value.
56-
fn ind_sample<R: Rng>(&self, &mut R) -> Support;
56+
fn ind_sample<R: Rng>(&self, _: &mut R) -> Support;
5757
}
5858

5959
/// A wrapper for generating types that implement `Rand` via the

src/librand/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ impl<'a, R: fmt::Debug> fmt::Debug for AsciiGenerator<'a, R> {
329329
/// the same stream of randomness multiple times.
330330
pub trait SeedableRng<Seed>: Rng {
331331
/// Reseed an RNG with the given seed.
332-
fn reseed(&mut self, Seed);
332+
fn reseed(&mut self, _: Seed);
333333

334334
/// Create a new RNG with the given seed.
335335
fn from_seed(seed: Seed) -> Self;

src/librustc/session/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1804,7 +1804,7 @@ mod dep_tracking {
18041804
use rustc_back::PanicStrategy;
18051805

18061806
pub trait DepTrackingHash {
1807-
fn hash(&self, &mut DefaultHasher, ErrorOutputType);
1807+
fn hash(&self, hasher: &mut DefaultHasher, error_format: ErrorOutputType);
18081808
}
18091809

18101810
macro_rules! impl_dep_tracking_hash_via_hash {

src/librustc/ty/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
15021502

15031503
pub trait InternAs<T: ?Sized, R> {
15041504
type Output;
1505-
fn intern_with<F>(self, F) -> Self::Output
1505+
fn intern_with<F>(self, f: F) -> Self::Output
15061506
where F: FnOnce(&T) -> R;
15071507
}
15081508

src/librustc_data_structures/indexed_vec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use rustc_serialize as serialize;
2424
///
2525
/// (purpose: avoid mixing indexes for different bitvector domains.)
2626
pub trait Idx: Copy + 'static + Eq + Debug {
27-
fn new(usize) -> Self;
27+
fn new(idx: usize) -> Self;
2828
fn index(self) -> usize;
2929
}
3030

src/librustc_driver/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ pub trait CompilerCalls<'a> {
343343

344344
// Create a CompilController struct for controlling the behaviour of
345345
// compilation.
346-
fn build_controller(&mut self, &Session, &getopts::Matches) -> CompileController<'a>;
346+
fn build_controller(&mut self, _: &Session, _: &getopts::Matches) -> CompileController<'a>;
347347
}
348348

349349
// CompilerCalls instance for a regular rustc build.

src/librustc_save_analysis/dump.rs

+24-24
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,28 @@ use super::external_data::*;
1313
use rls_data::CratePreludeData;
1414

1515
pub trait Dump {
16-
fn crate_prelude(&mut self, CratePreludeData) {}
17-
fn enum_data(&mut self, EnumData) {}
18-
fn extern_crate(&mut self, ExternCrateData) {}
19-
fn impl_data(&mut self, ImplData) {}
20-
fn inheritance(&mut self, InheritanceData) {}
21-
fn function(&mut self, FunctionData) {}
22-
fn function_ref(&mut self, FunctionRefData) {}
23-
fn function_call(&mut self, FunctionCallData) {}
24-
fn method(&mut self, MethodData) {}
25-
fn method_call(&mut self, MethodCallData) {}
26-
fn macro_data(&mut self, MacroData) {}
27-
fn macro_use(&mut self, MacroUseData) {}
28-
fn mod_data(&mut self, ModData) {}
29-
fn mod_ref(&mut self, ModRefData) {}
30-
fn struct_data(&mut self, StructData) {}
31-
fn struct_variant(&mut self, StructVariantData) {}
32-
fn trait_data(&mut self, TraitData) {}
33-
fn tuple_variant(&mut self, TupleVariantData) {}
34-
fn type_ref(&mut self, TypeRefData) {}
35-
fn typedef(&mut self, TypeDefData) {}
36-
fn use_data(&mut self, UseData) {}
37-
fn use_glob(&mut self, UseGlobData) {}
38-
fn variable(&mut self, VariableData) {}
39-
fn variable_ref(&mut self, VariableRefData) {}
16+
fn crate_prelude(&mut self, _: CratePreludeData) {}
17+
fn enum_data(&mut self, _: EnumData) {}
18+
fn extern_crate(&mut self, _: ExternCrateData) {}
19+
fn impl_data(&mut self, _: ImplData) {}
20+
fn inheritance(&mut self, _: InheritanceData) {}
21+
fn function(&mut self, _: FunctionData) {}
22+
fn function_ref(&mut self, _: FunctionRefData) {}
23+
fn function_call(&mut self, _: FunctionCallData) {}
24+
fn method(&mut self, _: MethodData) {}
25+
fn method_call(&mut self, _: MethodCallData) {}
26+
fn macro_data(&mut self, _: MacroData) {}
27+
fn macro_use(&mut self, _: MacroUseData) {}
28+
fn mod_data(&mut self, _: ModData) {}
29+
fn mod_ref(&mut self, _: ModRefData) {}
30+
fn struct_data(&mut self, _: StructData) {}
31+
fn struct_variant(&mut self, _: StructVariantData) {}
32+
fn trait_data(&mut self, _: TraitData) {}
33+
fn tuple_variant(&mut self, _: TupleVariantData) {}
34+
fn type_ref(&mut self, _: TypeRefData) {}
35+
fn typedef(&mut self, _: TypeDefData) {}
36+
fn use_data(&mut self, _: UseData) {}
37+
fn use_glob(&mut self, _: UseGlobData) {}
38+
fn variable(&mut self, _: VariableData) {}
39+
fn variable_ref(&mut self, _: VariableRefData) {}
4040
}

src/librustdoc/clean/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ impl<'a> Iterator for ListAttributesIter<'a> {
503503

504504
pub trait AttributesExt {
505505
/// Finds an attribute as List and returns the list of attributes nested inside.
506-
fn lists<'a>(&'a self, &'a str) -> ListAttributesIter<'a>;
506+
fn lists<'a>(&'a self, name: &'a str) -> ListAttributesIter<'a>;
507507
}
508508

509509
impl AttributesExt for [ast::Attribute] {
@@ -518,7 +518,7 @@ impl AttributesExt for [ast::Attribute] {
518518

519519
pub trait NestedAttributesExt {
520520
/// Returns whether the attribute list contains a specific `Word`
521-
fn has_word(self, &str) -> bool;
521+
fn has_word(self, word: &str) -> bool;
522522
}
523523

524524
impl<I: IntoIterator<Item=ast::NestedMetaItem>> NestedAttributesExt for I {

src/librustdoc/core.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl<'a, 'tcx> DocContext<'a, 'tcx> {
8989
}
9090

9191
pub trait DocAccessLevels {
92-
fn is_doc_reachable(&self, DefId) -> bool;
92+
fn is_doc_reachable(&self, did: DefId) -> bool;
9393
}
9494

9595
impl DocAccessLevels for AccessLevels<DefId> {

src/librustdoc/html/highlight.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ pub enum Class {
114114
pub trait Writer {
115115
/// Called when we start processing a span of text that should be highlighted.
116116
/// The `Class` argument specifies how it should be highlighted.
117-
fn enter_span(&mut self, Class) -> io::Result<()>;
117+
fn enter_span(&mut self, _: Class) -> io::Result<()>;
118118

119119
/// Called at the end of a span of highlighted text.
120120
fn exit_span(&mut self) -> io::Result<()>;
@@ -131,7 +131,11 @@ pub trait Writer {
131131
/// ```
132132
/// The latter can be thought of as a shorthand for the former, which is
133133
/// more flexible.
134-
fn string<T: Display>(&mut self, T, Class, Option<&TokenAndSpan>) -> io::Result<()>;
134+
fn string<T: Display>(&mut self,
135+
text: T,
136+
klass: Class,
137+
tok: Option<&TokenAndSpan>)
138+
-> io::Result<()>;
135139
}
136140

137141
// Implement `Writer` for anthing that can be written to, this just implements

src/libsyntax/ext/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub trait AstBuilder {
5252
fn ty_mt(&self, ty: P<ast::Ty>, mutbl: ast::Mutability) -> ast::MutTy;
5353

5454
fn ty(&self, span: Span, ty: ast::TyKind) -> P<ast::Ty>;
55-
fn ty_path(&self, ast::Path) -> P<ast::Ty>;
55+
fn ty_path(&self, path: ast::Path) -> P<ast::Ty>;
5656
fn ty_ident(&self, span: Span, idents: ast::Ident) -> P<ast::Ty>;
5757

5858
fn ty_rptr(&self, span: Span,

0 commit comments

Comments
 (0)