]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_builtin_macros/src/test.rs
Auto merge of #99472 - RalfJung:provenance, r=oli-obk
[rust.git] / compiler / rustc_builtin_macros / src / test.rs
index 0c2d20b8f2dc89eea86804cd2c56ed77d1d4ed11..e20375689f3d1f7a136ea48c6d885563ff7bf4a8 100644 (file)
@@ -118,7 +118,7 @@ pub fn expand_test_or_bench(
         };
         err.span_label(attr_sp, "the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions")
             .span_label(item.span, format!("expected a non-associated function, found {} {}", item.kind.article(), item.kind.descr()))
-            .span_suggestion(attr_sp, "replace with conditional compilation to make the item only exist when tests are being run", String::from("#[cfg(test)]"), Applicability::MaybeIncorrect)
+            .span_suggestion(attr_sp, "replace with conditional compilation to make the item only exist when tests are being run", "#[cfg(test)]", Applicability::MaybeIncorrect)
             .emit();
 
         return vec![Annotatable::Item(item)];