Skip to content

Remove reflection #18064

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 13 commits into from
Closed
9 changes: 4 additions & 5 deletions mk/crates.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

TARGET_CRATES := libc std green native flate arena glob term semver \
uuid serialize sync getopts collections num test time rand \
url log regex graphviz core rbml rlibc alloc debug rustrt \
url log regex graphviz core rbml rlibc alloc rustrt \
unicode
HOST_CRATES := syntax rustc rustdoc fourcc hexfloat regex_macros fmt_macros \
rustc_llvm rustc_back
Expand All @@ -63,20 +63,19 @@ DEPS_libc := core
DEPS_rlibc := core
DEPS_unicode := core
DEPS_alloc := core libc native:jemalloc
DEPS_debug := std
DEPS_rustrt := alloc core libc collections native:rustrt_native
DEPS_std := core libc rand alloc collections rustrt sync unicode \
native:rust_builtin native:backtrace
DEPS_graphviz := std
DEPS_green := std native:context_switch
DEPS_native := std
DEPS_syntax := std term serialize log fmt_macros debug arena libc
DEPS_syntax := std term serialize log fmt_macros arena libc
DEPS_rustc := syntax flate arena serialize getopts rbml \
time log graphviz debug rustc_llvm rustc_back
time log graphviz rustc_llvm rustc_back
DEPS_rustc_llvm := native:rustllvm libc std
DEPS_rustc_back := std syntax rustc_llvm flate log libc
DEPS_rustdoc := rustc native:hoedown serialize getopts \
test time debug
test time
DEPS_flate := std native:miniz
DEPS_arena := std
DEPS_graphviz := std
Expand Down
6 changes: 1 addition & 5 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,7 @@ This is a list of behaviour not considered *unsafe* in Rust terms, but that may
be undesired.

* Deadlocks
* Reading data from private fields (`std::repr`, `format!("{:?}", x)`)
* Reading data from private fields (`std::repr`)
* Leaks due to reference count cycles, even in the global heap
* Exiting without calling destructors
* Sending signals
Expand Down Expand Up @@ -2279,8 +2279,6 @@ These types help drive the compiler's analysis
: The lifetime parameter should be considered invariant
* `malloc`
: Allocate memory on the managed heap.
* `opaque`
: ___Needs filling in___
* `owned_box`
: ___Needs filling in___
* `stack_exhausted`
Expand All @@ -2295,8 +2293,6 @@ These types help drive the compiler's analysis
: The type parameter should be considered invariant
* `ty_desc`
: ___Needs filling in___
* `ty_visitor`
: ___Needs filling in___

> **Note:** This list is likely to become out of date. We should auto-generate
> it from `librustc/middle/lang_items.rs`.
Expand Down
2 changes: 0 additions & 2 deletions src/liballoc/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,6 @@ mod tests {

assert_eq!((*arc_v)[2], 3);
assert_eq!((*arc_v)[4], 5);

info!("{:?}", arc_v);
}

#[test]
Expand Down
1 change: 0 additions & 1 deletion src/liballoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ extern crate libc;

// Allow testing this library

#[cfg(test)] extern crate debug;
#[cfg(test)] extern crate native;
#[cfg(test)] #[phase(plugin, link)] extern crate std;
#[cfg(test)] #[phase(plugin, link)] extern crate log;
Expand Down
5 changes: 1 addition & 4 deletions src/libcollections/hash/sip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ mod tests {
debug!("siphash test {}: {}", t, buf);
let vec = u8to64_le!(vecs[t], 0);
let out = hash_with_keys(k0, k1, &Bytes(buf.as_slice()));
debug!("got {:?}, expected {:?}", out, vec);
debug!("got {}, expected {}", out, vec);
assert_eq!(vec, out);

state_full.reset();
Expand All @@ -412,9 +412,6 @@ mod tests {
let v = to_hex_str(&vecs[t]);
debug!("{}: ({}) => inc={} full={}", t, v, i, f);

debug!("full state {:?}", state_full);
debug!("inc state {:?}", state_inc);

assert_eq!(f, i);
assert_eq!(f, v);

Expand Down
1 change: 0 additions & 1 deletion src/libcollections/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ extern crate alloc;

#[cfg(test)] extern crate native;
#[cfg(test)] extern crate test;
#[cfg(test)] extern crate debug;

#[cfg(test)] #[phase(plugin, link)] extern crate std;
#[cfg(test)] #[phase(plugin, link)] extern crate log;
Expand Down
20 changes: 10 additions & 10 deletions src/libcollections/ringbuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,21 +551,21 @@ mod tests {
assert_eq!(d.len(), 3u);
d.push(137);
assert_eq!(d.len(), 4u);
debug!("{:?}", d.front());
debug!("{}", d.front());
assert_eq!(*d.front().unwrap(), 42);
debug!("{:?}", d.back());
debug!("{}", d.back());
assert_eq!(*d.back().unwrap(), 137);
let mut i = d.pop_front();
debug!("{:?}", i);
debug!("{}", i);
assert_eq!(i, Some(42));
i = d.pop();
debug!("{:?}", i);
debug!("{}", i);
assert_eq!(i, Some(137));
i = d.pop();
debug!("{:?}", i);
debug!("{}", i);
assert_eq!(i, Some(137));
i = d.pop();
debug!("{:?}", i);
debug!("{}", i);
assert_eq!(i, Some(17));
assert_eq!(d.len(), 0u);
d.push(3);
Expand All @@ -576,10 +576,10 @@ mod tests {
assert_eq!(d.len(), 3u);
d.push_front(1);
assert_eq!(d.len(), 4u);
debug!("{:?}", d.get(0));
debug!("{:?}", d.get(1));
debug!("{:?}", d.get(2));
debug!("{:?}", d.get(3));
debug!("{}", d.get(0));
debug!("{}", d.get(1));
debug!("{}", d.get(2));
debug!("{}", d.get(3));
assert_eq!(*d.get(0), 1);
assert_eq!(*d.get(1), 2);
assert_eq!(*d.get(2), 3);
Expand Down
6 changes: 4 additions & 2 deletions src/libcore/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,21 @@ pub struct TyDesc {
pub drop_glue: GlueFn,

// Called by reflection visitor to visit a value of type `T`
#[cfg(stage0)]
pub visit_glue: GlueFn,

// Name corresponding to the type
pub name: &'static str,
}

#[cfg(stage0)]
#[lang="opaque"]
pub enum Opaque { }

#[cfg(stage0)]
pub type Disr = u64;

#[cfg(stage0)]
#[lang="ty_visitor"]
pub trait TyVisitor {
fn visit_bot(&mut self) -> bool;
Expand Down Expand Up @@ -327,8 +331,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
53 changes: 0 additions & 53 deletions src/libdebug/fmt.rs

This file was deleted.

33 changes: 0 additions & 33 deletions src/libdebug/lib.rs

This file was deleted.

Loading