Commit dc8eb782 authored by Yuki Izumi's avatar Yuki Izumi

Fix for latest nightly.

parent 7cef24d6
use syntax::ptr::P;
use syntax::util::ThinVec;
use syntax::util::small_vector::SmallVector;
use syntax::{codemap, ast, ptr};
use syntax::{codemap, ast};
use syntax::ast::Ident;
use syntax::parse::{self, parser, classify, PResult};
use syntax::parse::token;
......@@ -37,7 +37,8 @@ pub fn dfa_fn<T>(cx: &base::ExtCtxt, dfa: &Dfa<char, T>, state_enum: Ident, stat
} else {
cx.pat(DUMMY_SP, ast::PatKind::Range(
cx.expr_lit(DUMMY_SP, ast::LitKind::Char(ch)),
cx.expr_lit(DUMMY_SP, ast::LitKind::Char(end))
cx.expr_lit(DUMMY_SP, ast::LitKind::Char(end)),
ast::RangeEnd::Included
))
};
subarms.push(ast::Arm {
......@@ -228,7 +229,7 @@ fn parse_lexer<'a>(cx: &mut base::ExtCtxt<'a>, sp: codemap::Span, args: &[TokenT
lifetime: text_lt,
bounds: Vec::new(),
}],
ty_params: ptr::P::new(),
ty_params: vec![],
where_clause: ast::WhereClause {
id: DUMMY_NODE_ID,
predicates: Vec::new(),
......
#![feature(plugin_registrar, quote, rustc_private)]
#![feature(plugin_registrar, quote, rustc_private, i128_type)]
extern crate lalr;
extern crate redfa;
......
......@@ -4,7 +4,7 @@ use std::fmt::Write;
use syntax::ptr::P;
use syntax::util::small_vector::SmallVector;
use syntax::util::ThinVec;
use syntax::{ast, ptr, codemap};
use syntax::{ast, codemap};
use syntax::ast::Ident;
use syntax::parse::{parser, classify, PResult};
use syntax::parse::token;
......@@ -17,10 +17,10 @@ use syntax::ast::DUMMY_NODE_ID;
use syntax::tokenstream::TokenTree;
fn lit_u32(cx: &base::ExtCtxt, val: u32) -> P<ast::Expr> {
cx.expr_lit(DUMMY_SP, ast::LitKind::Int(val as u64, ast::LitIntType::Unsigned(ast::UintTy::U32)))
cx.expr_lit(DUMMY_SP, ast::LitKind::Int(val as u128, ast::LitIntType::Unsigned(ast::UintTy::U32)))
}
fn lit_usize(cx: &base::ExtCtxt, val: usize) -> P<ast::Expr> {
cx.expr_lit(DUMMY_SP, ast::LitKind::Int(val as u64, ast::LitIntType::Unsigned(ast::UintTy::Us)))
cx.expr_lit(DUMMY_SP, ast::LitKind::Int(val as u128, ast::LitIntType::Unsigned(ast::UintTy::Us)))
}
fn pat_u32(cx: &base::ExtCtxt, val: u32) -> P<ast::Pat> {
cx.pat_lit(DUMMY_SP, lit_u32(cx, val))
......@@ -153,8 +153,8 @@ where T: Ord + fmt::Debug + fmt::Display,
]));
let generics = ast::Generics {
lifetimes: vec![],
ty_params: ptr::P::from_vec(vec![
cx.typaram(DUMMY_SP, it_ty_id, vec![], ptr::P::from_vec(vec![
ty_params: vec![
cx.typaram(DUMMY_SP, it_ty_id, vec![], vec![
cx.typarambound(cx.path_all(DUMMY_SP, true, vec![
cx.ident_of("std"),
cx.ident_of("iter"),
......@@ -167,8 +167,8 @@ where T: Ord + fmt::Debug + fmt::Display,
span: DUMMY_SP,
}
]))
]), None)
]),
], None)
],
where_clause: ast::WhereClause {
id: DUMMY_NODE_ID,
predicates: vec![]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment