diff options
| author | Ding Xiang Fei <dingxiangfei2009@protonmail.ch> | 2024-12-03 06:46:17 +0800 |
|---|---|---|
| committer | Ding Xiang Fei <dingxiangfei2009@protonmail.ch> | 2024-12-04 20:34:48 +0800 |
| commit | 836ab5cd89e72487b003d0034b6ca4c3399878e8 (patch) | |
| tree | 45a8dda8358401aa53bf38eb23d3e9c252cae128 /tests/ui/deriving | |
| parent | 32eea2f4460b06b12acc98050a4211b8c0ccfd67 (diff) | |
| download | rust-836ab5cd89e72487b003d0034b6ca4c3399878e8.tar.gz rust-836ab5cd89e72487b003d0034b6ca4c3399878e8.zip | |
make CoercePointee errors translatable
Diffstat (limited to 'tests/ui/deriving')
| -rw-r--r-- | tests/ui/deriving/deriving-coerce-pointee-neg.rs | 6 | ||||
| -rw-r--r-- | tests/ui/deriving/deriving-coerce-pointee-neg.stderr | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/ui/deriving/deriving-coerce-pointee-neg.rs b/tests/ui/deriving/deriving-coerce-pointee-neg.rs index deef35cdf70..da25c854c54 100644 --- a/tests/ui/deriving/deriving-coerce-pointee-neg.rs +++ b/tests/ui/deriving/deriving-coerce-pointee-neg.rs @@ -29,7 +29,7 @@ struct NoFieldUnit<'a, #[pointee] T: ?Sized>(); struct NoGeneric<'a>(&'a u8); #[derive(CoercePointee)] -//~^ ERROR: exactly one generic type parameter must be marked as #[pointee] to derive CoercePointee traits +//~^ ERROR: exactly one generic type parameter must be marked as `#[pointee]` to derive `CoercePointee` traits #[repr(transparent)] struct AmbiguousPointee<'a, T1: ?Sized, T2: ?Sized> { a: (&'a T1, &'a T2), @@ -38,7 +38,7 @@ struct AmbiguousPointee<'a, T1: ?Sized, T2: ?Sized> { #[derive(CoercePointee)] #[repr(transparent)] struct TooManyPointees<'a, #[pointee] A: ?Sized, #[pointee] B: ?Sized>((&'a A, &'a B)); -//~^ ERROR: only one type parameter can be marked as `#[pointee]` when deriving CoercePointee traits +//~^ ERROR: only one type parameter can be marked as `#[pointee]` when deriving `CoercePointee` traits #[derive(CoercePointee)] //~^ ERROR: `CoercePointee` can only be derived on `struct`s with `#[repr(transparent)]` @@ -49,7 +49,7 @@ struct NotTransparent<'a, #[pointee] T: ?Sized> { #[derive(CoercePointee)] #[repr(transparent)] struct NoMaybeSized<'a, #[pointee] T> { - //~^ ERROR: `derive(CoercePointee)` requires T to be marked `?Sized` + //~^ ERROR: `derive(CoercePointee)` requires `T` to be marked `?Sized` ptr: &'a T, } diff --git a/tests/ui/deriving/deriving-coerce-pointee-neg.stderr b/tests/ui/deriving/deriving-coerce-pointee-neg.stderr index e590d636d0e..c1e8be49d37 100644 --- a/tests/ui/deriving/deriving-coerce-pointee-neg.stderr +++ b/tests/ui/deriving/deriving-coerce-pointee-neg.stderr @@ -30,7 +30,7 @@ LL | #[derive(CoercePointee)] | = note: this error originates in the derive macro `CoercePointee` (in Nightly builds, run with -Z macro-backtrace for more info) -error: exactly one generic type parameter must be marked as #[pointee] to derive CoercePointee traits +error: exactly one generic type parameter must be marked as `#[pointee]` to derive `CoercePointee` traits --> $DIR/deriving-coerce-pointee-neg.rs:31:10 | LL | #[derive(CoercePointee)] @@ -38,11 +38,11 @@ LL | #[derive(CoercePointee)] | = note: this error originates in the derive macro `CoercePointee` (in Nightly builds, run with -Z macro-backtrace for more info) -error: only one type parameter can be marked as `#[pointee]` when deriving CoercePointee traits +error: only one type parameter can be marked as `#[pointee]` when deriving `CoercePointee` traits --> $DIR/deriving-coerce-pointee-neg.rs:40:39 | LL | struct TooManyPointees<'a, #[pointee] A: ?Sized, #[pointee] B: ?Sized>((&'a A, &'a B)); - | ^ ^ + | ^ - here another type parameter is marked as `#[pointee]` error: `CoercePointee` can only be derived on `struct`s with `#[repr(transparent)]` --> $DIR/deriving-coerce-pointee-neg.rs:43:10 @@ -52,7 +52,7 @@ LL | #[derive(CoercePointee)] | = note: this error originates in the derive macro `CoercePointee` (in Nightly builds, run with -Z macro-backtrace for more info) -error: `derive(CoercePointee)` requires T to be marked `?Sized` +error: `derive(CoercePointee)` requires `T` to be marked `?Sized` --> $DIR/deriving-coerce-pointee-neg.rs:51:36 | LL | struct NoMaybeSized<'a, #[pointee] T> { |
