Skip to content

Commit

Permalink
Improve an error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadrieril committed Oct 18, 2024
1 parent ba07bab commit 2f77d5b
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion charon/tests/ui/error-dependencies.out
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
6 changes: 3 additions & 3 deletions charon/tests/ui/generic-associated-types.out
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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> {
Expand All @@ -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> {
Expand Down
2 changes: 1 addition & 1 deletion charon/tests/ui/issue-378-ctor-as-fn.out
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
8 changes: 4 additions & 4 deletions charon/tests/ui/non-lifetime-gats.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error: Generic associated types are not supported
5 | type Pointer<T>: Deref<Target = T>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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 {
Expand All @@ -16,7 +16,7 @@ error: Generic associated types are not supported
34 | type Type<U>: Link<T>;
| ^^^^^^^^^^^^^^^^^^^^^

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<T> {
Expand All @@ -28,7 +28,7 @@ error: Generic associated types are not supported
13 | type Pointer<T> = Box<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/non-lifetime-gats.rs:12:1
|
12 | impl PointerFamily for BoxFamily {
Expand All @@ -40,7 +40,7 @@ error: Generic associated types are not supported
39 | type Type<U> = (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<T> Trait<Option<T>> for Foo {
Expand Down
2 changes: 1 addition & 1 deletion charon/tests/ui/unsupported/advanced-const-generics.out
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ error: Constant parameters of non-literal type are not supported
14 | fn foo<const X: 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<const X: Foo>() -> Foo {
Expand Down
2 changes: 1 addition & 1 deletion charon/tests/ui/unsupported/unbound-lifetime.out
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand Down
2 changes: 1 addition & 1 deletion charon/tests/ui/unsupported/well-formedness-bound.out
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 2f77d5b

Please sign in to comment.