Update codegen for 2017-12-14 nightly.

This commit is contained in:
Sergio Benitez 2017-12-14 23:09:59 -08:00
parent 6e18093c3a
commit d22dbfbded
3 changed files with 7 additions and 4 deletions

View File

@ -8,7 +8,7 @@ use yansi::Color::{Red, Yellow, Blue, White};
use version_check::{supports_features, is_min_version, is_min_date}; use version_check::{supports_features, is_min_version, is_min_date};
// Specifies the minimum nightly version needed to compile Rocket's codegen. // Specifies the minimum nightly version needed to compile Rocket's codegen.
const MIN_DATE: &'static str = "2017-12-13"; const MIN_DATE: &'static str = "2017-12-14";
const MIN_VERSION: &'static str = "1.24.0-nightly"; const MIN_VERSION: &'static str = "1.24.0-nightly";
fn main() { fn main() {

View File

@ -227,6 +227,7 @@
#[macro_use] extern crate log; #[macro_use] extern crate log;
extern crate syntax; extern crate syntax;
extern crate syntax_ext; extern crate syntax_ext;
extern crate syntax_pos;
extern crate rustc_plugin; extern crate rustc_plugin;
extern crate rocket; extern crate rocket;
extern crate ordermap; extern crate ordermap;

View File

@ -72,11 +72,13 @@ pub fn attach_and_emit(out: &mut Vec<Annotatable>, attr: Attribute, to: Annotata
} }
} }
pub fn parse_as_tokens(ecx: &ExtCtxt, string: &str) -> Vec<TokenTree> { pub fn parse_as_tokens(ecx: &ExtCtxt, s: &str) -> Vec<TokenTree> {
use syntax_pos::FileName;
use syntax::parse::parse_stream_from_source_str as parse_stream; use syntax::parse::parse_stream_from_source_str as parse_stream;
let stream = parse_stream("<_>".into(), string.into(), ecx.parse_sess, None); parse_stream(FileName::ProcMacroSourceCode, s.into(), ecx.parse_sess, None)
stream.into_trees().collect() .into_trees()
.collect()
} }
pub struct TyLifetimeRemover; pub struct TyLifetimeRemover;