3
3
//! [rustc guide]: https://rust-lang.github.io/rustc-guide/hir.html
4
4
5
5
pub use self :: BlockCheckMode :: * ;
6
- pub use self :: CaptureClause :: * ;
7
6
pub use self :: FunctionRetTy :: * ;
8
7
pub use self :: PrimTy :: * ;
9
8
pub use self :: UnOp :: * ;
@@ -22,7 +21,7 @@ use syntax_pos::{Span, DUMMY_SP, MultiSpan};
22
21
use syntax:: source_map:: Spanned ;
23
22
use syntax:: ast:: { self , CrateSugar , Ident , Name , NodeId , AsmDialect } ;
24
23
use 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 } ;
26
25
use syntax:: attr:: { InlineAttr , OptimizeAttr } ;
27
26
use syntax:: symbol:: { Symbol , kw} ;
28
27
use syntax:: tokenstream:: TokenStream ;
@@ -1629,7 +1628,7 @@ pub enum ExprKind {
1629
1628
///
1630
1629
/// This may also be a generator literal or an `async block` as indicated by the
1631
1630
/// `Option<Movability>`.
1632
- Closure ( CaptureClause , P < FnDecl > , BodyId , Span , Option < Movability > ) ,
1631
+ Closure ( CaptureBy , P < FnDecl > , BodyId , Span , Option < Movability > ) ,
1633
1632
/// A block (e.g., `'label: { ... }`).
1634
1633
Block ( P < Block > , Option < Label > ) ,
1635
1634
@@ -1820,12 +1819,6 @@ impl fmt::Display for YieldSource {
1820
1819
}
1821
1820
}
1822
1821
1823
- #[ derive( Copy , Clone , RustcEncodable , RustcDecodable , Debug , HashStable ) ]
1824
- pub enum CaptureClause {
1825
- CaptureByValue ,
1826
- CaptureByRef ,
1827
- }
1828
-
1829
1822
// N.B., if you change this, you'll probably want to change the corresponding
1830
1823
// type structure in middle/ty.rs as well.
1831
1824
#[ derive( RustcEncodable , RustcDecodable , Debug , HashStable ) ]
@@ -2620,7 +2613,7 @@ pub struct Upvar {
2620
2613
pub span : Span
2621
2614
}
2622
2615
2623
- pub type CaptureModeMap = NodeMap < CaptureClause > ;
2616
+ pub type CaptureModeMap = NodeMap < CaptureBy > ;
2624
2617
2625
2618
// The TraitCandidate's import_ids is empty if the trait is defined in the same module, and
2626
2619
// has length > 0 if the trait is found through an chain of imports, starting with the
0 commit comments