@@ -231,7 +231,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
231
231
232
232
// We now fake capture information for all variables that are mentioned within the closure
233
233
// We do this after handling migrations so that min_captures computes before
234
- if !enable_precise_capture ( self . tcx , span) {
234
+ if !enable_precise_capture ( span) {
235
235
let mut capture_information: InferredCaptureInformation < ' tcx > = Default :: default ( ) ;
236
236
237
237
if let Some ( upvars) = self . tcx . upvars_mentioned ( closure_def_id) {
@@ -265,7 +265,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
265
265
266
266
// If we have an origin, store it.
267
267
if let Some ( origin) = origin {
268
- let origin = if enable_precise_capture ( self . tcx , span) {
268
+ let origin = if enable_precise_capture ( span) {
269
269
( origin. 0 , origin. 1 )
270
270
} else {
271
271
( origin. 0 , Place { projections : vec ! [ ] , ..origin. 1 } )
@@ -1243,8 +1243,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1243
1243
///
1244
1244
/// This will make more sense with an example:
1245
1245
///
1246
- /// ```rust
1247
- /// #![feature(capture_disjoint_fields)]
1246
+ /// ```rust,edition2021
1248
1247
///
1249
1248
/// struct FancyInteger(i32); // This implements Drop
1250
1249
///
@@ -2250,12 +2249,10 @@ fn truncate_capture_for_optimization(
2250
2249
( place, curr_mode)
2251
2250
}
2252
2251
2253
- /// Precise capture is enabled if the feature gate `capture_disjoint_fields` is enabled or if
2254
- /// user is using Rust Edition 2021 or higher.
2255
- ///
2252
+ /// Precise capture is enabled if user is using Rust Edition 2021 or higher.
2256
2253
/// `span` is the span of the closure.
2257
- fn enable_precise_capture ( tcx : TyCtxt < ' _ > , span : Span ) -> bool {
2254
+ fn enable_precise_capture ( span : Span ) -> bool {
2258
2255
// We use span here to ensure that if the closure was generated by a macro with a different
2259
2256
// edition.
2260
- tcx . features ( ) . capture_disjoint_fields || span. rust_2021 ( )
2257
+ span. rust_2021 ( )
2261
2258
}
0 commit comments