about summary refs log tree commit diff
path: root/src/libcore/macros.rs
AgeCommit message (Collapse)AuthorLines
2017-08-08Avoid calling the column!() macro in panicest31-2/+12
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-1/+1
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-05Insert current implementation headerStefan Schindler-1/+1
2017-07-02Fix the test failure, add comment, and refactor a little bitest31-2/+2
2017-07-02Output line column info when panickingest31-4/+6
2017-06-24Auto merge of #42541 - gilescope:patch-1, r=alexcrichtonbors-8/+12
assert_eq failure message easier to read By having the left and right strings aligned with one another it helps spot the difference between the two far quicker than if they are on the same line. E.g. Before: ``` thread 'tests::test_safe_filename' panicked at 'assertion failed: `(left == right)` left: `"-aandb--S123.html"` right: `"-aandb-S123.html"`', ``` After: ``` thread 'tests::test_safe_filename' panicked at 'assertion failed: `(left == right)` left: `"-aandb--S123.html"` right: `"-aandb-S123.html"`', ``` When the strings are both on the same line it take a lot longer to spot the difference. It is a small change but the small time savings add up with repetition. This would help Rust be an excellent language to write tests in out of the box. Closes https://github.com/rust-lang/rust/issues/41615
2017-06-22Adding training commer to be more consistent with prior format.Giles Cope-4/+4
2017-06-20Whitespace changeGiles Cope-2/+2
2017-06-19Merge remote-tracking branch 'upstream/master'Giles Cope-2/+3
2017-06-19Add compile_error!Wesley Wiser-0/+11
Related to #40872
2017-06-15Add hint about the return code of panic!Stefan Schindler-1/+1
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-06-13Removing tabs. Sorry - have updated my .vimrcGiles Cope-2/+2
2017-06-13Updated tests and fixed inconsistent message on assert_eqGiles Cope-8/+10
2017-06-13updated assert_eq test, fixed incorrect assert_ne message and added test.Giles Cope-8/+12
2017-06-11Auto merge of #42155 - seanmonstar:unimplemented, r=sfacklerbors-1/+2
core: allow messages in unimplemented!() macro This makes `unimplemented!()` match `unreachable!()`, allowing a message and possible formatting to be provided to better explain what and/or why something is not implemented. I've used this myself in hyper for a while, include the type and method name, to better help while prototyping new modules, like `unimplemented!("Conn::poll_complete")`, or `unimplemented!("Conn::poll; state={:?}", state)`.
2017-06-08Assert failure message easier to readSquirrel-4/+6
By having the left and right strings above and below on the same line it helps spot the difference between the two. E.g. thread 'tests::test_safe_filename' panicked at 'assertion failed: `(left == right)` left: `"-aandb--S123.html"` right: `"-aandb-S123.html"`', When the strings are both on the same line it take a lot longer to spot the difference. It is a small change but the small time savings add up with repetition. This helps Rust be an excellent language to write tests in.
2017-06-07core: allow messages in unimplemented!() macroSean McArthur-1/+2
2017-06-05Doc changes for assert macrosMichael Kohl-5/+13
See #29381
2017-04-18Fix a few stability attributesOliver Middleton-5/+5
These show up in rustdoc so need to be correct.
2017-03-30Improve the docs for the write and writeln macrosSam Whited-38/+16
This change reduces duplication by linking the documentation for `writeln!` to `write!`. It also restructures the `write!` documentation to read in a more logical manner. Updates #29329, #29381
2017-03-13Remove function invokation parens from documentation links.Corey Farwell-2/+2
This was never established as a convention we should follow in the 'More API Documentation Conventions' RFC: https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md
2017-03-07Add missing urls in some macros docGuillaume Gomez-7/+16
2017-02-06improve error message when two-arg assert_eq! receives a trailing commaZack M. Davis-6/+6
Previously, `assert_eq!(left, right,)` (respectively, `assert_ne!(left, right,)`; note the trailing comma) would result in a confusing "requires at least a format string argument" error. In reality, a format string is optional, but the trailing comma puts us into the "match a token tree of zero or more tokens" branch of the macro (in order to support the optional format string), and passing the empty token tree into `format_args!` results in the confusing error. If instead we match a token tree of one or more tokens, we get a much more sensible "unexpected end of macro invocation" error. While we're here, fix up a stray space before a comma in the match guards. Resolves #39369.
2017-01-11Document the optional extra arguments to assert_eq!() / assert_ne!()Federico Mena Quintero-1/+12
And clarify that those arguments in assert!() are in fact formattable.
2016-12-19Allow `writeln!` without arguments, in symmetry with `println!`Tobias Bucher-1/+5
2016-11-12Fix invalid src urlGuillaume Gomez-2/+15
2016-11-09Rollup merge of #37472 - joshtriplett:doc-fmt-write-io-write, r=brsonEduard-Mihai Burtescu-0/+30
Document convention for using both fmt::Write and io::Write Using a trait's methods (like `Write::write_fmt` as used in `writeln!` and other macros) requires importing that trait directly (not just the module containing it). Both `fmt::Write` and `io::Write` provide compatible `Write::write_fmt` methods, and code can use `writeln!` and other macros on both an object implementing `fmt::Write` (such as a `String`) and an object implementing `io::Write` (such as `Stderr`). However, importing both `Write` traits produces an error due to the name conflict. The convention I've seen renames both of them on import, to `FmtWrite` and `IoWrite` respectively. Document that convention in the Rust documentation for `write!` and `writeln!`, with examples.
2016-11-02Rollup merge of #37473 - joshtriplett:doc-copyedit-write-writeln, r=alexcrichtonJonathan Turner-18/+20
Copyediting on documentation for write! and writeln! Fix various sentence fragments, missing articles, and other grammatical issues in the documentation for write! and writeln!. Also fix the links (and link names) for common return types. (Noticed when preparing https://github.com/rust-lang/rust/pull/37472 ; posted separately to avoid mixing the new documentation with copyedits to existing documentation.)
2016-11-01Rollup merge of #37316 - ollie27:docs_links, r=GuillaumeGomezGuillaume Gomez-3/+4
Fix a few links in the docs r? @steveklabnik
2016-10-29Copyediting on documentation for write! and writeln!Josh Triplett-18/+20
Fix various sentence fragments, missing articles, and other grammatical issues in the documentation for write! and writeln!. Also fix the links (and link names) for common return types.
2016-10-29Add documentation to write! and writeln! on using both io::Write and fmt::WriteJosh Triplett-0/+30
Various existing code does this, but the documentation doesn't explain how to do it.
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 doc change for include!Артём Павлов [Artyom Pavlov]-3/+1
2016-10-21libcore documentation for builtin macrosАртём Павлов [Artyom Pavlov]-0/+142
2016-10-21Fix a few links in the docsOliver Middleton-3/+4
2016-10-12Review changesNick Cameron-1/+1
2016-10-12Stabilise `?`Nick Cameron-0/+3
cc [`?` tracking issue](https://github.com/rust-lang/rust/issues/31436)
2016-09-21add assert_ne and debug_assert_ne macrosAshley Williams-0/+63
2016-09-01Document try!'s error conversion behaviourFlorian Gilcher-7/+26
2016-08-04Be more explicit about duck typingCengiz Can-20/+24
2016-08-04Use consistent spelling for word 'implementor'Cengiz Can-4/+4
2016-08-04Provide a cleaner documentation for 'write!'Cengiz Can-6/+31
2016-07-27Mention debug_assert! in assert! docPanashe M. Fundira-1/+2
2016-07-27Revert section about panic! in assert! docPanashe M. Fundira-3/+2
2016-07-27Correct minor typo in debug_assert docPanashe M. Fundira-1/+1
2016-07-27Update docs for assert! and debug_assert!Panashe M. Fundira-2/+20
2016-07-12doc: Mention that writeln! and println! always use LFMike Hommey-0/+2
Fixes #34697
2016-06-21Add message argument to `assert_eq` macroMitsunori Komatsu-1/+12