summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2015-10-28The `source_did` may not be local, so don't unwrap theNiko Matsakis-0/+26
`as_local_node_id`, instead just compare against `Some(id)`. Fixes #29161.
2015-10-27Auto merge of #28833 - jryans:borrowck-linear-errors, r=pnkfelixbors-0/+28
Change error reporting of conflicting loans to stop earlier after printing an error for a given borrow, instead of proceeding to error on possibly every issued loan. This keeps us down to O(n) errors (for n problem lines), instead of O(n^2) errors in some cases. Fixes #27485.
2015-10-27Auto merge of #26421 - nham:fix_21546, r=pnkfelixbors-0/+65
Fixes #21546.
2015-10-27Auto merge of #26848 - oli-obk:const_fn_const_eval, r=pnkfelixbors-2/+20
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 #29327 - sanxiyn:argument, r=nrcbors-2/+45
Fix #24114.
2015-10-27Auto merge of #29325 - alexcrichton:revert-trait-accessibility, r=nrcbors-0/+28
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-1/+1
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-26test: Add regression test for "source trait is private"Alex Crichton-0/+52
2015-10-26Revert "Add UFCS privacy test."Alex Crichton-24/+0
This reverts commit b3e1aca40f889a565bfa2607b82b80fe7cbcefea.
2015-10-27Distinguish argument from local variableSeo Sanghyeon-2/+45
2015-10-25Auto merge of #29284 - apasel422:tests, r=alexcrichtonbors-0/+59
Closes #22781. Closes #23891. Closes #24956. Closes #25145. Closes #25693. Closes #26095. Closes #26459. Closes #27320. Closes #27895.
2015-10-25Add testsAndrew Paseltiner-0/+59
Closes #22781. Closes #23891. Closes #24956. Closes #25145. Closes #25693. Closes #26095. Closes #26459. Closes #27320. Closes #27895.
2015-10-25Auto merge of #29273 - Manishearth:regression, r=alexcrichtonbors-0/+17
None
2015-10-25Switch to 'const unsafe fn' ordering (rust-lang/rust#29107)John Hodge-1/+1
2015-10-24Add regression test for #26886Manish Goregaokar-0/+17
(fixes #26886)
2015-10-24object_safety: check whether a supertrait contains Self even without being itAriel Ben-Yehuda-0/+33
This is a [breaking-change]:lang, but the broken code does not make much sense. Fixes #26056
2015-10-23Auto merge of #29243 - skeleten:issue-29184, r=alexcrichtonbors-0/+13
Fixes #29184 This adds an error message for the use of the reserved `typeof` keyword, instead of reporting an ICE. Also adds a `compile-fail` test. I chose to add a `span_err` instead of removing to parser code, as to preserve the reservation of `typeof`.
2015-10-23Add error message for using `typeof` instead of an ICE.skeleten-0/+13
This adds error E0516 fixing a type pointed out by @jonas-schievink
2015-10-22Warn when creating a module and a struct that both have the same name.Nick Hamann-0/+65
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-21don't revisit modules while finding traits in suggestAriel Ben-Yehuda-0/+17
Fixes #29181
2015-10-19allow constant evaluation of function callsOliver Schneider-2/+20
2015-10-18Auto merge of #28845 - oli-obk:rfc1229, r=pnkfelixbors-22/+58
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 #28933 - fhahn:issue-28837-partialeq-note, r=alexcrichtonbors-0/+60
this PR adds notes for missing `PartialEq` and `PartialOrd`. I've added a test case but it seems like `NOTE` is ignored by the test runner. #28837
2015-10-17Auto merge of #29110 - apasel422:shared, r=alexcrichtonbors-0/+34
Fixes #29037. Fixes #29106. r? @pnkfelix CC @Gankro
2015-10-16Add `Shared` pointer and have `{Arc, Rc}` use itAndrew Paseltiner-0/+34
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-16Auto merge of #29014 - petrochenkov:stability, r=brsonbors-39/+61
Stricter checking of stability attributes + enforcement of their invariants at compile time (+ removed dead file librustc_front/attr.rs) I intended to enforce use of `reason` for unstable items as well (it normally presents for new items), but it turned out too intrusive, many older unstable items don't have `reason`s. r? @aturon I'm studying how stability works and do some refactoring along the way, so it's probably not the last PR.
2015-10-16Auto merge of #28957 - GuillaumeGomez:patch-5, r=Manishearthbors-9/+9
cc @nagisa
2015-10-16Change error message in rustbookGuillaume Gomez-4/+4
2015-10-15Auto merge of #28980 - nrc:unsafe-macros, r=@pnkfelixbors-88/+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-14Auto merge of #28827 - thepowersgang:unsafe-const-fn-2, r=Aatchbors-0/+24
This is the original test implementation, which works according to the tests I wrote, but might need a review.
2015-10-13implement RFC 1229Oliver Schneider-22/+58
const eval errors outside of true constant enviroments are not reported anymore, but instead forwarded to a lint.
2015-10-13Some additional testsVadim Petrochenkov-0/+25
2015-10-13Test and gate empty structures and variants betterVadim Petrochenkov-18/+218
2015-10-13Unify structures and enum variants in ASTVadim Petrochenkov-4/+4
2015-10-13Update test error compilation message for E0512Guillaume Gomez-5/+5
2015-10-13Reword note about missing trait implementationFlorian Hahn-16/+16
2015-10-13Refactor attr::StabilityVadim Petrochenkov-39/+36
Stricter checking + enforcement of invariants at compile time
2015-10-12Add notes for all potentially missing std::ops traitsFlorian Hahn-10/+50
2015-10-12Remove the push_unsafe! and pop_unsafe! macros.Nick Cameron-88/+0
This is a [breaking change].
2015-10-11Auto merge of #28948 - steveklabnik:gh28944, r=alexcrichtonbors-2/+2
"Crate features" isn't a thing in Rust, but you do need to add this line to your crate root. Fixes #28944
2015-10-10Diagnostic change: crate features -> crate rootSteve Klabnik-2/+2
"Crate features" isn't a thing in Rust, but you do need to add this line to your crate root. Fixes #28944
2015-10-10Auto merge of #28932 - barosl:empty-comment, r=alexcrichtonbors-0/+17
Previously, `/**/` was incorrectly regarded as a doc comment because it starts with `/**` and ends with `*/`. However, this caused an ICE because some code assumed that the length of a doc comment is at least 5. This commit adds an additional check to `is_block_doc_comment` that tests the length of the input. Fixes #28844.
2015-10-10Auto merge of #28861 - pnkfelix:fsk-nonparam-dropck-issue28498, r=arielb1bors-0/+236
implement RFC 1238: nonparametric dropck. cc #28498 cc @nikomatsakis
2015-10-09Add notes for missing PartialEq and PartialOrd, closes #28837Florian Hahn-0/+20
2015-10-10Prevent `/**/` from being parsed as a doc commentBarosl Lee-0/+17
Previously, `/**/` was incorrectly regarded as a doc comment because it starts with `/**` and ends with `*/`. However, this caused an ICE because some code assumed that the length of a doc comment is at least 5. This commit adds an additional check to `is_block_doc_comment` that tests the length of the input. Fixes #28844.
2015-10-09revise cfail test, removing ugeh attribute that was erroneously ↵Felix S. Klock II-1/+0
cut-and-pasted into it.
2015-10-09Auto merge of #28857 - nrc:lowering, r=nikomatsakisbors-11/+53
r? @nikomatsakis
2015-10-09review commentsNick Cameron-0/+51
2015-10-09hygiene for `for` loops, `if let`, `while let`Nick Cameron-25/+16
and some unrelated test cleanups
2015-10-08typos: fix a grabbag of typos all over the placeCristi Cobzarenco-12/+12