about summary refs log tree commit diff
path: root/src/libstd/macros.rs
AgeCommit message (Collapse)AuthorLines
2018-05-24Add documentation about env! second argumentGuillaume Gomez-2/+15
2018-05-03update concat_idents doc stubsMichael Lamparski-2/+2
2018-04-16Remove unwanted auto-linking and updateGuillaume Gomez-2/+2
2018-04-03tweak format_args! docsAlex Burka-2/+2
Swap the variable names in the example.
2018-03-21document format_args! further wrt. Debug & Display"Mazdak Farrokhzad-0/+12
2018-03-16Auto merge of #48813 - sinkuu:build_in_assert_macro, r=alexcrichtonbors-0/+54
Make `assert` a built-in procedural macro Makes `assert` macro a built-in one without touching its functionality. This is a prerequisite for RFC 2011 (#44838).
2018-03-08Rollup merge of #48857 - Songbird0:improve_column_macro_documentation, ↵Manish Goregaokar-1/+1
r=joshtriplett Modify part of `column!` documentation. Just like `line!` documentation, I've replaced: > The returned column is not the invocation of the `column!` macro itself By > The returned column is *not necessarily* the line of the `column!` invocation itself See #46997.
2018-03-09Modify part of `column!` documentation.Anthony Defranceschi-1/+1
Just like `line!` documentation, I've replaced: > The returned column is not the invocation of the `column!` macro itself By > The returned column is *not necessarily* the line of the `column!` invocation itself See #46997.
2018-03-09Modify part of `line!` documentation.Anthony Defranceschi-1/+1
In accordance with #46997, I've replaced: > The returned line is not the invocation of the line! macro itself [...] By > The returned line is *not necessarily* the line of the `line!` invocation itself [...]
2018-03-07Make `assert` macro a built-in procedural macroShotaro Yamada-0/+54
2018-02-07update the builtin macro doc stubsMichael Lamparski-5/+20
2018-02-07libcore/libstd: fix commas in macro_rules! macrosMichael Lamparski-0/+3
BREAKING CHANGE: (or perhaps, *bugfix*) In #![no_std] applications, the following calls to `panic!` used to behave differently; they now behave the same. Old behavior: panic!("{{"); // panics with "{{" panic!("{{",); // panics with "{" New behavior: panic!("{{"); // panics with "{{" panic!("{{",); // panics with "{{" This only affects calls to `panic!` (and by proxy `assert` and `debug_assert`) with a single string literal followed by a trailing comma, and only in `#![no_std]` applications.
2018-01-08Fixed a typo in the compile_error docsAndrew Brinker-1/+1
2017-12-25Fix docs mistakeest31-1/+1
2017-12-24Make column macro output 1 based and document itest31-6/+12
2017-12-07Rollup merge of #46416 - liigo:cfg-macro, r=steveklabnikGuillaume Gomez-1/+1
doc: macro `cfg!` evaluating at compile-time
2017-12-05compile_error example blurbsHavvy-0/+5
2017-12-05No unused macro warning in compile_error example.Havvy-1/+4
2017-12-04Give compile_error macro examplesHavvy-2/+19
2017-12-01doc: macro `cfg!` evaluating at compile-timeLiigo Zhuang-1/+1
2017-11-25Make builtin macro doc stubs more accurateMichael Lamparski-6/+14
See #46242.
2017-11-19std: Add a new wasm32-unknown-unknown targetAlex Crichton-0/+36
This commit adds a new target to the compiler: wasm32-unknown-unknown. This target is a reimagining of what it looks like to generate WebAssembly code from Rust. Instead of using Emscripten which can bring with it a weighty runtime this instead is a target which uses only the LLVM backend for WebAssembly and a "custom linker" for now which will hopefully one day be direct calls to lld. Notable features of this target include: * There is zero runtime footprint. The target assumes nothing exists other than the wasm32 instruction set. * There is zero toolchain footprint beyond adding the target. No custom linker is needed, rustc contains everything. * Very small wasm modules can be generated directly from Rust code using this target. * Most of the standard library is stubbed out to return an error, but anything related to allocation works (aka `HashMap`, `Vec`, etc). * Naturally, any `#[no_std]` crate should be 100% compatible with this new target. This target is currently somewhat janky due to how linking works. The "linking" is currently unconditional whole program LTO (aka LLVM is being used as a linker). Naturally that means compiling programs is pretty slow! Eventually though this target should have a linker. This target is also intended to be quite experimental. I'm hoping that this can act as a catalyst for further experimentation in Rust with WebAssembly. Breaking changes are very likely to land to this target, so it's not recommended to rely on it in any critical capacity yet. We'll let you know when it's "production ready". --- Currently testing-wise this target is looking pretty good but isn't complete. I've got almost the entire `run-pass` test suite working with this target (lots of tests ignored, but many passing as well). The `core` test suite is still getting LLVM bugs fixed to get that working and will take some time. Relatively simple programs all seem to work though! --- It's worth nothing that you may not immediately see the "smallest possible wasm module" for the input you feed to rustc. For various reasons it's very difficult to get rid of the final "bloat" in vanilla rustc (again, a real linker should fix all this). For now what you'll have to do is: cargo install --git https://github.com/alexcrichton/wasm-gc wasm-gc foo.wasm bar.wasm And then `bar.wasm` should be the smallest we can get it! --- In any case for now I'd love feedback on this, particularly on the various integration points if you've got better ideas of how to approach them!
2017-10-22fix stringify docs in stdAlex Burka-2/+2
2017-09-10Use rvalue promotion to 'static instead of static items.Eduard-Mihai Burtescu-15/+3
2017-08-31Update bootstrap compilerAlex Crichton-10/+0
This commit updates the bootstrap compiler and clears out a number of #[cfg(stage0)] annotations and related business
2017-08-29broken links resolvedAndy Gauge-1/+1
2017-08-29fix test failures in documentation changeAndrew Gauger-2/+2
2017-08-29API docs: macros. Part of #29329 Standard Library Documentation Checklist.Andy Gauge-21/+101
2017-08-12Add complete doc example for `include_str!`.Corey Farwell-1/+18
2017-08-12Add complete doc example for `include_bytes!`.Corey Farwell-1/+18
2017-08-12Demonstrate `include!` with Rust code, not just a string slice literal.Corey Farwell-6/+11
2017-08-08Avoid calling the column!() macro in panicest31-2/+14
2017-07-27Auto merge of #43477 - est31:master, r=alexcrichtonbors-1/+1
Switch to begin_panic again In https://github.com/rust-lang/rust/pull/42938 we made the compiler emit a call to begin_panic_new in order to pass column info to it. Now with stage0 updated (https://github.com/rust-lang/rust/pull/43320), we can safely change begin_panic and start emitting calls for it again.
2017-07-25Switch to begin_panic againest31-1/+1
In https://github.com/rust-lang/rust/pull/42938 we made the compiler emit a call to begin_panic_new in order to pass column info to it. Now with stage0 updated (https://github.com/rust-lang/rust/pull/43320), we can safely change begin_panic and start emitting calls for it again.
2017-07-25Stabilize the `compile_error_macro` featureAlex Crichton-1/+1
Stabilizes: * `compile_error!` as a macro defined by rustc Closes #40872
2017-07-12Rollup merge of #42670 - dns2utf8:panic_return_code, r=steveklabnikMark Simulacrum-0/+5
Add hint about the return code of panic! I hope the link works on all cases, since the `unreachable` doc is copied to `std::` as well.
2017-07-11Wrap long lineStefan Schindler-1/+2
2017-07-05Be more specific about the implications of the panic!Stefan Schindler-1/+1
2017-07-05Insert current implementation headerStefan Schindler-0/+2
2017-07-02Output line column info when panickingest31-5/+5
2017-06-23Removed as many "```ignore" as possible.kennytm-4/+4
Replaced by adding extra imports, adding hidden code (`# ...`), modifying examples to be runnable (sorry Homura), specifying non-Rust code, and converting to should_panic, no_run, or compile_fail. Remaining "```ignore"s received an explanation why they are being ignored.
2017-06-19Add compile_error!Wesley Wiser-0/+10
Related to #40872
2017-06-15Add hint about the return code of panic!Stefan Schindler-0/+2
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