@@ -231,7 +231,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
231231
232232 // We now fake capture information for all variables that are mentioned within the closure
233233 // 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) {
235235 let mut capture_information: InferredCaptureInformation < ' tcx > = Default :: default ( ) ;
236236
237237 if let Some ( upvars) = self . tcx . upvars_mentioned ( closure_def_id) {
@@ -265,7 +265,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
265265
266266 // If we have an origin, store it.
267267 if let Some ( origin) = origin {
268- let origin = if enable_precise_capture ( self . tcx , span) {
268+ let origin = if enable_precise_capture ( span) {
269269 ( origin. 0 , origin. 1 )
270270 } else {
271271 ( origin. 0 , Place { projections : vec ! [ ] , ..origin. 1 } )
@@ -1240,8 +1240,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
12401240 ///
12411241 /// This will make more sense with an example:
12421242 ///
1243- /// ```rust
1244- /// #![feature(capture_disjoint_fields)]
1243+ /// ```rust,edition2021
12451244 ///
12461245 /// struct FancyInteger(i32); // This implements Drop
12471246 ///
@@ -2247,12 +2246,10 @@ fn truncate_capture_for_optimization(
22472246 ( place, curr_mode)
22482247}
22492248
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.
22532250/// `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 {
22552252 // We use span here to ensure that if the closure was generated by a macro with a different
22562253 // edition.
2257- tcx . features ( ) . capture_disjoint_fields || span. rust_2021 ( )
2254+ span. rust_2021 ( )
22582255}
0 commit comments