about summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2018-06-15Moving allow statemate to the function blockSebastian Malton-1/+1
2018-06-12Stabilize #[repr(transparent)]Simon Sapin-4/+1
Tracking issue FCP: https://github.com/rust-lang/rust/issues/43036#issuecomment-394094318 Reference PR: https://github.com/rust-lang-nursery/reference/pull/353
2018-06-11Remove some '#[feature]' attributes for stabilized featuresSimon Sapin-10/+0
2018-06-11Stablize the alloc module without changing stability of its contents.Simon Sapin-0/+7
2018-06-11Auto merge of #51480 - dtolnay:lifetime, r=kennytmbors-1/+1
Enable fall through past $:lifetime matcher ```rust macro_rules! is_lifetime { ($lifetime:lifetime) => { true }; ($other:tt) => { false }; } fn main() { println!("{}", is_lifetime!('lifetime)); println!("{}", is_lifetime!(@)); } ``` Before this fix, the `is_lifetime!` invocation would fail to compile with: ``` error: expected a lifetime, found `@` --> src/main.rs:8:33 | 8 | println!("{}", is_lifetime!(@)); | ^ ``` Fixes #50903. Fixes #51477. r? @kennytm
2018-06-10Enable fall through past $:lifetime matcherDavid Tolnay-1/+1
2018-06-10Fix error codesGuillaume Gomez-4/+4
2018-06-08Rollup merge of #51401 - estebank:warn-repr, r=cramertjMark Rousskov-1/+2
Warn on `repr` without hints Fix #51376.
2018-06-08Rollup merge of #51298 - Dylan-DPC:stabilise/termination-test, r=nikomatsakisMark Rousskov-22/+0
Stabilize unit tests with non-`()` return type References #48854
2018-06-08Rollup merge of #51099 - Crazycolorz5:expectedcloseparen, r=estebankMark Rousskov-62/+1
Fix Issue 38777 When looking through for a closing bracket in the loop condition, adds them to expecteds. https://github.com/rust-lang/rust/issues/38777
2018-06-08Built, corrected, and run tests. Added expected stderr files.Crazycolorz5-1/+1
2018-06-08rename `irrefutable_let_pattern` to `irrefutable_let_patterns`Niko Matsakis-6/+6
2018-06-08Rollup merge of #51368 - varkor:panic_implementation-closures, r=eddybkennytm-0/+21
Fix the use of closures within #[panic_implementation] Fixes #51365.
2018-06-06Use consistent span for repr attr suggestionEsteban Küber-1/+2
2018-06-05Properly report transitive errorsOliver Schneider-0/+3
2018-06-05Refactor the const eval diagnostic APIOliver Schneider-41/+30
2018-06-05Rollup merge of #51343 - glaubitz:sparc64-tests, r=shepmasterMark Simulacrum-0/+6
test: Ignore some problematic tests on sparc and sparc64 This updates the list of tests which can be safely ignored on sparc and sparc64.
2018-06-05Implementation of RFC 2086 - Allow Irrefutable Let patternsSebastian Malton-0/+49
2018-06-05Fix the use of closures within #[panic_implementation]varkor-0/+21
2018-06-05Fix testsFabian Zaiser-2/+4
2018-06-04Changed a few tests, and changed the folder of a few of them.Crazycolorz5-62/+1
2018-06-04test: Ignore some problematic tests on sparc and sparc64John Paul Adrian Glaubitz-0/+6
2018-06-04Merge branch 'master' into stabilise/termination-testDylan DPC-8/+255
2018-06-03add more testsJorge Aparicio-0/+73
2018-06-03reject `fn panic_impl<T>(_: &PanicInfo) -> !`Jorge Aparicio-0/+23
2018-06-03implement #[panic_implementation]Jorge Aparicio-7/+157
2018-06-02Stabilize unit tests with non-`()` return typedylan_DPC-22/+0
2018-06-01merge UNNECESSARY_EXTERN_CRATE and UNUSED_EXTERN_CRATESNiko Matsakis-1/+2
2018-05-30rustc: don't visit lifetime parameters through visit_lifetime.Eduard-Mihai Burtescu-1/+0
2018-05-27Auto merge of #48309 - mark-i-m:anon_param_lint, r=nikomatsakisbors-4/+4
Make anon params lint warn-by-default This is intended as a followup on anonymous parameters deprecation. Cross-posting from #41686: > After having read a bit more of the discussion that I can find, I propose a more aggressive deprecation strategy: > - We make the lint warn-by-default as soon as possible > - We make anon parameters a hard error at the epoch boundary cc @matklad @est31 @aturon
2018-05-27Make anon params lint warn-by-defaultMark Mansi-4/+4
2018-05-27Address comments in pull request #51084.Simon Martin-12/+0
2018-05-27Auto merge of #51084 - simartin:issue_51022, r=estebankbors-0/+12
Issue #51022: Improve E0131 message when lifetimes are involved. Fixes #51022
2018-05-27Issue #51022: Improve E0131 message when lifetimes are involved.Simon Martin-0/+12
2018-05-26Rollup merge of #51070 - est31:fix_break_const_ice, r=estebankkennytm-0/+1
Fail typecheck if we encounter a bogus break Lone breaks outside of loops create errors in the loop check pass but as they are not fatal, compilation continues. MIR building code assumes all HIR break statements to point to valid locations and fires ICEs if this assumption is violated. In normal compilation, this causes no issues, as code apparently prevents MIR from being built if errors are present. However, before that, typecheck runs and with it MIR const eval. Here we operate differently from normal compilation: it doesn't check for any errors except for type checker ones and then directly builds the MIR. This constellation causes an ICE-on-error if bogus break statements are being put into array length expressions. This commit fixes this ICE by letting typecheck fail if bogus break statements are encountered. This way, MIR const eval fails cleanly with a type check error. Fixes #50576 Fixes #50581
2018-05-26Fail typecheck if we encounter a bogus breakest31-0/+1
Lone breaks outside of loops create errors in the loop check pass but as they are not fatal, compilation continues. MIR building code assumes all HIR break statements to point to valid locations and fires ICEs if this assumption is violated. In normal compilation, this causes no issues, as code apparently prevents MIR from being built if errors are present. However, before that, typecheck runs and with it MIR const eval. Here we operate differently from normal compilation: it doesn't check for any errors except for type checker ones and then directly builds the MIR. This constellation causes an ICE-on-error if bogus break statements are being put into array length expressions. This commit fixes this ICE by letting typecheck fail if bogus break statements are encountered. This way, MIR const eval fails cleanly with a type check error. Fixes #50576 Fixes #50581
2018-05-26Auto merge of #50070 - toidiu:ak-2093-outlives, r=nikomatsakisbors-25/+0
2093 infer outlives requirements Tracking issue: #44493 RFC: https://github.com/rust-lang/rfcs/pull/2093 - [x] add `rustc_attrs` flag - [x] use `RequirePredicates` type - [x] handle explicit predicates on `dyn` Trait - [x] handle explicit predicates on projections - [x] more tests - [x] remove `unused`, `dead_code` and etc.. - [x] documentation
2018-05-25Implement outlives requirements inference for dyn and projections.toidiu-25/+0
Add tests, documentation and attr for feature.
2018-05-25Auto merge of #50986 - estebank:main-start-span, r=nikomatsakisbors-1/+1
Tweak `main` type arguments and where clause spans Tweak the spans for error when finding type arguments or where clauses in main and start functions.
2018-05-25Fix naming conventions for new lintsVadim Petrochenkov-2/+2
2018-05-24Auto merge of #50943 - oli-obk:cleanups, r=estebankbors-42/+0
impl Trait diagnostic/test cleanups
2018-05-22Tweak `main` type arguments and where clause spansEsteban Küber-1/+1
Tweak the spans for error when finding type arguments or where clauses in main and start functions.
2018-05-22Fix a typo in a commentOliver Schneider-1/+1
2018-05-22Report let bindings and statements as unstableOliver Schneider-29/+55
2018-05-21Move a test to ui tests so we can observe the output changes betterOliver Schneider-42/+0
2018-05-20Auto merge of #50851 - eddyb:the-only-constant, r=nikomatsakisbors-0/+43
rustc: introduce {ast,hir}::AnonConst to consolidate so-called "embedded constants". Previously, constants in array lengths and enum variant discriminants were "merely an expression", and had no separate ID for, e.g. type-checking or const-eval, instead reusing the expression's. That complicated code working with bodies, because such constants were the only special case where the "owner" of the body wasn't the HIR parent, but rather the same node as the body itself. Also, if the body happened to be a closure, we had no way to allocate a `DefId` for both the constant *and* the closure, leading to *several* bugs (mostly ICEs where type errors were expected). This PR rectifies the situation by adding another (`{ast,hir}::AnonConst`) node around every such constant. Also, const generics are expected to rely on the new `AnonConst` nodes, as well (cc @varkor). * fixes #48838 * fixes #50600 * fixes #50688 * fixes #50689 * obsoletes #50623 r? @nikomatsakis
2018-05-20Auto merge of #50803 - varkor:never-transmute-never, r=eddybbors-0/+33
Fix an ICE when attempting to transmute an uninhabited type Fixes https://github.com/rust-lang/rust/issues/50570.
2018-05-19rustc: introduce {ast,hir}::AnonConst to consolidate so-called "embedded ↵Eduard-Mihai Burtescu-0/+43
constants".
2018-05-19Auto merge of #50760 - petrochenkov:legimp, r=nikomatsakisbors-8/+2
Turn deprecation lint `legacy_imports` into a hard error Closes https://github.com/rust-lang/rust/issues/38260 The lint was introduced in Dec 2016, then made deny-by-default in Jun 2017 when crater run found 0 regressions caused by it. This lint requires some not entirely trivial amount of import resolution logic that (surprisingly or not) interacts with `feature(use_extern_macros)` (https://github.com/rust-lang/rust/issues/35896), so it would be desirable to remove it before stabilizing `use_extern_macros`. In particular, this PR fixes the failing example in https://github.com/rust-lang/rust/issues/50725 (but not the whole issue, `use std::panic::{self}` still can cause other undesirable errors when `use_extern_macros` is enabled).
2018-05-18Auto merge of #50653 - oli-obk:bad_const, r=cramertjbors-11/+8
Make the `const_err` lint `deny`-by-default At best these things are runtime panics (debug mode) or overflows (release mode). More likely they are public constants that are unused in the crate declaring them. This is not a breaking change, as dependencies won't break and root crates can `#![warn(const_err)]`, though I don't know why anyone would do that.