]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #103488 - oli-obk:impl_trait_for_tait, r=lcnr
authorManish Goregaokar <manishsmail@gmail.com>
Wed, 23 Nov 2022 03:54:38 +0000 (22:54 -0500)
committerGitHub <noreply@github.com>
Wed, 23 Nov 2022 03:54:38 +0000 (22:54 -0500)
Allow opaque types in trait impl headers and rely on coherence to reject unsound cases

r? ````@lcnr````

fixes #99840

1  2 
clippy_utils/src/qualify_min_const_fn.rs

index 65722f142aa69c4c8b5055e325b32b60ff3adb17,b48bacb9ace6ffbe93943e8fee8db999937742f5..d183e28f667c01178d9f156deb173ea80f13d9fe
@@@ -18,7 -18,7 +18,7 @@@ use std::borrow::Cow
  
  type McfResult = Result<(), (Span, Cow<'static, str>)>;
  
 -pub fn is_min_const_fn<'a, 'tcx>(tcx: TyCtxt<'tcx>, body: &'a Body<'tcx>, msrv: Option<RustcVersion>) -> McfResult {
 +pub fn is_min_const_fn<'tcx>(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, msrv: Option<RustcVersion>) -> McfResult {
      let def_id = body.source.def_id();
      let mut current = def_id;
      loop {
@@@ -37,6 -37,7 +37,7 @@@
                  ty::PredicateKind::ClosureKind(..) => panic!("closure kind predicate on function: {predicate:#?}"),
                  ty::PredicateKind::Subtype(_) => panic!("subtype predicate on function: {predicate:#?}"),
                  ty::PredicateKind::Coerce(_) => panic!("coerce predicate on function: {predicate:#?}"),
+                 ty::PredicateKind::Ambiguous => panic!("ambiguous predicate on function: {predicate:#?}"),
              }
          }
          match predicates.parent {
@@@ -276,9 -277,9 +277,9 @@@ fn check_place<'tcx>(tcx: TyCtxt<'tcx>
      Ok(())
  }
  
 -fn check_terminator<'a, 'tcx>(
 +fn check_terminator<'tcx>(
      tcx: TyCtxt<'tcx>,
 -    body: &'a Body<'tcx>,
 +    body: &Body<'tcx>,
      terminator: &Terminator<'tcx>,
      msrv: Option<RustcVersion>,
  ) -> McfResult {