about summary refs log tree commit diff
path: root/src/libcore/macros.rs
AgeCommit message (Collapse)AuthorLines
2016-05-18Remove unnecessary parens in macroSeo Sanghyeon-1/+1
2016-04-12Clarify try! doc exampleSzabolcs Berecz-1/+1
The original is correct, but a bit misleading.
2016-03-08doc: Fix a bunch of broken linksAlex Crichton-4/+4
A few categories: * Links into compiler docs were just all removed as we're not generating compiler docs. * Move up one more level to forcibly go to std docs to fix inlined documentation across the facade crates.
2015-12-29Correct the documentation of debug_assert_eqSteve Klabnik-3/+3
Also, make its panic description identical in wording to assert_eq. Fixes #30600
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-14/+38
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-12Auto merge of #29544 - Ryman:reduce_doc_warnings, r=steveklabnikbors-0/+2
Did this alphabetically, so I didn't see [how `std` was doing things](https://dxr.mozilla.org/rust/source/src/libstd/lib.rs#215) till I was nearly finished. If you prefer to add crate-level-whitelists like std instead of test-level, I can rebase with that strategy. A number of these commits can probably be dropped as the crates don't have much to test, and are deprecated. Let me know which if any to drop! (can also squash after review if desired) r? @steveklabnik
2015-11-12Auto merge of #29770 - ollie27:assert_eq_unsized, r=alexcrichtonbors-1/+1
`format_args!` doesn't support none Sized types so we should just pass it the references to `left_val` and `right_val`. The following works: ```rust assert!([1, 2, 3][..] == vec![1, 2, 3][..]) ``` So I would expect this to as well: ```rust assert_eq!([1, 2, 3][..], vec![1, 2, 3][..]) ``` But it fails with "error: the trait `core::marker::Sized` is not implemented for the type `[_]` [E0277]" I don't know if this change will have any nasty side effects I don't understand.
2015-11-12libcore: deny warnings in doctestsKevin Butler-0/+2
2015-11-12docs: Fix variable nameKohei Hasegawa-6/+6
2015-11-11Allow none Sized types in assert_eq!Oliver Middleton-1/+1
format_args! doesn't support none Sized types so we should just pass it the references to left_val and right_val. This fixes `assert_eq!([1, 2, 3][..], vec![1, 2, 3][..])` for example.
2015-10-28Mention in the docs, that `assert!` has a second version with a custom messageMarcell Pardavi-0/+5
I recently discovered that this is not mentioned in the docs, only in the examples, and it's not evident for people coming from C++ r? @steveklabnik
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