about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2015-02-07Auto merge of #21978 - Potpourri:error-extern-crate-staticlib, r=alexcrichtonbors-0/+31
Add special error for this case and help message `please recompile this crate using --crate-type lib`, also list found candidates. See issue #14416 r? @alexcrichton
2015-02-07Auto merge of #21949 - japaric:index, r=nikomatsakisbors-12/+0
closes #21630 Overloaded indexing (`&[mut] foo[bar]`) only works when `<Self as Index>::Output` is the same as `<Self as IndexMut>::Output` (see issue above). To restrict implementations of `IndexMut` that doesn't work, this PR makes `IndexMut` a supertrait over `Index`, i.e. `trait IndexMut<I>: Index<I>`, just like in the `trait DerefMut: Deref` case. This breaks all downstream implementations of `IndexMut`, in most cases this simply means removing the `type Output = ..` bit, which is now redundant, from `IndexMut` implementations: ``` diff impl Index<Foo> for Bar { type Output = Baz; .. } impl IndexMut<Foo> for Bar { - type Output = Baz; .. } ``` [breaking-change] --- r? @nikomatsakis
2015-02-06make `IndexMut` a super trait over `Index`Jorge Aparicio-12/+0
closes #21630
2015-02-07Auto merge of #21505 - GuillaumeGomez:interned_string, r=alexcrichtonbors-3/+5
It's in order to make the code more homogeneous.
2015-02-06librustdoc has been updatedGuillaumeGomez-3/+5
Fixes run build error Fix test failure Fix tests' errors
2015-02-07Rollup merge of #22009 - japaric:no-mov, r=alexcrichtonManish Goregaokar-2/+1
If you were still using `MaybeOwnedVector`, update your code to use `CowVec`. [breaking-change] --- We already removed `MaybeOwned` (the string equivalent) long time ago and with a much shorter deprecation period. It's time to let go.
2015-02-06remove the deprecated MaybeOwnedVectorJorge Aparicio-2/+1
2015-02-06Rollup merge of #21968 - nikomatsakis:issue-21965-duplicate-preds-in-env, ↵Manish Goregaokar-0/+78
r=pnkfelix We were already building a hashset to check for duplicates, but we assumed that the initial vector had no duplicates. Fixes #21965. r? @pnkfelix
2015-02-06Rollup merge of #21966 - scialex:fix-extern, r=alexcrichtonManish Goregaokar-0/+41
Also added test for it. Fixes #21928
2015-02-06Rollup merge of #21958 - brson:stable-features, r=alexcrichtonManish Goregaokar-1/+20
.... The 'stable_features' lint helps people progress from unstable to stable Rust by telling them when they no longer need a `feature` attribute because upstream Rust has declared it stable. This compares to the existing 'unstable_features' lint, which is used to implement feature staging, and triggers on *any* use of `#[feature]`.
2015-02-06Rollup merge of #21925 - sfackler:allow-missing-copy, r=alexcrichtonManish Goregaokar-3/+1
This was particularly helpful in the time just after OIBIT's implementation to make sure things that were supposed to be Copy continued to be, but it's now creates a lot of noise for types that intentionally don't want to be Copy. r? @alexcrichton
2015-02-06Rollup merge of #21955 - jbcrail:fix-test-comments, r=steveklabnikManish Goregaokar-6/+6
Just spelling corrections.
2015-02-06Rollup merge of #21983 - pnkfelix:eschew-untyped-arena-in-regions-mock-tcx, ↵Manish Goregaokar-8/+11
r=huonw Ported regions-mock-tcx to use TypedArena rather than Arena since it holds cyclic structure (which the Arena API updated for the Drop-Check-Rule cannot handle). Plus, the use of `arena::Arena` here really is not justified; the allocated values are all the same type anyway.
2015-02-06Rollup merge of #21986 - LeoTestard:identical-statics, r=eddybManish Goregaokar-0/+16
Creating two identical static expressions involving casts of pointers to arrays caused an assertion failure in librustc_trans. cc @eddyb
2015-02-06Auto merge of #21947 - bluss:full-range-syntax, r=brsonbors-29/+36
Implement step 1 of rust-lang/rfcs#702 Allows the expression `..` (without either endpoint) in general, can be used in slicing syntax `&expr[..]` where we previously wrote `&expr[]`. The old syntax &expr[] is not yet removed or warned for.
2015-02-06Improve error message, when found staticlib instead cratePotpourri-0/+31
2015-02-06Fix an ICE when translating some static expressions.Leo Testard-0/+16
Creating two identical static expressions involving casts of pointers to arrays caused an assertion failure in librustc_trans.
2015-02-06Ported regions-mock-tcx to use TypedArena rather than Arena since it holdsFelix S. Klock II-8/+11
cyclic structure (which the Arena API updated for dropck cannot handle).
2015-02-05Clean up tidy scripts, coverage, performanceBrian Anderson-7/+29
This restructures tidy.py to walk the tree itself, and improves performance considerably by not loading entire files into buffers for licenseck. Splits build rules into 'tidy', 'tidy-basic', 'tidy-binaries', 'tidy-errors', 'tidy-features'.
2015-02-05Fix licenseNiko Matsakis-0/+14
2015-02-05Now that the elaboration mechanism is suppressing defaults, we can remove ↵Niko Matsakis-0/+28
this overeager code that was pruning out ambig where-clause matches in trait selection. cc #21974.
2015-02-05Extend the solution to encompass HRTBNiko Matsakis-0/+9
2015-02-05cleanup: replace `as[_mut]_slice()` calls with deref coercionsJorge Aparicio-297/+294
2015-02-05Implement pretty-printing of `..` and update tests.Ulrik Sverdrup-25/+22
Update tests to change all `&expr[]` to `&expr[..]` to make sure pretty printing passes.
2015-02-05When elaborating predicates, purge duplicates from the initial vector.Niko Matsakis-0/+27
Fixes #21965.
2015-02-05Made external_crates feature work again.Alexander Light-0/+41
Also added test for it. Fixes #21928
2015-02-04Add a lint for writing `#[feature]` for stable features, warn by default.Brian Anderson-1/+20
The 'stable_features' lint helps people progress from unstable to stable Rust by telling them when they no longer need a `feature` attribute because upstream Rust has declared it stable. This compares to the existing 'unstable_features', which is used to implement feature staging, and triggers on *any* use of `#[feature]`.
2015-02-04Fix for misspelled comments in tests.Joseph Crail-6/+6
Just spelling corrections.
2015-02-04remove all kind annotations from closuresJorge Aparicio-209/+214
2015-02-04Implement `..` syntax for RangeFull as expressionUlrik Sverdrup-4/+14
Allows the expression `..` (without either endpoint) in general, can be used in slicing syntax `&expr[..]` where we previously wrote `&expr[]`. The old syntax &expr[] is not yet removed or warned for.
2015-02-04Auto merge of #21499 - P1start:issue-8706, r=huonwbors-0/+32
Closes #8706.
2015-02-04Auto merge of #21892 - huonw:deprecate-rand, r=alexcrichtonbors-97/+1
Use [`rand`](https://crates.io/crates/rand) and [`derive_rand`](https://crates.io/crates/derive_rand) from crates.io. [breaking-change]
2015-02-03Switch missing_copy_implementations to default-allowSteven Fackler-3/+1
This was particularly helpful in the time just after OIBIT's implementation to make sure things that were supposed to be Copy continued to be, but it's now creates a lot of noise for types that intentionally don't want to be Copy.
2015-02-03rollup merge of #21910: Manishearth/missing_stabilityAlex Crichton-41/+37
Currently, if a `#![staged_api]` crate contains an exported item without a stability marker (or inherited stability), the item is useless. This change introduces a check to ensure that all exported items have a defined stability. it also introduces the `unmarked_api` feature, which lets users import unmarked features. While this PR should in theory forbid these from existing, in practice we can't be so sure; so this lets users bypass this check instead of having to wait for the library and/or compiler to be fixed (since otherwise this is a hard error). r? @aturon
2015-02-03rollup merge of #21899: nikomatsakis/closure-unify-anyhowAlex Crichton-70/+78
This *almost* completes the job for #16440. The idea is that even if we do not know whether some closure type `C` implements `Fn` or `FnMut` (etc), we still know its argument and return types. So if we see an obligation `C : Fn(_0)`, we can unify `_0` with those argument types while still considering the obligation ambiguous and unsatisfied. This helps to make a lot of progress with type inference even before closure kind inference is done. As part of this PR, the explicit `:` syntax is removed from the AST and completely ignored. We still infer the closure kind based on the expected type if that is available. There are several reasons for this. First, deciding the closure kind earlier is always better, as it allows us to make more progress. Second, this retains a (admittedly obscure) way for users to manually specify the closure kind, which is useful for writing tests if nothing else. Finally, there are still some cases where inference can fail, so it may be useful to have this manual override. (The expectation is that we will eventually revisit an explicit syntax for specifying the closure kind, but it will not be `:` and may be some sort of generalization of the `||` syntax to handle other traits as well.) This commit does not *quite* fix #16640 because a snapshot is still needed to enable the obsolete syntax errors for explicit `&mut:` and friends. r? @eddyb as he reviewed the prior patch in this direction
2015-02-03Add new path moduleAaron Turon-6/+5
Implements [RFC 474](https://github.com/rust-lang/rfcs/pull/474); see that RFC for details/motivation for this change. This initial commit does not include additional normalization or platform-specific path extensions. These will be done in follow up commits or PRs.
2015-02-04Deprecate in-tree `rand`, `std::rand` and `#[derive(Rand)]`.Huon Wilson-97/+1
Use the crates.io crate `rand` (version 0.1 should be a drop in replacement for `std::rand`) and `rand_macros` (`#[derive_Rand]` should be a drop-in replacement). [breaking-change]
2015-02-03Rename std::path to std::old_pathAaron Turon-3/+3
As part of [RFC 474](https://github.com/rust-lang/rfcs/pull/474), this commit renames `std::path` to `std::old_path`, leaving the existing path API in place to ease migration to the new one. Updating should be as simple as adjusting imports, and the prelude still maps to the old path APIs for now. [breaking-change]
2015-02-04Fix testManish Goregaokar-41/+4
2015-02-04Add test for missing stability checkerManish Goregaokar-0/+33
2015-02-03Update compile-fail tests to use the expected type to force theNiko Matsakis-64/+72
closure kind, thereby detecting what happens if there are mismatches. Simply removing the `:` annotations caused most of these tests to pass or produce other errors, because the inference would convert the closure into a more appropriate kind. (The ability to override the inference by using the expected type is an important backdoor partly for this reason.)
2015-02-03Teach project to unify the return type even if a precise match is notNiko Matsakis-5/+5
possible. There is some amount of duplication as a result (similar to select) -- I am not happy about this but not sure how to fix it without deeper rewrites.
2015-02-03Allow closure arguments types to unify even if we can't fully resolveNiko Matsakis-1/+1
a trait obligation. Partial fix for #16440 -- closure return types are not handled yet.
2015-02-03Auto merge of #21675 - huonw:less-false-positives, r=nikomatsakisbors-4/+81
That is, when offering suggestions for unresolved method calls, avoid suggesting traits for which implementing the trait for the receiver type either makes little sense (e.g. type errors, or sugared unboxed closures), or violates coherence. The latter is approximated by ensuring that at least one of `{receiver type, trait}` is local. This isn't precisely correct due to multidispatch, but the error messages one encounters in such situation are useless more often than not; it is better to be conservative and miss some cases, than have overly many false positives (e.g. writing `some_slice.map(|x| ...)` uselessly suggested that one should implement `IteratorExt` for `&[T]`, while the correct fix is to call `.iter()`). Closes #21420.
2015-02-04Compute widths properly when displaying spans in error messagesP1start-0/+32
Closes #8706.
2015-02-03Try to only suggest implementable traits for method calls.Huon Wilson-4/+81
That is, when offering suggestions for unresolved method calls, avoid suggesting traits for which implementing the trait for the receiver type either makes little sense (e.g. type errors, or sugared unboxed closures), or violates coherence. The latter is approximated by ensuring that at least one of `{receiver type, trait}` is local. This isn't precisely correct due to multidispatch, but the error messages one encounters in such situation are useless more often than not; it is better to be conservative and miss some cases, than have overly many false positives (e.g. writing `some_slice.map(|x| ...)` uselessly suggested that one should implement `IteratorExt` for `&[T]`, while the correct fix is to call `.iter()`). Closes #21420.
2015-02-02Test fixes and rebase conflictsAlex Crichton-8/+28
2015-02-02rollup merge of #21845: Potpourri/import-syntaxAlex Crichton-0/+22
syntax like `use foo::bar::;` and `use foo:: as bar;` should be rejected, see issue #21629
2015-02-02rollup merge of #21830: japaric/for-cleanupAlex Crichton-111/+111
Conflicts: src/librustc/metadata/filesearch.rs src/librustc_back/target/mod.rs src/libstd/os.rs src/libstd/sys/windows/os.rs src/libsyntax/ext/tt/macro_parser.rs src/libsyntax/print/pprust.rs src/test/compile-fail/issue-2149.rs
2015-02-02rollup merge of #21817: edwardw/symmetric-binopAlex Crichton-3/+25
For "symmetric" binary operators, meaning the types of two sides must be equal, if the type of LHS doesn't know yet but RHS does, use that as an hint to infer LHS' type. Closes #21634