summary refs log tree commit diff
path: root/src/test/auxiliary
AgeCommit message (Collapse)AuthorLines
2015-05-07test: update run-pass tests to not use mutable transmutingSean McArthur-2/+2
2015-04-30Regression test for issue 24687.Felix S. Klock II-0/+57
use visible characters for the multibyte character filler.
2015-04-23test: Fix fallout in testsAlex Crichton-79/+31
2015-04-15Forbid is/us suffixes. Fixes #22496Brian Anderson-1/+1
It was an oversight that this was not done in the great int upheaval. [breaking-change]
2015-04-11Expand internal-unstable to handle named field accesses and method calls.Ryan Prichard-0/+33
2015-04-10Auto merge of #24177 - alexcrichton:rustdoc, r=aturonbors-0/+288
This commit series starts out with more official test harness support for rustdoc tests, and then each commit afterwards adds a test (where appropriate). Each commit should also test and finish independently of all others (they're all pretty separable). I've uploaded a [copy of the documentation](http://people.mozilla.org/~acrichton/doc/std/) generated after all these commits were applied, and a double check on issues being closed would be greatly appreciated! I'll also browse the docs a bit and make sure nothing regressed too horribly.
2015-04-08Allow plugins to register LLVM passesKeegan McAllister-0/+28
2015-04-07rustdoc: Handle duplicate reexports listedAlex Crichton-0/+29
This ends up causing duplicate output in rustdoc. The source of these duplicates is that the item is defined in both resolve namespaces, so it's listed twice. Closes #23207
2015-04-07rustdoc: Encode ABI in all methodsAlex Crichton-0/+18
This commit ensures that the ABI of functions is propagated all the way through to the documentation. Closes #22038
2015-04-07rustdoc: Simplify predicates with paren notationAlex Crichton-0/+17
This change is aimed at improving cross-crate (inlined) notation of generic closures. The change modifies `simplify::where_predicates` to handle parenthesized notation as well as starting to handle supertrait bounds as well. This was necessary because all output constraints of closures are bound to `FnOnce` but most trait bounds are that of `FnMut`. Close #21801
2015-04-07rustdoc: Detect provided methods on inlined traitsAlex Crichton-0/+14
Closes #23864
2015-04-07rustdoc: Add a test for #21092Alex Crichton-0/+20
Close #21092
2015-04-07rustdoc: Improve handling inlined associated typesAlex Crichton-0/+38
* All bounds are now discovered through the trait to be inlined. * The `?Sized` bound now renders correctly for inlined associated types. * All `QPath`s (`<A as B>::C`) instances are rendered as `A::C` where `C` is a hyperlink to the trait `B`. This should improve at least how the docs look at least. * Supertrait bounds are now separated and display as the source lists them. Closes #20727 Closes #21145
2015-04-07rustdoc: Simplify cross-crate where clausesAlex Crichton-0/+15
Add a custom module to rustdoc which simplifies the output of `middle::ty` into a more readable form which tends to be written down anyway! Closes #20646
2015-04-07rustdoc: Link "Trait Implementations" to sourcesAlex Crichton-0/+16
All methods listed in "Trait Implementations" now hyperlink to the source trait instead of themselves, allowing easy browsing of the documentation of a trait method. Closes #17476
2015-04-07rustdoc: Add a primitive page for raw pointersAlex Crichton-0/+15
Closes #15318
2015-04-07rustdoc: Run external traits through filtersAlex Crichton-0/+16
This ensures that all external traits are run through the same filters that the rest of the AST goes through, stripping hidden function as necessary. Closes #13698
2015-04-07test: Move all run-make rustdoc tests to test/rustdocAlex Crichton-0/+90
2015-04-02Merge conflictsNiko Matsakis-3/+1
2015-04-02Fallout in testsNiko Matsakis-7/+3
2015-04-01rollup merge of #23860: nikomatsakis/copy-requires-cloneAlex Crichton-11/+11
Conflicts: src/test/compile-fail/coherence-impls-copy.rs
2015-04-01Fallout in testsNiko Matsakis-11/+11
2015-04-01Update tests for new coherence rules, and add a swatch of new testsNiko Matsakis-0/+22
probing the specifics of `Fundamental`. Fixes #23086. Fixes #23516.
2015-03-30Fallout in tests: largely changes to error messages.Niko Matsakis-8/+9
2015-03-30Fallout where types must be specified.Niko Matsakis-0/+18
This is due to a [breaking-change] to operators. The primary affected code is uses of the `Rng` trait where we used to (incorrectly) infer the right-hand-side type from the left-hand-side, in the case that the LHS type was a scalar like `i32`. The fix is to add a type annotation like `x + rng.gen::<i32>()`.
2015-03-27rollup merge of #23786: alexcrichton/less-quotesAlex Crichton-12/+9
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/+1
Conflicts: src/test/run-pass/issue-13027.rs
2015-03-27Feature gate *all* slice patterns. #23121Brian Anderson-0/+1
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-11/+7
2015-03-27Unquote all crate names without underscoresRicho Healey-2/+2
2015-03-27rollup merge of #23741: alexcrichton/remove-int-uintAlex Crichton-318/+318
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 #23712: nikomatsakis/reflect-traitAlex Crichton-4/+4
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-26Implement `Reflect` trait with a variant on the standard OIBITNiko Matsakis-4/+4
semantics that tests the *interface* of trait objects, rather than what they close over.
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-318/+318
Now that support has been removed, all lingering use cases are renamed.
2015-03-26Auto merge of #21237 - erickt:derive-assoc-types, r=ericktbors-0/+1
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-1/+1
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-0/+0
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-0/+0
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-24Reject specialized Drop impls.Felix S. Klock II-1/+1
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. Includes two new error codes for the new dropck check. Update run-pass tests to accommodate new dropck pass. Update tests and docs to reflect new destructor restriction. ---- Implementation notes: We identify Drop impl specialization by not being as parametric as the struct/enum definition via unification. More specifically: 1. Attempt unification of a skolemized instance of the struct/enum with an instance of the Drop impl's type expression where all of the impl's generics (i.e. the free variables of the type expression) have been replaced with unification variables. 2. If unification fails, then reject Drop impl as specialized. 3. If unification succeeds, check if any of the skolemized variables "leaked" into the constraint set for the inference context; if so, then reject Drop impl as specialized. 4. Otherwise, unification succeeded without leaking skolemized variables: accept the Drop impl. We identify whether a Drop impl is injecting new predicates by simply looking whether the predicate, after an appropriate substitution, appears on the struct/enum definition.
2015-03-24test: silence a warningErick Tryzelaar-0/+1
2015-03-25Add trivial cast lints.Nick Cameron-1/+1
This permits all coercions to be performed in casts, but adds lints to warn in those cases. Part of this patch moves cast checking to a later stage of type checking. We acquire obligations to check casts as part of type checking where we previously checked them. Once we have type checked a function or module, then we check any cast obligations which have been acquired. That means we have more type information available to check casts (this was crucial to making coercions work properly in place of some casts), but it means that casts cannot feed input into type inference. [breaking change] * Adds two new lints for trivial casts and trivial numeric casts, these are warn by default, but can cause errors if you build with warnings as errors. Previously, trivial numeric casts and casts to trait objects were allowed. * The unused casts lint has gone. * Interactions between casting and type inference have changed in subtle ways. Two ways this might manifest are: - You may need to 'direct' casts more with extra type information, for example, in some cases where `foo as _ as T` succeeded, you may now need to specify the type for `_` - Casts do not influence inference of integer types. E.g., the following used to type check: ``` let x = 42; let y = &x as *const u32; ``` Because the cast would inform inference that `x` must have type `u32`. This no longer applies and the compiler will fallback to `i32` for `x` and thus there will be a type error in the cast. The solution is to add more type information: ``` let x: u32 = 42; let y = &x as *const u32; ```
2015-03-23rollup merge of #23598: brson/gateAlex Crichton-15/+52
Conflicts: src/compiletest/compiletest.rs src/libcollections/lib.rs src/librustc_back/lib.rs src/libserialize/lib.rs src/libstd/lib.rs src/libtest/lib.rs src/test/run-make/rustdoc-default-impl/foo.rs src/test/run-pass/env-home-dir.rs
2015-03-23Require feature attributes, and add them where necessaryBrian Anderson-15/+52
2015-03-23Fallout in stdlib, rustdoc, rustc, etc. For most maps, converted uses ofNiko Matsakis-2/+2
`[]` on maps to `get` in rustc, since stage0 and stage1+ disagree about how to use `[]`.
2015-03-20std: Remove old_io/old_path from the preludeAlex Crichton-2/+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-19Add test case for stable import of invalid span information.Michael Woerister-0/+47
2015-03-17Rollup merge of #23385 - tamird:cleanup-whitespace, r=alexcrichtonManish Goregaokar-25/+0
r? @alexcrichton Conflicts: src/test/run-pass/test-fn-signature-verification-for-explicit-return-type.rs
2015-03-17Rollup merge of #23402 - tamird:needstest-tests, r=jakub-Manish Goregaokar-0/+11
@alexcrichton @jakub-
2015-03-16Regression test for #13077Tamir Duberstein-0/+11
Closes #13077.
2015-03-16Fallout in testing.Nick Cameron-1/+1