diff options
author | Martin Fischer <martin@push-f.com> | 2021-11-25 10:30:54 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-11-26 11:45:53 +0100 |
commit | 7489a3c2246e7ea2483446dd2ed3fdbfaf462c1a (patch) | |
tree | fc2670f56f7cc16567eb10d88f9439abb9098298 /ui-tests/src/bin | |
parent | 43950edc4f26a07055fb917fa8bbb262276e2a08 (diff) |
introduce #[convert] attribute
Diffstat (limited to 'ui-tests/src/bin')
-rw-r--r-- | ui-tests/src/bin/attr_convert_duplicate.rs | 8 | ||||
-rw-r--r-- | ui-tests/src/bin/attr_convert_duplicate.stderr | 5 | ||||
-rw-r--r-- | ui-tests/src/bin/qualified_self.stderr | 6 | ||||
-rw-r--r-- | ui-tests/src/bin/qualified_self_opt.stderr | 6 |
4 files changed, 19 insertions, 6 deletions
diff --git a/ui-tests/src/bin/attr_convert_duplicate.rs b/ui-tests/src/bin/attr_convert_duplicate.rs new file mode 100644 index 0000000..b074d81 --- /dev/null +++ b/ui-tests/src/bin/attr_convert_duplicate.rs @@ -0,0 +1,8 @@ +#[dynamize::dynamize] +#[convert = |x: Foo| -> Bar {x.baz()}] +#[convert = |x: Foo| -> Bar {x.baz()}] +trait Trait { + fn test(&self) -> Foo; +} + +fn main() {} diff --git a/ui-tests/src/bin/attr_convert_duplicate.stderr b/ui-tests/src/bin/attr_convert_duplicate.stderr new file mode 100644 index 0000000..e4f3622 --- /dev/null +++ b/ui-tests/src/bin/attr_convert_duplicate.stderr @@ -0,0 +1,5 @@ +error: conversion is defined multiple times for this type + --> src/bin/attr_convert_duplicate.rs:3:17 + | +3 | #[convert = |x: Foo| -> Bar {x.baz()}] + | ^^^ diff --git a/ui-tests/src/bin/qualified_self.stderr b/ui-tests/src/bin/qualified_self.stderr index d8c3a37..87dc0c2 100644 --- a/ui-tests/src/bin/qualified_self.stderr +++ b/ui-tests/src/bin/qualified_self.stderr @@ -1,5 +1,5 @@ -error: dynamize does not support Self qualified as another trait - --> src/bin/qualified_self.rs:7:32 +error: dynamize does not know how to convert this type (you can tell it with #[convert]) + --> src/bin/qualified_self.rs:7:23 | 7 | fn test(&self) -> <Self as Foo>::X; - | ^^^ + | ^ diff --git a/ui-tests/src/bin/qualified_self_opt.stderr b/ui-tests/src/bin/qualified_self_opt.stderr index dd99406..e20e9c3 100644 --- a/ui-tests/src/bin/qualified_self_opt.stderr +++ b/ui-tests/src/bin/qualified_self_opt.stderr @@ -1,5 +1,5 @@ -error: dynamize does not support Self qualified as another trait - --> src/bin/qualified_self_opt.rs:7:39 +error: dynamize does not know how to convert this type (you can tell it with #[convert]) + --> src/bin/qualified_self_opt.rs:7:29 | 7 | fn test(&self) -> Option<<Self as Foo>::X>; - | ^^^ + | ^^ |