From 2f77d5bbd0f581957c756a44f3b8baa66445fe9c Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 17 Oct 2024 16:14:55 +0200 Subject: [PATCH] Improve an error message --- .../charon-driver/translate/translate_crate_to_ullbc.rs | 2 +- charon/tests/ui/error-dependencies.out | 2 +- charon/tests/ui/generic-associated-types.out | 6 +++--- charon/tests/ui/issue-378-ctor-as-fn.out | 2 +- charon/tests/ui/non-lifetime-gats.out | 8 ++++---- charon/tests/ui/unsupported/advanced-const-generics.out | 2 +- charon/tests/ui/unsupported/unbound-lifetime.out | 2 +- charon/tests/ui/unsupported/well-formedness-bound.out | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/charon/src/bin/charon-driver/translate/translate_crate_to_ullbc.rs b/charon/src/bin/charon-driver/translate/translate_crate_to_ullbc.rs index 2094222e7..e7da2e806 100644 --- a/charon/src/bin/charon-driver/translate/translate_crate_to_ullbc.rs +++ b/charon/src/bin/charon-driver/translate/translate_crate_to_ullbc.rs @@ -296,7 +296,7 @@ impl<'tcx, 'ctx> TranslateCtx<'tcx, 'ctx> { if res.is_err() { ctx.span_err( span, - &format!("Ignoring the following item due to an error: {rust_id:?}"), + &format!("Ignoring the following item due to a previous error: {rust_id:?}"), ); ctx.errors.ignore_failed_decl(trans_id); } diff --git a/charon/tests/ui/error-dependencies.out b/charon/tests/ui/error-dependencies.out index 693d3449f..1fc045f71 100644 --- a/charon/tests/ui/error-dependencies.out +++ b/charon/tests/ui/error-dependencies.out @@ -1,7 +1,7 @@ error: Trait aliases are not supported --> /rustc/730d5d4095a264ef5f7c0a0781eea68c15431d45/library/core/src/ptr/metadata.rs:81:1 -error: Ignoring the following item due to an error: core::ptr::metadata::Thin +error: Ignoring the following item due to a previous error: core::ptr::metadata::Thin --> /rustc/730d5d4095a264ef5f7c0a0781eea68c15431d45/library/core/src/ptr/metadata.rs:81:1 error: The external definition `core::ptr::metadata::Thin` triggered errors. It is (transitively) used at the following location(s): diff --git a/charon/tests/ui/generic-associated-types.out b/charon/tests/ui/generic-associated-types.out index 3a75cd7b0..a06043145 100644 --- a/charon/tests/ui/generic-associated-types.out +++ b/charon/tests/ui/generic-associated-types.out @@ -4,7 +4,7 @@ error: Generic associated types are not supported 5 | type Item<'a> | ^^^^^^^^^^^^^ -error: Ignoring the following item due to an error: test_crate::LendingIterator +error: Ignoring the following item due to a previous error: test_crate::LendingIterator --> tests/ui/generic-associated-types.rs:4:1 | 4 | trait LendingIterator { @@ -16,7 +16,7 @@ error: Generic associated types are not supported 46 | type Type<'b>: for<'c> Foo<&'a &'b &'c ()>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: Ignoring the following item due to an error: test_crate::lifetimes::Bar +error: Ignoring the following item due to a previous error: test_crate::lifetimes::Bar --> tests/ui/generic-associated-types.rs:45:5 | 45 | trait Bar<'a> { @@ -28,7 +28,7 @@ error: Generic associated types are not supported 13 | type Item<'b> = &'b T; | ^^^^^^^^^^^^^ -error: Ignoring the following item due to an error: test_crate::{impl#0} +error: Ignoring the following item due to a previous error: test_crate::{impl#0} --> tests/ui/generic-associated-types.rs:12:1 | 12 | impl<'a, T> LendingIterator for Option<&'a T> { diff --git a/charon/tests/ui/issue-378-ctor-as-fn.out b/charon/tests/ui/issue-378-ctor-as-fn.out index 2f9e23cbe..d008e175e 100644 --- a/charon/tests/ui/issue-378-ctor-as-fn.out +++ b/charon/tests/ui/issue-378-ctor-as-fn.out @@ -1,7 +1,7 @@ error: Casting constructors to function pointers is not supported --> /rustc/730d5d4095a264ef5f7c0a0781eea68c15431d45/library/core/src/option.rs:579:5 -error: Ignoring the following item due to an error: core::option::Option::Some::{constructor#0} +error: Ignoring the following item due to a previous error: core::option::Option::Some::{constructor#0} --> /rustc/730d5d4095a264ef5f7c0a0781eea68c15431d45/library/core/src/option.rs:579:5 error: The external definition `core::option::Option::Some` triggered errors. It is (transitively) used at the following location(s): diff --git a/charon/tests/ui/non-lifetime-gats.out b/charon/tests/ui/non-lifetime-gats.out index e4eda3ab2..21e1a8d1a 100644 --- a/charon/tests/ui/non-lifetime-gats.out +++ b/charon/tests/ui/non-lifetime-gats.out @@ -4,7 +4,7 @@ error: Generic associated types are not supported 5 | type Pointer: Deref; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: Ignoring the following item due to an error: test_crate::PointerFamily +error: Ignoring the following item due to a previous error: test_crate::PointerFamily --> tests/ui/non-lifetime-gats.rs:4:1 | 4 | trait PointerFamily { @@ -16,7 +16,7 @@ error: Generic associated types are not supported 34 | type Type: Link; | ^^^^^^^^^^^^^^^^^^^^^ -error: Ignoring the following item due to an error: test_crate::moar_variables::Trait +error: Ignoring the following item due to a previous error: test_crate::moar_variables::Trait --> tests/ui/non-lifetime-gats.rs:33:5 | 33 | trait Trait { @@ -28,7 +28,7 @@ error: Generic associated types are not supported 13 | type Pointer = Box; | ^^^^^^^^^^^^^^^ -error: Ignoring the following item due to an error: test_crate::{impl#0} +error: Ignoring the following item due to a previous error: test_crate::{impl#0} --> tests/ui/non-lifetime-gats.rs:12:1 | 12 | impl PointerFamily for BoxFamily { @@ -40,7 +40,7 @@ error: Generic associated types are not supported 39 | type Type = (T, U); | ^^^^^^^^^^^^ -error: Ignoring the following item due to an error: test_crate::moar_variables::{impl#1} +error: Ignoring the following item due to a previous error: test_crate::moar_variables::{impl#1} --> tests/ui/non-lifetime-gats.rs:38:5 | 38 | impl Trait> for Foo { diff --git a/charon/tests/ui/unsupported/advanced-const-generics.out b/charon/tests/ui/unsupported/advanced-const-generics.out index c7bef9ff1..8d59e8a4d 100644 --- a/charon/tests/ui/unsupported/advanced-const-generics.out +++ b/charon/tests/ui/unsupported/advanced-const-generics.out @@ -26,7 +26,7 @@ error: Constant parameters of non-literal type are not supported 14 | fn foo() -> Foo { | ^^^^^^^^^^^^ -error: Ignoring the following item due to an error: test_crate::foo +error: Ignoring the following item due to a previous error: test_crate::foo --> tests/ui/unsupported/advanced-const-generics.rs:14:1 | 14 | fn foo() -> Foo { diff --git a/charon/tests/ui/unsupported/unbound-lifetime.out b/charon/tests/ui/unsupported/unbound-lifetime.out index c2f09126d..207854945 100644 --- a/charon/tests/ui/unsupported/unbound-lifetime.out +++ b/charon/tests/ui/unsupported/unbound-lifetime.out @@ -18,7 +18,7 @@ error: Could not find region: Region { kind: ReError(ErrorGuaranteed { todo: "Er 5 | fn get(_x: &'a u32) {} | ^^^^^^^^^^^^^^^^^^^^^^ -error: Ignoring the following item due to an error: test_crate::get +error: Ignoring the following item due to a previous error: test_crate::get --> tests/ui/unsupported/unbound-lifetime.rs:5:1 | 5 | fn get(_x: &'a u32) {} diff --git a/charon/tests/ui/unsupported/well-formedness-bound.out b/charon/tests/ui/unsupported/well-formedness-bound.out index 020ea9ab6..426581c98 100644 --- a/charon/tests/ui/unsupported/well-formedness-bound.out +++ b/charon/tests/ui/unsupported/well-formedness-bound.out @@ -4,7 +4,7 @@ error: Well-formedness clauses are unsupported 4 | &'a ():, | ^^^^^^ -error: Ignoring the following item due to an error: test_crate::get +error: Ignoring the following item due to a previous error: test_crate::get --> tests/ui/unsupported/well-formedness-bound.rs:2:1 | 2 | / fn get<'a>(x: &'a u32) -> Option<&'a u32>