33//! [rustc guide]: https://rust-lang.github.io/rustc-guide/hir.html
44
55pub use self :: BlockCheckMode :: * ;
6- pub use self :: CaptureClause :: * ;
76pub use self :: FunctionRetTy :: * ;
87pub use self :: PrimTy :: * ;
98pub use self :: UnOp :: * ;
@@ -22,7 +21,7 @@ use syntax_pos::{Span, DUMMY_SP, MultiSpan};
2221use syntax:: source_map:: Spanned ;
2322use syntax:: ast:: { self , CrateSugar , Ident , Name , NodeId , AsmDialect } ;
2423use syntax:: ast:: { Attribute , Label , LitKind , StrStyle , FloatTy , IntTy , UintTy } ;
25- pub use syntax:: ast:: { Mutability , Constness , Unsafety , Movability } ;
24+ pub use syntax:: ast:: { Mutability , Constness , Unsafety , Movability , CaptureBy } ;
2625use syntax:: attr:: { InlineAttr , OptimizeAttr } ;
2726use syntax:: symbol:: { Symbol , kw} ;
2827use syntax:: tokenstream:: TokenStream ;
@@ -1629,7 +1628,7 @@ pub enum ExprKind {
16291628 ///
16301629 /// This may also be a generator literal or an `async block` as indicated by the
16311630 /// `Option<Movability>`.
1632- Closure ( CaptureClause , P < FnDecl > , BodyId , Span , Option < Movability > ) ,
1631+ Closure ( CaptureBy , P < FnDecl > , BodyId , Span , Option < Movability > ) ,
16331632 /// A block (e.g., `'label: { ... }`).
16341633 Block ( P < Block > , Option < Label > ) ,
16351634
@@ -1820,12 +1819,6 @@ impl fmt::Display for YieldSource {
18201819 }
18211820}
18221821
1823- #[ derive( Copy , Clone , RustcEncodable , RustcDecodable , Debug , HashStable ) ]
1824- pub enum CaptureClause {
1825- CaptureByValue ,
1826- CaptureByRef ,
1827- }
1828-
18291822// N.B., if you change this, you'll probably want to change the corresponding
18301823// type structure in middle/ty.rs as well.
18311824#[ derive( RustcEncodable , RustcDecodable , Debug , HashStable ) ]
@@ -2620,7 +2613,7 @@ pub struct Upvar {
26202613 pub span : Span
26212614}
26222615
2623- pub type CaptureModeMap = NodeMap < CaptureClause > ;
2616+ pub type CaptureModeMap = NodeMap < CaptureBy > ;
26242617
26252618 // The TraitCandidate's import_ids is empty if the trait is defined in the same module, and
26262619 // has length > 0 if the trait is found through an chain of imports, starting with the
0 commit comments