summary refs log tree commit diff
path: root/src/test/run-pass
AgeCommit message (Collapse)AuthorLines
2015-12-02Disable the null check elimination passBjörn Steinbrink-0/+24
This pass causes mis-optimizations in some cases and is probably no longer really important for us, so let's disable it for now. Fixes #30081
2015-11-21backport: Fix hygiene regression in patternsVadim Petrochenkov-0/+45
2015-11-04Move test file to run-fail, since it does an unwrapNiko Matsakis-26/+0
2015-11-04Don't "double check" var-sub-var constraints, which are handled inNiko Matsakis-0/+26
expansion already by growing the RHS to be bigger than LHS (all the way to `'static` if necessary). This is needed because contraction doesn't handle givens. Fixes #28934.
2015-11-04Regression test for #29048. Fixes #29048.Niko Matsakis-0/+21
2015-10-27Auto merge of #26421 - nham:fix_21546, r=pnkfelixbors-15/+0
Fixes #21546.
2015-10-27Auto merge of #26848 - oli-obk:const_fn_const_eval, r=pnkfelixbors-23/+39
this has the funky side-effect of also allowing constant evaluation of function calls to functions that are not `const fn` as long as `check_const` didn't mark that function `NOT_CONST` It's still not possible to call a normal function from a `const fn`, but let statements' initialization value can get const evaluated (this caused the fallout in the overflowing tests) we can now do this: ```rust const fn add(x: usize, y: usize) -> usize { x + y } const ARR: [i32; add(1, 2)] = [5, 6, 7]; ``` also added a test for destructuring in const fn args ```rust const fn i((a, b): (u32, u32)) -> u32 { a + b } //~ ERROR: E0022 ``` This is a **[breaking change]**, since it turns some runtime panics into compile-time errors. This statement is true for ANY improvement to the const evaluator.
2015-10-27Auto merge of #29325 - alexcrichton:revert-trait-accessibility, r=nrcbors-27/+0
These commits revert https://github.com/rust-lang/rust/pull/28504 and add a regression test pointed out by @petrochenkov, it's not immediately clear with the regression that the accessibility check should be removed, so for now preserve the behavior on stable by default. r? @nrc
2015-10-26Auto merge of #29274 - thepowersgang:issues-29107-const-unsafe-fn-order, ↵bors-2/+2
r=nikomatsakis This PR switches the implemented ordering from `unsafe const fn` (as was in the original RFC) to `const unsafe fn` (which is what the lang team decided on)
2015-10-26Revert "Remove unnecessary trait accessibility check."Alex Crichton-27/+0
This reverts commit f4f95eb3a9f2c3c38679db84aabbb7cdb46d2641.
2015-10-26Auto merge of #29312 - apasel422:issue-21410, r=alexcrichtonbors-0/+51
Closes #21410. Closes #24972.
2015-10-25Add tests for #21410 and #24972Andrew Paseltiner-0/+51
Closes #21410. Closes #24972.
2015-10-25Auto merge of #29284 - apasel422:tests, r=alexcrichtonbors-0/+144
Closes #22781. Closes #23891. Closes #24956. Closes #25145. Closes #25693. Closes #26095. Closes #26459. Closes #27320. Closes #27895.
2015-10-25Auto merge of #29281 - skeleten:issue-28189, r=steveklabnikbors-0/+15
Closes #28189
2015-10-25Add testsAndrew Paseltiner-0/+144
Closes #22781. Closes #23891. Closes #24956. Closes #25145. Closes #25693. Closes #26095. Closes #26459. Closes #27320. Closes #27895.
2015-10-25Switch to 'const unsafe fn' ordering (rust-lang/rust#29107)John Hodge-2/+2
2015-10-24adding test for #28189skeleten-0/+15
2015-10-23Add test for #22403Andrew Paseltiner-0/+15
Closes #22403.
2015-10-23add main fn to testNiko Matsakis-0/+2
2015-10-22Warn when creating a module and a struct that both have the same name.Nick Hamann-15/+0
Currently it is possible to do the following: - define a module named `Foo` and then a unit or tuple struct also named `Foo` - define any struct named `Foo` and then a module named `Foo` This commit introduces a warning for both of these cases.
2015-10-22distinguish projections from the env/obj-types vs those fromNiko Matsakis-0/+31
trait definitions, and give prefence to the former. This is consistent with what we do for selection. It also works around a limitation that was leading to #28871.
2015-10-21Add test for #28936Andrew Paseltiner-0/+36
Closes #28936.
2015-10-21Auto merge of #29186 - pnkfelix:fsk-fix-issue-29166, r=alexcrichtonbors-0/+30
Add dropck unsafe escape hatch (UGEH) to vec::IntoIter. Fix #29166
2015-10-20Auto merge of #29148 - petrochenkov:noshow, r=alexcrichtonbors-7/+11
Closes https://github.com/rust-lang/rust/issues/29145 [breaking-change], needs a crater run.
2015-10-20Add dropck unsafe escape hatch (UGEH) to vec::IntoIter.Felix S. Klock II-0/+30
Fix #29166
2015-10-20Auto merge of #27723 - mystor:vecdeque_drain_range, r=blussbors-1/+2
This is a WIP PR for my implementation of drain over the VecDeque data structure supporting ranges. It brings the VecDeque drain implementation in line with Vec's. Tests haven't been written for the new function yet.
2015-10-19allow constant evaluation of function callsOliver Schneider-23/+39
2015-10-18Remove #[derive(Show)]Vadim Petrochenkov-7/+11
2015-10-18Auto merge of #28845 - oli-obk:rfc1229, r=pnkfelixbors-2/+0
This PR turns statically known erroneous code (e.g. numeric overflow) into a warning and continues normal code-generation to emit the same code that would have been generated without `check_const` detecting that the result can be computed at compile-time. <del>It's not done yet, as I don't know how to properly emit a lint from trans. I can't seem to extract the real lint level of the item the erroneous expression is in.</del> It's an unconditional warning now. r? @pnkfelix cc @nikomatsakis * [RFC 1229 text](https://github.com/rust-lang/rfcs/blob/master/text/1229-compile-time-asserts.md) * RFC PR: rust-lang/rfcs#1229 * tracking issue: https://github.com/rust-lang/rust/issues/28238
2015-10-17Auto merge of #29114 - apasel422:issue-27105, r=alexcrichtonbors-0/+24
Closes #27105.
2015-10-16Add test for #27105Andrew Paseltiner-0/+24
Closes #27105.
2015-10-16Add `Shared` pointer and have `{Arc, Rc}` use itAndrew Paseltiner-0/+32
This change has two consequences: 1. It makes `Arc<T>` and `Rc<T>` covariant in `T`. 2. It causes the compiler to reject code that was unsound with respect to dropck. See compile-fail/issue-29106.rs for an example of code that no longer compiles. Because of this, this is a [breaking-change]. Fixes #29037. Fixes #29106.
2015-10-15Auto merge of #28980 - nrc:unsafe-macros, r=@pnkfelixbors-56/+0
This is a [breaking change]. @brson could you do a Crater run with this PR please? Lets not land till Crater says its OK. This was discussed at https://internals.rust-lang.org/t/does-anyone-use-the-push-pop-unsafe-macros/2702
2015-10-15Auto merge of #29012 - tari:issue-28676, r=luqmanabors-0/+40
Fixes #28676. There doesn't seem to be a good way to add a test for this, but I tested the repro in #28676 and confirmed it now yields the correct result.
2015-10-14Add test case for #28676.Peter Marheine-0/+40
2015-10-14Auto merge of #29001 - arielb1:normalized-foreign, r=eddybbors-0/+31
This is needed as item types are allowed to be unnormalized. Fixes an ICE that occurs when foreign function signatures contained an associated type. Fixes #28983
2015-10-14Auto merge of #28827 - thepowersgang:unsafe-const-fn-2, r=Aatchbors-0/+31
This is the original test implementation, which works according to the tests I wrote, but might need a review.
2015-10-14Rollup merge of #29006 - arielb1:callee-outlives-call, r=pnkfelixManish Goregaokar-0/+20
This rather crucial requirement was not checked. In most cases, that didn't cause any trouble because the argument types are required to outlive the call and are subtypes of a subformula of the callee type. However, binary ops are taken by ref only indirectly, without it being marked in the argument types, which led to the argument types not being constrained anywhere causing spurious errors (as these are basically unconstrainable, I don't think this change can break code). Of course, the old way was also incorrent with contravariance, but that is still unsound for other reasons. This also improves rustc::front to get RUST_LOG to *somewhat* work. Fixes #28999. That issue is one of the several regression introduced by #28669. r? @pnkfelix
2015-10-14Rollup merge of #29004 - frewsxcv:regression-test-22814, r=alexcrichtonManish Goregaokar-0/+22
Closes #22814
2015-10-13implement RFC 1229Oliver Schneider-2/+0
const eval errors outside of true constant enviroments are not reported anymore, but instead forwarded to a lint.
2015-10-13Test and gate empty structures and variants betterVadim Petrochenkov-14/+46
2015-10-12require a method callee's type to outlive the callAriel Ben-Yehuda-0/+20
This rather crucial requirement was not checked. In most cases, that didn't cause any trouble because the argument types are required to outlive the call and are subtypes of a subformula of the callee type. However, binary ops are taken by ref only indirectly, without it being marked in the argument types, which led to the argument types not being constrained anywhere causing spurious errors (as these are basically unconstrainable, I don't think this change can break code). Of course, the old way was also incorrent with contravariance, but that is still unsound for other reasons. This also improves rustc::front to get RUST_LOG to *somewhat* work. Fixes #28999
2015-10-12Add regression test for #22814Corey Farwell-0/+22
Closes #22814
2015-10-12normalize the types of foreign functionsAriel Ben-Yehuda-0/+31
This is needed as item types are allowed to be unnormalized. Fixes an ICE that occurs when foreign function signatures contained an associated type. Fixes #28983
2015-10-12Add regression test for #17336Corey Farwell-0/+17
Closes #17336
2015-10-12Remove the push_unsafe! and pop_unsafe! macros.Nick Cameron-56/+0
This is a [breaking change].
2015-10-10Auto merge of #28938 - GlenDC:master, r=Manishearthbors-0/+16
Here is my attempt to resolve issue #28822, @Manishearth. Please let me know if it's fine. And if not, what should I do instead? This issue felt like quite a good start for some rust contributions. It allows me to get used to the workflow and codebase of rust in an easy-to-swallow manner. Are there any other issues you would recommend me to look at? :) Would love to do some more stuff!
2015-10-10Whitelisting PatWild for E0022. Fix #28822glendc-0/+16
2015-10-10Auto merge of #28861 - pnkfelix:fsk-nonparam-dropck-issue28498, r=arielb1bors-1/+255
implement RFC 1238: nonparametric dropck. cc #28498 cc @nikomatsakis
2015-10-09Auto merge of #28929 - pnkfelix:expand-legal-cycles-test, r=alexcrichtonbors-46/+480
Major revision to the dropck_legal_cycles test. 1. Added big comment block explaining the test framework. 2. Added tests exericising Rc and Arc. This was inspired by a comment from eefriedman on PR #28861. 3. Made the cycle-detection not issue false-positives on acyclic dags. Doing this efficiently required revising the framework; instead of visiting all children (i.e. doing a traversal), now each test is responsible for supplying the path that will act as a witness to the cycle. Luckily for me, all of the pre-existing tests worked with a trivial path built from "always tke your first left", but new tests I added did require other input paths (i.e., "first turn right, then left". (The path representation is a bit-string and its branches are n-ary, not word phrases and binary branches as you might think from the outline above.) cc PR #27185