summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2016-08-14prohibit splitting literal patternsAriel Ben-Yehuda-0/+46
Before PR #32202, check_match tended to report bogus errors or ICE when encountering a pattern that split a literal, e.g. ```Rust match foo { "bar" => {}, &_ => {} } ``` That PR fixed these issues, but trans::_match generates bad code when it encounters these matches. MIR trans has that fixed, but it is waiting for 6 weeks in beta. Report an error when encountering these instead. Fixes issue #35044.
2016-08-08Avoid writing a temporary closure kindNiko Matsakis-0/+32
We used to write a temporary closure kind into the inference table, but this could lead to obligations being incorrectled resolved before inference had completed. This result could then be cached, leading to further trouble. This patch avoids writing any closure kind until the computation is complete. Fixes #34349.
2016-08-01Add regression testJeffrey Seyfried-1/+7
2016-07-21Backport fix for #34209 to betaVadim Petrochenkov-0/+23
2016-07-05Try to fix a test on betaAlex Crichton-1/+0
2016-07-03Auto merge of #34530 - alexcrichton:stabilize-1.11, r=aturonbors-3/+2
std: Stabilize APIs for the 1.11.0 release Although the set of APIs being stabilized this release is relatively small, the trains keep going! Listed below are the APIs in the standard library which have either transitioned from unstable to stable or those from unstable to deprecated. Stable * `BTreeMap::{append, split_off}` * `BTreeSet::{append, split_off}` * `Cell::get_mut` * `RefCell::get_mut` * `BinaryHeap::append` * `{f32, f64}::{to_degrees, to_radians}` - libcore stabilizations mirroring past libstd stabilizations * `Iterator::sum` * `Iterator::product` Deprecated * `{f32, f64}::next_after` * `{f32, f64}::integer_decode` * `{f32, f64}::ldexp` * `{f32, f64}::frexp` * `num::One` * `num::Zero` Added APIs (all unstable) * `iter::Sum` * `iter::Product` * `iter::Step` - a few methods were added to accomodate deprecation of One/Zero Removed APIs * `From<Range<T>> for RangeInclusive<T>` - everything about `RangeInclusive` is unstable Closes #27739 Closes #27752 Closes #32526 Closes #33444 Closes #34152 cc #34529 (new tracking issue)
2016-07-03std: Stabilize APIs for the 1.11.0 releaseAlex Crichton-3/+2
Although the set of APIs being stabilized this release is relatively small, the trains keep going! Listed below are the APIs in the standard library which have either transitioned from unstable to stable or those from unstable to deprecated. Stable * `BTreeMap::{append, split_off}` * `BTreeSet::{append, split_off}` * `Cell::get_mut` * `RefCell::get_mut` * `BinaryHeap::append` * `{f32, f64}::{to_degrees, to_radians}` - libcore stabilizations mirroring past libstd stabilizations * `Iterator::sum` * `Iterator::product` Deprecated * `{f32, f64}::next_after` * `{f32, f64}::integer_decode` * `{f32, f64}::ldexp` * `{f32, f64}::frexp` * `num::One` * `num::Zero` Added APIs (all unstable) * `iter::Sum` * `iter::Product` * `iter::Step` - a few methods were added to accomodate deprecation of One/Zero Removed APIs * `From<Range<T>> for RangeInclusive<T>` - everything about `RangeInclusive` is unstable Closes #27739 Closes #27752 Closes #32526 Closes #33444 Closes #34152 cc #34529 (new tracking issue)
2016-07-02Auto merge of #34580 - eddyb:two-steps-forward-one-step-backwards, r=nagisabors-0/+24
Revert "Remove the return_address intrinsic." This reverts commit b30134dbc3c29cf62a4518090e1389ff26918c19. Servo might want this merged if they don't merge servo/servo#11872 soon. cc @pnkfelix @jdm
2016-07-02Auto merge of #34443 - eddyb:sized-matters, r=arielb1bors-0/+37
Disallow constants and statics from having unsized types. This is a `[breaking-change]` which fixes #34390 by banning unsized `const` and `static`, e.g.: ```rust const A: [i32] = *(&[0, 1, 2] as &[i32]); static B: str = *"foo"; ``` This was not intentionally allowed, and other than for `static` since some versions ago, it ICE'd. If you've been taking advantage of this with `static`, you should be able to just use references instead.
2016-07-02Auto merge of #34539 - arielb1:metadata-hash, r=alexcrichtonbors-8/+8
Make the metadata lock more robust Fixes #33778 and friends. I also needed to add a metadata encoding version to rlibs, as they did not have it before. To keep it backwards-compatible, I added 4 zeroes to the start of the metadata, which are treated as an empty length field by older rustcs. r? @alexcrichton
2016-07-02fix test falloutAriel Ben-Yehuda-8/+8
2016-07-02Rollup merge of #34531 - GuillaumeGomez:libsyntax_err_codes, r=jonathandturnerManish Goregaokar-24/+25
Add error codes in libsyntax r? @jonathandturner Fixes #34526
2016-06-30Revert "Remove the return_address intrinsic."Eduard Burtescu-0/+24
This reverts commit b30134dbc3c29cf62a4518090e1389ff26918c19.
2016-06-29Fix testsggomez-24/+25
2016-06-29Rollup merge of #34542 - jseyfried:fix_recursive_modules, r=nrcManish Goregaokar-0/+28
Fix non-termination on recursive module re-exports in extern crates Fixes #33776. r? @nrc
2016-06-29Rollup merge of #34497 - oli-obk:double_negation, r=eddybManish Goregaokar-0/+1
Revert "skip double negation in const eval" This reverts commit 735c018974e5570ea13fd887aa70a011a5b8e7b8. fixes #34395 The original commit was based on a mis-understanding of the overflowing literal lint. This needs to be ported to beta. r? @eddyb
2016-06-29Rollup merge of #34495 - jseyfried:only_ident_macro_invocations, r=eddybManish Goregaokar-3/+3
Forbid type parameters and global paths in macro invocations Fixes #28558. This is a [breaking-change]. For example, the following would break: ```rust macro_rules! m { () => { () } } fn main() { m::<T>!(); // Type parameters are no longer allowed in macro invocations ::m!(); // Global paths are no longer allowed in macro invocations } ``` Any breakage can be fixed by removing the type parameters or the leading `::` (respectively). r? @eddyb
2016-06-29Disallow `derive` on items with type macrosJeffrey Seyfried-6/+6
2016-06-29Add regression testJeffrey Seyfried-0/+28
2016-06-27Auto merge of #34424 - jseyfried:breaking_batch, r=Manishearthbors-4/+35
Batch up libsyntax breaking changes Batch of the following syntax-[breaking-change] changes: - #34213: Add a variant `Macro` to `TraitItemKind` - #34368: Merge the variant `QPath` of `PatKind` into the variant `PatKind::Path` - #34385: Move `syntax::ast::TokenTree` into a new module `syntax::tokenstream` - #33943: - Remove the type parameter from `visit::Visitor` - Remove `attr::WithAttrs` -- use `attr::HasAttrs` instead. - Change `fold_tt`/`fold_tts` to take token trees by value and avoid wrapping token trees in `Rc`. - Remove the field `ctxt` of `ast::Mac_` - Remove inherent method `attrs()` of types -- use the method `attrs` of `HasAttrs` instead. - #34316: - Remove `ast::Decl`/`ast::DeclKind` and add variants `Local` and `Item` to `StmtKind`. - Move the node id for statements from the `StmtKind` variants to a field of `Stmt` (making `Stmt` a struct instead of an alias for `Spanned<StmtKind>`) - Rename `ast::ExprKind::Again` to `Continue`. - #34339: Generalize and abstract `ThinAttributes` to `ThinVec<Attribute>` - Use `.into()` in convert between `Vec<Attribute>` and `ThinVec<Attribute>` - Use autoderef instead of `.as_attr_slice()` - #34436: Remove the optional expression from `ast::Block` and instead use a `StmtKind::Expr` at the end of the statement list. - #34403: Move errors into a separate crate (unlikely to cause breakage)
2016-06-27Revert "skip double negation in const eval"Oliver Schneider-0/+1
This reverts commit 735c018974e5570ea13fd887aa70a011a5b8e7b8.
2016-06-27Auto merge of #34453 - frewsxcv:regress, r=sanxiynbors-0/+18
Add regression test for #24424. Fixes https://github.com/rust-lang/rust/issues/24424.
2016-06-27Add regression testJeffrey Seyfried-3/+3
2016-06-26Auto merge of #34491 - eddyb:return-in-peace, r=nagisabors-24/+0
Remove the return_address intrinsic. This intrinsic to get the return pointer was introduced in #16248 / #16081 by @pcwalton for Servo. However, as explained in #34227, it's impossible to ensure it's used correctly, and it broke with `-Zorbit`. Servo's usage is being replaced in servo/servo#11872, and I expect nobody else to have abused it. But I've also started a crater run, just in case this is a `[breaking-change]` for anyone else.
2016-06-27Remove the return_address intrinsic.Eduard Burtescu-24/+0
2016-06-26Disallow constants and statics from having unsized types.Eduard Burtescu-0/+37
2016-06-26Rollup merge of #34436 - jseyfried:no_block_expr, r=eddybJeffrey Seyfried-0/+31
To allow these braced macro invocation, this PR removes the optional expression from `ast::Block` and instead uses a `StmtKind::Expr` at the end of the statement list. Currently, braced macro invocations in blocks can expand into statements (and items) except when they are last in a block, in which case they can only expand into expressions. For example, ```rust macro_rules! make_stmt { () => { let x = 0; } } fn f() { make_stmt! {} //< This is OK... let x = 0; //< ... unless this line is commented out. } ``` Fixes #34418.
2016-06-25Rollup merge of #34403 - jonathandturner:move_liberror, r=alexcrichtonJeffrey Seyfried-3/+3
This PR refactors the 'errors' part of libsyntax into its own crate (librustc_errors). This is the first part of a few refactorings to simplify error reporting and potentially support more output formats (like a standardized JSON output and possibly an --explain mode that can work with the user's code), though this PR stands on its own and doesn't assume further changes. As part of separating out the errors crate, I have also refactored the code position portion of codemap into its own crate (libsyntax_pos). While it's helpful to have the common code positions in a separate crate for the new errors crate, this may also enable further simplifications in the future.
2016-06-25Rollup merge of #34368 - petrochenkov:astqpath, r=ManishearthJeffrey Seyfried-1/+1
The AST part of https://github.com/rust-lang/rust/pull/34365 plugin-[breaking-change] cc https://github.com/rust-lang/rust/issues/31645
2016-06-25Add regression test for #24424.Corey Farwell-0/+18
Fixes https://github.com/rust-lang/rust/issues/24424.
2016-06-24Add regression testJeffrey Seyfried-0/+34
2016-06-23Add regression testJeffrey Seyfried-0/+31
2016-06-23Fix touchy test to work with old and new error formatJonathan Turner-3/+3
2016-06-23Address more travis errorsJonathan Turner-3/+3
2016-06-22Rollup merge of #34367 - Stebalien:issue-23281, r=sfacklerManish Goregaokar-0/+20
Add regression test for #23281 Closes #23281
2016-06-20trans: generalize immediate temporaries to all MIR locals.Eduard Burtescu-0/+3
2016-06-20Merge PatKind::QPath into PatKind::Path in ASTVadim Petrochenkov-1/+1
2016-06-20Add regression test for #23281Steven Allen-0/+20
Closes #23281
2016-06-19Auto merge of #34348 - dsprenkels:issue-34194-test, r=alexcrichtonbors-0/+21
Add regression test for #34194 This pull request adds a regression test for #34194. Closes #34194.
2016-06-18Add test case for #22434Steven Allen-0/+18
Closes #22434
2016-06-18Add regression test for #34194Daan Sprenkels-0/+21
2016-06-18Fix ICE in memory categorization of tuple patternsVadim Petrochenkov-0/+15
2016-06-16Auto merge of #34296 - dsprenkels:issue-23122-tests, r=alexcrichtonbors-0/+44
Add regression tests for #23122 This PR adds two regression tests for #23122. Closes #23122.
2016-06-16Auto merge of #34239 - jseyfried:fix_macro_use_scope_regression, r=nrcbors-0/+32
Revert a change in the scope of macros imported from crates to fix a regression Fixes #34212. The regression was caused by #34032, which changed the scope of macros imported from extern crates to match the scope of macros imported from modules. r? @nrc
2016-06-16Auto merge of #34216 - jseyfried:nested_cfg_attr, r=nrcbors-0/+14
Support nested `cfg_attr` attributes Support arbitrarily deeply nested `cfg_attr` attributes (e.g. `#[cfg_attr(foo, cfg_attr(bar, baz))]`). This makes configuration idempotent. Currently, the nighties do not support any `cfg_attr` nesting. Stable and beta support just one level of `cfg_attr` nesting (expect for attributes on macro-expanded nodes, where no nesting is supported). This is a [breaking-change]. For example, the following would break: ```rust macro_rules! m { () => { #[cfg_attr(all(), cfg_attr(all(), cfg(foo)))] fn f() {} } } m!(); fn main() { f() } //~ ERROR unresolved name `f` ``` r? @nrc
2016-06-16Add regression tests for #23122Daan Sprenkels-0/+44
2016-06-15Auto merge of #34000 - estebank:missingargs, r=jseyfriedbors-1/+16
Show types of all args when missing args When there're missing arguments in a function call, present a list of all the expected types: ```rust fn main() { t(""); } fn t(a: &str, x: String) {} ``` ```bash % rustc file.rs file.rs:3:5: 2:8 error: this function takes 2 parameters but 0 parameters were supplied [E0061] file.rs:3 t(); ^~~ file.rs:3:5: 2:8 help: run `rustc --explain E0061` to see a detailed explanation file.rs:3:5: 2:8 note: the following parameter types were expected: &str, std::string::String error: aborting due to previous error ``` Fixes #33649
2016-06-15Show types of all args when missing argsEsteban Küber-1/+16
When there're missing arguments in a function call, present a list of all the expected types: ```rust fn main() { t(""); } fn t(a: &str, x: String) {} ``` ```bash % rustc file.rs file.rs:3:5: 2:8 error: this function takes 2 parameters but 0 parameters were supplied [E0061] file.rs:3 t(); ^~~ file.rs:3:5: 2:8 help: run `rustc --explain E0061` to see a detailed explanation file.rs:3:5: 2:8 note: the following parameter types were expected: &str, std::string::String error: aborting due to previous error ``` Fixes #33649
2016-06-15Auto merge of #34180 - durka:patch-24, r=brsonbors-0/+206
derive Hash (and not Copy) for ranges Fixes #34170. Also, `RangeInclusive` was `Copy` by mistake -- fix that, which is a [breaking-change] to that unstable type.
2016-06-13Auto merge of #33749 - jseyfried:fix_call_site_span, r=nrcbors-11/+29
Fix macro call site spans Fix macro call site spans. r? @nrc