about summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2017-03-06Add missing tests for 'E-needstest' labeled issuestopecongiro-0/+41
2017-03-06Clean up "pattern doesn't bind x" messagesEsteban Küber-8/+12
Group "missing variable bind" spans in `or` matches and clarify wording for the two possible cases: when a variable from the first pattern is not in any of the subsequent patterns, and when a variable in any of the other patterns is not in the first one. Before: ``` error[E0408]: variable `a` from pattern #1 is not bound in pattern #2 --> file.rs:10:23 | 10 | T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); } | ^^^^^^^^^^^ pattern doesn't bind `a` error[E0408]: variable `b` from pattern #2 is not bound in pattern #1 --> file.rs:10:32 | 10 | T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); } | ^ pattern doesn't bind `b` error[E0408]: variable `a` from pattern #1 is not bound in pattern #3 --> file.rs:10:37 | 10 | T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); } | ^^^^^^^^ pattern doesn't bind `a` error[E0408]: variable `d` from pattern #1 is not bound in pattern #3 --> file.rs:10:37 | 10 | T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); } | ^^^^^^^^ pattern doesn't bind `d` error[E0408]: variable `c` from pattern #3 is not bound in pattern #1 --> file.rs:10:43 | 10 | T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); } | ^ pattern doesn't bind `c` error[E0408]: variable `d` from pattern #1 is not bound in pattern #4 --> file.rs:10:48 | 10 | T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); } | ^^^^^^^^ pattern doesn't bind `d` error: aborting due to 6 previous errors ``` After: ``` error[E0408]: variable `a` is not bound in all patterns --> file.rs:20:37 | 20 | T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { intln!("{:?}", a); } | - ^^^^^^^^^^^ ^^^^^^^^ - variable t in all patterns | | | | | | | pattern doesn't bind `a` | | pattern doesn't bind `a` | variable not in all patterns error[E0408]: variable `d` is not bound in all patterns --> file.rs:20:37 | 20 | T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { intln!("{:?}", a); } | - - ^^^^^^^^ ^^^^^^^^ pattern esn't bind `d` | | | | | | | pattern doesn't bind `d` | | variable not in all patterns | variable not in all patterns error[E0408]: variable `b` is not bound in all patterns --> file.rs:20:37 | 20 | T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { intln!("{:?}", a); } | ^^^^^^^^^^^ - ^^^^^^^^ ^^^^^^^^ pattern esn't bind `b` | | | | | | | pattern doesn't bind `b` | | variable not in all patterns | pattern doesn't bind `b` error[E0408]: variable `c` is not bound in all patterns --> file.rs:20:48 | 20 | T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { intln!("{:?}", a); } | ^^^^^^^^^^^ ^^^^^^^^^^^ - ^^^^^^^^ pattern esn't bind `c` | | | | | | | variable not in all tterns | | pattern doesn't bind `c` | pattern doesn't bind `c` error: aborting due to 4 previous errors ``` * Have only one presentation for binding consistency errors * Point to same binding in multiple patterns when possible * Check inconsistent bindings in all arms * Simplify wording of diagnostic message * Sort emition and spans of binding errors for deterministic output
2017-03-05Add compile-fail test for cfg_target_thread_localGibson Fahnestock-0/+44
Test copied from src/test/run-pass/thread-local-extern-static.rs. Refs: https://github.com/rust-lang/rust/issues/39059
2017-03-05Add compile-fail test for unwind_attributesGibson Fahnestock-0/+28
Test copied from src/test/codegen/extern-functions.rs. Refs: https://github.com/rust-lang/rust/issues/39059
2017-03-05Add compile fail test for stmt_expr_attributestopecongiro-0/+14
2017-03-03Auto merge of #40101 - danobi:feat_gate_test_simd, r=alexcrichtonbors-0/+23
Add compile fail test for SIMD This completes the missing SIMD test task for issue #39059.
2017-03-03Auto merge of #40178 - arielb1:provide-destructors, r=eddybbors-0/+23
convert AdtDef::destructor to on-demand This removes the `Cell` from `AdtDef`. Also, moving destructor validity checking to on-demand (forced during item-type checking) ensures that invalid destructors can't cause ICEs. Fixes #38868. Fixes #40132. r? @eddyb
2017-03-02Add compile fail test for SIMDDaniel Xu-0/+23
2017-03-03Auto merge of #39927 - nikomatsakis:incr-comp-skip-borrowck-2, r=eddybbors-4/+31
transition borrowck to visit all **bodies** and not item-likes This is a better structure for incremental compilation and also more compatible with the eventual borrowck mir. It also fixes #38520 as a drive-by fix. r? @eddyb
2017-03-02Auto merge of #40216 - frewsxcv:rollup, r=frewsxcvbors-0/+24
Rollup of 7 pull requests - Successful merges: #39832, #40104, #40110, #40117, #40129, #40139, #40166 - Failed merges:
2017-03-02Rollup merge of #40110 - benschreiber:nostackcheck, r=brsonCorey Farwell-0/+16
Made no_stack_check a stable_removed attribute r? @brson
2017-03-02Add support for x86-interrupt calling conventionPhilipp Oppermann-0/+8
Tracking issue: https://github.com/rust-lang/rust/issues/40180 This calling convention can be used for definining interrupt handlers on 32-bit and 64-bit x86 targets. The compiler then uses `iret` instead of `ret` for returning and ensures that all registers are restored to their original values. Usage: ``` extern "x86-interrupt" fn handler(stack_frame: &ExceptionStackFrame) {…} ``` for interrupts and exceptions without error code and ``` extern "x86-interrupt" fn page_fault_handler(stack_frame: &ExceptionStackFrame, error_code: u64) {…} ``` for exceptions that push an error code (e.g., page faults or general protection faults). The programmer must ensure that the correct version is used for each interrupt. For more details see the [LLVM PR][1] and the corresponding [proposal][2]. [1]: https://reviews.llvm.org/D15567 [2]: http://lists.llvm.org/pipermail/cfe-dev/2015-September/045171.html
2017-03-02Auto merge of #39655 - durka:recursion-limit-suggestion, r=nikomatsakisbors-57/+0
suggest doubling recursion limit in more situations Fixes #38852. r? @bluss
2017-03-02Rollup merge of #40168 - topecongiro:compile-fail-test-abi-ptx, r=petrochenkovGuillaume Gomez-0/+8
Add compile fail test for abi_ptx Issue #39059.
2017-03-01convert AdtDef::destructor to on-demandAriel Ben-Yehuda-0/+23
This removes the Cell from AdtDef. Also, moving destructor validity checking to on-demand (forced during item-type checking) ensures that invalid destructors can't cause ICEs. Fixes #38868. Fixes #40132.
2017-03-01Auto merge of #34198 - eddyb:you're-a-bad-transmute-and-you-should-feel-bad, ↵bors-50/+48
r=nikomatsakis Make transmuting from fn item types to pointer-sized types a hard error. Closes #19925 by removing the future compatibility lint and the associated workarounds. This is a `[breaking-change]` if you `transmute` from a function item without casting first. For more information on how to fix your code, see https://github.com/rust-lang/rust/issues/19925.
2017-03-01Auto merge of #39419 - jseyfried:simplify_tokentree, r=nrcbors-21/+12
Simplify `TokenTree` and fix `macro_rules!` bugs This PR - fixes #39390, fixes #39403, and fixes #39404 (each is a [breaking-change], see issues for examples), - fixes #39889, - simplifies and optimizes macro invocation parsing, - cleans up `ext::tt::transcribe`, - removes `tokenstream::TokenTree::Sequence` and `Token::MatchNt`, - instead, adds a new type `ext::tt::quoted::TokenTree` for use by `macro_rules!` (`ext::tt`) - removes `parser.quote_depth` and `parser.parsing_token_tree`, and - removes `quote_matcher!`. - Instead, use `quote_tokens!` and `ext::tt::quoted::parse` the result with `expect_matchers=true`. - I found no outside uses of `quote_matcher!` when searching Rust code on Github. r? @nrc
2017-03-01Add compile fail test for abi_ptxtopecongiro-0/+8
2017-02-28Add warning cycle.Jeffrey Seyfried-2/+19
2017-02-28Add `syntax::ext::tt::quoted::{TokenTree, ..}` and remove ↵Jeffrey Seyfried-33/+7
`tokenstream::TokenTree::Sequence`.
2017-02-28Make transmuting from fn item types to pointer-sized types a hard error.Eduard Burtescu-50/+48
2017-03-01Add compile test for cfg_target_has_atomictopecongiro-0/+86
2017-02-28remove special-case code for statics and just use `borrowck_fn`Niko Matsakis-4/+31
Fixes #38520
2017-02-28Rollup merge of #40047 - topecongiro:master, r=est31Corey Farwell-0/+24
Add compile fail test for unboxed_closures feature Hello, this is my first contribution to rust. Issue #39059.
2017-02-28Add compile fail test for unboxed_closures featuretopecongiro-0/+24
2017-02-25teach rustc about remove_stable_features and removed no-stack-chech feature. ↵Ben Schreiber-0/+16
fixes #34915
2017-02-25rustc_const_eval: demand that the MIR qualify_consts ran on each evaluated body.Eduard-Mihai Burtescu-24/+35
2017-02-25rustc_const_eval: always demand typeck_tables for evaluating constants.Eduard-Mihai Burtescu-145/+96
2017-02-25rustc_typeck: rework coherence to be almost completely on-demand.Eduard-Mihai Burtescu-4/+13
2017-02-25rustc: allow handling cycle errors gracefully in on-demand.Eduard-Mihai Burtescu-0/+1
2017-02-25rustc_typeck: hook up collect and item/body check to on-demand.Eduard-Mihai Burtescu-29/+8
2017-02-25rustc_typeck: don't use Result for get_type_parameter_bounds and ↵Eduard-Mihai Burtescu-5/+13
ensure_super_predicates.
2017-02-25rustc: move the actual values of enum discriminants into a map.Eduard-Mihai Burtescu-12/+12
2017-02-25rustc_typeck: simplify AstConv requests as implemented by collect.Eduard-Mihai Burtescu-13/+15
2017-02-25rustc: store type parameter defaults outside of ty::Generics.Eduard-Mihai Burtescu-6/+7
2017-02-25Rollup merge of #40035 - er-1:master, r=alexcrichtonEduard-Mihai Burtescu-0/+6
Ignore ASM tests on powerpc Part of #39015
2017-02-25Rollup merge of #40027 - cramertj:stabilize_static_recursion, r=nrcEduard-Mihai Burtescu-67/+0
Stabilize static_recursion Fix #29719.
2017-02-25Rollup merge of #40025 - est31:master, r=eddybEduard-Mihai Burtescu-0/+69
Implement non-capturing closure to fn coercion Implements non capturing closure coercion ([RFC 1558](https://github.com/rust-lang/rfcs/blob/master/text/1558-closure-to-fn-coercion.md)). cc tracking issue #39817
2017-02-25Rollup merge of #39980 - arielb1:privately-uninhabited, r=nikomatsakisEduard-Mihai Burtescu-7/+33
check_match: don't treat privately uninhabited types as uninhabited Fixes #38972, which is a regression in 1.16 from @canndrew's patchset. r? @nikomatsakis beta-nominating because regression.
2017-02-25Rollup merge of #39945 - petrochenkov:llvmtarg, r=alexcrichtonEduard-Mihai Burtescu-2/+2
Use ARM instead of SystemZ for testing uninstalled targets This needs some explanation. `config.toml` has section `targets` listing backends that are built during LLVM build: ``` targets = "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc;NVPTX" ``` It would be reasonable to expect that `targets = "X86"` would be enough for doing a local build in typical case (building on x86 and not working on some non-x86 platform-specific functionality). However, for `x.py test` to pass successfully you have to add ARM and SystemZ to the target list as well (`targets = "X86;ARM;SystemZ"`), because two tests (`compile-fail/issue-37131.rs` and `run-make\target-without-atomics`) require these architectures to be enabled in LLVM. This patch moves `compile-fail/issue-37131.rs` from SystemZ to ARM, so `targets = "X86;ARM"` becomes sufficient for running the full test suite without errors.
2017-02-25Rollup merge of #39905 - estebank:useless-error, r=arielb1Eduard-Mihai Burtescu-4/+4
Properly display note/expected details Given a file ```rust fn takes_cb(f: fn(i8)) {} fn main() { fn callback(x: i32) {} takes_cb(callback) } ``` output ```rust error[E0308]: mismatched types --> file2.rs:5:22 | 5 | takes_cb(callback) | ^^^^^^^^ expected i8, found i32 | = note: expected type `fn(i8)` found type `fn(i32) {main::callback}` ``` Fix #39343.
2017-02-25Rollup merge of #39864 - cramertj:normalize-breaks, r=nikomatsakisEduard-Mihai Burtescu-2/+56
Normalize labeled and unlabeled breaks Part of #39849.
2017-02-24Review changesest31-5/+5
* use more convenient mk_substs function * remove type annotations * use map_bound one level farther outside * style improvements
2017-02-23Two more testsest31-0/+69
2017-02-23use a more conservative inhabitableness ruleAriel Ben-Yehuda-3/+3
This is a [breaking-change] from 1.15, because this used to compile: ```Rust enum Void {} fn foo(x: &Void) { match x {} } ```
2017-02-22Ignore ASM tests on powerpcer-1-0/+6
Part of #39015
2017-02-21Stabilize static_recursionTaylor Cramer-67/+0
2017-02-21Auto merge of #39765 - GuillaumeGomez:file-not-found-for-module-error, ↵bors-0/+42
r=jseyfried File not found for module error Fixes #39542. r? @jonathandturner Maybe you want to take a look @pnkfelix?
2017-02-20check_match: don't treat privately uninhabited types as uninhabitedAriel Ben-Yehuda-7/+33
Fixes #38972.
2017-02-20Rollup merge of #39913 - nikomatsakis:inference-error, r=pnkfelixCorey Farwell-4/+1
Report full details of inference errors When the old suggestion machinery was removed by @brson in https://github.com/rust-lang/rust/pull/37057, it was not completely removed. There was a bit of code that had the job of going through errors and finding those for which suggestions were applicable, and it remained, causing us not to emit the full details of such errors. This PR removes that. I've also added various lifetime tests to the UI test suite (so you can also see the before/after there). I have some concrete thoughts on how to improve these cases and am planning on writing those up in some mentoring issues (@CengizIO has expressed interest in working on those changes, so I plan to work with him on it, at least to start). cc @jonathandturner