]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_expand/src/config.rs
Rollup merge of #103567 - RalfJung:ptr-eq-dyn-trait, r=dtolnay
[rust.git] / compiler / rustc_expand / src / config.rs
index 8d4e3640748631250921c9a57068c142e5a59a1b..1d2b1298a68f6372dca41d0bf71b0241636eda44 100644 (file)
@@ -469,6 +469,7 @@ pub(crate) fn cfg_true(&self, attr: &Attribute) -> bool {
     }
 
     /// If attributes are not allowed on expressions, emit an error for `attr`
+    #[instrument(level = "trace", skip(self))]
     pub(crate) fn maybe_emit_expr_attr_err(&self, attr: &Attribute) {
         if !self.features.map_or(true, |features| features.stmt_expr_attributes) {
             let mut err = feature_err(
@@ -486,9 +487,12 @@ pub(crate) fn maybe_emit_expr_attr_err(&self, attr: &Attribute) {
         }
     }
 
-    pub fn configure_expr(&self, expr: &mut P<ast::Expr>) {
-        for attr in expr.attrs.iter() {
-            self.maybe_emit_expr_attr_err(attr);
+    #[instrument(level = "trace", skip(self))]
+    pub fn configure_expr(&self, expr: &mut P<ast::Expr>, method_receiver: bool) {
+        if !method_receiver {
+            for attr in expr.attrs.iter() {
+                self.maybe_emit_expr_attr_err(attr);
+            }
         }
 
         // If an expr is valid to cfg away it will have been removed by the