diff --git a/core/codegen/build.rs b/core/codegen/build.rs index a2024820..b3403274 100644 --- a/core/codegen/build.rs +++ b/core/codegen/build.rs @@ -8,7 +8,7 @@ use yansi::Color::{Red, Yellow, Blue, White}; use version_check::{supports_features, is_min_version, is_min_date}; // Specifies the minimum nightly version needed to compile Rocket's codegen. -const MIN_DATE: &'static str = "2018-08-17"; +const MIN_DATE: &'static str = "2018-08-23"; const MIN_VERSION: &'static str = "1.30.0-nightly"; fn main() { diff --git a/core/codegen/src/decorators/catch.rs b/core/codegen/src/decorators/catch.rs index 9f8ce0ac..d198b971 100644 --- a/core/codegen/src/decorators/catch.rs +++ b/core/codegen/src/decorators/catch.rs @@ -2,7 +2,7 @@ use ::{CATCH_STRUCT_PREFIX, CATCH_FN_PREFIX, CATCHER_ATTR}; use parser::CatchParams; use utils::*; -use syntax::codemap::{Span}; +use syntax::source_map::{Span}; use syntax::ast::{MetaItem, Ident, TyKind}; use syntax::ext::base::{Annotatable, ExtCtxt}; use syntax::tokenstream::TokenTree; diff --git a/core/codegen/src/decorators/route.rs b/core/codegen/src/decorators/route.rs index 92d6691e..e1b45382 100644 --- a/core/codegen/src/decorators/route.rs +++ b/core/codegen/src/decorators/route.rs @@ -6,7 +6,7 @@ use ::{ROUTE_ATTR, ROUTE_INFO_ATTR}; use parser::{Param, RouteParams}; use utils::*; -use syntax::codemap::{Span, Spanned, dummy_spanned}; +use syntax::source_map::{Span, Spanned, dummy_spanned}; use syntax::tokenstream::TokenTree; use syntax::ast::{Arg, Ident, Item, Stmt, Expr, MetaItem, Path}; use syntax::ext::base::{Annotatable, ExtCtxt}; diff --git a/core/codegen/src/macros/mod.rs b/core/codegen/src/macros/mod.rs index 1e75544d..c5893b89 100644 --- a/core/codegen/src/macros/mod.rs +++ b/core/codegen/src/macros/mod.rs @@ -3,7 +3,7 @@ mod uri; use {ROUTE_STRUCT_PREFIX, CATCH_STRUCT_PREFIX}; use utils::{sep_by_tok, ParserExt, IdentExt}; -use syntax::codemap::Span; +use syntax::source_map::Span; use syntax::tokenstream::TokenTree; use syntax::ast::{Path, Expr}; use syntax::ext::base::{DummyResult, ExtCtxt, MacResult, MacEager}; diff --git a/core/codegen/src/macros/uri.rs b/core/codegen/src/macros/uri.rs index 4df3defd..2cec0e47 100644 --- a/core/codegen/src/macros/uri.rs +++ b/core/codegen/src/macros/uri.rs @@ -1,6 +1,6 @@ use std::fmt::Display; -use syntax::codemap::Span; +use syntax::source_map::Span; use syntax::ext::base::{DummyResult, ExtCtxt, MacEager, MacResult}; use syntax::tokenstream::{TokenStream, TokenTree}; use syntax::ast::{self, Expr, GenericArg, MacDelimiter, Ident}; diff --git a/core/codegen/src/parser/catch.rs b/core/codegen/src/parser/catch.rs index fd503f61..48a83330 100644 --- a/core/codegen/src/parser/catch.rs +++ b/core/codegen/src/parser/catch.rs @@ -1,6 +1,6 @@ use syntax::ast::*; use syntax::ext::base::{ExtCtxt, Annotatable}; -use syntax::codemap::{Span, Spanned, dummy_spanned}; +use syntax::source_map::{Span, Spanned, dummy_spanned}; use rocket_http::Status; diff --git a/core/codegen/src/parser/function.rs b/core/codegen/src/parser/function.rs index c185a596..a9d02225 100644 --- a/core/codegen/src/parser/function.rs +++ b/core/codegen/src/parser/function.rs @@ -1,5 +1,5 @@ use syntax::ast::*; -use syntax::codemap::{Span, Spanned}; +use syntax::source_map::{Span, Spanned}; use syntax::ext::base::Annotatable; use utils::{ArgExt, span}; diff --git a/core/codegen/src/parser/keyvalue.rs b/core/codegen/src/parser/keyvalue.rs index af282712..1f3c65b3 100644 --- a/core/codegen/src/parser/keyvalue.rs +++ b/core/codegen/src/parser/keyvalue.rs @@ -1,4 +1,4 @@ -use syntax::codemap::{Spanned, Span, dummy_spanned, DUMMY_SP}; +use syntax::source_map::{Spanned, Span, dummy_spanned, DUMMY_SP}; use syntax::ext::base::ExtCtxt; use syntax::tokenstream::TokenTree; use syntax::ext::quote::rt::ToTokens; diff --git a/core/codegen/src/parser/param.rs b/core/codegen/src/parser/param.rs index a24af12e..32e99cef 100644 --- a/core/codegen/src/parser/param.rs +++ b/core/codegen/src/parser/param.rs @@ -1,5 +1,5 @@ use syntax::ast::Ident; -use syntax::codemap::{Span, Spanned}; +use syntax::source_map::{Span, Spanned}; use syntax::ext::base::ExtCtxt; use utils::SpanExt; use syntax::parse::PResult; diff --git a/core/codegen/src/parser/route.rs b/core/codegen/src/parser/route.rs index c286d571..5e1f4970 100644 --- a/core/codegen/src/parser/route.rs +++ b/core/codegen/src/parser/route.rs @@ -3,7 +3,7 @@ use std::collections::HashSet; use syntax::ast::*; use syntax::ext::base::{ExtCtxt, Annotatable}; -use syntax::codemap::{Span, Spanned, dummy_spanned}; +use syntax::source_map::{Span, Spanned, dummy_spanned}; use utils::{MetaItemExt, SpanExt, span, is_valid_ident}; use super::Function; diff --git a/core/codegen/src/parser/uri.rs b/core/codegen/src/parser/uri.rs index 5441e005..f8b700ea 100644 --- a/core/codegen/src/parser/uri.rs +++ b/core/codegen/src/parser/uri.rs @@ -1,5 +1,5 @@ use syntax::ast::*; -use syntax::codemap::{Span, Spanned, dummy_spanned}; +use syntax::source_map::{Span, Spanned, dummy_spanned}; use syntax::ext::base::ExtCtxt; use rocket_http::ext::IntoOwned; diff --git a/core/codegen/src/parser/uri_macro.rs b/core/codegen/src/parser/uri_macro.rs index e0ac9caf..e6b70175 100644 --- a/core/codegen/src/parser/uri_macro.rs +++ b/core/codegen/src/parser/uri_macro.rs @@ -1,6 +1,6 @@ use utils::{self, ParserExt, SpanExt}; -use syntax::codemap::{Spanned, Span}; +use syntax::source_map::{Spanned, Span}; use syntax::ext::base::ExtCtxt; use syntax::symbol::LocalInternedString; use syntax::ast::{self, Expr, Name, Ident, Path}; diff --git a/core/codegen/src/utils/mod.rs b/core/codegen/src/utils/mod.rs index f9f71728..4af922e2 100644 --- a/core/codegen/src/utils/mod.rs +++ b/core/codegen/src/utils/mod.rs @@ -21,7 +21,7 @@ use syntax::parse::token::Token; use syntax::tokenstream::TokenTree; use syntax::ast::{Item, Expr, Attribute, Ty}; use syntax::ext::base::{Annotatable, ExtCtxt}; -use syntax::codemap::{Span, Spanned, DUMMY_SP}; +use syntax::source_map::{Span, Spanned, DUMMY_SP}; use syntax::ext::quote::rt::ToTokens; use syntax::print::pprust::item_to_string; use syntax::symbol::{Ident, Symbol}; @@ -148,7 +148,7 @@ pub fn split_idents(path: &str) -> Vec { macro_rules! quote_enum { ($ecx:expr, $var:expr => $(::$from_root:ident)+ -> $(::$to_root:ident)+ { $($variant:ident),+ ; $($extra:pat => $result:expr),* }) => ({ - use syntax::codemap::DUMMY_SP; + use syntax::source_map::DUMMY_SP; use syntax::ast::Ident; use $(::$from_root)+::*; let root_idents = vec![$(Ident::from_str(stringify!($to_root))),+]; diff --git a/core/codegen/src/utils/parser_ext.rs b/core/codegen/src/utils/parser_ext.rs index 9b4a4bf8..024ed24a 100644 --- a/core/codegen/src/utils/parser_ext.rs +++ b/core/codegen/src/utils/parser_ext.rs @@ -1,4 +1,4 @@ -use syntax::codemap; +use syntax::source_map; use syntax::parse::{token, SeqSep, PResult}; use syntax::parse::parser::{PathStyle, Parser}; use syntax::parse::token::Token::{Eof, Comma}; @@ -17,7 +17,7 @@ pub trait ParserExt<'a> { // Duplicates previously removed method in libsyntax. fn parse_seq(&mut self, bra: &token::Token, ket: &token::Token, sep: SeqSep, f: F) - -> PResult<'a, codemap::Spanned>> where F: FnMut(&mut Parser<'a>) -> PResult<'a, T>; + -> PResult<'a, source_map::Spanned>> where F: FnMut(&mut Parser<'a>) -> PResult<'a, T>; } impl<'a> ParserExt<'a> for Parser<'a> { @@ -66,7 +66,7 @@ impl<'a> ParserExt<'a> for Parser<'a> { ket: &token::Token, sep: SeqSep, f: F - ) -> PResult<'a, codemap::Spanned>> + ) -> PResult<'a, source_map::Spanned>> where F: FnMut(&mut Parser<'a>) -> PResult<'a, T> { let lo = self.span; @@ -74,6 +74,6 @@ impl<'a> ParserExt<'a> for Parser<'a> { let result = self.parse_seq_to_before_end(ket, sep, f)?; let hi = self.span; self.bump(); - Ok(codemap::respan(lo.to(hi), result)) + Ok(source_map::respan(lo.to(hi), result)) } } diff --git a/core/codegen/src/utils/span_ext.rs b/core/codegen/src/utils/span_ext.rs index 0dabe44d..e32b6c4f 100644 --- a/core/codegen/src/utils/span_ext.rs +++ b/core/codegen/src/utils/span_ext.rs @@ -1,4 +1,4 @@ -use syntax::codemap::{Span, Spanned, BytePos}; +use syntax::source_map::{Span, Spanned, BytePos}; pub trait SpanExt { /// Trim the span on the left and right by `length`.