mirror of https://github.com/rwf2/Rocket.git
Update codegen and core for 2018-04-28 nightly.
This commit is contained in:
parent
3aefe4f894
commit
bd4e54609e
|
@ -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 = "2018-04-14";
|
const MIN_DATE: &'static str = "2018-04-28";
|
||||||
const MIN_VERSION: &'static str = "1.27.0-nightly";
|
const MIN_VERSION: &'static str = "1.27.0-nightly";
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -89,7 +89,7 @@ pub fn from_form_derive(
|
||||||
generics: ty::LifetimeBounds::empty(),
|
generics: ty::LifetimeBounds::empty(),
|
||||||
explicit_self: None,
|
explicit_self: None,
|
||||||
args: vec![
|
args: vec![
|
||||||
ty::Ptr(
|
(ty::Ptr(
|
||||||
Box::new(ty::Literal(ty::Path::new_(
|
Box::new(ty::Literal(ty::Path::new_(
|
||||||
vec!["rocket", "request", "FormItems"],
|
vec!["rocket", "request", "FormItems"],
|
||||||
lifetime_var,
|
lifetime_var,
|
||||||
|
@ -97,8 +97,8 @@ pub fn from_form_derive(
|
||||||
ty::PathKind::Global,
|
ty::PathKind::Global,
|
||||||
))),
|
))),
|
||||||
ty::Borrowed(None, Mutability::Mutable)
|
ty::Borrowed(None, Mutability::Mutable)
|
||||||
),
|
), "it"),
|
||||||
ty::Literal(ty::Path::new_local("bool")),
|
(ty::Literal(ty::Path::new_local("bool")), "strict"),
|
||||||
],
|
],
|
||||||
ret_ty: ty::Literal(ty::Path::new_(
|
ret_ty: ty::Literal(ty::Path::new_(
|
||||||
vec!["result", "Result"],
|
vec!["result", "Result"],
|
||||||
|
|
|
@ -12,7 +12,7 @@ use syntax::ast::{Arg, Ident, Item, Stmt, Expr, MetaItem, Path};
|
||||||
use syntax::ext::base::{Annotatable, ExtCtxt};
|
use syntax::ext::base::{Annotatable, ExtCtxt};
|
||||||
use syntax::ext::build::AstBuilder;
|
use syntax::ext::build::AstBuilder;
|
||||||
use syntax::parse::token;
|
use syntax::parse::token;
|
||||||
use syntax::symbol::InternedString;
|
use syntax::symbol::LocalInternedString;
|
||||||
use syntax::ptr::P;
|
use syntax::ptr::P;
|
||||||
|
|
||||||
use rocket::http::{Method, MediaType};
|
use rocket::http::{Method, MediaType};
|
||||||
|
@ -260,7 +260,7 @@ impl RouteParams {
|
||||||
).expect("consistent uri macro item")
|
).expect("consistent uri macro item")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn explode(&self, ecx: &ExtCtxt) -> (InternedString, &str, Path, P<Expr>, P<Expr>) {
|
fn explode(&self, ecx: &ExtCtxt) -> (LocalInternedString, &str, Path, P<Expr>, P<Expr>) {
|
||||||
let name = self.annotated_fn.ident().name.as_str();
|
let name = self.annotated_fn.ident().name.as_str();
|
||||||
let path = &self.uri.node.as_str();
|
let path = &self.uri.node.as_str();
|
||||||
let method = method_to_path(ecx, self.method.node);
|
let method = method_to_path(ecx, self.method.node);
|
||||||
|
|
|
@ -2,7 +2,7 @@ use utils::{self, ParserExt, SpanExt};
|
||||||
|
|
||||||
use syntax::codemap::{Spanned, Span};
|
use syntax::codemap::{Spanned, Span};
|
||||||
use syntax::ext::base::ExtCtxt;
|
use syntax::ext::base::ExtCtxt;
|
||||||
use syntax::symbol::InternedString;
|
use syntax::symbol::LocalInternedString;
|
||||||
use syntax::ast::{self, Expr, Name, Ident, Path};
|
use syntax::ast::{self, Expr, Name, Ident, Path};
|
||||||
use syntax::parse::PResult;
|
use syntax::parse::PResult;
|
||||||
use syntax::parse::token::{DelimToken, Token};
|
use syntax::parse::token::{DelimToken, Token};
|
||||||
|
@ -27,7 +27,7 @@ pub enum Args {
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct UriParams {
|
pub struct UriParams {
|
||||||
pub mount_point: Option<Spanned<InternedString>>,
|
pub mount_point: Option<Spanned<LocalInternedString>>,
|
||||||
pub route_path: Path,
|
pub route_path: Path,
|
||||||
pub arguments: Option<Spanned<Args>>,
|
pub arguments: Option<Spanned<Args>>,
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ impl UriParams {
|
||||||
pub fn parse_prelude<'a>(
|
pub fn parse_prelude<'a>(
|
||||||
ecx: &'a ExtCtxt,
|
ecx: &'a ExtCtxt,
|
||||||
parser: &mut Parser<'a>
|
parser: &mut Parser<'a>
|
||||||
) -> PResult<'a, (Option<Spanned<InternedString>>, Path)> {
|
) -> PResult<'a, (Option<Spanned<LocalInternedString>>, Path)> {
|
||||||
if parser.token == Token::Eof {
|
if parser.token == Token::Eof {
|
||||||
return Err(ecx.struct_span_err(ecx.call_site(),
|
return Err(ecx.struct_span_err(ecx.call_site(),
|
||||||
"call to `uri!` cannot be empty"));
|
"call to `uri!` cannot be empty"));
|
||||||
|
|
|
@ -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.
|
// Specifies the minimum nightly version needed to compile Rocket.
|
||||||
const MIN_DATE: &'static str = "2018-04-03";
|
const MIN_DATE: &'static str = "2018-04-28";
|
||||||
const MIN_VERSION: &'static str = "1.27.0-nightly";
|
const MIN_VERSION: &'static str = "1.27.0-nightly";
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#![feature(plugin, decl_macro)]
|
#![feature(plugin, decl_macro)]
|
||||||
#![feature(try_trait)]
|
#![feature(try_trait)]
|
||||||
#![feature(fnbox)]
|
#![feature(fnbox)]
|
||||||
|
#![feature(never_type)]
|
||||||
#![recursion_limit="256"]
|
#![recursion_limit="256"]
|
||||||
|
|
||||||
#![plugin(pear_codegen)]
|
#![plugin(pear_codegen)]
|
||||||
|
|
Loading…
Reference in New Issue