summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2017-04-20Avoid type-checking addition and indexing twice.Eduard-Mihai Burtescu-0/+32
2017-04-04Ensure that macro resolutions in trait positions get finalized.Jeffrey Seyfried-0/+16
2017-04-02keep the AST node-id when lowering ExprKind::RangeAriel Ben-Yehuda-0/+16
When the Range expression is the root of a constant, its node-id is used for the def-id of the body, so it has to be preserved in the AST -> HIR lowering. Fixes #40749.
2017-04-01store a copy of the Issue32230 info within TypeErrorAriel Ben-Yehuda-0/+21
The data can't be looked up from the region variable directly, because the region variable might have been destroyed at the end of a snapshot. Fixes #40000. Fixes #40743.
2017-03-31Revert "Auto merge of #39485 - canndrew:inference-fix-39297, r=nikomatsakis"Niko Matsakis-0/+36
This reverts commit dc0bb3f2839c13ab42feacd423f728fbfd2f2f7a, reversing changes made to e879aa43ef63962f8e4d797292194a9f40a22a13. This is a temporary step intended to fix regressions. A more comprehensive fix for type inference and dead-code is in the works.
2017-03-12Auto merge of #40340 - petrochenkov:restricted, r=nikomatsakisbors-16/+11
Update syntax for `pub(restricted)` Update the syntax before stabilization. cc https://github.com/rust-lang/rust/issues/32409 r? @nikomatsakis
2017-03-11Rollup merge of #40319 - eddyb:it's-"unsize"-not-"unsound", r=nikomatsakisAriel Ben-Yehuda-13/+84
Disallow subtyping between T and U in T: Unsize<U>. Because `&mut T` can be coerced to `&mut U`, `T` and `U` must be unified invariantly. Fixes #40288. E.g. coercing `&mut [&'a X; N]` to `&mut [&'b X]` must require `'a` be equal to `'b`, otherwise you can convert between `&'a X` and `&'b X` (in either direction), potentially unsoundly lengthening lifetimes. Subtyping here was introduced with `Unsize` in #24619 (landed in 1.1, original PR is #23785).
2017-03-10Update syntax for `pub(restricted)`Vadim Petrochenkov-16/+11
2017-03-10Point to enclosing block/fn on nested unsafeEsteban Küber-66/+0
When declaring nested unsafe blocks (`unsafe {unsafe {}}`) that trigger the "unnecessary `unsafe` block" error, point out the enclosing `unsafe block` or `unsafe fn` that makes it unnecessary.
2017-03-09Use subtyping on the target of unsizing coercions.Eduard-Mihai Burtescu-13/+13
2017-03-08Rollup merge of #40296 - topecongiro:add-missing-tests, r=alexcrichtonAriel Ben-Yehuda-0/+49
Add tests for issues with the 'E-needtest' label. This PR adds tests for the following issues:
2017-03-08Rollup merge of #40279 - gibfahn:test-unwind, r=est31Ariel Ben-Yehuda-0/+72
Add compile-fail tests for remaining items in whitelist and remove it Add compile-fail tests for `cfg_target_thread_local` and `unwind_attributes`, and remove the whitelist. Let me know if I should clean up the tests (or if I've done anything else wrong, this is my first contribution to rust). cc/ @est31
2017-03-08Disallow subtyping between T and U in T: Unsize<U>.Eduard-Mihai Burtescu-0/+71
2017-03-08Auto merge of #39713 - estebank:issue-39698, r=jonathandturnerbors-8/+12
Clean up "pattern doesn't bind x" messages 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: ```rust 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: ```rust error[E0408]: variable `d` is not bound in all patterns --> $DIR/issue-39698.rs:20:37 | 20 | T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); } | - - ^^^^^^^^ ^^^^^^^^ pattern doesn't bind `d` | | | | | | | pattern doesn't bind `d` | | variable not in all patterns | variable not in all patterns error[E0408]: variable `c` is not bound in all patterns --> $DIR/issue-39698.rs:20:48 | 20 | T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); } | ^^^^^^^^^^^ ^^^^^^^^^^^ - ^^^^^^^^ pattern doesn't bind `c` | | | | | | | variable not in all patterns | | pattern doesn't bind `c` | pattern doesn't bind `c` error[E0408]: variable `a` is not bound in all patterns --> $DIR/issue-39698.rs:20:37 | 20 | T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); } | - ^^^^^^^^^^^ ^^^^^^^^ - variable not in all patterns | | | | | | | pattern doesn't bind `a` | | pattern doesn't bind `a` | variable not in all patterns error[E0408]: variable `b` is not bound in all patterns --> $DIR/issue-39698.rs:20:37 | 20 | T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); } | ^^^^^^^^^^^ - ^^^^^^^^ ^^^^^^^^ pattern doesn't bind `b` | | | | | | | pattern doesn't bind `b` | | variable not in all patterns | pattern doesn't bind `b` error: aborting due to 4 previous errors ``` Fixes #39698.
2017-03-07Add tests for issues with the 'E-needtest' label.topecongiro-0/+49
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