summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2015-04-02Tweak relese notes + rebase fixesAlex Crichton-0/+2
2015-04-01Test fixes and rebase conflicts, round 2Alex Crichton-35/+0
2015-04-01rollup merge of #23860: nikomatsakis/copy-requires-cloneAlex Crichton-142/+153
Conflicts: src/test/compile-fail/coherence-impls-copy.rs
2015-04-01rollup merge of #23945: pnkfelix/gate-u-negateAlex Crichton-9/+19
Feature-gate unsigned unary negate. Discussed in weekly meeting here: https://github.com/rust-lang/meeting-minutes/blob/master/weekly-meetings/2015-03-31.md#feature-gate--expr and also in the internals thread here: http://internals.rust-lang.org/t/forbid-unsigned-integer/752
2015-04-02Test fixes and rebase conflicts, round 2Alex Crichton-1/+3
Conflicts: src/libcore/num/mod.rs
2015-04-02fixes for fallout in tests/compile-failFelix S. Klock II-0/+6
2015-04-02partial set of fixes for fallout in tests/run-passFelix S. Klock II-8/+10
2015-04-01rollup merge of #23948: nikomatsakis/feature-gate-rust-abiAlex Crichton-4/+28
Like it says. r? @alexcrichton
2015-04-01rollup merge of #23939: nikomatsakis/fn-boxAlex Crichton-10/+9
Conflicts: src/liballoc/boxed.rs
2015-04-01Path rustdoc testNiko Matsakis-0/+3
2015-04-01Feature gate rust-call ABI.Niko Matsakis-4/+25
2015-04-02Rollup merge of #23895 - nikomatsakis:fn-trait-inheritance-add-impls, r=pnkfelixManish Goregaokar-10/+80
The primary purpose of this PR is to add blanket impls for the `Fn` traits of the following (simplified) form: impl<F:Fn> Fn for &F impl<F:FnMut> FnMut for &mut F However, this wound up requiring two changes: 1. A slight hack so that `x()` where `x: &mut F` is translated to `FnMut::call_mut(&mut *x, ())` vs `FnMut::call_mut(&mut x, ())`. This is achieved by just autoderef'ing one time when calling something whose type is `&F` or `&mut F`. 2. Making the infinite recursion test in trait matching a bit more tailored. This involves adding a notion of "matching" types that looks to see if types are potentially unifiable (it's an approximation). The PR also includes various small refactorings to the inference code that are aimed at moving the unification and other code into a library (I've got that particular change in a branch, these changes just lead the way there by removing unnecessary dependencies between the compiler and the more general unification code). Note that per rust-lang/rfcs#1023, adding impls like these would be a breaking change in the future. cc @japaric cc @alexcrichton cc @aturon Fixes #23015.
2015-04-02Rollup merge of #23867 - nikomatsakis:issue-23086-take-3, r=pnkfelixManish Goregaokar-36/+431
This PR implements rust-lang/rfcs#1023. In the process it fixes #23086 and #23516. A few impls in libcore had to be updated, but the impact is generally pretty minimal. Most of the fallout is in the tests that probed the limits of today's coherence. I tested and we were able to build the most popular crates along with iron (modulo errors around errors being sendable). Fixes #23918.
2015-04-02Rollup merge of #23066 - michaelwoerister:unreachable-if, r=pnkfelixManish Goregaokar-1/+84
This PR solves #21559 by making sure that unreachable if-expressions are not further translated. Could someone who knows their way around `trans` take a look at the changes in `controlflow.rs`? I'm not sure if any other code relies on any side-effects of translating unreachable things. cc @nikomatsakis @nrc @eddyb
2015-04-01Remove `Thunk` struct and `Invoke` trait; change `Thunk` to be an aliasNiko Matsakis-10/+9
for `Box<FnBox()>`. I found the alias was still handy because it is shorter than the fully written type. This is a [breaking-change]: convert code using `Invoke` to use `FnBox`, which is usually pretty straight-forward. Code using thunk mostly works if you change `Thunk::new => Box::new` and `foo.invoke(arg)` to `foo(arg)`.
2015-04-01Fallout in testsNiko Matsakis-142/+154
2015-04-01Update tests for new coherence rules, and add a swatch of new testsNiko Matsakis-36/+431
probing the specifics of `Fundamental`. Fixes #23086. Fixes #23516.
2015-04-01Test fixes and rebase conflictsAlex Crichton-4/+7
2015-03-31rollup merge of #23921: aturon/issue-17746Alex Crichton-0/+33
Closes #17746
2015-03-31rollup merge of #23863: pnkfelix/arith-oflo-const-evalAlex Crichton-7/+813
const_eval : add overflow-checking for {`+`, `-`, `*`, `/`, `<<`, `>>`}. One tricky detail here: There is some duplication of labor between `rustc::middle::const_eval` and `rustc_trans::trans::consts`. It might be good to explore ways to try to factor out the common structure to the two passes (by abstracting over the particular value-representation used in the compile-time interpreter). ---- Update: Rebased atop #23841 Fix #22531 Fix #23030 Fix #23221 Fix #23235
2015-04-01dealing with fallout to the tests, in particular diffs between 32- vs 64-bit ↵Felix S. Klock II-10/+18
targets. See also #23926.
2015-04-01Fixes to compile-fail error messages post-rebase.Felix S. Klock II-3/+12
2015-04-01Include feature `core` to get access to `wrapping_add`.Felix S. Klock II-0/+3
2015-04-01Test cases for checking arithmetic overflow during const eval.Felix S. Klock II-0/+301
2015-04-01Fallout from changes for overflow-checking during constant evaluation.Felix S. Klock II-5/+14
2015-04-01Added tests for discriminant overflows.Felix S. Klock II-0/+476
2015-03-31Test fixes and rebase conflicts, round 3Alex Crichton-1/+2
2015-03-31Add test for #17746Aaron Turon-0/+33
Closes #17746
2015-03-31rollup merge of #23288: alexcrichton/issue-19470Alex Crichton-8/+7
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 #23907: alexcrichton/impl-exitAlex Crichton-0/+31
This commit is an implementation of [RFC #1011][rfc] which adds an `exit` function to the standard library for immediately terminating the current process with a specified exit code. [rfc]: https://github.com/rust-lang/rfcs/pull/1011 Closes #23914
2015-03-31rollup merge of #23873: alexcrichton/remove-deprecatedAlex Crichton-226/+165
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-31rollup merge of #23875: aturon/revise-convert-2Alex Crichton-3/+0
* Marks `#[stable]` the contents of the `std::convert` module. * Added methods `PathBuf::as_path`, `OsString::as_os_str`, `String::as_str`, `Vec::{as_slice, as_mut_slice}`. * Deprecates `OsStr::from_str` in favor of a new, stable, and more general `OsStr::new`. * Adds unstable methods `OsString::from_bytes` and `OsStr::{to_bytes, to_cstring}` for ergonomic FFI usage. [breaking-change] r? @alexcrichton
2015-03-31rollup merge of #23872: huonw/eager-lexingAlex Crichton-1/+36
Conflicts: src/libsyntax/parse/lexer/mod.rs
2015-03-31std: Clean out #[deprecated] APIsAlex Crichton-226/+165
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-31rollup merge of #23886: demelev/remove_as_slice_usageAlex Crichton-2/+2
2015-03-31rollup merge of #23878: Ryman/stable_extremesAlex Crichton-0/+83
`min`-like functions now return the leftmost element/input for equal elements. `max`-like return the rightmost. Closes #23687. cc @HeroesGrave, @aturon, @alexcrichton
2015-03-31rollup merge of #23876: alexcrichton/stabilize-anyAlex Crichton-1/+0
This commit stabilizes the following APIs: * `TypeId::of` - now that it has an `Any` bound it's ready to be stable. * `Box<Any>::downcast` - now that an inherent impl on `Box<Any>` as well as `Box<Any+Send>` is allowed the `BoxAny` trait is removed in favor of these inherent methods. This is a breaking change due to the removal of the `BoxAny` trait, but consumers can simply remove imports to fix crates. [breaking-change]
2015-03-31rollup merge of #23704: hirschenberger/simd-intdiv-iceAlex Crichton-0/+2
Fixes #23339
2015-03-31std: Add a process::exit functionAlex Crichton-0/+31
This commit is an implementation of [RFC #1011][rfc] which adds an `exit` function to the standard library for immediately terminating the current process with a specified exit code. [rfc]: https://github.com/rust-lang/rfcs/pull/1011
2015-03-31rustc: Remove old_orphan_check entirelyAlex Crichton-7/+6
2015-03-31std: Remove #[old_orphan_check] from PartialEqAlex Crichton-1/+1
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-31Stabilize `std::convert` and related codeAaron Turon-3/+0
* Marks `#[stable]` the contents of the `std::convert` module. * Added methods `PathBuf::as_path`, `OsString::as_os_str`, `String::as_str`, `Vec::{as_slice, as_mut_slice}`. * Deprecates `OsStr::from_str` in favor of a new, stable, and more general `OsStr::new`. * Adds unstable methods `OsString::from_bytes` and `OsStr::{to_bytes, to_cstring}` for ergonomic FFI usage. [breaking-change]
2015-03-31rollup merge of #23549: aturon/stab-numAlex Crichton-9/+8
This commit stabilizes the `std::num` module: * The `Int` and `Float` traits are deprecated in favor of (1) the newly-added inherent methods and (2) the generic traits available in rust-lang/num. * The `Zero` and `One` traits are reintroduced in `std::num`, which together with various other traits allow you to recover the most common forms of generic programming. * The `FromStrRadix` trait, and associated free function, is deprecated in favor of inherent implementations. * A wide range of methods and constants for both integers and floating point numbers are now `#[stable]`, having been adjusted for integer guidelines. * `is_positive` and `is_negative` are renamed to `is_sign_positive` and `is_sign_negative`, in order to address #22985 * The `Wrapping` type is moved to `std::num` and stabilized; `WrappingOps` is deprecated in favor of inherent methods on the integer types, and direct implementation of operations on `Wrapping<X>` for each concrete integer type `X`. Closes #22985 Closes #21069 [breaking-change] r? @alexcrichton
2015-03-31Add tests for blanket impls.Niko Matsakis-0/+74
2015-03-31Auto merge of #23549 - aturon:stab-num, r=alexcrichtonbors-9/+8
This commit stabilizes the `std::num` module: * The `Int` and `Float` traits are deprecated in favor of (1) the newly-added inherent methods and (2) the generic traits available in rust-lang/num. * The `Zero` and `One` traits are reintroduced in `std::num`, which together with various other traits allow you to recover the most common forms of generic programming. * The `FromStrRadix` trait, and associated free function, is deprecated in favor of inherent implementations. * A wide range of methods and constants for both integers and floating point numbers are now `#[stable]`, having been adjusted for integer guidelines. * `is_positive` and `is_negative` are renamed to `is_sign_positive` and `is_sign_negative`, in order to address #22985 * The `Wrapping` type is moved to `std::num` and stabilized; `WrappingOps` is deprecated in favor of inherent methods on the integer types, and direct implementation of operations on `Wrapping<X>` for each concrete integer type `X`. Closes #22985 Closes #21069 [breaking-change] r? @alexcrichton
2015-03-31Stabilize std::numAaron Turon-9/+8
This commit stabilizes the `std::num` module: * The `Int` and `Float` traits are deprecated in favor of (1) the newly-added inherent methods and (2) the generic traits available in rust-lang/num. * The `Zero` and `One` traits are reintroduced in `std::num`, which together with various other traits allow you to recover the most common forms of generic programming. * The `FromStrRadix` trait, and associated free function, is deprecated in favor of inherent implementations. * A wide range of methods and constants for both integers and floating point numbers are now `#[stable]`, having been adjusted for integer guidelines. * `is_positive` and `is_negative` are renamed to `is_sign_positive` and `is_sign_negative`, in order to address #22985 * The `Wrapping` type is moved to `std::num` and stabilized; `WrappingOps` is deprecated in favor of inherent methods on the integer types, and direct implementation of operations on `Wrapping<X>` for each concrete integer type `X`. Closes #22985 Closes #21069 [breaking-change]
2015-03-31Port over type inference to using the new type relation stuffNiko Matsakis-4/+0
2015-03-31Combine `try` and `commit_if_ok` and make some details of inferenceNiko Matsakis-6/+6
context private.
2015-03-31Rollup merge of #23866 - alexcrichton:switch-some-orders, r=aturonManish Goregaokar-6/+5
This functions swaps the order of arguments to a few functions that previously took (output, input) parameters, but now take (input, output) parameters (in that order). The affected functions are: * ptr::copy * ptr::copy_nonoverlapping * slice::bytes::copy_memory * intrinsics::copy * intrinsics::copy_nonoverlapping Closes #22890 [breaking-change]
2015-03-31Rollup merge of #23859 - pnkfelix:fsk-lesser-box, r=nikomatsakisManish Goregaokar-1/+61
Disallow writing through mutable pointers stored in non-mut Box. Fix #14270 The fix works by making `cmt::freely_aliasable` result more fine-grained. Instead of encoding the aliasability (i.e. whether the cmt is uniquely writable or not) as an option, now pass back an enum indicating either: 1. freely-aliasable (thus not uniquely-writable), 2. non-aliasable (thus uniquely writable), or 3. unique but immutable (and thus not uniquely writable, according to proposal from issue #14270.) This is all of course a giant hack that will hopefully go away with an eventually removal of special treatment of `Box<T>` (aka `ty_unique`) from the compiler.