146 Commits

Author SHA1 Message Date
Eduard-Mihai Burtescu
10f66bd6e4 Use rvalue promotion to 'static instead of static items. 2017-09-10 11:20:27 +03:00
MarkMcCaskey
570ae39973 Merge branch 'master' of git://github.com/rust-lang/rust 2017-09-02 17:01:34 -04:00
Mark
e572d85e00 Merge branch 'master' into master 2017-08-31 12:49:48 -04:00
Alex Crichton
2972687d10 Update bootstrap compiler
This commit updates the bootstrap compiler and clears out a number
of #[cfg(stage0)] annotations and related business
2017-08-31 06:58:58 -07:00
MarkMcCaskey
1d69c985be update unimplemented! docs 2017-08-30 22:26:54 -04:00
Andy Gauge
b9b654924e API docs: macros. Part of #29329 Standard Library Documentation Checklist. 2017-08-29 10:30:19 -07:00
est31
b6ac9c0d30 Avoid calling the column!() macro in panic 2017-08-08 11:35:09 +02:00
Alex Crichton
20b4f86d13 Stabilize the compile_error_macro feature
Stabilizes:

* `compile_error!` as a macro defined by rustc

Closes #40872
2017-07-25 07:09:31 -07:00
Mark Simulacrum
500518ab72 Rollup merge of #42670 - dns2utf8:panic_return_code, r=steveklabnik
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-12 06:58:43 -06:00
Stefan Schindler
d5390573ba Insert current implementation header 2017-07-05 21:16:58 +02:00
est31
eb5fb21bd5 Fix the test failure, add comment, and refactor a little bit 2017-07-02 13:53:29 +02:00
est31
da887074fc Output line column info when panicking 2017-07-02 13:53:29 +02:00
bors
3cf9f5d787 Auto merge of #42541 - gilescope:patch-1, r=alexcrichton
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-24 12:18:40 +00:00
Giles Cope
940d5ca3d0 Adding training commer to be more consistent with prior format. 2017-06-22 22:18:57 +01:00
Giles Cope
7acaf18c9d Whitespace change 2017-06-20 08:30:25 +01:00
Giles Cope
4b8446a233 Merge remote-tracking branch 'upstream/master' 2017-06-19 23:00:45 +01:00
Wesley Wiser
0b29d26079 Add compile_error!
Related to #40872
2017-06-19 14:29:12 -04:00
Stefan Schindler
84b880d55e Add hint about the return code of panic! 2017-06-15 11:36:32 +02:00
Wonwoo Choi
3cb7825986 Update older URLs pointing to the first edition of the Book
`compiler-plugins.html` is moved into the Unstable Book.
Explanation is slightly modified to match the change.
2017-06-15 00:04:00 +09:00
Giles Cope
02969a7e0d Removing tabs. Sorry - have updated my .vimrc 2017-06-13 14:53:01 +01:00
Giles Cope
87cfb5431e Updated tests and fixed inconsistent message on assert_eq 2017-06-13 14:31:23 +01:00
Giles Cope
1ec1b1f1eb updated assert_eq test, fixed incorrect assert_ne message and added test. 2017-06-13 14:17:59 +01:00
bors
e2eaef8497 Auto merge of #42155 - seanmonstar:unimplemented, r=sfackler
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-11 18:56:27 +00:00
Squirrel
de8bbd2b16 Assert failure message easier to read
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-08 18:38:49 +01:00
Sean McArthur
f51771939b core: allow messages in unimplemented!() macro 2017-06-07 17:06:55 -07:00
Michael Kohl
867ed2e17d Doc changes for assert macros
See #29381
2017-06-05 16:46:12 +07:00
Oliver Middleton
fd325a1b48 Fix a few stability attributes
These show up in rustdoc so need to be correct.
2017-04-18 23:33:38 +01:00
Sam Whited
b03edb4a02 Improve the docs for the write and writeln macros
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-30 14:40:10 -05:00
Corey Farwell
e7b0f2badf Remove function invokation parens from documentation links.
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-13 21:43:18 -04:00
Guillaume Gomez
65ac1e92fe Add missing urls in some macros doc 2017-03-07 19:13:17 +01:00
Zack M. Davis
65435e14fe improve error message when two-arg assert_eq! receives a trailing comma
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-02-06 22:33:09 -08:00
Federico Mena Quintero
ff5ba731a0 Document the optional extra arguments to assert_eq!() / assert_ne!()
And clarify that those arguments in assert!() are in fact formattable.
2017-01-11 18:10:26 -06:00
Tobias Bucher
a0b346a349 Allow writeln! without arguments, in symmetry with println! 2016-12-19 16:57:23 +01:00
Guillaume Gomez
248a3d9fc0 Fix invalid src url 2016-11-12 00:30:53 +01:00
Eduard-Mihai Burtescu
e10e49d815 Rollup merge of #37472 - joshtriplett:doc-fmt-write-io-write, r=brson
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-09 20:51:17 +02:00
Jonathan Turner
3752673cbc Rollup merge of #37473 - joshtriplett:doc-copyedit-write-writeln, r=alexcrichton
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-02 15:09:41 -04:00
Guillaume Gomez
7e805eae8e Rollup merge of #37316 - ollie27:docs_links, r=GuillaumeGomez
Fix a few links in the docs

r? @steveklabnik
2016-11-01 16:15:52 +01:00
Josh Triplett
07bff08e4f 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.
2016-10-29 15:44:43 -07:00
Josh Triplett
955829cee9 Add documentation to write! and writeln! on using both io::Write and fmt::Write
Various existing code does this, but the documentation doesn't explain
how to do it.
2016-10-29 15:23:49 -07:00
Tamir Duberstein
bef1911b15
tidy/features: fix checking of lang features
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-27 21:35:57 -04:00
Артём Павлов [Artyom Pavlov]
b374c53ae6
Small doc change for include! 2016-10-21 17:44:19 +03:00
Артём Павлов [Artyom Pavlov]
ce8e4e71f8
libcore documentation for builtin macros 2016-10-21 17:23:50 +03:00
Oliver Middleton
8faa503a6b Fix a few links in the docs 2016-10-21 00:49:47 +01:00
Nick Cameron
79b5177378 Review changes 2016-10-12 08:40:23 +13:00
Nick Cameron
9bc6d26092 Stabilise ?
cc [`?` tracking issue](https://github.com/rust-lang/rust/issues/31436)
2016-10-12 08:40:22 +13:00
Ashley Williams
3d8d55787b add assert_ne and debug_assert_ne macros 2016-09-21 14:38:26 +02:00
Florian Gilcher
0f8eb81011 Document try!'s error conversion behaviour 2016-09-01 19:16:19 +02:00
Cengiz Can
c630beaed7 Be more explicit about duck typing 2016-08-04 04:33:50 +03:00
Cengiz Can
800aa92aa3 Use consistent spelling for word 'implementor' 2016-08-04 03:55:37 +03:00
Cengiz Can
15be66dc04 Provide a cleaner documentation for 'write!' 2016-08-04 03:11:50 +03:00