@@ -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 } )
@@ -1243,8 +1243,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
12431243 ///
12441244 /// This will make more sense with an example:
12451245 ///
1246- /// ```rust
1247- /// #![feature(capture_disjoint_fields)]
1246+ /// ```rust,edition2021
12481247 ///
12491248 /// struct FancyInteger(i32); // This implements Drop
12501249 ///
@@ -2250,12 +2249,10 @@ fn truncate_capture_for_optimization(
22502249 ( place, curr_mode)
22512250}
22522251
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.
22562253/// `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 {
22582255 // We use span here to ensure that if the closure was generated by a macro with a different
22592256 // edition.
2260- tcx . features ( ) . capture_disjoint_fields || span. rust_2021 ( )
2257+ span. rust_2021 ( )
22612258}
0 commit comments