Skip to content

Commit 9a38230

Browse files
committed
nyaaaaaaa
1 parent 4a71036 commit 9a38230

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

compiler/rustc_data_structures/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
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)]

compiler/rustc_middle/src/ty/context.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,6 +1506,7 @@ unsafe impl DynSync for TyCtxt<'_> {}
15061506
fn _assert_tcx_fields() {
15071507
sync::assert_dyn_sync::<&'_ GlobalCtxt<'_>>();
15081508
sync::assert_dyn_send::<&'_ GlobalCtxt<'_>>();
1509+
15091510
}
15101511

15111512
impl<'tcx> Deref for TyCtxt<'tcx> {

compiler/rustc_trait_selection/src/traits/select/mod.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff 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.

library/core/src/marker.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,8 +1384,8 @@ pub unsafe auto trait Move {
13841384
marker_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
}

0 commit comments

Comments
 (0)