File tree 2 files changed +4
-2
lines changed
compiler/rustc_middle/src/ty
src/test/ui/rfc-2632-const-trait-impl
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1054,15 +1054,15 @@ pub fn trivial_const_drop<'tcx>(ty: Ty<'tcx>) -> bool {
1054
1054
| ty:: RawPtr ( _)
1055
1055
| ty:: Ref ( ..)
1056
1056
| ty:: FnDef ( ..)
1057
- | ty:: FnPtr ( _) => true ,
1057
+ | ty:: FnPtr ( _)
1058
+ | ty:: Never => true ,
1058
1059
1059
1060
ty:: Opaque ( ..)
1060
1061
| ty:: Dynamic ( ..)
1061
1062
| ty:: Error ( _)
1062
1063
| ty:: Bound ( ..)
1063
1064
| ty:: Param ( _)
1064
1065
| ty:: Placeholder ( _)
1065
- | ty:: Never
1066
1066
| ty:: Foreign ( _)
1067
1067
| ty:: Projection ( _)
1068
1068
| ty:: Infer ( _) => false ,
Original file line number Diff line number Diff line change 3
3
#![ feature( const_trait_impl) ]
4
4
#![ feature( const_fn_trait_bound) ]
5
5
#![ feature( const_mut_refs) ]
6
+ #![ feature( never_type) ]
6
7
#![ cfg_attr( precise, feature( const_precise_live_drops) ) ]
7
8
8
9
struct S < ' a > ( & ' a mut u8 ) ;
@@ -77,6 +78,7 @@ implements_const_drop! {
77
78
& 1 ,
78
79
& 1 as * const i32 ,
79
80
ConstDropWithBound :: <( ) >,
81
+ Result :: <i32 , !>:: Ok ( 1 ) ,
80
82
}
81
83
82
84
fn main ( ) {
You can’t perform that action at this time.
0 commit comments