Fallout: remove unused type and region parameters.

This commit is contained in:
Niko Matsakis 2015-02-12 12:32:37 -05:00
parent 872ce47955
commit 60f507be45
5 changed files with 17 additions and 19 deletions

View file

@ -29,7 +29,6 @@ use middle::ty::{MethodOrigin, MethodParam, MethodTypeParam};
use middle::ty::{MethodStatic, MethodStaticClosure};
use util::ppaux::Repr;
use std::marker;
use syntax::{ast, ast_util};
use syntax::ptr::P;
use syntax::codemap::Span;
@ -128,16 +127,14 @@ pub enum MatchMode {
MovingMatch,
}
#[derive(PartialEq,Debug)]
enum TrackMatchMode<T> {
#[derive(Copy, PartialEq, Debug)]
enum TrackMatchMode {
Unknown,
Definite(MatchMode),
Conflicting,
}
impl<T> marker::Copy for TrackMatchMode<T> {}
impl<T> TrackMatchMode<T> {
impl TrackMatchMode {
// Builds up the whole match mode for a pattern from its constituent
// parts. The lattice looks like this:
//
@ -931,7 +928,7 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
return true;
}
fn arm_move_mode(&mut self, discr_cmt: mc::cmt<'tcx>, arm: &ast::Arm) -> TrackMatchMode<Span> {
fn arm_move_mode(&mut self, discr_cmt: mc::cmt<'tcx>, arm: &ast::Arm) -> TrackMatchMode {
let mut mode = Unknown;
for pat in &arm.pats {
self.determine_pat_move_mode(discr_cmt.clone(), &**pat, &mut mode);
@ -966,7 +963,7 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
fn determine_pat_move_mode(&mut self,
cmt_discr: mc::cmt<'tcx>,
pat: &ast::Pat,
mode: &mut TrackMatchMode<Span>) {
mode: &mut TrackMatchMode) {
debug!("determine_pat_move_mode cmt_discr={} pat={}", cmt_discr.repr(self.tcx()),
pat.repr(self.tcx()));
return_if_err!(self.mc.cat_pattern(cmt_discr, pat, |_mc, cmt_pat, pat| {

View file

@ -31,7 +31,7 @@ pub trait HigherRankedRelations<'tcx> {
where T : Combineable<'tcx>;
}
trait InferCtxtExt<'tcx> {
trait InferCtxtExt {
fn tainted_regions(&self, snapshot: &CombinedSnapshot, r: ty::Region) -> Vec<ty::Region>;
fn region_vars_confined_to_snapshot(&self,
@ -371,7 +371,7 @@ fn fold_regions_in<'tcx, T, F>(tcx: &ty::ctxt<'tcx>,
}))
}
impl<'a,'tcx> InferCtxtExt<'tcx> for InferCtxt<'a,'tcx> {
impl<'a,'tcx> InferCtxtExt for InferCtxt<'a,'tcx> {
fn tainted_regions(&self, snapshot: &CombinedSnapshot, r: ty::Region) -> Vec<ty::Region> {
self.region_vars.tainted(&snapshot.region_vars_snapshot, r)
}

View file

@ -306,10 +306,10 @@ pub fn all_traits<'a>(ccx: &'a CrateCtxt) -> AllTraits<'a> {
// Crate-local:
//
// meh.
struct Visitor<'a, 'b: 'a, 'tcx: 'a + 'b> {
struct Visitor<'a> {
traits: &'a mut AllTraitsVec,
}
impl<'v,'a, 'b, 'tcx> visit::Visitor<'v> for Visitor<'a, 'b, 'tcx> {
impl<'v, 'a> visit::Visitor<'v> for Visitor<'a> {
fn visit_item(&mut self, i: &'v ast::Item) {
match i.node {
ast::ItemTrait(..) => {

View file

@ -433,7 +433,7 @@ pub enum IoErrorKind {
}
/// A trait that lets you add a `detail` to an IoError easily
trait UpdateIoError<T> {
trait UpdateIoError {
/// Returns an IoError with updated description and detail
fn update_err<D>(self, desc: &'static str, detail: D) -> Self where
D: FnOnce(&IoError) -> String;
@ -446,7 +446,7 @@ trait UpdateIoError<T> {
fn update_desc(self, desc: &'static str) -> Self;
}
impl<T> UpdateIoError<T> for IoResult<T> {
impl<T> UpdateIoError for IoResult<T> {
fn update_err<D>(self, desc: &'static str, detail: D) -> IoResult<T> where
D: FnOnce(&IoError) -> String,
{

View file

@ -45,11 +45,11 @@ fn no_prelude(attrs: &[ast::Attribute]) -> bool {
attr::contains_name(attrs, "no_implicit_prelude")
}
struct StandardLibraryInjector<'a> {
alt_std_name: Option<String>
struct StandardLibraryInjector {
alt_std_name: Option<String>,
}
impl<'a> fold::Folder for StandardLibraryInjector<'a> {
impl fold::Folder for StandardLibraryInjector {
fn fold_crate(&mut self, mut krate: ast::Crate) -> ast::Crate {
// The name to use in `extern crate "name" as std;`
@ -80,9 +80,10 @@ fn inject_crates_ref(krate: ast::Crate, alt_std_name: Option<String>) -> ast::Cr
fold.fold_crate(krate)
}
struct PreludeInjector<'a>;
struct PreludeInjector;
impl<'a> fold::Folder for PreludeInjector<'a> {
impl fold::Folder for PreludeInjector {
fn fold_crate(&mut self, mut krate: ast::Crate) -> ast::Crate {
// only add `use std::prelude::*;` if there wasn't a
// `#![no_implicit_prelude]` at the crate level.