From 8eaf17bca2674293eba0ea10056d5c77b6352086 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Thu, 20 Jun 2019 11:52:31 +0300 Subject: Introduce built-in macros through libcore --- src/libstd/lib.rs | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) (limited to 'src/libstd/lib.rs') diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index fbc68c610ee..722c08a22a6 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -221,14 +221,15 @@ #![cfg_attr(test, feature(print_internals, set_stdio, test, update_panic_count))] #![cfg_attr(all(target_vendor = "fortanix", target_env = "sgx"), - feature(global_asm, slice_index_methods, - decl_macro, coerce_unsized, sgx_platform, ptr_wrapping_offset_from))] + feature(slice_index_methods, decl_macro, coerce_unsized, + sgx_platform, ptr_wrapping_offset_from))] #![cfg_attr(all(test, target_vendor = "fortanix", target_env = "sgx"), feature(fixed_size_array, maybe_uninit_extra))] // std is implemented with unstable features, many of which are internal // compiler details that will never be stable // NB: the following list is sorted to minimize merge conflicts. +#![cfg_attr(not(bootstrap), feature(__rust_unstable_column))] #![feature(alloc_error_handler)] #![feature(alloc_layout_extra)] #![feature(allocator_api)] @@ -251,6 +252,7 @@ #![feature(const_cstr_unchecked)] #![feature(const_raw_ptr_deref)] #![feature(core_intrinsics)] +#![feature(custom_test_frameworks)] #![feature(doc_alias)] #![feature(doc_cfg)] #![feature(doc_keyword)] @@ -262,7 +264,9 @@ #![feature(exhaustive_patterns)] #![feature(external_doc)] #![feature(fn_traits)] +#![feature(format_args_nl)] #![feature(generator_trait)] +#![feature(global_asm)] #![feature(hash_raw_entry)] #![feature(hashmap_internals)] #![feature(int_error_internals)] @@ -272,6 +276,7 @@ #![feature(libc)] #![feature(link_args)] #![feature(linkage)] +#![feature(log_syntax)] #![feature(maybe_uninit_ref)] #![feature(maybe_uninit_slice)] #![feature(mem_take)] @@ -303,6 +308,7 @@ #![feature(thread_local)] #![feature(todo_macro)] #![feature(toowned_clone_into)] +#![feature(trace_macros)] #![feature(try_reserve)] #![feature(unboxed_closures)] #![feature(untagged_unions)] @@ -510,6 +516,36 @@ mod std_detect; #[cfg(not(test))] pub use std_detect::detect; +// Document built-in macros in the crate root for consistency with libcore and existing tradition. +// FIXME: Attribute and derive macros are not reexported because rustdoc renders them +// as reexports rather than as macros, and that's not what we want. +#[cfg(rustdoc)] +#[stable(feature = "builtin_macro_prelude", since = "1.38.0")] +pub use crate::prelude::v1::{ + __rust_unstable_column, + asm, + assert, + cfg, + column, + compile_error, + concat, + concat_idents, + env, + file, + format_args, + format_args_nl, + global_asm, + include, + include_bytes, + include_str, + line, + log_syntax, + module_path, + option_env, + stringify, + trace_macros, +}; + // Include a number of private modules that exist solely to provide // the rustdoc documentation for primitive types. Using `include!` // because rustdoc only looks for these modules at the crate level. -- cgit 1.4.1-3-g733a5