summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2015-08-23Refactor low-level UTF-16 decoding.Simon Sapin-61/+164
* Rename `utf16_items` to `decode_utf16`. "Items" is meaningless. * Move it to `rustc_unicode::char`, exposed in `std::char`. * Generalize it to any `u16` iterable, not just `&[u16]`. * Make it yield `Result` instead of a custom `Utf16Item` enum that was isomorphic to `Result`. This enable using the `FromIterator for Result` impl. * Add a `REPLACEMENT_CHARACTER` constant. * Document how `result.unwrap_or(REPLACEMENT_CHARACTER)` replaces `Utf16Item::to_char_lossy`.
2015-08-22Fix the Mac build, again.Richard Diamond-0/+1
2015-08-22Auto merge of #27914 - pnkfelix:fix-fcnr-for-valgrind, r=alexcrichtonbors-4/+28
Fix (and extend) src/test/run-pass/foreign-call-no-runtime.rs While going over various problems signaled by valgrind when running `make check` on a build configured with `--enable-valgrind`, I discovered a bug in this test case. Namely, the test case was previously creating an `i32` (originally an `int` aka `isize` but then we changed the name and the fallback rules), and then reading from a `*const isize`. Valgrind rightly complains about this, since we are reading an 8 byte value on 64-bit systems, but in principle only 4 bytes have been initialized. (I wish this was the only valgrind unclean test, but unfortunately there are a bunch more. This was just the easiest/first one that I dissected.)
2015-08-22Auto merge of #27896 - alexcrichton:into-raw-os-prelude, r=brsonbors-2/+2
These traits were mistakenly left out of the OS-specific prelude modules when they were added.
2015-08-22Auto merge of #27565 - TimNN:dead-visit-type-in-path, r=nrcbors-0/+78
Fixes #23808, passes `make check-stage1` `run-pass` and `run-fail` locally.
2015-08-22Don't emit memcpy's for zero-sized typesBjörn Steinbrink-0/+5
2015-08-22Add missing imports to `dladdr.rs` for Mac.Richard Diamond-0/+6
2015-08-22Auto merge of #27913 - birkenfeld:remove_suffix_len, r=alexcrichtonbors-27/+0
The methods gave wrong results for TyIs and TyUs, whose suffix len should be 5 nowadays. But since they were only used for parsing, and unneeded for that since 606a309d, remove them rather than fixing. I hope this is ok to do, since all of rustc is considered unstable...
2015-08-22Auto merge of #27907 - huonw:simd, r=alexcrichtonbors-4/+7
The definitions of the rsqrte and recpe had typos, and vqtbl1q is useful for a benchmark (fannkuch-redux).
2015-08-22Move the Borrow and BorrowMut traits to libcore.Simon Sapin-110/+129
2015-08-22Auto merge of #27892 - nikomatsakis:issue-27583, r=pnkfelixbors-116/+925
Issue #27583 was caused by the fact that `LUB('a,'b)` yielded `'static`, even if there existed a region `'tcx:'a+'b`. This PR replaces the old very hacky code for computing how free regions relate to one another with something rather more robust. This solves the issue for #27583, though I think that similar bizarro bugs can no doubt arise in other ways -- the root of the problem is that the region-inference code was written in an era when a LUB always existed, but that hasn't held for some time. To *truly* solve this problem, it needs to be generalized to cope with that reality. But let's leave that battle for another day. r? @aturon
2015-08-22Auto merge of #27871 - alexcrichton:stabilize-libcore, r=aturonbors-461/+244
These commits move libcore into a state so that it's ready for stabilization, performing some minor cleanup: * The primitive modules for integers in the standard library were all removed from the source tree as they were just straight reexports of the libcore variants. * The `core::atomic` module now lives in `core::sync::atomic`. The `core::sync` module is otherwise empty, but ripe for expansion! * The `core::prelude::v1` module was stabilized after auditing that it is a subset of the standard library's prelude plus some primitive extension traits (char, str, and slice) * Some unstable-hacks for float parsing errors were shifted around to not use the same unstable hacks (e.g. the `flt2dec` module is now used for "privacy"). After this commit, the remaining large unstable functionality specific to libcore is: * `raw`, `intrinsics`, `nonzero`, `array`, `panicking`, `simd` -- these modules are all unstable or not reexported in the standard library, so they're just remaining in the same status quo as before * `num::Float` - this extension trait for floats needs to be audited for functionality (much of that is happening in #27823) and may also want to be renamed to `FloatExt` or `F32Ext`/`F64Ext`. * Should the extension traits for primitives be stabilized in libcore? I believe other unstable pieces are not isolated to just libcore but also affect the standard library. cc #27701
2015-08-22Auto merge of #27860 - m4rw3r:rustdoc_unstable_feature_issue, r=alexcrichtonbors-62/+125
Implemented #27759 Example: ![screen shot 2015-08-16 at 21 45 17](https://cloud.githubusercontent.com/assets/108100/9295040/1fb24d50-4460-11e5-8ab8-81ac5330974a.png)
2015-08-22Auto merge of #27826 - sfackler:wait-timeout-enum, r=alexcrichtonbors-21/+42
Returning a primitive bool results in a somewhat confusing API - does `true` indicate success - i.e. no timeout, or that a timeout has occurred? An explicitly named enum makes it clearer. [breaking-change] r? @alexcrichton
2015-08-22Auto merge of #27653 - Keruspe:master, r=alexcrichtonbors-2/+10
2015-08-21Add a `allow_asm` option so virtual ISA based targets (JS/PNaCl/WAsm) can ↵Richard Diamond-0/+49
disallow the asm! macro.
2015-08-21completely aborted commentNiko Matsakis-1/+6
2015-08-21move the reverse into the iteratorNiko Matsakis-2/+2
2015-08-21missed one reference to "best"Niko Matsakis-4/+5
2015-08-21rename `best_upper_bound` to `postdom_upper_bound`Niko Matsakis-9/+9
2015-08-21remove use of swap_remove and compress the list as we go insteadNiko Matsakis-13/+12
2015-08-21nits from pnkfelixNiko Matsakis-45/+76
2015-08-21Auto merge of #27613 - GSam:binop, r=nrcbors-3/+30
In the case where there are no paren in the AST, the pretty printer doesn't correctly print binary operations where precedence is concerned. Parenthesis may be missing due to some kind of expansion or manipulation of the AST. Example: Pretty printer prints Expr(*, Expr(+, 1, 1), 2) as 1 + 1 * 2, as opposed to (1 + 1) * 2 r? @nrc
2015-08-21Include cfg(test) in the referenceMatt Brubeck-0/+1
2015-08-21fix spacing issue in trpl/documentation docMatej Ľach-2/+2
2015-08-21fix accidental reversal of 'static, and add a testNiko Matsakis-1/+26
2015-08-21add final test case, correct one of the others (both versions producedNiko Matsakis-4/+22
same result)
2015-08-21add test cases suggested by pnkfelixNiko Matsakis-0/+82
2015-08-21clarify diagonal arrowsNiko Matsakis-0/+3
2015-08-21Remove outdated comment and hide variants of `c_void`Tobias Bucher-5/+6
2015-08-21Auto merge of #27837 - Gankro:weaknique, r=aturonbors-161/+239
This prepares both for the FCP of #27718 Arc: * Add previously omitted function `Arc::try_unwrap(Self) -> Result<T, Self>` * Move `arc.downgrade()` to `Arc::downgrade(&Self)` per conventions. * Deprecate `Arc::weak_count` and `Arc::strong_count` for raciness. It is almost impossible to correctly act on these results without a CAS loop on the actual fields. * Rename `Arc::make_unique` to `Arc::make_mut` to avoid uniqueness terminology and to clarify relation to `Arc::get_mut`. Rc: * Add `Rc::would_unwrap(&Self) -> bool` to introspect whether try_unwrap would succeed, because it's destructive (unlike get_mut). * Move `rc.downgrade()` to `Rc::downgrade(&Self)` per conventions. * Deprecate `Rc::weak_count` and `Rc::strong_count` for questionable utility. * Deprecate `Rc::is_unique` for questionable semantics (there are two kinds of uniqueness with Weak pointers in play). * Rename `rc.make_unique()` to `Rc::make_mut(&mut Self)` per conventions, to avoid uniqueness terminology, and to clarify the relation to `Rc::get_mut`. Notable omission: * Arc::would_unwrap is not added due to the fact that it's racy, and therefore doesn't provide much actionable information. (note: rc_would_unwrap is not proposed for FCP as it is truly experimental) r? @aturon (careful attention needs to be taken for the new Arc::try_unwrap, but intuitively it should "just work" by virtue of being semantically equivalent to Drop).
2015-08-20emphasize that doctests don't run in bin cratesAlex Burka-8/+8
2015-08-20Use handle the same way in similarly structured examplesKornel Lesiński-3/+5
2015-08-20Refactor unix backtracing. NFC.Richard Diamond-586/+681
2015-08-20book: add DST to glossaryTshepang Lekhonkhobe-0/+6
2015-08-20nomicon: insert missing wordsTshepang Lekhonkhobe-1/+1
2015-08-20nomicon: use current syntaxTshepang Lekhonkhobe-1/+1
2015-08-20Show variadic args in rustdoc output.Lee Jeffery-1/+24
2015-08-20Add a test for char::to_lowercase mapping to more than one `char`.Simon Sapin-21/+17
I was wrong about Unicode not having such language-independent mapping.
2015-08-20Fix (and extend) src/test/run-pass/foreign-call-no-runtime.rsFelix S. Klock II-4/+28
While going over various problems signaled by valgrind when running `make check` on a build configured with `--enable-valgrind`, I discovered a bug in this test case. Namely, the test case was previously creating an `i32` (originally an `int` aka `isize` but then we changed the name and the fallback rules), and then reading from a `*const isize`. Valgrind rightly complains about this, since we are reading an 8 byte value on 64-bit systems, but in principle only 4 bytes have been initialized. (I wish this was the only valgrind unclean test, but unfortunately there are a bunch more. This was just the easiest/first one that I dissected.)
2015-08-20syntax: remove suffix_len methods from LitIntTypesGeorg Brandl-27/+0
The methods gave wrong results for TyIs and TyUs, whose suffix len should be 5 nowadays. But since they were only used for parsing, and unneeded for that since 606a309d, remove them rather than fixing.
2015-08-19Add issue numbersSteven Fackler-1/+2
2015-08-19Turn TimedOut into a BarrierWaitResult style opaque typeSteven Fackler-38/+25
2015-08-19Add `TimedOut::timed_out`Steven Fackler-1/+8
2015-08-19Make Condvar::wait_timeout return an enum instead of a boolSteven Fackler-19/+45
Returning a primitive bool results in a somewhat confusing API - does `true` indicate success - i.e. no timeout, or that a timeout has occurred? An explicitly named enum makes it clearer. [breaking-change]
2015-08-19don't do deprecations yetAlexis Beingessner-5/+0
2015-08-19fallout of reworking rc and arc APIsAlexis Beingessner-8/+9
2015-08-19Rework Arc for FCP of #27718Alexis Beingessner-71/+118
* Add previously omitted function `Arc::try_unwrap(Self) -> Result<T, Self>` * Move `arc.downgrade()` to `Arc::downgrade(&Self)` per conventions. * Deprecate `Arc::weak_count` and `Arc::strong_count` for raciness. It is almost impossible to correctly act on these results without a CAS loop on the actual fields. * Rename `Arc::make_unique` to `Arc::make_mut` to avoid uniqueness terminology and to clarify relation to `Arc::get_mut`.
2015-08-19Rework Rc for FCP of #27718Alexis Beingessner-82/+117
* Add `Rc::would_unwrap(&Self) -> bool` to introspect whether try_unwrap would succeed, because it's destructive (unlike get_mut). * Move `rc.downgrade()` to `Rc::downgrade(&Self)` per conventions. * Deprecate `Rc::weak_count` and `Rc::strong_count` for questionable utility. * Deprecate `Rc::is_unique` for questionable semantics (there are two kinds of uniqueness with Weak pointers in play). * Rename `rc.make_unique()` to `Rc::make_mut(&mut Self)` per conventions, to avoid uniqueness terminology, and to clarify the relation to `Rc::get_mut`.
2015-08-19Tweak aarch64 SIMD intrinsics.Huon Wilson-4/+7
The definitions of the rsqrte and recpe had typos, and vqtbl1q is useful for a benchmark (fannkuch-redux).