aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/transform.rs9
-rw-r--r--ui-tests/src/bin/unconvertible_type.stderr4
2 files changed, 6 insertions, 7 deletions
diff --git a/src/transform.rs b/src/transform.rs
index 69929cc..e8481bb 100644
--- a/src/transform.rs
+++ b/src/transform.rs
@@ -24,10 +24,9 @@ pub enum TransformError {
impl AssocTypeConversions<'_> {
pub fn parse_type_path(&self, type_: &mut Type) -> Result<TypeTransform, TransformError> {
- let assoc_span = match iter_type(type_).filter_map(filter_map_assoc_paths).next() {
- Some(path) => path.span(),
- None => return Ok(TypeTransform::NoOp),
- };
+ if !iter_type(type_).any(match_assoc_type) {
+ return Ok(TypeTransform::NoOp);
+ }
if let Type::Reference(TypeReference {
lifetime: None,
@@ -144,7 +143,7 @@ impl AssocTypeConversions<'_> {
// the type contains an associated type but we
// don't know how to deal with it so we abort
- Err(TransformError::AssocTypeInUnsupportedType(assoc_span))
+ Err(TransformError::AssocTypeInUnsupportedType(type_.span()))
}
}
diff --git a/ui-tests/src/bin/unconvertible_type.stderr b/ui-tests/src/bin/unconvertible_type.stderr
index 462b939..03c7f30 100644
--- a/ui-tests/src/bin/unconvertible_type.stderr
+++ b/ui-tests/src/bin/unconvertible_type.stderr
@@ -1,5 +1,5 @@
error: dynamize does not know how to convert this type
- --> src/bin/unconvertible_type.rs:7:31
+ --> src/bin/unconvertible_type.rs:7:27
|
7 | fn a(&self) -> Option<Foo<Self::A>>;
- | ^^^^
+ | ^^^