]> git.lizzy.rs Git - rust.git/commitdiff
Filter error by span edition.
authorCamille GILLOT <gillot.camille@gmail.com>
Sun, 17 Oct 2021 17:10:21 +0000 (19:10 +0200)
committerCamille GILLOT <gillot.camille@gmail.com>
Sat, 4 Dec 2021 22:13:58 +0000 (23:13 +0100)
compiler/rustc_typeck/src/astconv/mod.rs

index bc271fac68fd63d83127a920685d8d692c15df87..3d449578eb06c46d93a858c52a510d3c502b2d29 100644 (file)
@@ -2635,7 +2635,7 @@ fn maybe_lint_bare_trait(&self, self_ty: &hir::Ty<'_>, in_path: bool) {
                     sugg = format!("<{}>", sugg);
                 }
             }
-            if tcx.sess.edition() >= Edition::Edition2021 {
+            if self_ty.span.edition() >= Edition::Edition2021 {
                 let msg = "trait objects must include the `dyn` keyword";
                 let label = "add `dyn` keyword before this trait";
                 let mut err =