]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/ty/sty.rs
Auto merge of #65140 - petrochenkov:disapp, r=nikomatsakis
[rust.git] / src / librustc / ty / sty.rs
index 41224ba40f33c771fb5a37e2eab08b440c0d2cc1..4af73fa389a7db87f26b353981a38697cab8020f 100644 (file)
@@ -1775,6 +1775,10 @@ pub fn is_phantom_data(&self) -> bool {
     #[inline]
     pub fn is_bool(&self) -> bool { self.kind == Bool }
 
+    /// Returns `true` if this type is a `str`.
+    #[inline]
+    pub fn is_str(&self) -> bool { self.kind == Str }
+
     #[inline]
     pub fn is_param(&self, index: u32) -> bool {
         match self.kind {
@@ -2199,7 +2203,9 @@ pub fn to_opt_closure_kind(&self) -> Option<ty::ClosureKind> {
                 _ => bug!("cannot convert type `{:?}` to a closure kind", self),
             },
 
-            Infer(_) => None,
+            // "Bound" types appear in canonical queries when the
+            // closure type is not yet known
+            Bound(..) | Infer(_) => None,
 
             Error => Some(ty::ClosureKind::Fn),