about summary refs log tree commit diff
path: root/src/liblog
AgeCommit message (Collapse)AuthorLines
2015-01-07Replace full slice notation with index callsNick Cameron-3/+3
2015-01-05Revert "Remove i suffix in docs"Alex Crichton-2/+2
This reverts commit f031671c6ea79391eeb3e1ad8f06fe0e436103fb. Conflicts: src/libcollections/slice.rs src/libcore/iter.rs src/libstd/sync/mpsc/mod.rs src/libstd/sync/rwlock.rs
2015-01-05rollup merge of #20482: kmcallister/macro-reformAlex Crichton-16/+10
Conflicts: src/libflate/lib.rs src/libstd/lib.rs src/libstd/macros.rs src/libsyntax/feature_gate.rs src/libsyntax/parse/parser.rs src/libsyntax/show_span.rs src/test/auxiliary/macro_crate_test.rs src/test/compile-fail/lint-stability.rs src/test/run-pass/intrinsics-math.rs src/test/run-pass/tcp-connect-timeouts.rs
2015-01-05Replace #[phase] with #[plugin] / #[macro_use] / #[no_link]Keegan McAllister-14/+7
2015-01-05Remove i suffix in docsSteve Klabnik-2/+2
2015-01-05Rename macro_escape to macro_useKeegan McAllister-1/+2
In the future we want to support #[macro_use(foo, bar)] mod macros; but it's not an essential part of macro reform. Reserve the syntax for now.
2015-01-05Stop using macro_escape as an inner attributeKeegan McAllister-2/+2
In preparation for the rename.
2015-01-03sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rsJorge Aparicio-4/+4
2015-01-01std: Second pass stabilization of syncAlex Crichton-1/+1
This pass performs a second pass of stabilization through the `std::sync` module, avoiding modules/types that are being handled in other PRs (e.g. mutexes, rwlocks, condvars, and channels). The following items are now stable * `sync::atomic` * `sync::atomic::ATOMIC_BOOL_INIT` (was `INIT_ATOMIC_BOOL`) * `sync::atomic::ATOMIC_INT_INIT` (was `INIT_ATOMIC_INT`) * `sync::atomic::ATOMIC_UINT_INIT` (was `INIT_ATOMIC_UINT`) * `sync::Once` * `sync::ONCE_INIT` * `sync::Once::call_once` (was `doit`) * C == `pthread_once(..)` * Boost == `call_once(..)` * Windows == `InitOnceExecuteOnce` * `sync::Barrier` * `sync::Barrier::new` * `sync::Barrier::wait` (now returns a `bool`) * `sync::Semaphore::new` * `sync::Semaphore::acquire` * `sync::Semaphore::release` The following items remain unstable * `sync::SemaphoreGuard` * `sync::Semaphore::access` - it's unclear how this relates to the poisoning story of mutexes. * `sync::TaskPool` - the semantics of a failing task and whether a thread is re-attached to a thread pool are somewhat unclear, and the utility of this type in `sync` is question with respect to the jobs of other primitives. This type will likely become stable or move out of the standard library over time. * `sync::Future` - futures as-is have yet to be deeply re-evaluated with the recent core changes to Rust's synchronization story, and will likely become stable in the future but are unstable until that time comes. [breaking-change]
2015-01-02Fallout - change array syntax to use `;`Nick Cameron-1/+1
2014-12-31Revert "std: Re-enable at_exit()"Alex Crichton-26/+8
This reverts commit 9e224c2bf18ebf8f871efb2e1aba43ed7970ebb7. Conflicts: src/libstd/sys/windows/os.rs
2014-12-30rollup merge of #20353: alexcrichton/snapshotsAlex Crichton-95/+0
2014-12-30Register new snapshotsAlex Crichton-95/+0
2014-12-30std: Re-enable at_exit()Alex Crichton-8/+26
The new semantics of this function are that the callbacks are run when the *main thread* exits, not when all threads have exited. This implies that other threads may still be running when the `at_exit` callbacks are invoked and users need to be prepared for this situation. Users in the standard library have been audited in accordance to these new rules as well. Closes #20012
2014-12-27Fallout of changing format_args!(f, args) to f(format_args!(args)).Eduard Burtescu-2/+97
2014-12-22rollup merge of #20056: MrFloya/iter_renameAlex Crichton-1/+1
Conflicts: src/libcollections/bit.rs src/libcore/str.rs
2014-12-22Renaming of the Iter types as in RFC #344Florian Wilkens-1/+1
libcore: slice::Items -> slice::Iter, slice::MutItems -> slice::IterMut libcollections: *::Items -> *::Iter, *::MoveItems -> *::IntoIter, *::MutItems -> *::IterMut This is of course a [breaking-change].
2014-12-21Fallout of std::str stabilizationAlex Crichton-5/+5
2014-12-19liblog: use `#[deriving(Copy)]`Jorge Aparicio-5/+2
2014-12-18librustc: Always parse `macro!()`/`macro![]` as expressions if notPatrick Walton-15/+18
followed by a semicolon. This allows code like `vec![1i, 2, 3].len();` to work. This breaks code that uses macros as statements without putting semicolons after them, such as: fn main() { ... assert!(a == b) assert!(c == d) println(...); } It also breaks code that uses macros as items without semicolons: local_data_key!(foo) fn main() { println("hello world") } Add semicolons to fix this code. Those two examples can be fixed as follows: fn main() { ... assert!(a == b); assert!(c == d); println(...); } local_data_key!(foo); fn main() { println("hello world") } RFC #378. Closes #18635. [breaking-change]
2014-12-17rollup merge of #19820: alexcrichton/deprecate-some-more-libsAlex Crichton-1/+1
This commit deprecates a few more in-tree libs for their crates.io counterparts. Note that this commit does not make use of the #[deprecated] tag to prevent warnings from being generated for in-tree usage. Once #[unstable] warnings are turned on then all external users will be warned to move. These crates have all been duplicated in rust-lang/$crate repositories so development can happen independently of the in-tree copies. We can explore at a later date replacing the in-tree copies with the external copies, but at this time the libraries have changed very little over the past few months so it's unlikely for changes to be sent to both repos. cc #19260
2014-12-15rollup merge of #19710: steveklabnik/gh15449Brian Anderson-6/+5
Fixes #15499.
2014-12-14Mostly rote conversion of `proc()` to `move||` (and occasionally `Thunk::new`)Niko Matsakis-2/+2
2014-12-13Deprecate more in-tree libs for crates.ioAlex Crichton-1/+1
This commit deprecates a few more in-tree libs for their crates.io counterparts. Note that this commit does not make use of the #[deprecated] tag to prevent warnings from being generated for in-tree usage. Once #[unstable] warnings are turned on then all external users will be warned to move. These crates have all been duplicated in rust-lang/$crate repositories so development can happen independently of the in-tree copies. We can explore at a later date replacing the in-tree copies with the external copies, but at this time the libraries have changed very little over the past few months so it's unlikely for changes to be sent to both repos. cc #19260
2014-12-10Fix inappropriate ## headingsSteve Klabnik-6/+5
Fixes #15499.
2014-12-08librustc: Make `Copy` opt-in.Niko Matsakis-0/+4
This change makes the compiler no longer infer whether types (structures and enumerations) implement the `Copy` trait (and thus are implicitly copyable). Rather, you must implement `Copy` yourself via `impl Copy for MyType {}`. A new warning has been added, `missing_copy_implementations`, to warn you if a non-generic public type has been added that could have implemented `Copy` but didn't. For convenience, you may *temporarily* opt out of this behavior by using `#![feature(opt_out_copy)]`. Note though that this feature gate will never be accepted and will be removed by the time that 1.0 is released, so you should transition your code away from using it. This breaks code like: #[deriving(Show)] struct Point2D { x: int, y: int, } fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } Change this code to: #[deriving(Show)] struct Point2D { x: int, y: int, } impl Copy for Point2D {} fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } This is the backwards-incompatible part of #13231. Part of RFC #3. [breaking-change]
2014-12-06liblog: remove unnecessary `as_slice` callsJorge Aparicio-12/+3
2014-11-26Remove special casing for some meta attributesSteven Fackler-1/+0
Descriptions and licenses are handled by Cargo now, so there's no reason to keep these attributes around.
2014-11-23std: Add a new top-level thread_local moduleAlex Crichton-5/+14
This commit removes the `std::local_data` module in favor of a new `std::thread_local` module providing thread local storage. The module provides two variants of TLS: one which owns its contents and one which is based on scoped references. Each implementation has pros and cons listed in the documentation. Both flavors have accessors through a function called `with` which yield a reference to a closure provided. Both flavors also panic if a reference cannot be yielded and provide a function to test whether an access would panic or not. This is an implementation of [RFC 461][rfc] and full details can be found in that RFC. This is a breaking change due to the removal of the `std::local_data` module. All users can migrate to the new thread local system like so: thread_local!(static FOO: Rc<RefCell<Option<T>>> = Rc::new(RefCell::new(None))) The old `local_data` module inherently contained the `Rc<RefCell<Option<T>>>` as an implementation detail which must now be explicitly stated by users. [rfc]: https://github.com/rust-lang/rfcs/pull/461 [breaking-change]
2014-11-18std: Stabilize std::fmtAlex Crichton-7/+0
This commit applies the stabilization of std::fmt as outlined in [RFC 380][rfc]. There are a number of breaking changes as a part of this commit which will need to be handled to migrated old code: * A number of formatting traits have been removed: String, Bool, Char, Unsigned, Signed, and Float. It is recommended to instead use Show wherever possible or to use adaptor structs to implement other methods of formatting. * The format specifier for Boolean has changed from `t` to `b`. * The enum `FormatError` has been renamed to `Error` as well as becoming a unit struct instead of an enum. The `WriteError` variant no longer exists. * The `format_args_method!` macro has been removed with no replacement. Alter code to use the `format_args!` macro instead. * The public fields of a `Formatter` have become read-only with no replacement. Use a new formatting string to alter the formatting flags in combination with the `write!` macro. The fields can be accessed through accessor methods on the `Formatter` structure. Other than these breaking changes, the contents of std::fmt should now also all contain stability markers. Most of them are still #[unstable] or #[experimental] [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0380-stabilize-std-fmt.md [breaking-change] Closes #18904
2014-11-17Fix several typos in commentsjmu303-1/+1
liblog, libregex, librustc, libstd
2014-10-30rollup merge of #18398 : aturon/lint-conventions-2Alex Crichton-1/+1
Conflicts: src/libcollections/slice.rs src/libcore/failure.rs src/libsyntax/parse/token.rs src/test/debuginfo/basic-types-mut-globals.rs src/test/debuginfo/simple-struct.rs src/test/debuginfo/trait-pointers.rs
2014-10-29Rename fail! to panic!Steve Klabnik-3/+3
https://github.com/rust-lang/rfcs/pull/221 The current terminology of "task failure" often causes problems when writing or speaking about code. You often want to talk about the possibility of an operation that returns a Result "failing", but cannot because of the ambiguity with task failure. Instead, you have to speak of "the failing case" or "when the operation does not succeed" or other circumlocutions. Likewise, we use a "Failure" header in rustdoc to describe when operations may fail the task, but it would often be helpful to separate out a section describing the "Err-producing" case. We have been steadily moving away from task failure and toward Result as an error-handling mechanism, so we should optimize our terminology accordingly: Result-producing functions should be easy to describe. To update your code, rename any call to `fail!` to `panic!` instead. Assuming you have not created your own macro named `panic!`, this will work on UNIX based systems: grep -lZR 'fail!' . | xargs -0 -l sed -i -e 's/fail!/panic!/g' You can of course also do this by hand. [breaking-change]
2014-10-28Update code with new lint namesAaron Turon-1/+1
2014-10-10Register new snapshotsAlex Crichton-2/+2
Also convert a number of `static mut` to just a plain old `static` and remove some unsafe blocks.
2014-10-10auto merge of #17853 : alexcrichton/rust/issue-17718, r=pcwaltonbors-6/+6
This change is an implementation of [RFC 69][rfc] which adds a third kind of global to the language, `const`. This global is most similar to what the old `static` was, and if you're unsure about what to use then you should use a `const`. The semantics of these three kinds of globals are: * A `const` does not represent a memory location, but only a value. Constants are translated as rvalues, which means that their values are directly inlined at usage location (similar to a #define in C/C++). Constant values are, well, constant, and can not be modified. Any "modification" is actually a modification to a local value on the stack rather than the actual constant itself. Almost all values are allowed inside constants, whether they have interior mutability or not. There are a few minor restrictions listed in the RFC, but they should in general not come up too often. * A `static` now always represents a memory location (unconditionally). Any references to the same `static` are actually a reference to the same memory location. Only values whose types ascribe to `Sync` are allowed in a `static`. This restriction is in place because many threads may access a `static` concurrently. Lifting this restriction (and allowing unsafe access) is a future extension not implemented at this time. * A `static mut` continues to always represent a memory location. All references to a `static mut` continue to be `unsafe`. This is a large breaking change, and many programs will need to be updated accordingly. A summary of the breaking changes is: * Statics may no longer be used in patterns. Statics now always represent a memory location, which can sometimes be modified. To fix code, repurpose the matched-on-`static` to a `const`. static FOO: uint = 4; match n { FOO => { /* ... */ } _ => { /* ... */ } } change this code to: const FOO: uint = 4; match n { FOO => { /* ... */ } _ => { /* ... */ } } * Statics may no longer refer to other statics by value. Due to statics being able to change at runtime, allowing them to reference one another could possibly lead to confusing semantics. If you are in this situation, use a constant initializer instead. Note, however, that statics may reference other statics by address, however. * Statics may no longer be used in constant expressions, such as array lengths. This is due to the same restrictions as listed above. Use a `const` instead. [breaking-change] Closes #17718 [rfc]: https://github.com/rust-lang/rfcs/pull/246
2014-10-09Use the same html_root_url for all docsBrian Anderson-1/+1
2014-10-09Revert "Update html_root_url for 0.12.0 release"Brian Anderson-1/+1
This reverts commit 2288f332301b9e22db2890df256322650a7f3445.
2014-10-09log: Convert statics to constantsAlex Crichton-6/+6
2014-10-07Update html_root_url for 0.12.0 releaseBrian Anderson-1/+1
2014-09-17Fix the inverted RUST_LOG filterKevin Ballard-2/+2
RUST_LOG supports regex filtering of log messages with a syntax like `RUST_LOG=main/foo` to use the regex filter 'foo'. Unfortunately, the filter was inverted, so `RUST_LOG=main/foo` would actually show all messages except the ones containing 'foo'.
2014-08-31Rename `RawPtr::to_option()` to `RawPtr::as_ref()`Andrew Poelstra-1/+1
As outlined in https://aturon.github.io/style/naming/conversions.html `to_` functions names should only be used for expensive operations. Thus `to_option` is better named `as_option`. Also, putting type names into method names is considered bad style; what the user is really trying to get is a reference. This `as_ref` is even better. Also, we are missing a mutable version of this method. So add a new trait `RawMutPtr` with a corresponding `as_mut` methode. Finally, there is a bug in the signature of `to_option` which has been around since lifetime elision: originally the returned reference had 'static lifetime, but since the elision changes this become the lifetime of the raw pointer (which does not make sense, since the pointer lifetime and referent lifetime are unrelated). Fix the bug to return a reference with a fresh lifetime (which will be inferred from the calling context). [breaking-change]
2014-08-29doc: Runnable examples logging.Jonas Hietala-141/+236
Also use //! Instead of /*! in liblog.
2014-08-28Allow a regex filter for RUST_LOGNick Cameron-22/+127
When specifying RUST_LOG, the programmer may append `/regex` to the end of the spec. All results will then be filtered using that regex.
2014-08-11Accept empty log levelNick Cameron-1/+12
2014-07-29Rename the std::ascii::{Owned,}StrAsciiExt traits to {Owned,}AsciiExtSimon Sapin-1/+1
… and implement them on Vec<u8> / &[u8]. [breaking-change]
2014-07-11Update doc URLs for version bumpBrian Anderson-1/+1
2014-07-09Register new snapshotsAlex Crichton-2/+0
Closes #15544
2014-07-05Add #[crate_name] attributes as necessaryAlex Crichton-2/+3
2014-07-04auto merge of #15343 : alexcrichton/rust/0.11.0-release, r=brsonbors-2/+2