about summary refs log tree commit diff
path: root/src/librustc_interface
diff options
context:
space:
mode:
authorAlexander Regueiro <alexreg@me.com>2019-02-28 22:43:53 +0000
committerAlexander Regueiro <alexreg@me.com>2019-06-05 21:09:26 +0100
commit3816958f18ea6c8990d64d03da839e5a180b0b9b (patch)
tree1bf9dca622038936fb05d803c5cd441b7e95885e /src/librustc_interface
parentdce27cba78ebda2c5adfe149d33af5a88a28d08d (diff)
downloadrust-3816958f18ea6c8990d64d03da839e5a180b0b9b.tar.gz
rust-3816958f18ea6c8990d64d03da839e5a180b0b9b.zip
Implemented for function bounds, type bounds, and named existential types.
Diffstat (limited to 'src/librustc_interface')
-rw-r--r--src/librustc_interface/util.rs16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/librustc_interface/util.rs b/src/librustc_interface/util.rs
index 4ff996d1f57..f49f2110f23 100644
--- a/src/librustc_interface/util.rs
+++ b/src/librustc_interface/util.rs
@@ -716,8 +716,22 @@ impl<'a> ReplaceBodyWithLoop<'a> {
                                     ast::GenericArg::Type(ty) => Some(ty),
                                     _ => None,
                                 });
+                                let any_assoc_ty_bounds = data.constraints.iter().any(|c| {
+                                    if let ast::AssocTyConstraintKind::Bound { .. } = c.kind {
+                                        true
+                                    } else {
+                                        false
+                                    }
+                                });
+                                any_assoc_ty_bounds ||
                                 any_involves_impl_trait(types.into_iter()) ||
-                                any_involves_impl_trait(data.bindings.iter().map(|b| &b.ty))
+                                any_involves_impl_trait(data.constraints.iter().filter_map(|c| {
+                                    if let ast::AssocTyConstraintKind::Equality { ref ty } = c.kind {
+                                        Some(ty)
+                                    } else {
+                                        None
+                                    }
+                                }))
                             },
                             Some(&ast::GenericArgs::Parenthesized(ref data)) => {
                                 any_involves_impl_trait(data.inputs.iter()) ||