summary refs log tree commit diff
path: root/src/libcore/macros.rs
AgeCommit message (Collapse)AuthorLines
2015-10-13Correct spelling in docsAndrew Paseltiner-1/+1
2015-10-09Improve docs for write!/writeln! macrosSteve Klabnik-4/+30
2015-08-28Auto merge of #28038 - durka:grep-unstable-issue-refs, r=alexcrichtonbors-2/+4
After submitting #28031, I ran a [script](https://gist.github.com/durka/a5243440697c780f669b) on the rest of src/ and found some anomalies. In this PR are the fixes that I thought were obvious (but I might be wrong!). The others I've submitted in issue #28037.
2015-08-27Some extra examples for the unimplemented! macroSteve Klabnik-0/+45
2015-08-27fix some more unstable issue annotationsAlex Burka-2/+4
2015-07-30Use $crate in core::panic!Chris Morgan-2/+2
2015-06-17core: Split apart the global `core` featureAlex Crichton-0/+1
This commit shards the broad `core` feature of the libcore library into finer grained features. This split groups together similar APIs and enables tracking each API separately, giving a better sense of where each feature is within the stabilization process. A few minor APIs were deprecated along the way: * Iterator::reverse_in_place * marker::NoCopy
2015-06-06Remove many unneeded feature annotations in the docsSteve Klabnik-3/+2
When things get stabilized, they don't always have their docs updated to remove the gate.
2015-05-13Writer -> Write in macro docsSteve Klabnik-1/+1
Fixes #25355
2015-05-09Squeeze the last bits of `task`s in documentation in favor of `thread`Barosl Lee-1/+1
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-04-07std: Deny most warnings in doctestsAlex Crichton-1/+0
Allow a few specific ones but otherwise this helps ensure that our examples are squeaky clean! Closes #18199
2015-04-03Auto merge of #23934 - lfairy:write-no-deref, r=alexcrichtonbors-1/+1
This means passing in e.g. a `Vec<u8>` or `String` will work as intended, rather than deref-ing to `&mut [u8]` or `&mut str`. [breaking-change] Closes #23768
2015-04-01Don't reborrow the target of a `write!()`Chris Wong-1/+1
This means passing in e.g. a `Vec<u8>` or `String` will work as intended, rather than deref-ing to `&mut [u8]` or `&mut str`. [breaking-change] Closes #23768
2015-03-31rollup merge of #23288: alexcrichton/issue-19470Alex Crichton-7/+5
This is a deprecated attribute that is slated for removal, and it also affects all implementors of the trait. This commit removes the attribute and fixes up implementors accordingly. The primary implementation which was lost was the ability to compare `&[T]` and `Vec<T>` (in that order). This change also modifies the `assert_eq!` macro to not consider both directions of equality, only the one given in the left/right forms to the macro. This modification is motivated due to the fact that `&[T] == Vec<T>` no longer compiles, causing hundreds of errors in unit tests in the standard library (and likely throughout the community as well). Closes #19470 [breaking-change]
2015-03-31rollup merge of #23873: alexcrichton/remove-deprecatedAlex Crichton-1/+1
Conflicts: src/libcollectionstest/fmt.rs src/libcollectionstest/lib.rs src/libcollectionstest/str.rs src/libcore/error.rs src/libstd/fs.rs src/libstd/io/cursor.rs src/libstd/os.rs src/libstd/process.rs src/libtest/lib.rs src/test/run-pass-fulldeps/compiler-calls.rs
2015-03-31std: Clean out #[deprecated] APIsAlex Crichton-1/+1
This commit cleans out a large amount of deprecated APIs from the standard library and some of the facade crates as well, updating all users in the compiler and in tests as it goes along.
2015-03-31std: Remove #[old_orphan_check] from PartialEqAlex Crichton-7/+5
This is a deprecated attribute that is slated for removal, and it also affects all implementors of the trait. This commit removes the attribute and fixes up implementors accordingly. The primary implementation which was lost was the ability to compare `&[T]` and `Vec<T>` (in that order). This change also modifies the `assert_eq!` macro to not consider both directions of equality, only the one given in the left/right forms to the macro. This modification is motivated due to the fact that `&[T] == Vec<T>` no longer compiles, causing hundreds of errors in unit tests in the standard library (and likely throughout the community as well). cc #19470 [breaking-change]
2015-03-30convert: remove FromError, use From<E> insteadSean McArthur-1/+1
This removes the FromError trait, since it can now be expressed using the new convert::Into trait. All implementations of FromError<E> where changed to From<E>, and `try!` was changed to use From::from instead. Because this removes FromError, it is a breaking change, but fixing it simply requires changing the words `FromError` to `From`, and `from_error` to `from`. [breaking-change]
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-1/+1
Now that support has been removed, all lingering use cases are renamed.
2015-03-23Add #![feature] attributes to doctestsBrian Anderson-0/+1
2015-03-20std: Remove old_io/old_path from the preludeAlex Crichton-0/+1
This commit removes the reexports of `old_io` traits as well as `old_path` types and traits from the prelude. This functionality is now all deprecated and needs to be removed to make way for other functionality like `Seek` in the `std::io` module (currently reexported as `NewSeek` in the io prelude). Closes #23377 Closes #23378
2015-03-13Remove explicit syntax highlight from docs.Joseph Crail-2/+2
2015-03-11Example -> ExamplesSteve Klabnik-5/+5
This brings comments in line with https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md#using-markdown
2015-03-06Rollup merge of #22980 - alexcrichton:debug-assertions, r=pnkfelixManish Goregaokar-10/+14
This commit is an implementation of [RFC 563][rfc] which adds a new `cfg(debug_assertions)` directive which is specially recognized and calculated by the compiler. The flag is turned off at any optimization level greater than 1 and may also be explicitly controlled through the `-C debug-assertions` flag. [rfc]: https://github.com/rust-lang/rfcs/pull/563 The `debug_assert!` and `debug_assert_eq!` macros now respect this instead of the `ndebug` variable and `ndebug` no longer holds any meaning to the standard library. Code which was previously relying on `not(ndebug)` to gate expensive code should be updated to rely on `debug_assertions` instead. Closes #22492 [breaking-change]
2015-03-05rustc: Add a debug_assertions #[cfg] directiveAlex Crichton-10/+14
This commit is an implementation of [RFC 563][rfc] which adds a new `cfg(debug_assertions)` directive which is specially recognized and calculated by the compiler. The flag is turned off at any optimization level greater than 1 and may also be explicitly controlled through the `-C debug-assertions` flag. [rfc]: https://github.com/rust-lang/rfcs/pull/563 The `debug_assert!` and `debug_assert_eq!` macros now respect this instead of the `ndebug` variable and `ndebug` no longer holds any meaning to the standard library. Code which was previously relying on `not(ndebug)` to gate expensive code should be updated to rely on `debug_assertions` instead. Closes #22492 [breaking-change]
2015-03-05Remove integer suffixes where the types in compiled code are identical.Eduard Burtescu-1/+1
2015-02-27register snapshot 880fb89Flavio Percoco-6/+0
2015-02-21Resolve barriers to changing column!() / line!() return type to u32 in ↵Brian Brooks-3/+8
#19284 . Address review comments in #21769 .
2015-02-21Resolve includeme.fragment conflict.Brian Brooks-2/+3
2015-01-25Merge remote-tracking branch 'rust-lang/master'Brian Anderson-5/+5
Conflicts: src/libcore/cmp.rs src/libcore/fmt/mod.rs src/libcore/iter.rs src/libcore/marker.rs src/libcore/num/f32.rs src/libcore/num/f64.rs src/libcore/result.rs src/libcore/str/mod.rs src/librustc/lint/builtin.rs src/librustc/lint/context.rs src/libstd/sync/mpsc/mod.rs src/libstd/sync/poison.rs
2015-01-25Moving away from deprecated i/u suffixes in libcoreAlfie John-5/+5
2015-01-23grandfathered -> rust1Brian Anderson-4/+4
2015-01-23Set unstable feature names appropriatelyBrian Anderson-2/+2
* `core` - for the core crate * `hash` - hashing * `io` - io * `path` - path * `alloc` - alloc crate * `rand` - rand crate * `collections` - collections crate * `std_misc` - other parts of std * `test` - test crate * `rustc_private` - everything else
2015-01-21Remove 'since' from unstable attributesBrian Anderson-2/+2
2015-01-21Add 'feature' and 'since' to stability attributesBrian Anderson-6/+8
2015-01-17Evaluate # fn in docsSteve Klabnik-6/+11
I searched for times when we were hiding functions with # in the documentation, and fixed them to not use it unless neccesary. I also made random improvements whenever I changed something. For example, I changed Example to Examples, for consistency. Fixes #13423
2015-01-09Re-reduce libstd macro duplicationKeegan McAllister-2/+7
The libstd definitions move to libcore, which causes some minor updates there.
2015-01-08Remove warning from the libraries.Huon Wilson-2/+2
This adds the int_uint feature to *every* library, whether or not it needs it.
2015-01-06More test fixesAlex Crichton-2/+2
2015-01-06rollup merge of #20563: cmr/macro-input-future-proofingAlex Crichton-3/+6
2015-01-06Minor fallout/update FOLLOW setsCorey Richardson-4/+4
2015-01-06Register new snapshotsAlex Crichton-7/+0
Conflicts: src/librbml/lib.rs src/libserialize/json_stage0.rs src/libserialize/serialize_stage0.rs src/libsyntax/ast.rs src/libsyntax/ext/deriving/generic/mod.rs src/libsyntax/parse/token.rs
2015-01-06Stricter rules surrounding adjacent nonterminals and sequencesCorey Richardson-1/+4
2015-01-06core: split into fmt::Show and fmt::StringSean McArthur-1/+1
fmt::Show is for debugging, and can and should be implemented for all public types. This trait is used with `{:?}` syntax. There still exists #[derive(Show)]. fmt::String is for types that faithfully be represented as a String. Because of this, there is no way to derive fmt::String, all implementations must be purposeful. It is used by the default format syntax, `{}`. This will break most instances of `{}`, since that now requires the type to impl fmt::String. In most cases, replacing `{}` with `{:?}` is the correct fix. Types that were being printed specifically for users should receive a fmt::String implementation to fix this. Part of #20013 [breaking-change]
2015-01-05Stop using macro_escape as an inner attributeKeegan McAllister-2/+0
In preparation for the rename.
2015-01-05Use $crate and macro reexport to reduce duplicated codeKeegan McAllister-22/+177
Many of libstd's macros are now re-exported from libcore and libcollections. Their libstd definitions have moved to a macros_stage0 module and can disappear after the next snapshot. Where the two crates had already diverged, I took the libstd versions as they're generally newer and better-tested. See e.g. d3c831b, which was a fix to libstd's assert_eq!() that didn't make it into libcore's. Fixes #16806.
2014-12-30Register new snapshotsAlex Crichton-53/+0
2014-12-29rollup merge of #20191: lifthrasiir/double-debug_assertAlex Crichton-11/+1
Yes, really. That definition wouldn't work anyway. This also fixes repeated entries for `debug_assert!` from libcore docs. Maybe we should warn such macro definitions in the first place?
2014-12-27Fallout of changing format_args!(f, args) to f(format_args!(args)).Eduard Burtescu-0/+34
2014-12-24core: Removed a shadowed, unused definition of `debug_assert!`.Kang Seonghoon-11/+1