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
#[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)]
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.
// 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
/// 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;
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 {
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;
}
///
/// (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;
}
// 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.
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) {}
}
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] {
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 {
}
pub trait DocAccessLevels {
- fn is_doc_reachable(&self, DefId) -> bool;
+ fn is_doc_reachable(&self, did: DefId) -> bool;
}
impl DocAccessLevels for AccessLevels<DefId> {
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<()>;
/// ```
/// 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
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,