From 17ba6f019017cf7478c95516e56865fe38555e36 Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Wed, 25 Jan 2017 15:00:22 -0800 Subject: [PATCH] Get 0.29.x to compile on latest nightly @nmatsakis has fixed a soundness bug that is causing 0.29.x to fail. There are a few dependencies that are still on serde 0.6 / syntex 0.29.x, so this backports the fix in order to get the crater run to pass. --- syntex_syntax/Cargo.toml | 2 +- syntex_syntax/src/attr.rs | 4 ++-- syntex_syntax/src/errors/mod.rs | 3 --- syntex_syntax/src/ext/quote.rs | 2 +- syntex_syntax/src/parse/mod.rs | 1 - syntex_syntax/src/parse/parser.rs | 1 - syntex_syntax/src/util/interner.rs | 2 -- 7 files changed, 4 insertions(+), 11 deletions(-) diff --git a/syntex_syntax/Cargo.toml b/syntex_syntax/Cargo.toml index 8e99a24e..ad322b1e 100644 --- a/syntex_syntax/Cargo.toml +++ b/syntex_syntax/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "syntex_syntax" -version = "0.29.1" +version = "0.29.3" authors = [ "erick.tryzelaar@gmail.com" ] license = "MIT/Apache-2.0" description = "Export of libsyntax for code generation" diff --git a/syntex_syntax/src/attr.rs b/syntex_syntax/src/attr.rs index cb0e5444..608a2f7e 100644 --- a/syntex_syntax/src/attr.rs +++ b/syntex_syntax/src/attr.rs @@ -818,8 +818,8 @@ pub type ThinAttributes = Option>>; pub trait ThinAttributesExt { fn map_thin_attrs(self, f: F) -> Self where F: FnOnce(Vec) -> Vec; - fn prepend(mut self, attrs: Self) -> Self; - fn append(mut self, attrs: Self) -> Self; + fn prepend(self, attrs: Self) -> Self; + fn append(self, attrs: Self) -> Self; fn update(&mut self, f: F) where Self: Sized, F: FnOnce(Self) -> Self; diff --git a/syntex_syntax/src/errors/mod.rs b/syntex_syntax/src/errors/mod.rs index 9e1cb60f..622d4c08 100644 --- a/syntex_syntax/src/errors/mod.rs +++ b/syntex_syntax/src/errors/mod.rs @@ -19,7 +19,6 @@ use errors::emitter::{Emitter, EmitterWriter}; use std::cell::{RefCell, Cell}; use std::{error, fmt}; -use std::io::prelude::*; use std::rc::Rc; use term; @@ -644,8 +643,6 @@ pub enum Level { impl fmt::Display for Level { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - use std::fmt::Display; - self.to_str().fmt(f) } } diff --git a/syntex_syntax/src/ext/quote.rs b/syntex_syntax/src/ext/quote.rs index 2bb23b37..83076bcf 100644 --- a/syntex_syntax/src/ext/quote.rs +++ b/syntex_syntax/src/ext/quote.rs @@ -414,7 +414,7 @@ pub fn expand_quote_expr<'cx>(cx: &'cx mut ExtCtxt, base::MacEager::expr(expanded) } -pub fn expand_quote_item<'cx>(cx: &mut ExtCtxt, +pub fn expand_quote_item<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[TokenTree]) -> Box { diff --git a/syntex_syntax/src/parse/mod.rs b/syntex_syntax/src/parse/mod.rs index e9723798..24578939 100644 --- a/syntex_syntax/src/parse/mod.rs +++ b/syntex_syntax/src/parse/mod.rs @@ -19,7 +19,6 @@ use ptr::P; use str::char_at; use std::cell::RefCell; -use std::io::Read; use std::iter; use std::path::{Path, PathBuf}; use std::rc::Rc; diff --git a/syntex_syntax/src/parse/parser.rs b/syntex_syntax/src/parse/parser.rs index 0403f5f7..c08a7998 100644 --- a/syntex_syntax/src/parse/parser.rs +++ b/syntex_syntax/src/parse/parser.rs @@ -62,7 +62,6 @@ use ptr::P; use parse::PResult; use std::collections::HashSet; -use std::io::prelude::*; use std::mem; use std::path::{Path, PathBuf}; use std::rc::Rc; diff --git a/syntex_syntax/src/util/interner.rs b/syntex_syntax/src/util/interner.rs index 6e9c1612..8e203580 100644 --- a/syntex_syntax/src/util/interner.rs +++ b/syntex_syntax/src/util/interner.rs @@ -115,14 +115,12 @@ impl Ord for RcStr { impl fmt::Debug for RcStr { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - use std::fmt::Debug; self[..].fmt(f) } } impl fmt::Display for RcStr { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - use std::fmt::Display; self[..].fmt(f) } }