about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJorge Aparicio <japaricious@gmail.com>2014-12-09 12:21:18 -0500
committerJorge Aparicio <japaricious@gmail.com>2014-12-13 20:04:41 -0500
commit821b836634d7f86a867c0e642abbd15c3064b36d (patch)
tree339208c1d356efd9ade1b1a9449e88ff88751336 /src
parentc434954b272318d8fdceca01de7d005c8cce2118 (diff)
librustc: use tuple indexing
Diffstat (limited to 'src')
-rw-r--r--src/librustc/lint/context.rs15
-rw-r--r--src/librustc/metadata/loader.rs6
-rw-r--r--src/librustc/middle/check_match.rs2
-rw-r--r--src/librustc_borrowck/graphviz.rs4
4 files changed, 13 insertions, 14 deletions
diff --git a/src/librustc/lint/context.rs b/src/librustc/lint/context.rs
index 9f9e266c6c7..75f2fc81900 100644
--- a/src/librustc/lint/context.rs
+++ b/src/librustc/lint/context.rs
@@ -34,7 +34,6 @@ use lint::builtin;
 use util::nodemap::FnvHashMap;
 
 use std::cell::RefCell;
-use std::tuple::Tuple2;
 use std::mem;
 use syntax::ast_util::IdVisitingOperation;
 use syntax::attr::AttrMetaMethods;
@@ -87,7 +86,7 @@ impl LintStore {
     }
 
     fn set_level(&mut self, lint: LintId, lvlsrc: LevelSource) {
-        if lvlsrc.val0() == Allow {
+        if lvlsrc.0 == Allow {
             self.levels.remove(&lint);
         } else {
             self.levels.insert(lint, lvlsrc);
@@ -110,8 +109,8 @@ impl LintStore {
 
     pub fn get_lint_groups<'t>(&'t self) -> Vec<(&'static str, Vec<LintId>, bool)> {
         self.lint_groups.iter().map(|(k, v)| (*k,
-                                              v.ref0().clone(),
-                                              *v.ref1())).collect()
+                                              v.0.clone(),
+                                              v.1)).collect()
     }
 
     pub fn register_pass(&mut self, sess: Option<&Session>,
@@ -275,7 +274,7 @@ impl LintStore {
             match self.find_lint(lint_name.as_slice(), sess, None) {
                 Some(lint_id) => self.set_level(lint_id, (level, CommandLine)),
                 None => {
-                    match self.lint_groups.iter().map(|(&x, pair)| (x, pair.ref0().clone()))
+                    match self.lint_groups.iter().map(|(&x, pair)| (x, pair.0.clone()))
                                                  .collect::<FnvHashMap<&'static str,
                                                                        Vec<LintId>>>()
                                                  .get(lint_name.as_slice()) {
@@ -443,7 +442,7 @@ impl<'a, 'tcx> Context<'a, 'tcx> {
             None => return,
             Some(&(Warn, src)) => {
                 let lint_id = LintId::of(builtin::WARNINGS);
-                (self.lints.get_level_source(lint_id).val0(), src)
+                (self.lints.get_level_source(lint_id).0, src)
             }
             Some(&pair) => pair,
         };
@@ -503,7 +502,7 @@ impl<'a, 'tcx> Context<'a, 'tcx> {
             };
 
             for (lint_id, level, span) in v.into_iter() {
-                let now = self.lints.get_level_source(lint_id).val0();
+                let now = self.lints.get_level_source(lint_id).0;
                 if now == Forbid && level != Forbid {
                     let lint_name = lint_id.as_str();
                     self.tcx.sess.span_err(span,
@@ -511,7 +510,7 @@ impl<'a, 'tcx> Context<'a, 'tcx> {
                                                    level.as_str(), lint_name,
                                                    lint_name).as_slice());
                 } else if now != level {
-                    let src = self.lints.get_level_source(lint_id).val1();
+                    let src = self.lints.get_level_source(lint_id).1;
                     self.level_stack.push((lint_id, (now, src)));
                     pushed += 1;
                     self.lints.set_level(lint_id, (level, Node(span)));
diff --git a/src/librustc/metadata/loader.rs b/src/librustc/metadata/loader.rs
index e364bd8e752..e83f69b1e31 100644
--- a/src/librustc/metadata/loader.rs
+++ b/src/librustc/metadata/loader.rs
@@ -364,7 +364,7 @@ impl<'a> Context<'a> {
         let dypair = self.dylibname();
 
         // want: crate_name.dir_part() + prefix + crate_name.file_part + "-"
-        let dylib_prefix = format!("{}{}", dypair.ref0(), self.crate_name);
+        let dylib_prefix = format!("{}{}", dypair.0, self.crate_name);
         let rlib_prefix = format!("lib{}", self.crate_name);
 
         let mut candidates = HashMap::new();
@@ -392,8 +392,8 @@ impl<'a> Context<'a> {
                 (file.slice(rlib_prefix.len(), file.len() - ".rlib".len()),
                  true)
             } else if file.starts_with(dylib_prefix.as_slice()) &&
-                      file.ends_with(dypair.ref1().as_slice()) {
-                (file.slice(dylib_prefix.len(), file.len() - dypair.ref1().len()),
+                      file.ends_with(dypair.1.as_slice()) {
+                (file.slice(dylib_prefix.len(), file.len() - dypair.1.len()),
                  false)
             } else {
                 return FileDoesntMatch
diff --git a/src/librustc/middle/check_match.rs b/src/librustc/middle/check_match.rs
index ea3ef2af739..669f4ee6ec8 100644
--- a/src/librustc/middle/check_match.rs
+++ b/src/librustc/middle/check_match.rs
@@ -220,7 +220,7 @@ fn check_expr(cx: &mut MatchCheckCtxt, ex: &ast::Expr) {
             let matrix: Matrix = inlined_arms
                 .iter()
                 .filter(|&&(_, guard)| guard.is_none())
-                .flat_map(|arm| arm.ref0().iter())
+                .flat_map(|arm| arm.0.iter())
                 .map(|pat| vec![&**pat])
                 .collect();
             check_exhaustive(cx, ex.span, &matrix);
diff --git a/src/librustc_borrowck/graphviz.rs b/src/librustc_borrowck/graphviz.rs
index e09ec791669..9d41efd678c 100644
--- a/src/librustc_borrowck/graphviz.rs
+++ b/src/librustc_borrowck/graphviz.rs
@@ -53,7 +53,7 @@ pub struct DataflowLabeller<'a, 'tcx: 'a> {
 
 impl<'a, 'tcx> DataflowLabeller<'a, 'tcx> {
     fn dataflow_for(&self, e: EntryOrExit, n: &Node<'a>) -> String {
-        let id = n.val1().data.id;
+        let id = n.1.data.id;
         debug!("dataflow_for({}, id={}) {}", e, id, self.variants);
         let mut sets = "".to_string();
         let mut seen_one = false;
@@ -67,7 +67,7 @@ impl<'a, 'tcx> DataflowLabeller<'a, 'tcx> {
     }
 
     fn dataflow_for_variant(&self, e: EntryOrExit, n: &Node, v: Variant) -> String {
-        let cfgidx = n.val0();
+        let cfgidx = n.0;
         match v {
             Loans   => self.dataflow_loans_for(e, cfgidx),
             Moves   => self.dataflow_moves_for(e, cfgidx),