File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 55#![ feature( lint_reasons) ]
66#![ feature( never_type) ]
77#![ feature( rustc_private) ]
8+ #![ feature( assert_matches) ]
89#![ recursion_limit = "512" ]
910#![ cfg_attr( feature = "deny-warnings" , deny( warnings) ) ]
1011#![ allow( clippy:: missing_errors_doc, clippy:: missing_panics_doc, clippy:: must_use_candidate) ]
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ use rustc_target::abi::{Size, VariantIdx};
2727use rustc_trait_selection:: traits:: query:: evaluate_obligation:: InferCtxtExt as _;
2828use rustc_trait_selection:: traits:: query:: normalize:: QueryNormalizeExt ;
2929use rustc_trait_selection:: traits:: { Obligation , ObligationCause } ;
30+ use std:: assert_matches:: debug_assert_matches;
3031use std:: iter;
3132
3233use crate :: { match_def_path, path_res, paths} ;
@@ -259,7 +260,11 @@ pub fn implements_trait_with_env_from_iter<'tcx>(
259260 } ) ) ,
260261 ) ;
261262
262- debug_assert_eq ! ( tcx. def_kind( trait_id) , DefKind :: Trait ) ;
263+ debug_assert_matches ! (
264+ tcx. def_kind( trait_id) ,
265+ DefKind :: Trait | DefKind :: TraitAlias ,
266+ "`DefId` must belong to a trait or trait alias"
267+ ) ;
263268 #[ cfg( debug_assertions) ]
264269 assert_generic_args_match ( tcx, trait_id, trait_ref. args ) ;
265270
Original file line number Diff line number Diff line change 1+ #![ feature( trait_alias) ]
2+
3+ trait Confusing < F > = Fn ( i32 ) where F : Fn ( u32 ) ;
4+
5+ fn alias < T : Confusing < F > , F > ( _: T , _: F ) { }
6+
7+ fn main ( ) {
8+ alias ( |_| { } , |_| { } ) ;
9+ }
You can’t perform that action at this time.
0 commit comments