@@ -527,17 +527,9 @@ impl<'a, 'b> Context<'a, 'b> {
527
527
self . verify_arg_type ( Exact ( idx) , ty)
528
528
}
529
529
None => {
530
- let capture_feature_enabled = self
531
- . ecx
532
- . ecfg
533
- . features
534
- . map_or ( false , |features| features. format_args_capture ) ;
535
-
536
530
// For the moment capturing variables from format strings expanded from macros is
537
531
// disabled (see RFC #2795)
538
- let can_capture = capture_feature_enabled && self . is_literal ;
539
-
540
- if can_capture {
532
+ if self . is_literal {
541
533
// Treat this name as a variable to capture from the surrounding scope
542
534
let idx = self . args . len ( ) ;
543
535
self . arg_types . push ( Vec :: new ( ) ) ;
@@ -559,23 +551,15 @@ impl<'a, 'b> Context<'a, 'b> {
559
551
} ;
560
552
let mut err = self . ecx . struct_span_err ( sp, & msg[ ..] ) ;
561
553
562
- if capture_feature_enabled && !self . is_literal {
563
- err. note ( & format ! (
564
- "did you intend to capture a variable `{}` from \
565
- the surrounding scope?",
566
- name
567
- ) ) ;
568
- err. note (
569
- "to avoid ambiguity, `format_args!` cannot capture variables \
570
- when the format string is expanded from a macro",
571
- ) ;
572
- } else if self . ecx . parse_sess ( ) . unstable_features . is_nightly_build ( ) {
573
- err. help ( & format ! (
574
- "if you intended to capture `{}` from the surrounding scope, add \
575
- `#![feature(format_args_capture)]` to the crate attributes",
576
- name
577
- ) ) ;
578
- }
554
+ err. note ( & format ! (
555
+ "did you intend to capture a variable `{}` from \
556
+ the surrounding scope?",
557
+ name
558
+ ) ) ;
559
+ err. note (
560
+ "to avoid ambiguity, `format_args!` cannot capture variables \
561
+ when the format string is expanded from a macro",
562
+ ) ;
579
563
580
564
err. emit ( ) ;
581
565
}
0 commit comments