]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_middle/src/traits/mod.rs
Rollup merge of #91895 - pitaj:91867-monomorphize, r=Aaron1011
[rust.git] / compiler / rustc_middle / src / traits / mod.rs
index 49a64cb246ad0dd09af4b58d55e69b0cfcfd41d2..3e6a6b3ba4222f699177b2288bdad0fccc3cc1e3 100644 (file)
@@ -101,7 +101,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
     }
 }
 
-impl Deref for ObligationCause<'tcx> {
+impl<'tcx> Deref for ObligationCause<'tcx> {
     type Target = ObligationCauseData<'tcx>;
 
     #[inline(always)]
@@ -348,6 +348,12 @@ pub enum ObligationCauseCode<'tcx> {
     /// If `X` is the concrete type of an opaque type `impl Y`, then `X` must implement `Y`
     OpaqueType,
 
+    AwaitableExpr(Option<hir::HirId>),
+
+    ForLoopIterator,
+
+    QuestionMark,
+
     /// Well-formed checking. If a `WellFormedLoc` is provided,
     /// then it will be used to eprform HIR-based wf checking
     /// after an error occurs, in order to generate a more precise error span.
@@ -587,18 +593,18 @@ pub fn nested_obligations(self) -> Vec<N> {
     pub fn borrow_nested_obligations(&self) -> &[N] {
         match &self {
             ImplSource::UserDefined(i) => &i.nested[..],
-            ImplSource::Param(n, _) => &n[..],
-            ImplSource::Builtin(i) => &i.nested[..],
-            ImplSource::AutoImpl(d) => &d.nested[..],
-            ImplSource::Closure(c) => &c.nested[..],
-            ImplSource::Generator(c) => &c.nested[..],
-            ImplSource::Object(d) => &d.nested[..],
-            ImplSource::FnPointer(d) => &d.nested[..],
+            ImplSource::Param(n, _) => &n,
+            ImplSource::Builtin(i) => &i.nested,
+            ImplSource::AutoImpl(d) => &d.nested,
+            ImplSource::Closure(c) => &c.nested,
+            ImplSource::Generator(c) => &c.nested,
+            ImplSource::Object(d) => &d.nested,
+            ImplSource::FnPointer(d) => &d.nested,
             ImplSource::DiscriminantKind(ImplSourceDiscriminantKindData)
             | ImplSource::Pointee(ImplSourcePointeeData)
             | ImplSource::ConstDrop(ImplSourceConstDropData) => &[],
-            ImplSource::TraitAlias(d) => &d.nested[..],
-            ImplSource::TraitUpcasting(d) => &d.nested[..],
+            ImplSource::TraitAlias(d) => &d.nested,
+            ImplSource::TraitUpcasting(d) => &d.nested,
         }
     }