traits::NonStructuralMatchTy::Generator => {
"generators cannot be used in patterns".to_string()
}
+ traits::NonStructuralMatchTy::Closure => {
+ "closures cannot be used in patterns".to_string()
+ }
traits::NonStructuralMatchTy::Param => {
bug!("use of a constant whose type is a parameter inside a pattern")
}
Opaque,
Generator,
Projection,
+ Closure,
}
/// This method traverses the structure of `ty`, trying to find an
self.found = Some(NonStructuralMatchTy::Generator);
return true; // Stop visiting.
}
+ ty::Closure(..) => {
+ self.found = Some(NonStructuralMatchTy::Closure);
+ return true; // Stop visiting.
+ }
ty::RawPtr(..) => {
// structural-match ignores substructure of
// `*const _`/`*mut _`, so skip `super_visit_with`.
ty.super_visit_with(self);
return false;
}
- ty::Closure(..) | ty::Infer(_) | ty::Placeholder(_) | ty::Bound(..) => {
+ ty::Infer(_) | ty::Placeholder(_) | ty::Bound(..) => {
bug!("unexpected type during structural-match checking: {:?}", ty);
}
ty::Error => {
--- /dev/null
+// check-pass
+
+#![feature(impl_trait_in_bindings)]
+//~^ WARN the feature `impl_trait_in_bindings` is incomplete
+
+const _: impl Fn() = ||();
+
+fn main() {}
--- /dev/null
+warning: the feature `impl_trait_in_bindings` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/impl-trait-in-bindings-issue-73003.rs:3:12
+ |
+LL | #![feature(impl_trait_in_bindings)]
+ | ^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(incomplete_features)]` on by default
+ = note: see issue #63065 <https://github.com/rust-lang/rust/issues/63065> for more information
+
+warning: 1 warning emitted
+