]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/check/mod.rs
On recursive ADT, provide indirection structured suggestion
[rust.git] / src / librustc_typeck / check / mod.rs
index f2aeed4f1e46563fc3a418111e4879ae7843d92e..1e8a149d7d9ec35bad99fbe645bbe23fa3c700d7 100644 (file)
@@ -2390,11 +2390,7 @@ fn check_representable(tcx: TyCtxt<'_>, sp: Span, item_def_id: LocalDefId) -> bo
     // caught by case 1.
     match rty.is_representable(tcx, sp) {
         Representability::SelfRecursive(spans) => {
-            let mut err = recursive_type_with_infinite_size_error(tcx, item_def_id.to_def_id());
-            for span in spans {
-                err.span_label(span, "recursive without indirection");
-            }
-            err.emit();
+            recursive_type_with_infinite_size_error(tcx, item_def_id.to_def_id(), spans);
             return false;
         }
         Representability::Representable | Representability::ContainsRecursive => (),