diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-07-18 21:14:47 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-18 21:14:47 +0530 |
| commit | 60c1068c924d5dacaa2bebb4427cf5aaca9577e9 (patch) | |
| tree | 5f04376b20e0787a77af661c332f3d0785831c42 /src | |
| parent | affdcd6cef020ca7a110c3b954214486a0727b85 (diff) | |
| parent | 75a1b1cf066b36decf39f4d5036c0b1aae53c680 (diff) | |
| download | rust-60c1068c924d5dacaa2bebb4427cf5aaca9577e9.tar.gz rust-60c1068c924d5dacaa2bebb4427cf5aaca9577e9.zip | |
Rollup merge of #99351 - compiler-errors:arg-mismatch-blame, r=davidtwco
Use `typeck_results` to get accurate qpath res for arg mismatch error Improves error message from "function" to actually what we're calling (e.g. enum variant constrcutor) in a few cases :smile_cat:
Diffstat (limited to 'src')
3 files changed, 4 insertions, 4 deletions
diff --git a/src/test/ui/type-alias-enum-variants/enum-variant-generic-args.stderr b/src/test/ui/type-alias-enum-variants/enum-variant-generic-args.stderr index 5467f61bee4..a922d7a5e41 100644 --- a/src/test/ui/type-alias-enum-variants/enum-variant-generic-args.stderr +++ b/src/test/ui/type-alias-enum-variants/enum-variant-generic-args.stderr @@ -7,7 +7,7 @@ LL | fn ts_variant() { LL | Self::TSVariant(()); | --------------- ^^ expected type parameter `T`, found `()` | | - | arguments to this function are incorrect + | arguments to this enum variant are incorrect | = note: expected type parameter `T` found unit type `()` @@ -55,7 +55,7 @@ LL | impl<T> Enum<T> { LL | Self::<()>::TSVariant(()); | --------------------- ^^ expected type parameter `T`, found `()` | | - | arguments to this function are incorrect + | arguments to this enum variant are incorrect | = note: expected type parameter `T` found unit type `()` diff --git a/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.rs b/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.rs index d012687533b..3a8712f2ae5 100644 --- a/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.rs +++ b/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.rs @@ -18,6 +18,6 @@ impl E2 { } fn main() { - <E>::V(); //~ ERROR this function takes 1 argument but 0 arguments were supplied + <E>::V(); //~ ERROR this enum variant takes 1 argument but 0 arguments were supplied let _: u8 = <E2>::V; //~ ERROR mismatched types } diff --git a/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr b/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr index 6ae2aa1dc77..006253f8432 100644 --- a/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr +++ b/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr @@ -1,4 +1,4 @@ -error[E0061]: this function takes 1 argument but 0 arguments were supplied +error[E0061]: this enum variant takes 1 argument but 0 arguments were supplied --> $DIR/enum-variant-priority-higher-than-other-inherent.rs:21:5 | LL | <E>::V(); |
