Skip to content

Commit a23d7e1

Browse files
committed
Remove Managed
Leftovers from @-pointer times.
1 parent 5c710b5 commit a23d7e1

File tree

7 files changed

+6
-43
lines changed

7 files changed

+6
-43
lines changed

src/libcore/intrinsics.rs

-3
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,6 @@ extern "rust-intrinsic" {
267267
/// `Copy`, then may return `true` or `false`.
268268
pub fn needs_drop<T>() -> bool;
269269

270-
/// Returns `true` if a type is managed (will be allocated on the local heap)
271-
pub fn owns_managed<T>() -> bool;
272-
273270
/// Calculates the offset from a pointer.
274271
///
275272
/// This is implemented as an intrinsic to avoid converting to and from an

src/libcore/marker.rs

-10
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ unsafe impl Send for .. { }
4343

4444
impl<T> !Send for *const T { }
4545
impl<T> !Send for *mut T { }
46-
impl !Send for Managed { }
4746

4847
/// Types with a constant size known at compile-time.
4948
#[stable(feature = "rust1", since = "1.0.0")]
@@ -212,7 +211,6 @@ unsafe impl Sync for .. { }
212211

213212
impl<T> !Sync for *const T { }
214213
impl<T> !Sync for *mut T { }
215-
impl !Sync for Managed { }
216214

217215
/// A type which is considered "not POD", meaning that it is not
218216
/// implicitly copyable. This is typically embedded in other types to
@@ -223,14 +221,6 @@ impl !Sync for Managed { }
223221
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
224222
pub struct NoCopy;
225223

226-
/// A type which is considered managed by the GC. This is typically
227-
/// embedded in other types.
228-
#[unstable(feature = "core",
229-
reason = "likely to change with new variance strategy")]
230-
#[lang="managed_bound"]
231-
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
232-
pub struct Managed;
233-
234224
macro_rules! impls{
235225
($t: ident) => (
236226
impl<T:?Sized> Hash for $t<T> {

src/librustc/middle/lang_items.rs

-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,6 @@ lets_do_this! {
334334
InvariantLifetimeItem, "invariant_lifetime", invariant_lifetime;
335335

336336
NoCopyItem, "no_copy_bound", no_copy_bound;
337-
ManagedItem, "managed_bound", managed_bound;
338337

339338
NonZeroItem, "non_zero", non_zero;
340339

src/librustc/middle/ty.rs

+1-22
Original file line numberDiff line numberDiff line change
@@ -3490,12 +3490,10 @@ def_type_content_sets! {
34903490
// Things that are owned by the value (second and third nibbles):
34913491
OwnsOwned = 0b0000_0000__0000_0001__0000,
34923492
OwnsDtor = 0b0000_0000__0000_0010__0000,
3493-
OwnsManaged /* see [1] below */ = 0b0000_0000__0000_0100__0000,
34943493
OwnsAll = 0b0000_0000__1111_1111__0000,
34953494

34963495
// Things that are reachable by the value in any way (fourth nibble):
34973496
ReachesBorrowed = 0b0000_0010__0000_0000__0000,
3498-
// ReachesManaged /* see [1] below */ = 0b0000_0100__0000_0000__0000,
34993497
ReachesMutable = 0b0000_1000__0000_0000__0000,
35003498
ReachesFfiUnsafe = 0b0010_0000__0000_0000__0000,
35013499
ReachesAll = 0b0011_1111__0000_0000__0000,
@@ -3506,13 +3504,6 @@ def_type_content_sets! {
35063504
// Things that prevent values from being considered sized
35073505
Nonsized = 0b0000_0000__0000_0000__0001,
35083506

3509-
// Bits to set when a managed value is encountered
3510-
//
3511-
// [1] Do not set the bits TC::OwnsManaged or
3512-
// TC::ReachesManaged directly, instead reference
3513-
// TC::Managed to set them both at once.
3514-
Managed = 0b0000_0100__0000_0100__0000,
3515-
35163507
// All bits
35173508
All = 0b1111_1111__1111_1111__1111
35183509
}
@@ -3527,10 +3518,6 @@ impl TypeContents {
35273518
(self.bits & tc.bits) != 0
35283519
}
35293520

3530-
pub fn owns_managed(&self) -> bool {
3531-
self.intersects(TC::OwnsManaged)
3532-
}
3533-
35343521
pub fn owns_owned(&self) -> bool {
35353522
self.intersects(TC::OwnsOwned)
35363523
}
@@ -3567,12 +3554,6 @@ impl TypeContents {
35673554
*self & TC::ReachesAll)
35683555
}
35693556

3570-
/// Includes only those bits that still apply when indirected through a managed pointer (`@`)
3571-
pub fn managed_pointer(&self) -> TypeContents {
3572-
TC::Managed | (
3573-
*self & TC::ReachesAll)
3574-
}
3575-
35763557
/// Includes only those bits that still apply when indirected through an unsafe pointer (`*`)
35773558
pub fn unsafe_pointer(&self) -> TypeContents {
35783559
*self & TC::ReachesAll
@@ -3817,9 +3798,7 @@ pub fn type_contents<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> TypeContents {
38173798

38183799
fn apply_lang_items(cx: &ctxt, did: ast::DefId, tc: TypeContents)
38193800
-> TypeContents {
3820-
if Some(did) == cx.lang_items.managed_bound() {
3821-
tc | TC::Managed
3822-
} else if Some(did) == cx.lang_items.unsafe_cell_type() {
3801+
if Some(did) == cx.lang_items.unsafe_cell_type() {
38233802
tc | TC::InteriorUnsafe
38243803
} else {
38253804
tc

src/librustc_trans/trans/intrinsic.rs

-4
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,6 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
387387

388388
C_bool(ccx, bcx.fcx.type_needs_drop(tp_ty))
389389
}
390-
(_, "owns_managed") => {
391-
let tp_ty = *substs.types.get(FnSpace, 0);
392-
C_bool(ccx, ty::type_contents(ccx.tcx(), tp_ty).owns_managed())
393-
}
394390
(_, "offset") => {
395391
let ptr = llargs[0];
396392
let offset = llargs[1];

src/librustc_typeck/check/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4945,7 +4945,6 @@ pub fn check_intrinsic_type(ccx: &CrateCtxt, it: &ast::ForeignItem) {
49454945
ty::mk_nil(tcx))
49464946
}
49474947
"needs_drop" => (1, Vec::new(), ccx.tcx.types.bool),
4948-
"owns_managed" => (1, Vec::new(), ccx.tcx.types.bool),
49494948

49504949
"type_name" => (1, Vec::new(), ty::mk_str_slice(tcx, tcx.mk_region(ty::ReStatic),
49514950
ast::MutImmutable)),

src/test/compile-fail/typeck-default-trait-impl-negation-sync.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212

1313
#![feature(optin_builtin_traits)]
1414

15-
use std::marker::Managed;
15+
struct Managed;
16+
impl !Send for Managed {}
17+
impl !Sync for Managed {}
18+
1619
use std::cell::UnsafeCell;
1720

1821
struct MySync {
@@ -46,5 +49,5 @@ fn main() {
4649
//~^ ERROR the trait `core::marker::Sync` is not implemented for the type `core::cell::UnsafeCell<u8>`
4750

4851
is_sync::<MyTypeManaged>();
49-
//~^ ERROR the trait `core::marker::Sync` is not implemented for the type `core::marker::Managed`
52+
//~^ ERROR the trait `core::marker::Sync` is not implemented for the type `Managed`
5053
}

0 commit comments

Comments
 (0)