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 1010#![ allow( internal_features) ]
1111#![ allow( rustc:: default_hash_types) ]
1212#![ allow( rustc:: potential_query_instability) ]
13+ #![ cfg_attr( not( bootstrap) , feature( move_trait) ) ]
1314#![ deny( unsafe_op_in_unsafe_fn) ]
1415#![ doc( html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/" ) ]
1516#![ doc( rust_logo) ]
Original file line number Diff line number Diff line change @@ -1506,6 +1506,7 @@ unsafe impl DynSync for TyCtxt<'_> {}
15061506fn _assert_tcx_fields ( ) {
15071507 sync:: assert_dyn_sync :: < & ' _ GlobalCtxt < ' _ > > ( ) ;
15081508 sync:: assert_dyn_send :: < & ' _ GlobalCtxt < ' _ > > ( ) ;
1509+
15091510}
15101511
15111512impl < ' tcx > Deref for TyCtxt < ' tcx > {
Original file line number Diff line number Diff line change @@ -1884,6 +1884,20 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
18841884 break ;
18851885 }
18861886
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+
18871901 // The next highest priority is for non-global where-bounds. However, while we don't
18881902 // prefer global where-clauses here, we do bail with ambiguity when encountering both
18891903 // 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 {
13841384marker_impls ! {
13851385 #[ unstable( feature = "move_trait" , issue = "none" ) ]
13861386 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 ,
13911391}
You can’t perform that action at this time.
0 commit comments