File tree 3 files changed +16
-1
lines changed 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 5
5
#![ feature( lint_reasons) ]
6
6
#![ feature( never_type) ]
7
7
#![ feature( rustc_private) ]
8
+ #![ feature( assert_matches) ]
8
9
#![ recursion_limit = "512" ]
9
10
#![ cfg_attr( feature = "deny-warnings" , deny( warnings) ) ]
10
11
#![ 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};
27
27
use rustc_trait_selection:: traits:: query:: evaluate_obligation:: InferCtxtExt as _;
28
28
use rustc_trait_selection:: traits:: query:: normalize:: QueryNormalizeExt ;
29
29
use rustc_trait_selection:: traits:: { Obligation , ObligationCause } ;
30
+ use std:: assert_matches:: debug_assert_matches;
30
31
use std:: iter;
31
32
32
33
use crate :: { match_def_path, path_res, paths} ;
@@ -259,7 +260,11 @@ pub fn implements_trait_with_env_from_iter<'tcx>(
259
260
} ) ) ,
260
261
) ;
261
262
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
+ ) ;
263
268
#[ cfg( debug_assertions) ]
264
269
assert_generic_args_match ( tcx, trait_id, trait_ref. args ) ;
265
270
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