Skip to content

Commit be726a1

Browse files
committed
Remove Managed
Leftovers from @-pointer times.
1 parent f191f92 commit be726a1

File tree

7 files changed

+6
-43
lines changed

7 files changed

+6
-43
lines changed

src/libcore/intrinsics.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,6 @@ extern "rust-intrinsic" {
252252
/// `Copy`, then may return `true` or `false`.
253253
pub fn needs_drop<T>() -> bool;
254254

255-
/// Returns `true` if a type is managed (will be allocated on the local heap)
256-
pub fn owns_managed<T>() -> bool;
257-
258255
/// Calculates the offset from a pointer. The offset *must* be in-bounds of
259256
/// the object, or one-byte-past-the-end. An arithmetic overflow is also
260257
/// undefined behaviour.

src/libcore/marker.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ unsafe impl Send for .. { }
5353

5454
impl<T> !Send for *const T { }
5555
impl<T> !Send for *mut T { }
56-
impl !Send for Managed { }
5756

5857
/// Types with a constant size known at compile-time.
5958
#[stable(feature = "rust1", since = "1.0.0")]
@@ -243,7 +242,6 @@ unsafe impl Sync for .. { }
243242

244243
impl<T> !Sync for *const T { }
245244
impl<T> !Sync for *mut T { }
246-
impl !Sync for Managed { }
247245

248246
/// A type which is considered "not POD", meaning that it is not
249247
/// implicitly copyable. This is typically embedded in other types to
@@ -254,14 +252,6 @@ impl !Sync for Managed { }
254252
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
255253
pub struct NoCopy;
256254

257-
/// A type which is considered managed by the GC. This is typically
258-
/// embedded in other types.
259-
#[unstable(feature = "core",
260-
reason = "likely to change with new variance strategy")]
261-
#[lang="managed_bound"]
262-
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
263-
pub struct Managed;
264-
265255
macro_rules! impls{
266256
($t: ident) => (
267257
impl<T:?Sized> Hash for $t<T> {

src/librustc/middle/lang_items.rs

Lines changed: 0 additions & 1 deletion
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

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3414,12 +3414,10 @@ def_type_content_sets! {
34143414
// Things that are owned by the value (second and third nibbles):
34153415
OwnsOwned = 0b0000_0000__0000_0001__0000,
34163416
OwnsDtor = 0b0000_0000__0000_0010__0000,
3417-
OwnsManaged /* see [1] below */ = 0b0000_0000__0000_0100__0000,
34183417
OwnsAll = 0b0000_0000__1111_1111__0000,
34193418

34203419
// Things that are reachable by the value in any way (fourth nibble):
34213420
ReachesBorrowed = 0b0000_0010__0000_0000__0000,
3422-
// ReachesManaged /* see [1] below */ = 0b0000_0100__0000_0000__0000,
34233421
ReachesMutable = 0b0000_1000__0000_0000__0000,
34243422
ReachesFfiUnsafe = 0b0010_0000__0000_0000__0000,
34253423
ReachesAll = 0b0011_1111__0000_0000__0000,
@@ -3430,13 +3428,6 @@ def_type_content_sets! {
34303428
// Things that prevent values from being considered sized
34313429
Nonsized = 0b0000_0000__0000_0000__0001,
34323430

3433-
// Bits to set when a managed value is encountered
3434-
//
3435-
// [1] Do not set the bits TC::OwnsManaged or
3436-
// TC::ReachesManaged directly, instead reference
3437-
// TC::Managed to set them both at once.
3438-
Managed = 0b0000_0100__0000_0100__0000,
3439-
34403431
// All bits
34413432
All = 0b1111_1111__1111_1111__1111
34423433
}
@@ -3451,10 +3442,6 @@ impl TypeContents {
34513442
(self.bits & tc.bits) != 0
34523443
}
34533444

3454-
pub fn owns_managed(&self) -> bool {
3455-
self.intersects(TC::OwnsManaged)
3456-
}
3457-
34583445
pub fn owns_owned(&self) -> bool {
34593446
self.intersects(TC::OwnsOwned)
34603447
}
@@ -3491,12 +3478,6 @@ impl TypeContents {
34913478
*self & TC::ReachesAll)
34923479
}
34933480

3494-
/// Includes only those bits that still apply when indirected through a managed pointer (`@`)
3495-
pub fn managed_pointer(&self) -> TypeContents {
3496-
TC::Managed | (
3497-
*self & TC::ReachesAll)
3498-
}
3499-
35003481
/// Includes only those bits that still apply when indirected through an unsafe pointer (`*`)
35013482
pub fn unsafe_pointer(&self) -> TypeContents {
35023483
*self & TC::ReachesAll
@@ -3741,9 +3722,7 @@ pub fn type_contents<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> TypeContents {
37413722

37423723
fn apply_lang_items(cx: &ctxt, did: ast::DefId, tc: TypeContents)
37433724
-> TypeContents {
3744-
if Some(did) == cx.lang_items.managed_bound() {
3745-
tc | TC::Managed
3746-
} else if Some(did) == cx.lang_items.unsafe_cell_type() {
3725+
if Some(did) == cx.lang_items.unsafe_cell_type() {
37473726
tc | TC::InteriorUnsafe
37483727
} else {
37493728
tc

src/librustc_trans/trans/intrinsic.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,10 +384,6 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
384384

385385
C_bool(ccx, bcx.fcx.type_needs_drop(tp_ty))
386386
}
387-
(_, "owns_managed") => {
388-
let tp_ty = *substs.types.get(FnSpace, 0);
389-
C_bool(ccx, ty::type_contents(ccx.tcx(), tp_ty).owns_managed())
390-
}
391387
(_, "offset") => {
392388
let ptr = llargs[0];
393389
let offset = llargs[1];

src/librustc_typeck/check/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4846,7 +4846,6 @@ pub fn check_intrinsic_type(ccx: &CrateCtxt, it: &ast::ForeignItem) {
48464846
ty::mk_nil(tcx))
48474847
}
48484848
"needs_drop" => (1, Vec::new(), ccx.tcx.types.bool),
4849-
"owns_managed" => (1, Vec::new(), ccx.tcx.types.bool),
48504849

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

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

Lines changed: 5 additions & 2 deletions
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)