about summary refs log tree commit diff
path: root/src/libstd/macros.rs
AgeCommit message (Collapse)AuthorLines
2017-06-15Update older URLs pointing to the first edition of the BookWonwoo Choi-1/+1
`compiler-plugins.html` is moved into the Unstable Book. Explanation is slightly modified to match the change.
2017-05-20Correct some stability versionsOliver Middleton-2/+2
These were found by running tidy on stable versions of rust and finding features stabilised with the wrong version numbers.
2017-05-10Fix up stability annotations per feedback.Zack Weinberg-2/+2
2017-05-10Revise the eprint(ln)! feature.Zack Weinberg-7/+7
* Factor out the nigh-identical bodies of `_print` and `_eprint` to a helper function `print_to` (I was sorely tempted to call it `_doprnt`). * Update the issue number for the unstable `eprint` feature. * Add entries to the "unstable book" for `eprint` and `eprint_internal`. * Style corrections to the documentation.
2017-05-10Add `eprint!` and `eprintln!` macros to the prelude.Zack Weinberg-0/+45
These are exactly the same as `print!` and `println!` except that they write to stderr instead of stdout. Issue #39228.
2017-02-21Get linkchecker cleanSteve Klabnik-1/+1
This affects the book, some missed things in the reference, the grammar, and the standard library. Whew!
2017-01-19Rollup merge of #38457 - frewsxcv:include, r=GuillaumeGomezGuillaume Gomez-5/+20
Improvements to 'include' macro documentation. None
2016-12-21Fix 'unhygienically' typo.Corey Farwell-1/+1
2016-12-21Move parenthesized statement within sentence.Corey Farwell-2/+2
2016-12-21Add a more complete doc example for 'include' macro.Corey Farwell-2/+17
2016-12-19Allow `writeln!` without arguments, in symmetry with `println!`Tobias Bucher-1/+1
2016-10-27tidy/features: fix checking of lang featuresTamir Duberstein-1/+1
Removes the `STATUSES` static which duplicates truth from the pattern match in `collect_lang_features`. Fixes existing duplicates by renaming: - never_type{,_impls} on `impl`s on `!` - concat_idents{,_macro} on `macro_rules! concat_idents` Fixes #37013.
2016-10-21Small docstring changes for include_bytes and include_strАртём Павлов [Artyom Pavlov]-5/+9
2016-10-21Small doc change for include!Артём Павлов [Artyom Pavlov]-3/+4
2016-10-11Auto merge of #36825 - sbwtw:master, r=alexcrichtonbors-0/+2
add println!() macro with out any arguments lets add println!() to write "\n". like java https://docs.oracle.com/javase/7/docs/api/java/io/PrintStream.html#println()
2016-10-02Auto merge of #36404 - christopherdumas:master, r=GuillaumeGomezbors-3/+10
Documentation change to macros.rs for `includes!` I'm not sure if this documentation is clear or extensive enough, but this is just to get started on the problem, fixes issue #36387.
2016-09-30add println!() macro with out any arguments石博文-0/+2
2016-09-16Add links between format_args! macro and std::fmt::Arguments structMark-Simulacrum-4/+10
2016-09-12Fixed issue #36387christopherdumas-3/+10
2016-07-12doc: Mention that writeln! and println! always use LFMike Hommey-1/+3
Fixes #34697
2016-06-21Mark concat_idents! unstableOliver Middleton-1/+1
This is mostly just a documentation fix as I don't think stability attributes have any effect on macros.
2016-05-09rustc: Implement custom panic runtimesAlex Crichton-5/+5
This commit is an implementation of [RFC 1513] which allows applications to alter the behavior of panics at compile time. A new compiler flag, `-C panic`, is added and accepts the values `unwind` or `panic`, with the default being `unwind`. This model affects how code is generated for the local crate, skipping generation of landing pads with `-C panic=abort`. [RFC 1513]: https://github.com/rust-lang/rfcs/blob/master/text/1513-less-unwinding.md Panic implementations are then provided by crates tagged with `#![panic_runtime]` and lazily required by crates with `#![needs_panic_runtime]`. The panic strategy (`-C panic` value) of the panic runtime must match the final product, and if the panic strategy is not `abort` then the entire DAG must have the same panic strategy. With the `-C panic=abort` strategy, users can expect a stable method to disable generation of landing pads, improving optimization in niche scenarios, decreasing compile time, and decreasing output binary size. With the `-C panic=unwind` strategy users can expect the existing ability to isolate failure in Rust code from the outside world. Organizationally, this commit dismantles the `sys_common::unwind` module in favor of some bits moving part of it to `libpanic_unwind` and the rest into the `panicking` module in libstd. The custom panic runtime support is pretty similar to the custom allocator support with the only major difference being how the panic runtime is injected (takes the `-C panic` flag into account).
2016-03-07mk: Distribute fewer TARGET_CRATESAlex Crichton-12/+0
Right now everything in TARGET_CRATES is built by default for all non-fulldeps tests and is distributed by default for all target standard library packages. Currenly this includes a number of unstable crates which are rarely used such as `graphviz` and `rbml`> This commit trims down the set of `TARGET_CRATES`, moves a number of tests to `*-fulldeps` as a result, and trims down the dependencies of libtest so we can distribute fewer crates in the `rust-std` packages.
2016-02-11doc: concat_idents! macro: more on its limitations.NODA, Kai-3/+6
Signed-off-by: NODA, Kai <nodakai@gmail.com>
2016-01-19Use different numbers of `#`s when expanding documentation commentsBarosl Lee-0/+3
Any documentation comments that contain raw-string-looking sequences may pretty-print invalid code when expanding them, as the current logic always uses the `r"literal"` form, without appending any `#`s. This commit calculates the minimum number of `#`s required to wrap a comment correctly and appends `#`s appropriately. Fixes #27489.
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-40/+0
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * The `#![no_std]` attribute * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-11-29tweak cfg! doc commentAlex Burka-3/+3
2015-11-26fix docs for compiler builtin macrosAlex Burka-3/+3
2015-11-18Add missing annotations and some testsVadim Petrochenkov-0/+14
2015-09-25Change the first line of the println macro docBen S-1/+1
This makes the first lines of the print! and println! macros different. Previously, they would show up exactly the same in the documentation for the macros in libstd [1], with nothing about how one of them also prints a newline. [1]: https://doc.rust-lang.org/stable/std/#macros
2015-09-19added panic docs for print\! and println\! macrosllogiq-0/+8
2015-09-07Clarify that `include_bytes!` returns a reference to an array, not just a sliceJake Goulding-2/+2
This can be shown with the example code ```rust fn main() { let () = include_bytes!("/etc/hosts"); } Which will have the error: expected `&[u8; 195]`, found `()`
2015-08-28Auto merge of #28047 - steveklabnik:doc_print, r=alexcrichtonbors-0/+20
2015-08-27Add some examples for the print! macroSteve Klabnik-0/+20
2015-08-27fix some more unstable issue annotationsAlex Burka-1/+1
2015-08-17std: Clean up primitive integer modulesAlex Crichton-0/+9
All of the modules in the standard library were just straight reexports of those in libcore, so remove all the "macro modules" from the standard library and just reexport what's in core directly.
2015-07-27Show appropriate feature flags in docsSteve Klabnik-1/+2
2015-06-26std: clean up duplicated attrs and comment on panicRicho Healey-22/+0
2015-06-19Fix docs for column/lineSteve Klabnik-2/+2
Fixes #26424
2015-06-17std: Split the `std_misc` featureAlex Crichton-4/+2
2015-06-03Indent 4 spaces instead of 2Carol Nichols-2/+2
2015-06-03Return Ok(()) instead of Ok()Carol Nichols-2/+2
2015-06-03Use write_all instead of write_lineCarol Nichols-2/+2
2015-06-03Add prelude to get WriteCarol Nichols-0/+1
2015-06-03Improve `try!` docs to make clearer it returns `Result`.Carol Nichols-1/+27
The API documentation is not explicit enough that because `try!` returns `Err` early for you, you can only use it in functions that return `Result`. The book mentions this, but if you come across `try!` outside of the book and look it up in the docs, this restriction on the return type of the function is not particularly clear.
2015-05-09Squeeze the last bits of `task`s in documentation in favor of `thread`Barosl Lee-9/+9
An automated script was run against the `.rs` and `.md` files, subsituting every occurrence of `task` with `thread`. In the `.rs` files, only the texts in the comment blocks were affected.
2015-05-05Auto merge of #25101 - alexcrichton:fix-flaky-windows-test, r=nikomatsakisbors-2/+4
This test has deadlocked on Windows once or twice now and we've had lots of problems in the past of threads panicking when the process is being shut down. One of the two threads in this test is guaranteed to panic because of the `.unwrap()` on the `send` calls, so just call `recv` on both receivers after the test executes to ensure that both threads are dying/dead.
2015-05-04std: Join threads in select! doctestAlex Crichton-2/+4
This test has deadlocked on Windows once or twice now and we've had lots of problems in the past of threads panicking when the process is being shut down. One of the two threads in this test is guaranteed to panic because of the `.unwrap()` on the `send` calls, so just call `recv` on both receivers after the test executes to ensure that both threads are dying/dead.
2015-05-04Fix spelling errors in documentation.Joseph Crail-1/+1
2015-04-28Register new snapshotsTamir Duberstein-25/+0