File tree Expand file tree Collapse file tree 4 files changed +20
-4
lines changed
rustc_data_structures/src
rustc_trait_selection/src/traits/select Expand file tree Collapse file tree 4 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 10
10
#![ allow( internal_features) ]
11
11
#![ allow( rustc:: default_hash_types) ]
12
12
#![ allow( rustc:: potential_query_instability) ]
13
+ #![ cfg_attr( not( bootstrap) , feature( move_trait) ) ]
13
14
#![ deny( unsafe_op_in_unsafe_fn) ]
14
15
#![ doc( html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/" ) ]
15
16
#![ doc( rust_logo) ]
Original file line number Diff line number Diff line change @@ -1506,6 +1506,7 @@ unsafe impl DynSync for TyCtxt<'_> {}
1506
1506
fn _assert_tcx_fields ( ) {
1507
1507
sync:: assert_dyn_sync :: < & ' _ GlobalCtxt < ' _ > > ( ) ;
1508
1508
sync:: assert_dyn_send :: < & ' _ GlobalCtxt < ' _ > > ( ) ;
1509
+
1509
1510
}
1510
1511
1511
1512
impl < ' tcx > Deref for TyCtxt < ' tcx > {
Original file line number Diff line number Diff line change @@ -1884,6 +1884,20 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
1884
1884
break ;
1885
1885
}
1886
1886
1887
+ if is_default_auto_trait {
1888
+ // Need to prefer alias-bound over env candidates.
1889
+ let alias_bound = candidates
1890
+ . iter ( )
1891
+ . filter_map ( |c| if let ProjectionCandidate ( i) = c. candidate { Some ( i) } else { None } )
1892
+ . try_reduce ( |c1, c2| if has_non_region_infer { None } else { Some ( c1. min ( c2) ) } ) ;
1893
+ match alias_bound {
1894
+ Some ( Some ( index) ) => return Some ( ProjectionCandidate ( index) ) ,
1895
+ Some ( None ) => { }
1896
+ None => return None ,
1897
+ }
1898
+
1899
+ }
1900
+
1887
1901
// The next highest priority is for non-global where-bounds. However, while we don't
1888
1902
// prefer global where-clauses here, we do bail with ambiguity when encountering both
1889
1903
// a global and a non-global where-clause.
Original file line number Diff line number Diff line change @@ -1384,8 +1384,8 @@ pub unsafe auto trait Move {
1384
1384
marker_impls ! {
1385
1385
#[ unstable( feature = "move_trait" , issue = "none" ) ]
1386
1386
unsafe Move for
1387
- { T : ?Sized + PointeeSized } * const T ,
1388
- { T : ?Sized + PointeeSized } * mut T ,
1389
- { T : ?Sized + PointeeSized } & T ,
1390
- { T : ?Sized + PointeeSized } & mut T ,
1387
+ { T : ?Sized + PointeeSized + ? Move } * const T ,
1388
+ { T : ?Sized + PointeeSized + ? Move } * mut T ,
1389
+ { T : ?Sized + PointeeSized + ? Move } & T ,
1390
+ { T : ?Sized + PointeeSized + ? Move } & mut T ,
1391
1391
}
You can’t perform that action at this time.
0 commit comments