]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax_expand/build.rs
Remove unchecked inline attribute, remove unused functions, make chache mod private...
[rust.git] / src / libsyntax_expand / build.rs
index 105ffe3ee8a9f0ce1eccc30597ed27a2125f5b8b..3d082101c41084e1d61cbeee6ac87ef14c94ba0c 100644 (file)
@@ -270,7 +270,7 @@ pub fn expr_deref(&self, sp: Span, e: P<ast::Expr>) -> P<ast::Expr> {
     }
 
     pub fn expr_addr_of(&self, sp: Span, e: P<ast::Expr>) -> P<ast::Expr> {
-        self.expr(sp, ast::ExprKind::AddrOf(ast::Mutability::Immutable, e))
+        self.expr(sp, ast::ExprKind::AddrOf(ast::BorrowKind::Ref, ast::Mutability::Immutable, e))
     }
 
     pub fn expr_call(
@@ -582,12 +582,13 @@ pub fn item(&self, span: Span, name: Ident,
     }
 
     pub fn variant(&self, span: Span, ident: Ident, tys: Vec<P<ast::Ty>> ) -> ast::Variant {
+        let vis_span = span.shrink_to_lo();
         let fields: Vec<_> = tys.into_iter().map(|ty| {
             ast::StructField {
                 span: ty.span,
                 ty,
                 ident: None,
-                vis: respan(span.shrink_to_lo(), ast::VisibilityKind::Inherited),
+                vis: respan(vis_span, ast::VisibilityKind::Inherited),
                 attrs: Vec::new(),
                 id: ast::DUMMY_NODE_ID,
                 is_placeholder: false,
@@ -606,6 +607,7 @@ pub fn variant(&self, span: Span, ident: Ident, tys: Vec<P<ast::Ty>> ) -> ast::V
             disr_expr: None,
             id: ast::DUMMY_NODE_ID,
             ident,
+            vis: respan(vis_span, ast::VisibilityKind::Inherited),
             span,
             is_placeholder: false,
         }