Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removal pass for anonymous parameters #41693

Merged
merged 2 commits into from
May 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libcore/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ pub trait Into<T>: Sized {
pub trait From<T>: Sized {
/// Performs the conversion.
#[stable(feature = "rust1", since = "1.0.0")]
fn from(T) -> Self;
fn from(_: T) -> Self;
}

/// An attempted conversion that consumes `self`, which may or may not be
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/hash/sip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,8 @@ impl<S: Sip> Default for Hasher<S> {

#[doc(hidden)]
trait Sip {
fn c_rounds(&mut State);
fn d_rounds(&mut State);
fn c_rounds(_: &mut State);
fn d_rounds(_: &mut State);
}

#[derive(Debug, Clone, Default)]
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2878,10 +2878,10 @@ pub trait Carrier {
type Error;

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

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

/// Translate this `Carrier` to another implementation of `Carrier` with the
/// same associated types.
Expand Down
2 changes: 1 addition & 1 deletion src/librand/distributions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub trait Sample<Support> {
// trait called `Sample` and the other should be `DependentSample`.
pub trait IndependentSample<Support>: Sample<Support> {
/// Generate a random value.
fn ind_sample<R: Rng>(&self, &mut R) -> Support;
fn ind_sample<R: Rng>(&self, _: &mut R) -> Support;
}

/// A wrapper for generating types that implement `Rand` via the
Expand Down
2 changes: 1 addition & 1 deletion src/librand/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ impl<'a, R: fmt::Debug> fmt::Debug for AsciiGenerator<'a, R> {
/// the same stream of randomness multiple times.
pub trait SeedableRng<Seed>: Rng {
/// Reseed an RNG with the given seed.
fn reseed(&mut self, Seed);
fn reseed(&mut self, _: Seed);

/// Create a new RNG with the given seed.
fn from_seed(seed: Seed) -> Self;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1804,7 +1804,7 @@ mod dep_tracking {
use rustc_back::PanicStrategy;

pub trait DepTrackingHash {
fn hash(&self, &mut DefaultHasher, ErrorOutputType);
fn hash(&self, hasher: &mut DefaultHasher, error_format: ErrorOutputType);
}

macro_rules! impl_dep_tracking_hash_via_hash {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1467,7 +1467,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {

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

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_data_structures/indexed_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use rustc_serialize as serialize;
///
/// (purpose: avoid mixing indexes for different bitvector domains.)
pub trait Idx: Copy + 'static + Eq + Debug {
fn new(usize) -> Self;
fn new(idx: usize) -> Self;
fn index(self) -> usize;
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_driver/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ pub trait CompilerCalls<'a> {

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

// CompilerCalls instance for a regular rustc build.
Expand Down
48 changes: 24 additions & 24 deletions src/librustc_save_analysis/dump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,28 @@ use super::external_data::*;
use rls_data::CratePreludeData;

pub trait Dump {
fn crate_prelude(&mut self, CratePreludeData) {}
fn enum_data(&mut self, EnumData) {}
fn extern_crate(&mut self, ExternCrateData) {}
fn impl_data(&mut self, ImplData) {}
fn inheritance(&mut self, InheritanceData) {}
fn function(&mut self, FunctionData) {}
fn function_ref(&mut self, FunctionRefData) {}
fn function_call(&mut self, FunctionCallData) {}
fn method(&mut self, MethodData) {}
fn method_call(&mut self, MethodCallData) {}
fn macro_data(&mut self, MacroData) {}
fn macro_use(&mut self, MacroUseData) {}
fn mod_data(&mut self, ModData) {}
fn mod_ref(&mut self, ModRefData) {}
fn struct_data(&mut self, StructData) {}
fn struct_variant(&mut self, StructVariantData) {}
fn trait_data(&mut self, TraitData) {}
fn tuple_variant(&mut self, TupleVariantData) {}
fn type_ref(&mut self, TypeRefData) {}
fn typedef(&mut self, TypeDefData) {}
fn use_data(&mut self, UseData) {}
fn use_glob(&mut self, UseGlobData) {}
fn variable(&mut self, VariableData) {}
fn variable_ref(&mut self, VariableRefData) {}
fn crate_prelude(&mut self, _: CratePreludeData) {}
fn enum_data(&mut self, _: EnumData) {}
fn extern_crate(&mut self, _: ExternCrateData) {}
fn impl_data(&mut self, _: ImplData) {}
fn inheritance(&mut self, _: InheritanceData) {}
fn function(&mut self, _: FunctionData) {}
fn function_ref(&mut self, _: FunctionRefData) {}
fn function_call(&mut self, _: FunctionCallData) {}
fn method(&mut self, _: MethodData) {}
fn method_call(&mut self, _: MethodCallData) {}
fn macro_data(&mut self, _: MacroData) {}
fn macro_use(&mut self, _: MacroUseData) {}
fn mod_data(&mut self, _: ModData) {}
fn mod_ref(&mut self, _: ModRefData) {}
fn struct_data(&mut self, _: StructData) {}
fn struct_variant(&mut self, _: StructVariantData) {}
fn trait_data(&mut self, _: TraitData) {}
fn tuple_variant(&mut self, _: TupleVariantData) {}
fn type_ref(&mut self, _: TypeRefData) {}
fn typedef(&mut self, _: TypeDefData) {}
fn use_data(&mut self, _: UseData) {}
fn use_glob(&mut self, _: UseGlobData) {}
fn variable(&mut self, _: VariableData) {}
fn variable_ref(&mut self, _: VariableRefData) {}
}
4 changes: 2 additions & 2 deletions src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ impl<'a> Iterator for ListAttributesIter<'a> {

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

impl AttributesExt for [ast::Attribute] {
Expand All @@ -518,7 +518,7 @@ impl AttributesExt for [ast::Attribute] {

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

impl<I: IntoIterator<Item=ast::NestedMetaItem>> NestedAttributesExt for I {
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl<'a, 'tcx> DocContext<'a, 'tcx> {
}

pub trait DocAccessLevels {
fn is_doc_reachable(&self, DefId) -> bool;
fn is_doc_reachable(&self, did: DefId) -> bool;
}

impl DocAccessLevels for AccessLevels<DefId> {
Expand Down
8 changes: 6 additions & 2 deletions src/librustdoc/html/highlight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub enum Class {
pub trait Writer {
/// Called when we start processing a span of text that should be highlighted.
/// The `Class` argument specifies how it should be highlighted.
fn enter_span(&mut self, Class) -> io::Result<()>;
fn enter_span(&mut self, _: Class) -> io::Result<()>;

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

// Implement `Writer` for anthing that can be written to, this just implements
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/ext/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub trait AstBuilder {
fn ty_mt(&self, ty: P<ast::Ty>, mutbl: ast::Mutability) -> ast::MutTy;

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

fn ty_rptr(&self, span: Span,
Expand Down