Module syntax_ext::deriving[][src]

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

The compiler code necessary to implement the #[derive] extensions.

Re-exports

use rustc_data_structures::sync::Lrc;
use syntax::ast;
use syntax::ext::base::Annotatable;
use syntax::ext::base::ExtCtxt;
use syntax::ext::base::SyntaxExtension;
use syntax::ext::base::Resolver;
use syntax::ext::build::AstBuilder;
use syntax::ext::hygiene::Mark;
use syntax::ext::hygiene::SyntaxContext;
use syntax::ptr::P;
use syntax::symbol::Symbol;
use syntax_pos::Span;

Modules

bounds [
Experimental
]
clone [
Experimental
]
custom [
Experimental
]
debug [
Experimental
]
decodable [
Experimental
]

The compiler code necessary for #[derive(Decodable)]. See encodable.rs for more.

default [
Experimental
]
encodable [
Experimental
]

The compiler code necessary to implement the #[derive(Encodable)] (and Decodable, in decodable.rs) extension. The idea here is that type-defining items may be tagged with #[derive(Encodable, Decodable)].

eq [
Experimental
]
generic [
Experimental
]

Some code that abstracts away much of the boilerplate of writing derive instances for traits. Among other things it manages getting access to the fields of the 4 different sorts of structs and enum variants, as well as creating the method and impl ast instances.

hash [
Experimental
]
ord [
Experimental
]
partial_eq [
Experimental
]
partial_ord [
Experimental
]

Functions

call_intrinsic [
Experimental
]

Constructs an expression that calls an intrinsic

hygienic_type_parameter [
Experimental
]

Construct a name for the inner type parameter that can't collide with any type parameters of the item. This is achieved by starting with a base and then concatenating the names of all other type parameters.

is_builtin_trait [
Experimental
]
register_builtin_derives [
Experimental
]
warn_if_deprecated [
Experimental
]