@@ -527,17 +527,9 @@ impl<'a, 'b> Context<'a, 'b> {
527527 self . verify_arg_type ( Exact ( idx) , ty)
528528 }
529529 None => {
530- let capture_feature_enabled = self
531- . ecx
532- . ecfg
533- . features
534- . map_or ( false , |features| features. format_args_capture ) ;
535-
536530 // For the moment capturing variables from format strings expanded from macros is
537531 // disabled (see RFC #2795)
538- let can_capture = capture_feature_enabled && self . is_literal ;
539-
540- if can_capture {
532+ if self . is_literal {
541533 // Treat this name as a variable to capture from the surrounding scope
542534 let idx = self . args . len ( ) ;
543535 self . arg_types . push ( Vec :: new ( ) ) ;
@@ -559,23 +551,15 @@ impl<'a, 'b> Context<'a, 'b> {
559551 } ;
560552 let mut err = self . ecx . struct_span_err ( sp, & msg[ ..] ) ;
561553
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+ ) ;
579563
580564 err. emit ( ) ;
581565 }
0 commit comments