@@ -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 } )
@@ -1240,8 +1240,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1240
1240
///
1241
1241
/// This will make more sense with an example:
1242
1242
///
1243
- /// ```rust
1244
- /// #![feature(capture_disjoint_fields)]
1243
+ /// ```rust,edition2021
1245
1244
///
1246
1245
/// struct FancyInteger(i32); // This implements Drop
1247
1246
///
@@ -2247,12 +2246,10 @@ fn truncate_capture_for_optimization(
2247
2246
( place, curr_mode)
2248
2247
}
2249
2248
2250
- /// Precise capture is enabled if the feature gate `capture_disjoint_fields` is enabled or if
2251
- /// user is using Rust Edition 2021 or higher.
2252
- ///
2249
+ /// Precise capture is enabled if user is using Rust Edition 2021 or higher.
2253
2250
/// `span` is the span of the closure.
2254
- fn enable_precise_capture ( tcx : TyCtxt < ' _ > , span : Span ) -> bool {
2251
+ fn enable_precise_capture ( span : Span ) -> bool {
2255
2252
// We use span here to ensure that if the closure was generated by a macro with a different
2256
2253
// edition.
2257
- tcx . features ( ) . capture_disjoint_fields || span. rust_2021 ( )
2254
+ span. rust_2021 ( )
2258
2255
}
0 commit comments