Skip to content

Commit

Permalink
librustc: Remove visit_tydesc intrinsic.
Browse files Browse the repository at this point in the history
  • Loading branch information
luqmana committed Oct 16, 2014
1 parent ce6226e commit 7a4122a
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 175 deletions.
2 changes: 0 additions & 2 deletions src/libcore/intrinsics.rs
Expand Up @@ -327,8 +327,6 @@ extern "rust-intrinsic" {
/// Returns `true` if a type is managed (will be allocated on the local heap)
pub fn owns_managed<T>() -> bool;

pub fn visit_tydesc(td: *const TyDesc, tv: &mut TyVisitor);

/// Calculates the offset from a pointer. The offset *must* be in-bounds of
/// the object, or one-byte-past-the-end. An arithmetic overflow is also
/// undefined behaviour.
Expand Down
7 changes: 0 additions & 7 deletions src/librustc/middle/trans/intrinsic.rs
Expand Up @@ -307,13 +307,6 @@ pub fn trans_intrinsic_call<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>, node: ast::N
let tp_ty = *substs.types.get(FnSpace, 0);
C_bool(ccx, ty::type_contents(ccx.tcx(), tp_ty).owns_managed())
}
(_, "visit_tydesc") => {
let td = *llargs.get(0);
let visitor = *llargs.get(1);
let td = PointerCast(bcx, td, ccx.tydesc_type().ptr_to());
glue::call_visit_glue(bcx, visitor, td);
C_nil(ccx)
}
(_, "offset") => {
let ptr = *llargs.get(0);
let offset = *llargs.get(1);
Expand Down
19 changes: 0 additions & 19 deletions src/librustc/middle/typeck/check/mod.rs
Expand Up @@ -5578,25 +5578,6 @@ pub fn check_intrinsic_type(ccx: &CrateCtxt, it: &ast::ForeignItem) {
}
}
},
"visit_tydesc" => {
let tydesc_ty = match ty::get_tydesc_ty(ccx.tcx) {
Ok(t) => t,
Err(s) => { tcx.sess.span_fatal(it.span, s.as_slice()); }
};
let region0 = ty::ReLateBound(it.id, ty::BrAnon(0));
let region1 = ty::ReLateBound(it.id, ty::BrAnon(1));
let visitor_object_ty =
match ty::visitor_object_ty(tcx, region0, region1) {
Ok((_, vot)) => vot,
Err(s) => { tcx.sess.span_fatal(it.span, s.as_slice()); }
};

let td_ptr = ty::mk_ptr(ccx.tcx, ty::mt {
ty: tydesc_ty,
mutbl: ast::MutImmutable
});
(0, vec!( td_ptr, visitor_object_ty ), ty::mk_nil())
}
"offset" => {
(1,
vec!(
Expand Down
147 changes: 0 additions & 147 deletions src/test/run-pass/reflect-visit-type.rs

This file was deleted.

0 comments on commit 7a4122a

Please sign in to comment.