about summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2018-06-22Auto merge of #51681 - varkor:rustc_deprecated-future-deprecation, ↵bors-0/+13
r=petrochenkov Support future deprecation for rustc_deprecated Follow-up to #49179 to allow `since` parameters to be set to future versions of Rust and correspondingly to not be treated as deprecated until that version. This is required for #30459 to be completed (though we'll need to wait until this hits beta).
2018-06-22Auto merge of #51463 - estebank:error-codes, r=nikomatsakisbors-136/+165
Various changes to existing diagnostics * [Add code to `invalid ABI` error, add span label, move list to help to make message shorter](https://github.com/rust-lang/rust/pull/51463/commits/23ae5af274defa9ff884f593e44a2bbcaf814a02): ``` error[E0697]: invalid ABI: found `路濫狼á́́` --> $DIR/unicode.rs:11:8 | LL | extern "路濫狼á́́" fn foo() {} //~ ERROR invalid ABI | ^^^^^^^^^ invalid ABI | = help: valid ABIs: cdecl, stdcall, fastcall, vectorcall, thiscall, aapcs, win64, sysv64, ptx-kernel, msp430-interrupt, x86-interrupt, Rust, C, system, rust-intrinsic, rust-call, platform-intrinsic, unadjusted ``` * [Add code to incorrect `pub` restriction error](https://github.com/rust-lang/rust/pull/51463/commits/e96fdea8a38f39f99f8b9a4000a689187a457e08) * [Add message to `rustc_on_unimplemented` attributes in core to have them set a custom message _and_ label](https://github.com/rust-lang/rust/pull/51463/commits/2cc7e5ed307aee936c20479cfdc7409d6b52a464): ``` error[E0277]: `W` does not have a constant size known at compile-time --> $DIR/unsized-enum2.rs:33:8 | LL | VA(W), | ^ `W` does not have a constant size known at compile-time | = help: the trait `std::marker::Sized` is not implemented for `W` = help: consider adding a `where W: std::marker::Sized` bound = note: no field of an enum variant may have a dynamically sized type ``` ``` error[E0277]: `Foo` cannot be sent between threads safely --> $DIR/E0277-2.rs:26:5 | LL | is_send::<Foo>(); | ^^^^^^^^^^^^^^ `Foo` cannot be sent between threads safely | = help: the trait `std::marker::Send` is not implemented for `Foo` ``` ``` error[E0277]: can't compare `{integer}` with `std::string::String` --> $DIR/binops.rs:16:7 | LL | 5 < String::new(); | ^ no implementation for `{integer} < std::string::String` and `{integer} > std::string::String` | = help: the trait `std::cmp::PartialOrd<std::string::String>` is not implemented for `{integer}` ``` ``` error[E0277]: can't compare `{integer}` with `std::result::Result<{integer}, _>` --> $DIR/binops.rs:17:7 | LL | 6 == Ok(1); | ^^ no implementation for `{integer} == std::result::Result<{integer}, _>` | = help: the trait `std::cmp::PartialEq<std::result::Result<{integer}, _>>` is not implemented for `{integer}` ``` ``` error[E0277]: a collection of type `i32` cannot be built from an iterator over elements of type `i32` --> $DIR/type-check-defaults.rs:16:19 | LL | struct WellFormed<Z = Foo<i32, i32>>(Z); | ^ a collection of type `i32` cannot be built from `std::iter::Iterator<Item=i32>` | = help: the trait `std::iter::FromIterator<i32>` is not implemented for `i32` note: required by `Foo` --> $DIR/type-check-defaults.rs:15:1 | LL | struct Foo<T, U: FromIterator<T>>(T, U); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` * [Add link to book for `Sized` errors](https://github.com/rust-lang/rust/pull/51463/commits/1244dc7c283323aea1a3457a4458d590a3e160c8): ``` error[E0277]: `std::fmt::Debug + std::marker::Sync + 'static` does not have a constant size known at compile-time --> $DIR/const-unsized.rs:13:29 | LL | const CONST_0: Debug+Sync = *(&0 as &(Debug+Sync)); | ^^^^^^^^^^^^^^^^^^^^^^ `std::fmt::Debug + std::marker::Sync + 'static` does not have a constant size known at compile-time | = help: the trait `std::marker::Sized` is not implemented for `std::fmt::Debug + std::marker::Sync + 'static` = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized> = note: constant expressions must have a statically known size ``` * [Point to previous line for single expected token not found](https://github.com/rust-lang/rust/pull/51463/commits/48165168fb0f059d8536cd4a2276b609d4a7f721) (if the current token is in a different line)
2018-06-21Support future deprecation for rustc_deprecatedvarkor-0/+13
2018-06-20Simply joint lifetime/type iterationvarkor-1/+1
2018-06-19Update message for `!Sized` typesEsteban Küber-80/+82
2018-06-19Fix tidy and remove unused methodEsteban Küber-3/+3
2018-06-19Add message to `rustc_on_unimplemented` attributes in coreEsteban Küber-135/+162
2018-06-19Update the existing compile-fail tests to reflect diagnostic changes in NLL.Felix S. Klock II-1/+8
2018-06-19updates to compile-fail tests for changes to NLL.Felix S. Klock II-3/+3
2018-06-17test: Ignore some problematic tests on powerpc and powerpc64*John Paul Adrian Glaubitz-0/+12
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