diff options
| author | Oliver 'ker' Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2016-02-09 17:44:47 +0100 |
|---|---|---|
| committer | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2016-02-11 12:34:48 +0100 |
| commit | 73fa9b2da2ee82c91a5c8d605b91f22f19e4d74b (patch) | |
| tree | c860b482cbc076ac8a87745b5b8f23b88c49d25d /src/libsyntax_ext | |
| parent | 14e09ad4686bb20a98acfd7d930386f6330d2b4d (diff) | |
| download | rust-73fa9b2da2ee82c91a5c8d605b91f22f19e4d74b.tar.gz rust-73fa9b2da2ee82c91a5c8d605b91f22f19e4d74b.zip | |
[breaking-change] don't glob export ast::Mutablity variants
Diffstat (limited to 'src/libsyntax_ext')
| -rw-r--r-- | src/libsyntax_ext/deriving/debug.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax_ext/deriving/decodable.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax_ext/deriving/encodable.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax_ext/deriving/generic/mod.rs | 17 | ||||
| -rw-r--r-- | src/libsyntax_ext/deriving/generic/ty.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax_ext/deriving/hash.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax_ext/env.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax_ext/format.rs | 6 |
8 files changed, 22 insertions, 19 deletions
diff --git a/src/libsyntax_ext/deriving/debug.rs b/src/libsyntax_ext/deriving/debug.rs index 917c6b1ab89..6e769cd3810 100644 --- a/src/libsyntax_ext/deriving/debug.rs +++ b/src/libsyntax_ext/deriving/debug.rs @@ -27,7 +27,7 @@ pub fn expand_deriving_debug(cx: &mut ExtCtxt, { // &mut ::std::fmt::Formatter let fmtr = Ptr(Box::new(Literal(path_std!(cx, core::fmt::Formatter))), - Borrowed(None, ast::MutMutable)); + Borrowed(None, ast::Mutability::Mutable)); let trait_def = TraitDef { span: span, diff --git a/src/libsyntax_ext/deriving/decodable.rs b/src/libsyntax_ext/deriving/decodable.rs index 4ea4f04623a..092f8548966 100644 --- a/src/libsyntax_ext/deriving/decodable.rs +++ b/src/libsyntax_ext/deriving/decodable.rs @@ -14,7 +14,7 @@ use deriving::generic::*; use deriving::generic::ty::*; use syntax::ast; -use syntax::ast::{MetaItem, Expr, MutMutable}; +use syntax::ast::{MetaItem, Expr, Mutability}; use syntax::codemap::Span; use syntax::ext::base::{ExtCtxt, Annotatable}; use syntax::ext::build::AstBuilder; @@ -72,7 +72,7 @@ fn expand_deriving_decodable_imp(cx: &mut ExtCtxt, }, explicit_self: None, args: vec!(Ptr(Box::new(Literal(Path::new_local("__D"))), - Borrowed(None, MutMutable))), + Borrowed(None, Mutability::Mutable))), ret_ty: Literal(Path::new_( pathvec_std!(cx, core::result::Result), None, diff --git a/src/libsyntax_ext/deriving/encodable.rs b/src/libsyntax_ext/deriving/encodable.rs index 14631659b0b..614a6381962 100644 --- a/src/libsyntax_ext/deriving/encodable.rs +++ b/src/libsyntax_ext/deriving/encodable.rs @@ -91,7 +91,7 @@ use deriving::generic::*; use deriving::generic::ty::*; -use syntax::ast::{MetaItem, Expr, ExprKind, MutMutable}; +use syntax::ast::{MetaItem, Expr, ExprKind, Mutability}; use syntax::codemap::Span; use syntax::ext::base::{ExtCtxt,Annotatable}; use syntax::ext::build::AstBuilder; @@ -148,7 +148,7 @@ fn expand_deriving_encodable_imp(cx: &mut ExtCtxt, }, explicit_self: borrowed_explicit_self(), args: vec!(Ptr(Box::new(Literal(Path::new_local("__S"))), - Borrowed(None, MutMutable))), + Borrowed(None, Mutability::Mutable))), ret_ty: Literal(Path::new_( pathvec_std!(cx, core::result::Result), None, diff --git a/src/libsyntax_ext/deriving/generic/mod.rs b/src/libsyntax_ext/deriving/generic/mod.rs index 51091b84672..b316b1e7d86 100644 --- a/src/libsyntax_ext/deriving/generic/mod.rs +++ b/src/libsyntax_ext/deriving/generic/mod.rs @@ -864,7 +864,9 @@ impl<'a> MethodDef<'a> { let self_arg = match explicit_self.node { ast::SelfKind::Static => None, // creating fresh self id - _ => Some(ast::Arg::new_self(trait_.span, ast::MutImmutable, special_idents::self_)) + _ => Some(ast::Arg::new_self(trait_.span, + ast::Mutability::Immutable, + special_idents::self_)) }; let args = { let args = arg_types.into_iter().map(|(name, ty)| { @@ -942,7 +944,7 @@ impl<'a> MethodDef<'a> { struct_def, &format!("__self_{}", i), - ast::MutImmutable); + ast::Mutability::Immutable); patterns.push(pat); raw_fields.push(ident_expr); } @@ -1135,11 +1137,12 @@ impl<'a> MethodDef<'a> { let mut match_arms: Vec<ast::Arm> = variants.iter().enumerate() .map(|(index, variant)| { let mk_self_pat = |cx: &mut ExtCtxt, self_arg_name: &str| { - let (p, idents) = trait_.create_enum_variant_pattern(cx, type_ident, - &**variant, - self_arg_name, - ast::MutImmutable); - (cx.pat(sp, ast::PatRegion(p, ast::MutImmutable)), idents) + let (p, idents) = trait_.create_enum_variant_pattern( + cx, type_ident, + &**variant, + self_arg_name, + ast::Mutability::Immutable); + (cx.pat(sp, ast::PatRegion(p, ast::Mutability::Immutable)), idents) }; // A single arm has form (&VariantK, &VariantK, ...) => BodyK diff --git a/src/libsyntax_ext/deriving/generic/ty.rs b/src/libsyntax_ext/deriving/generic/ty.rs index e5b82fa1afc..a924cc06953 100644 --- a/src/libsyntax_ext/deriving/generic/ty.rs +++ b/src/libsyntax_ext/deriving/generic/ty.rs @@ -98,7 +98,7 @@ pub enum Ty<'a> { } pub fn borrowed_ptrty<'r>() -> PtrTy<'r> { - Borrowed(None, ast::MutImmutable) + Borrowed(None, ast::Mutability::Immutable) } pub fn borrowed<'r>(ty: Box<Ty<'r>>) -> Ty<'r> { Ptr(ty, borrowed_ptrty()) diff --git a/src/libsyntax_ext/deriving/hash.rs b/src/libsyntax_ext/deriving/hash.rs index 6bd21f7c0e0..371ba732b48 100644 --- a/src/libsyntax_ext/deriving/hash.rs +++ b/src/libsyntax_ext/deriving/hash.rs @@ -11,7 +11,7 @@ use deriving::generic::*; use deriving::generic::ty::*; -use syntax::ast::{MetaItem, Expr, MutMutable}; +use syntax::ast::{MetaItem, Expr, Mutability}; use syntax::codemap::Span; use syntax::ext::base::{ExtCtxt, Annotatable}; use syntax::ext::build::AstBuilder; @@ -43,7 +43,7 @@ pub fn expand_deriving_hash(cx: &mut ExtCtxt, vec![path_std!(cx, core::hash::Hasher)])], }, explicit_self: borrowed_explicit_self(), - args: vec!(Ptr(Box::new(Literal(arg)), Borrowed(None, MutMutable))), + args: vec!(Ptr(Box::new(Literal(arg)), Borrowed(None, Mutability::Mutable))), ret_ty: nil_ty(), attributes: vec![], is_unsafe: false, diff --git a/src/libsyntax_ext/env.rs b/src/libsyntax_ext/env.rs index f1dd6854a3a..63ec9cac073 100644 --- a/src/libsyntax_ext/env.rs +++ b/src/libsyntax_ext/env.rs @@ -42,7 +42,7 @@ pub fn expand_option_env<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenT Some(cx.lifetime(sp, cx.ident_of( "'static").name)), - ast::MutImmutable)), + ast::Mutability::Immutable)), Vec::new())) } Ok(s) => { diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs index a5ad143f15b..4e24eb9f6d7 100644 --- a/src/libsyntax_ext/format.rs +++ b/src/libsyntax_ext/format.rs @@ -450,10 +450,10 @@ impl<'a, 'b> Context<'a, 'b> { let ty = ecx.ty_rptr(sp, ecx.ty(sp, ast::TyKind::Vec(piece_ty)), Some(ecx.lifetime(sp, special_idents::static_lifetime.name)), - ast::MutImmutable); + ast::Mutability::Immutable); let slice = ecx.expr_vec_slice(sp, pieces); // static instead of const to speed up codegen by not requiring this to be inlined - let st = ast::ItemKind::Static(ty, ast::MutImmutable, slice); + let st = ast::ItemKind::Static(ty, ast::Mutability::Immutable, slice); let name = ecx.ident_of(name); let item = ecx.item(sp, name, vec![], st); @@ -480,7 +480,7 @@ impl<'a, 'b> Context<'a, 'b> { self.fmtsp, self.ecx.ty_ident(self.fmtsp, self.ecx.ident_of("str")), Some(static_lifetime), - ast::MutImmutable); + ast::Mutability::Immutable); let pieces = Context::static_array(self.ecx, "__STATIC_FMTSTR", piece_ty, |
