]> git.lizzy.rs Git - rust.git/commitdiff
Removal pass for anonymous parameters
authorest31 <MTest31@outlook.com>
Tue, 2 May 2017 03:55:20 +0000 (05:55 +0200)
committerest31 <MTest31@outlook.com>
Tue, 2 May 2017 03:55:20 +0000 (05:55 +0200)
Removes occurences of anonymous parameters from the
rustc codebase, as they are to be deprecated.

See issue #41686 and RFC 1685.

14 files changed:
src/libcore/convert.rs
src/libcore/hash/sip.rs
src/libcore/ops.rs
src/librand/distributions/mod.rs
src/librand/lib.rs
src/librustc/session/config.rs
src/librustc/ty/context.rs
src/librustc_data_structures/indexed_vec.rs
src/librustc_driver/lib.rs
src/librustc_save_analysis/dump.rs
src/librustdoc/clean/mod.rs
src/librustdoc/core.rs
src/librustdoc/html/highlight.rs
src/libsyntax/ext/build.rs

index 084736685e3a7f49bf23e4db4e3f7c97eec02fc9..f5dc38e8aab677c29152da45e58ab69df0928e49 100644 (file)
@@ -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: T) -> Self;
 }
 
 /// An attempted conversion that consumes `self`, which may or may not be
index 5f5d07b6682372a3dd04ec92c552283ae1f27e76..db12496b6f320aac7ea3fac44bd8b57f59a45ef1 100644 (file)
@@ -403,8 +403,8 @@ fn default() -> 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)]
index 175b3a5a69ac15c86c51109154a6cdf3ef9ffac9..391b606f613f288970e7b74544d4e20e840eacb5 100644 (file)
@@ -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.
index eb9476efb7b4c148b243af2783128b837263ee37..67b9449981e0f02a4d24fa5adfb3928ec612665c 100644 (file)
@@ -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
index f2b43a20f944e47c6577781aac78dda3bc81a715..ca05db15ffeb9d44078b71576c0a6af56d5a57cf 100644 (file)
@@ -329,7 +329,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 /// 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;
index 0bb4cd69e0cd18e5cd1e8a50fb0f22534fe69b0c..d107e9a84856fbc95050f78bf9bf17cae3131d18 100644 (file)
@@ -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 {
index ac7a72e66655f8b8549fccff325f206ec6fce3aa..81b547d5a570aaccd206c0b294ec3469d4cb546c 100644 (file)
@@ -1467,7 +1467,7 @@ pub fn mk_substs_trait(self,
 
 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;
 }
 
index 62c430dda327fe1c48c4a9537c50daecbd87ecce..0642ddc71622b1abe8cfae41c72a6266b51b3d12 100644 (file)
@@ -24,7 +24,7 @@
 ///
 /// (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;
 }
 
index e4ed2b8eb8fabda1fad638c30772383eb05721db..889f4dd4b9aac9d3c526ffff8863a0f84e4b0a30 100644 (file)
@@ -343,7 +343,7 @@ fn no_input(&mut self,
 
     // 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.
index 84e1fb03f624e821068f2111b3fcefc67ee51eeb..795ff58e20607a1f663740afc31eaa86e717d315 100644 (file)
 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) {}
 }
index a25eb60d2a2fc0f934a888023493909b48ddcf80..1229851928e47a092b9599faf84403e7cc5863f2 100644 (file)
@@ -503,7 +503,7 @@ fn next(&mut self) -> Option<Self::Item> {
 
 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] {
@@ -518,7 +518,7 @@ fn lists<'a>(&'a self, name: &'a str) -> ListAttributesIter<'a> {
 
 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 {
index 6417270b9c73bc8a1ce8c0a137a8f950ff4bfaba..5879be08881fb9bb923960f665cec2b1c9210b1f 100644 (file)
@@ -89,7 +89,7 @@ pub fn enter_alias<F, R>(&self,
 }
 
 pub trait DocAccessLevels {
-    fn is_doc_reachable(&self, DefId) -> bool;
+    fn is_doc_reachable(&self, did: DefId) -> bool;
 }
 
 impl DocAccessLevels for AccessLevels<DefId> {
index 15dada10c0dc11d7758761762c7ad1924cbeb924..c1f1cb43e41db362ce3cb5ea9be36f56feddfebc 100644 (file)
@@ -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<()>;
@@ -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,
+                          tas: Option<&TokenAndSpan>)
+                          -> io::Result<()>;
 }
 
 // Implement `Writer` for anthing that can be written to, this just implements
index e0fb46ff5eb095a01c659ab0a6e124c30f82c577..09f22e8691e4ca481d89e82d03683f44b67cba22 100644 (file)
@@ -52,7 +52,7 @@ fn qpath_all(&self, self_type: P<ast::Ty>,
     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,