rustc_serialize/
lib.rs

1//! Support code for encoding and decoding types.
2
3// tidy-alphabetical-start
4#![allow(internal_features)]
5#![allow(rustc::internal)]
6#![cfg_attr(not(bootstrap), feature(sized_hierarchy))]
7#![cfg_attr(test, feature(test))]
8#![doc(
9    html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
10    html_playground_url = "https://play.rust-lang.org/",
11    test(attr(allow(unused_variables), deny(warnings)))
12)]
13#![doc(rust_logo)]
14#![feature(core_intrinsics)]
15#![feature(min_specialization)]
16#![feature(never_type)]
17#![feature(rustdoc_internals)]
18// tidy-alphabetical-end
19
20// Allows macros to refer to this crate as `::rustc_serialize`.
21#[cfg(test)]
22extern crate self as rustc_serialize;
23
24pub use self::serialize::{Decodable, Decoder, Encodable, Encoder};
25
26mod serialize;
27
28pub mod int_overflow;
29pub mod leb128;
30pub mod opaque;
31
32// This has nothing to do with `rustc_serialize` but it is convenient to define it in one place
33// for the rest of the compiler so that `cfg(bootstrap)` doesn't need to be littered throughout
34// the compiler wherever `PointeeSized` would be used. `rustc_serialize` happens to be the deepest
35// crate in the crate graph which uses `PointeeSized`.
36//
37// When bootstrap bumps, remove both the `cfg(not(bootstrap))` and `cfg(bootstrap)` lines below
38// and just import `std::marker::PointeeSized` whereever this item was used.
39
40#[cfg(not(bootstrap))]
41pub use std::marker::PointeeSized;
42
43#[cfg(bootstrap)]
44pub trait PointeeSized {}
45#[cfg(bootstrap)]
46impl<T: ?Sized> PointeeSized for T {}