about summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2018-01-25Shorten a filename for MSVCAlex Crichton-2/+2
2018-01-25Rollup merge of #47696 - Zoxc:variance-rg, r=nikomatsakisAlex Crichton-1/+1
Make use of the implemented red/green algorithm for variance r? @michaelwoerister
2018-01-25Rollup merge of #47600 - varkor:empty-never-array, r=eddybAlex Crichton-0/+27
Fix type inhabitedness check for arrays Arrays of uninhabited types were considered to also be uninhabited if their length had not been evaluated, causing unsoundness. Fixes #47563. r? @eddyb
2018-01-25Rollup merge of #47529 - nikomatsakis:impl-trait-issue-38064, r=cramertjAlex Crichton-0/+39
track recursion limit when expanding existential impl trait r? @cramertj
2018-01-25Rollup merge of #47691 - estebank:unknown-lang-item-sp, r=rkruppeGuillaume Gomez-1/+2
Point at unknown lang item attribute
2018-01-25Auto merge of #47006 - bitshifter:stabilize-repr-align, r=eddybbors-6/+0
Stabilized `#[repr(align(x))]` attribute (RFC 1358) Stabilzed `#[repr(align(x))]` with attr_literal syntax as proposed by @eddyb https://github.com/rust-lang/rust/issues/33626#issuecomment-348467804
2018-01-24Make use of the implemented red/green algorithm for varianceJohn Kåre Alsaker-1/+1
2018-01-23Point at unknown lang item attributeEsteban Küber-1/+2
2018-01-23Auto merge of #45337 - Zoxc:gen-static, r=nikomatsakisbors-0/+14
Immovable generators This adds support for immovable generators which allow you to borrow local values inside generator across suspension points. These are declared using a `static` keyword: ```rust let mut generator = static || { let local = &Vec::new(); yield; local.push(0i8); }; generator.resume(); // ERROR moving the generator after it has resumed would invalidate the interior reference // drop(generator); ``` Region inference is no longer affected by the types stored in generators so the regions inside should be similar to other code (and unaffected by the presence of `yield` expressions). The borrow checker is extended to pick up the slack so interior references still result in errors for movable generators. This fixes #44197, #45259 and #45093. This PR depends on [PR #44917 (immovable types)](https://github.com/rust-lang/rust/pull/44917), I suggest potential reviewers ignore the first commit as it adds immovable types.
2018-01-23Rollup merge of #47440 - mark-i-m:zunpretty, r=nikomatsakiskennytm-2/+2
Change the --unpretty flag to -Z unpretty First PR :smile: ! -Z unpretty no longer requires -Z unstable-options. Also, I mildly changed the syntax of the flag to match the other -Z flags. All uses of the flag take the form `unpretty=something` where something can either `string` or `string=string` (see the help messages of the CLI). Fix #47395 r? @nikomatsakis EDIT: apparently rust-highfive doesn't see edits...
2018-01-23Rollup merge of #47425 - EdSchouten:immutable-tls, r=nikomatsakiskennytm-0/+21
Properly pass down immutability info for thread-locals. For thread-locals we call into cat_rvalue_node() to create a CMT (Category, Mutability, Type) that always has McDeclared. This is incorrect for thread-locals that don't have the 'mut' keyword; we should use McImmutable there. Extend cat_rvalue_node() to have an additional mutability parameter. Fix up all the callers to make use of that function. Also extend one of the existing unit tests to cover this. Fixes: #47053
2018-01-23Adds support for immovable generators. Move checking of invalid borrows ↵John Kåre Alsaker-0/+14
across suspension points to borrowck. Fixes #44197, #45259 and #45093.
2018-01-22Fix test reduxEsteban Küber-7/+14
2018-01-23Stabilized `#[repr(align(x))]` attribute (RFC 1358)Cameron Hart-6/+0
2018-01-22Auto merge of #47158 - rkruppe:repr-transparent, r=eddybbors-1/+146
Implement repr(transparent) r? @eddyb for the functional changes. The bulk of the PR is error messages and docs, might be good to have a doc person look over those. cc #43036 cc @nox
2018-01-22Auto merge of #47144 - estebank:moved-closure-arg, r=nikomatsakisbors-185/+0
Custom error when moving arg outside of its closure When given the following code: ```rust fn give_any<F: for<'r> FnOnce(&'r ())>(f: F) { f(&()); } fn main() { let mut x = None; give_any(|y| x = Some(y)); } ``` provide a custom error: ``` error: borrowed data cannot be moved outside of its closure --> file.rs:7:27 | 6 | let mut x = None; | ----- borrowed data cannot be moved into here... 7 | give_any(|y| x = Some(y)); | --- ^ cannot be moved outside of its closure | | | ...because it cannot outlive this closure ``` instead of the generic lifetime error: ``` error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements --> file.rs:7:27 | 7 | give_any(|y| x = Some(y)); | ^ | note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 7:14... --> file.rs:7:14 | 7 | give_any(|y| x = Some(y)); | ^^^^^^^^^^^^^^^ note: ...so that expression is assignable (expected &(), found &()) --> file.rs:7:27 | 7 | give_any(|y| x = Some(y)); | ^ note: but, the lifetime must be valid for the block suffix following statement 0 at 6:5... --> file.rs:6:5 | 6 | / let mut x = None; 7 | | give_any(|y| x = Some(y)); 8 | | } | |_^ note: ...so that variable is valid at time of its declaration --> file.rs:6:9 | 6 | let mut x = None; | ^^^^^ ``` Fix #45983.
2018-01-21Rollup merge of #47512 - GuillaumeGomez:e0659, r=petrochenkovGuillaume Gomez-0/+26
Add E0659 for ambiguous names Still on the tracks of the "no error without error code" road.
2018-01-21Auto merge of #47116 - estebank:non-accessible-ctor, r=petrochenkovbors-5/+9
Tweaks to invalid ctor messages - Do not suggest using a constructor that isn't accessible - Suggest the appropriate syntax (`()`/`{}` as appropriate) - Add note when trying to use `Self` as a ctor CC #22488, fix #47085.
2018-01-20Add testing coverage for assigning to immutable thread-locals.Ed Schouten-0/+21
It is currently allowed to perform such assignments when not making use of NLL. NLL already does this right, but let's add a test in place to ensure it never regresses.
2018-01-19Fix tidy errorvarkor-1/+2
2018-01-19Fix type inhabitedness check for arraysvarkor-0/+26
Arrays of uninhabited types were considered to also be uninhabited if their length had not been evaluated, causing unsoundness.
2018-01-18Change the --unpretty flag to -Z unprettyMark Mansi-2/+2
-Z unpretty no longer requires -Z unstable-options. Also, I mildly changed the syntax of the flag to match the other -Z flags. All uses of the flag take the form `unpretty=something` where something can either `string` or `string=string` (see the help messages of the CLI).
2018-01-18in which the unused-parens lint comes to cover function and method argsZack M. Davis-5/+7
Resolves #46137.
2018-01-18Add E0659 for ambiguous namesGuillaume Gomez-0/+26
2018-01-17track recursion limit when expanding existential impl traitNiko Matsakis-0/+39
2018-01-16Implement repr(transparent)Robin Kruppe-1/+146
2018-01-15Further tweaks to the outputEsteban Küber-5/+9
- Properly address Variant Ctors - Show signature if span of trait method without `self` is not available
2018-01-15Move diagnostic logic to its own moduleEsteban Küber-191/+0
- Move specialized borrow checker diagnostic for bindings escaping its closure to its own module. - Move affected tests to `ui`.
2018-01-15Reexport -> re-export in prose and documentation commentsCarol (Nichols || Goulding)-2/+2
2018-01-15Reexport -> re-export in error messagesCarol (Nichols || Goulding)-23/+25
2018-01-15Auto merge of #47413 - GuillaumeGomez:unstable-error-code, r=estebankbors-0/+13
Add error code for unstable feature errors Fixes #47397.
2018-01-15Handle case of moving into vec with uninferred lifetimeEsteban Küber-1/+4
2018-01-15Generalize cases where specific move error ocurrsEsteban Küber-7/+10
Trigger new diagnostic in `compile-fail/regions-escape-bound-fn.rs` test, and not only in `compile-fail/regions-escape-bound-fn-2.rs`.
2018-01-15Custom error when moving arg outside of its closureEsteban Küber-1/+1
When given the following code: ```rust fn give_any<F: for<'r> FnOnce(&'r ())>(f: F) { f(&()); } fn main() { let mut x = None; give_any(|y| x = Some(y)); } ``` provide a custom error: ``` error: borrowed data cannot be moved outside of its closure --> file.rs:7:27 | 6 | let mut x = None; | ----- binding declared outside of closure 7 | give_any(|y| x = Some(y)); | --- ^ cannot be assigned to binding outside of its closure | | | closure you can't escape ``` instead of the generic lifetime error: ``` error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements --> file.rs:7:27 | 7 | give_any(|y| x = Some(y)); | ^ | note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 7:14... --> file.rs:7:14 | 7 | give_any(|y| x = Some(y)); | ^^^^^^^^^^^^^^^ note: ...so that expression is assignable (expected &(), found &()) --> file.rs:7:27 | 7 | give_any(|y| x = Some(y)); | ^ note: but, the lifetime must be valid for the block suffix following statement 0 at 6:5... --> file.rs:6:5 | 6 | / let mut x = None; 7 | | give_any(|y| x = Some(y)); 8 | | } | |_^ note: ...so that variable is valid at time of its declaration --> file.rs:6:9 | 6 | let mut x = None; | ^^^^^ ```
2018-01-15Rollup merge of #47372 - topecongiro:issue-43925, r=alexcrichtonkennytm-0/+30
Avoid panicking when invalid argument is passed to cfg(..) Closes #43925. Closes #43926.
2018-01-15Add error code for unstable feature errorsGuillaume Gomez-0/+13
2018-01-15Auto merge of #47329 - davidtwco:issue-46983, r=nikomatsakisbors-12/+12
NLL: bad error message when converting anonymous lifetime to `'static` Fixes #46983. r? @nikomatsakis
2018-01-14syntax: Disambiguate generics and qualified pathsVadim Petrochenkov-2/+2
2018-01-14syntax: Rewrite parsing of implsVadim Petrochenkov-7/+89
Properly parse impls for the never type `!` Recover from missing `for` in `impl Trait for Type` Prohibit inherent default impls and default impls of auto traits Change wording in more diagnostics to use "auto traits" Some minor code cleanups in the parser
2018-01-14Auto merge of #47261 - estebank:immutable-arg, r=petrochenkovbors-3/+3
Assignment to immutable argument: diagnostic tweak Re #46659.
2018-01-13Address review.leonardo.yvens-3/+3
2018-01-13Remove wfcheck for auto traits, remove dead error codesleonardo.yvens-9/+5
The WF checks are now done as an AST validation.
2018-01-13Adjust tests for removal of `impl Foo for .. {}`leonardo.yvens-123/+20
2018-01-13Remove `impl Foo for ..` in favor of `auto trait Foo`leonardo.yvens-19/+0
No longer parse it. Remove AutoTrait variant from AST and HIR. Remove backwards compatibility lint. Remove coherence checks, they make no sense for the new syntax. Remove from rustdoc.
2018-01-13Auto merge of #47242 - estebank:issue-15980, r=petrochenkovbors-1/+1
`struct` pattern parsing and diagnostic tweaks - Recover from struct parse error on match and point out missing match body. - Point at struct when finding non-identifier while parsing its fields. - Add label to "expected identifier, found {}" error. Fix #15980.
2018-01-13Rollup merge of #47382 - topecongiro:issue-43105, r=eddybkennytm-0/+21
Ignore CTFE errors while lowering patterns Closes #43105. r? @eddyb
2018-01-13Rollup merge of #47344 - topecongiro:fixed-ices, r=alexcrichtonkennytm-0/+16
Add tests to fixed issues. Closes #36792. Closes #38091. Closes #39687. Closes #42148. Closes #42956.
2018-01-13Rollup merge of #47306 - alexreg:dataflow-analysis, r=eddybkennytm-0/+10
Don't track local_needs_drop separately in qualify_consts. None
2018-01-13Rollup merge of #47298 - cramertj:path-as-modrs, r=nikomatsakiskennytm-16/+0
Treat #[path] files as mod.rs files Fixes https://github.com/rust-lang/rust/issues/46936, cc @briansmith, @SergioBenitez, @nikomatsakis. This (insta-stable) change treats files included via `#[path = "bla.rs"] mod foo;` as though they were `mod.rs` files. Namely, it allows them to include `mod` statements and looks for the child modules in sibling directories, rather than in relative `modname/childmodule.rs` files as happens for non-`mod.rs` files. This change makes the `non_modrs_mods` feature backwards compatible with the existing usage in https://github.com/briansmith/ring, several versions of which are currently broken in beta. If we decide to merge, this change should be backported to beta. cc https://github.com/rust-lang/rust/issues/37872 r? @jseyfried
2018-01-12Avoid panicking when invalid argument is passed to cfg(..)Seiichi Uchida-0/+30
Closes #43925. Closes #43926.