summary refs log tree commit diff
path: root/src/test/compile-fail
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-16/+23
Conflicts: src/test/compile-fail/coherence-impls-copy.rs
2015-04-01rollup merge of #23945: pnkfelix/gate-u-negateAlex Crichton-1/+9
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-01rollup merge of #23948: nikomatsakis/feature-gate-rust-abiAlex Crichton-4/+25
Like it says. r? @alexcrichton
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/+6
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-01Fallout in testsNiko Matsakis-16/+24
2015-04-01Update tests for new coherence rules, and add a swatch of new testsNiko Matsakis-12/+435
probing the specifics of `Fundamental`. Fixes #23086. Fixes #23516.
2015-03-31rollup merge of #23863: pnkfelix/arith-oflo-const-evalAlex Crichton-4/+646
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-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-2/+6
2015-04-01Added tests for discriminant overflows.Felix S. Klock II-0/+320
2015-03-31std: Clean out #[deprecated] APIsAlex Crichton-50/+15
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-31Auto merge of #23549 - aturon:stab-num, r=alexcrichtonbors-5/+4
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-5/+4
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 #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.
2015-03-30Fallout in tests: largely changes to error messages.Niko Matsakis-41/+24
2015-03-30Fallout to test.Felix S. Klock II-1/+61
2015-03-30Driveby cleanup of the impl for negation, which had some kind ofNiko Matsakis-0/+28
surprising casts. This version more obviously corresponds to the builtin semantics.
2015-03-28Fix some typosVadim Petrochenkov-1/+1
2015-03-29Port of pcwalton removal of `#[unsafe_destructor]` check.Felix S. Klock II-137/+6
Earlier commits impose rules on lifetimes that make generic destructors safe; thus we no longer need the `#[unsafe_destructor]` attribute nor its associated check. ---- So remove the check for the unsafe_destructor attribute. And remove outdated compile-fail tests from when lifetime-parameteric dtors were disallowed/unsafe. In addition, when one uses the attribute without the associated feature, report that the attribute is deprecated. However, I do not think this is a breaking-change, because the attribute and feature are still currently accepted by the compiler. (After the next snapshot that has this commit, we can remove the feature itself and the attribute as well.) ---- I consider this to: Fix #22196 (techincally there is still the post snapshot work of removing the last remants of the feature and the attribute, but the ticket can still be closed in my opinion).
2015-03-27rollup merge of #23786: alexcrichton/less-quotesAlex Crichton-30/+2
Conflicts: src/test/auxiliary/static-function-pointer-aux.rs src/test/auxiliary/trait_default_method_xc_aux.rs src/test/run-pass/issue-4545.rs
2015-03-27rollup merge of #23794: brson/slicegateAlex Crichton-0/+41
Conflicts: src/test/run-pass/issue-13027.rs
2015-03-27Feature gate *all* slice patterns. #23121Brian Anderson-0/+41
Until some backwards-compatibility hazards are fixed in #23121, these need to be unstable. [breaking-change]
2015-03-27Fix fallout of removing quotes in crate namesAlex Crichton-2/+2
2015-03-27rustc: Remove support for hyphens in crate namesAlex Crichton-28/+0
This commit removes parser support for `extern crate "foo" as bar` as the renamed crate is now required to be an identifier. Additionally this commit enables hard errors on crate names that contain hyphens in them, they must now solely contain alphanumeric characters or underscores. If the crate name is inferred from the file name, however, the file name `foo-bar.rs` will have the crate name inferred as `foo_bar`. If a binary is being emitted it will have the name `foo-bar` and a library will have the name `libfoo_bar.rlib`. This commit is a breaking change for a number of reasons: * Old syntax is being removed. This was previously only issuing warnings. * The output for the compiler when input is received on stdin is now `rust_out` instead of `rust-out`. * The crate name for a crate in the file `foo-bar.rs` is now `foo_bar` which can affect infrastructure such as logging. [breaking-change]
2015-03-27rollup merge of #23741: alexcrichton/remove-int-uintAlex Crichton-40/+3
Conflicts: src/librustc/middle/ty.rs src/librustc_trans/trans/adt.rs src/librustc_typeck/check/mod.rs src/libserialize/json.rs src/test/run-pass/spawn-fn.rs
2015-03-27rollup merge of #23738: alexcrichton/snapshotsAlex Crichton-13/+0
Conflicts: src/libcollections/vec.rs
2015-03-27rollup merge of #23765: alexcrichton/remove-colon-syntaxAlex Crichton-3/+3
This syntax has been renamed to `-l static=foo` some time ago.
2015-03-27rollup merge of #23761: alexcrichton/remove-phaseAlex Crichton-34/+0
This commit removes the extra deprecation warnings and support for the old `phase` and `plugin` attributes for loading plugins.
2015-03-27rollup merge of #23740: alexcrichton/remove-deprecated-slicing-syntaxAlex Crichton-20/+0
This syntax has been deprecated for quite some time, and there were only a few remaining uses of it in the codebase anyway.
2015-03-27rollup merge of #23712: nikomatsakis/reflect-traitAlex Crichton-0/+146
This PR introduces a `Reflect` marker trait which is a supertrait of `Any`. The idea is that `Reflect` is defined for all concrete types, but is not defined for type parameters unless there is a `T:Reflect` bound. This is intended to preserve the parametricity property. This allows the `Any` interface to be stabilized without committing us to unbounded reflection that is not easily detectable by the caller. The implementation of `Reflect` relies on an experimental variant of OIBIT. This variant behaves differently for objects, since it requires that all types exposed as part of the object's *interface* are `Reflect`, but isn't concerned about other types that may be closed over. In other words, you don't have to write `Foo+Reflect` in order for `Foo: Reflect` to hold (where `Foo` is a trait). Given that `Any` is slated to stabilization and hence that we are committed to some form of reflection, the goal of this PR is to leave our options open with respect to parametricity. I see the options for full stabilization as follows (I think an RFC would be an appropriate way to confirm whichever of these three routes we take): 1. We make `Reflect` a lang-item. 2. We stabilize some version of the OIBIT variation I implemented as a general mechanism that may be appropriate for other use cases. 3. We give up on preserving parametricity here and just have `impl<T> Reflect for T` instead. In that case, `Reflect` is a harmless but not especially useful trait going forward. cc @aturon cc @alexcrichton cc @glaebhoerl (this is more-or-less your proposal, as I understood it) cc @reem (this is more-or-less what we discussed on IRC at some point) cc @FlaPer87 (vaguely pertains to OIBIT)
2015-03-26rustc: Remove support for `-l foo:static`Alex Crichton-3/+3
This syntax has been renamed to `-l static=foo` some time ago.
2015-03-26rustc: Remove old #[phase] and #[plugin]Alex Crichton-34/+0
This commit removes the extra deprecation warnings and support for the old `phase` and `plugin` attributes for loading plugins.
2015-03-26Drive-by fix for incorrect variance rule that I noticed.Niko Matsakis-0/+25
2015-03-26Implement `Reflect` trait with a variant on the standard OIBITNiko Matsakis-0/+121
semantics that tests the *interface* of trait objects, rather than what they close over.
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-40/+3
Now that support has been removed, all lingering use cases are renamed.
2015-03-26syntax: Remove parsing of old slice syntaxAlex Crichton-20/+0
This syntax has been deprecated for quite some time, and there were only a few remaining uses of it in the codebase anyway.
2015-03-26Register new snapshotsAlex Crichton-13/+0
2015-03-26Auto merge of #21237 - erickt:derive-assoc-types, r=ericktbors-0/+29
This PR adds support for associated types to the `#[derive(...)]` syntax extension. In order to do this, it switches over to using where predicates to apply the type constraints. So now this: ```rust type Trait { type Type; } #[derive(Clone)] struct Foo<A> where A: Trait { a: A, b: <A as Trait>::Type, } ``` Gets expended into this impl: ```rust impl<A: Clone> Clone for Foo<A> where A: Trait, <A as Trait>::Type: Clone, { fn clone(&self) -> Foo<T> { Foo { a: self.a.clone(), b: self.b.clone(), } } } ```
2015-03-24rollup merge of #23638: pnkfelix/fsk-reject-specialized-dropsAlex Crichton-0/+79
Reject specialized Drop impls. See Issue #8142 for discussion. This makes it illegal for a Drop impl to be more specialized than the original item. So for example, all of the following are now rejected (when they would have been blindly accepted before): ```rust struct S<A> { ... }; impl Drop for S<i8> { ... } // error: specialized to concrete type struct T<'a> { ... }; impl Drop for T<'static> { ... } // error: specialized to concrete region struct U<A> { ... }; impl<A:Clone> Drop for U<A> { ... } // error: added extra type requirement struct V<'a,'b>; impl<'a,'b:a> Drop for V<'a,'b> { ... } // error: added extra region requirement ``` Due to examples like the above, this is a [breaking-change]. (The fix is to either remove the specialization from the `Drop` impl, or to transcribe the requirements into the struct/enum definition; examples of both are shown in the PR's fixed to `libstd`.) ---- This is likely to be the last thing blocking the removal of the `#[unsafe_destructor]` attribute. Fix #8142 Fix #23584
2015-03-24rollup merge of #23546: alexcrichton/hyphensAlex Crichton-58/+60
The compiler will now issue a warning for crates that have syntax of the form `extern crate "foo" as bar`, but it will still continue to accept this syntax. Additionally, the string `foo-bar` will match the crate name `foo_bar` to assist in the transition period as well. This patch will land hopefully in tandem with a Cargo patch that will start translating all crate names to have underscores instead of hyphens. cc #23533
2015-03-24rustc: Add support for `extern crate foo as bar`Alex Crichton-58/+60
The compiler will now issue a warning for crates that have syntax of the form `extern crate "foo" as bar`, but it will still continue to accept this syntax. Additionally, the string `foo-bar` will match the crate name `foo_bar` to assist in the transition period as well. This patch will land hopefully in tandem with a Cargo patch that will start translating all crate names to have underscores instead of hyphens. cc #23533