diff options
author | Martin Fischer <martin@push-f.com> | 2021-11-22 12:57:53 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-11-22 13:03:47 +0100 |
commit | 684d7e5873aa0b6423e167124fd8c72e02173ba2 (patch) | |
tree | e53af9b8b4abcd815cfdac5871d145ef73ac4d39 /ui-tests/src | |
parent | 890247746e74e015acbb290c925284c5047a580c (diff) |
better errors for type arguments of collections
Diffstat (limited to 'ui-tests/src')
-rw-r--r-- | ui-tests/src/bin/unconvertible_type_map.rs | 8 | ||||
-rw-r--r-- | ui-tests/src/bin/unconvertible_type_map.stderr | 5 | ||||
-rw-r--r-- | ui-tests/src/bin/unconvertible_type_vec.stderr | 6 |
3 files changed, 16 insertions, 3 deletions
diff --git a/ui-tests/src/bin/unconvertible_type_map.rs b/ui-tests/src/bin/unconvertible_type_map.rs new file mode 100644 index 0000000..40f883b --- /dev/null +++ b/ui-tests/src/bin/unconvertible_type_map.rs @@ -0,0 +1,8 @@ +#[dynamize::dynamize] +trait Trait { + type A: Into<String>; + + fn a(&self) -> HashMap<Self::A>; +} + +fn main() {} diff --git a/ui-tests/src/bin/unconvertible_type_map.stderr b/ui-tests/src/bin/unconvertible_type_map.stderr new file mode 100644 index 0000000..a6833d2 --- /dev/null +++ b/ui-tests/src/bin/unconvertible_type_map.stderr @@ -0,0 +1,5 @@ +error: dynamize expects at least 2 generic type arguments for this type + --> src/bin/unconvertible_type_map.rs:5:20 + | +5 | fn a(&self) -> HashMap<Self::A>; + | ^^^^^^^ diff --git a/ui-tests/src/bin/unconvertible_type_vec.stderr b/ui-tests/src/bin/unconvertible_type_vec.stderr index 65306f0..f966ede 100644 --- a/ui-tests/src/bin/unconvertible_type_vec.stderr +++ b/ui-tests/src/bin/unconvertible_type_vec.stderr @@ -1,5 +1,5 @@ -error: dynamize does not know how to convert this type - --> src/bin/unconvertible_type_vec.rs:5:20 +error: for Vec dynamize supports associated types only within the first 1 generic type parameters + --> src/bin/unconvertible_type_vec.rs:5:32 | 5 | fn a(&self) -> Vec<String, Self::A>; - | ^^^ + | ^^^^ |