]> git.lizzy.rs Git - rust.git/commitdiff
Work around inability to link lifetime of ref bindings (#16994)
authorPiotr Czarnecki <pioczarn@gmail.com>
Fri, 5 Sep 2014 00:24:04 +0000 (01:24 +0100)
committerPiotr Czarnecki <pioczarn@gmail.com>
Fri, 5 Sep 2014 00:24:04 +0000 (01:24 +0100)
src/librustc/lint/context.rs
src/librustdoc/html/render.rs

index b40916dcc30aaefe3c14dba1d593d15983daebe4..18e44cbac373f3ea0ac9683393073f15f781d376 100644 (file)
@@ -103,7 +103,9 @@ pub fn get_lints<'t>(&'t self) -> &'t [(&'static Lint, bool)] {
     }
 
     pub fn get_lint_groups<'t>(&'t self) -> Vec<(&'static str, Vec<LintId>, bool)> {
-        self.lint_groups.iter().map(|(k, &(ref v, b))| (*k, v.clone(), b)).collect()
+        self.lint_groups.iter().map(|(k, v)| (*k,
+                                              v.ref0().clone(),
+                                              *v.ref1())).collect()
     }
 
     pub fn register_pass(&mut self, sess: Option<&Session>,
@@ -210,7 +212,7 @@ pub fn process_command_line(&mut self, sess: &Session) {
             match self.by_name.find_equiv(&lint_name.as_slice()) {
                 Some(&lint_id) => self.set_level(lint_id, (level, CommandLine)),
                 None => {
-                    match self.lint_groups.iter().map(|(&x, &(ref y, _))| (x, y.clone()))
+                    match self.lint_groups.iter().map(|(&x, pair)| (x, pair.ref0().clone()))
                                                  .collect::<HashMap<&'static str, Vec<LintId>>>()
                                                  .find_equiv(&lint_name.as_slice()) {
                         Some(v) => {
index fc8fd0d086bc048dce7e09bad398df158f52286a..f68971ee8d203f214182b27de8b2468852fc059e 100644 (file)
@@ -312,7 +312,7 @@ pub fn run(mut krate: clean::Crate, external_html: &ExternalHtml, dst: Path) ->
     }).unwrap_or(HashMap::new());
     let mut cache = Cache {
         impls: HashMap::new(),
-        external_paths: paths.iter().map(|(&k, &(ref v, _))| (k, v.clone()))
+        external_paths: paths.iter().map(|(&k, v)| (k, v.ref0().clone()))
                              .collect(),
         paths: paths,
         implementors: HashMap::new(),