summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2018-09-09Fix compile-fail/cfg-empty-codemap.rs testPietro Albini-1/+1
2018-09-07Validate syntax of `--cfg` command line argumentsVadim Petrochenkov-13/+0
2018-07-29Move a test that depends on the arch bitwidth to compile-failOliver Schneider-0/+89
2018-07-29Sanity-check all constantsOliver Schneider-2/+1
2018-07-28Auto merge of #52546 - nikomatsakis:issue-52050, r=pnkfelixbors-0/+42
do not overwrite child def-id in place but rather remove/insert When inserting a node N into the tree of impls, we sometimes find than an existing node C should be replaced with N. We used to overwrite C in place with the new def-id N -- but since the lists of def-ids are separated by simplified type, that could lead to N being inserted in the wrong place. This meant we might miss conflicts. We are now not trying to be so smart -- we remove C and then add N later. Fixes #52050 r? @aturon -- do you still remember this code at all? :)
2018-07-26Auto merge of #52735 - Mark-Simulacrum:rollup, r=Mark-Simulacrumbors-67/+0
Rollup of 16 pull requests Successful merges: - #52558 (Add tests for ICEs which no longer repro) - #52610 (Clarify what a task is) - #52617 (Don't match on region kinds when reporting NLL errors) - #52635 (Fix #[linkage] propagation though generic functions) - #52647 (Suggest to take and ignore args while closure args count mismatching) - #52649 (Point spans to inner elements of format strings) - #52654 (Format linker args in a way that works for gcc and ld) - #52667 (update the stdsimd submodule) - #52674 (Impl Executor for Box<E: Executor>) - #52690 (ARM: expose `rclass` and `dsp` target features) - #52692 (Improve readability in a few sorts) - #52695 (Hide some lints which are not quite right the way they are reported to the user) - #52718 (State default capacity for BufReader/BufWriter) - #52721 (std::ops::Try impl for std::task::Poll) - #52723 (rustc: Register crates under their real names) - #52734 (sparc ABI issue - structure returning from function is returned in 64bit registers (with tests)) Failed merges: - #52678 ([NLL] Use better spans in some errors) r? @ghost
2018-07-26move mir_check_* to ui tests, add adjusted referencesNiko Matsakis-120/+0
2018-07-22Point at internal span in format stringEsteban Küber-67/+0
2018-07-21do not overwrite child def-id in place but rather remove/insertNiko Matsakis-0/+42
When inserting a node N into the tree of impls, we sometimes find than an existing node C should be replaced with N. We used to overwrite C in place with the new def-id N -- but since the lists of def-ids are separated by simplified type, that could lead to N being inserted in the wrong place. This meant we might miss conflicts. We are now not trying to be so smart -- we remove C and then add N later.
2018-07-20Update tests for new NLL mutability errorsMatthew Jasper-5/+5
2018-07-17Auto merge of #52409 - estebank:move-cfail-ui, r=oli-obkbors-12817/+4
Move some `compile-fail` tests to `ui` Re: #44844.
2018-07-16Return tests that have platform dependant outputEsteban Küber-0/+102
2018-07-16ExprKindcsmoe-1/+1
2018-07-15Fix testsEsteban Küber-0/+106
2018-07-15Move some `compile-fail` tests to `ui`Esteban Küber-13021/+0
2018-07-14structured suggestion for renamed-and-removed-lintsZack M. Davis-4/+4
2018-07-14Auto merge of #52318 - TheDarkula:master, r=oli-obkbors-0/+17
Removed the promotable field from CheckCrateVisitor... and replaced it with the custom enum Promotability. r? @oli-obk
2018-07-14Removed the promotable field from CheckCrateVisitor and replaced it with the ↵Meade Kincke-0/+17
structs Promotable and NotPromotable.
2018-07-11Rollup merge of #52207 - RalfJung:unsafety-errors, r=estebankMark Rousskov-71/+28
improve error message shown for unsafe operations Add a short explanation saying why undefined behavior could arise. In particular, the error many people got for "creating a pointer to a packed field requires unsafe block" was not worded great -- it lead to people just adding the unsafe block without considering if what they are doing follows the rules. I am not sure if a "note" is the right thing, but that was the easiest thing to add... Inspired by @gnzlbg at https://github.com/rust-lang/rust/issues/46043#issuecomment-381544673
2018-07-11Rollup merge of #52231 - lqd:error_mesg, r=GuillaumeGomezGuillaume Gomez-79/+79
Fix typo in error message E0277 Fix a typo we stumbled upon by accident :) r? @estebank
2018-07-11Auto merge of #52232 - arielb1:ill-adjusted-tuples, r=pnkfelixbors-0/+24
use the adjusted type for cat_pattern in tuple patterns This looks like a typo introduced in #51686. Fixes #52213. r? @pnkfelix beta + stable nominating because regression + unsoundness.
2018-07-11add test for #52213Ariel Ben-Yehuda-0/+24
2018-07-10Fix typo in error message E0277Rémy Rakic-79/+79
2018-07-10Auto merge of #52191 - SimonSapin:alloc_error_handler, r=alexcrichtonbors-0/+101
Implement #[alloc_error_handler] This to-be-stable attribute is equivalent to `#[lang = "oom"]`. It is required when using the `alloc` crate without the `std` crate. It is called by `handle_alloc_error`, which is in turned called by "infallible" allocations APIs such as `Vec::push`.
2018-07-10improve error message shown for unsafe operations: explain why undefined ↵Ralf Jung-71/+28
behavior could arise Inspired by @gnzlbg at https://github.com/rust-lang/rust/issues/46043#issuecomment-381544673
2018-07-09Implement #[alloc_error_handler]Simon Sapin-0/+101
This to-be-stable attribute is equivalent to `#[lang = "oom"]`. It is required when using the alloc crate without the std crate. It is called by `handle_alloc_error`, which is in turned called by "infallible" allocations APIs such as `Vec::push`.
2018-07-09bump minimum LLVM version to 5.0gnzlbg-1/+0
2018-07-06Rollup merge of #52083 - spastorino:dont-run-ast-borrowck-on-mir-mode, ↵Mark Rousskov-4/+4
r=nikomatsakis Dont run ast borrowck on mir mode r? @nikomatsakis
2018-07-06Auto merge of #52021 - nikomatsakis:nll-region-errors, r=estebankbors-7/+6
refactor and cleanup region errors for NLL This is a WIP commit. It simplifies some of the code from https://github.com/rust-lang/rust/pull/51536 and extends a few more steps towards the errors that @davidtwco and I were shooting for. These are intended as a replacement for the general "unable to infer lifetime" messages -- one that is actually actionable. We're certainly not there yet, but the overall shape hopefully gets a bit clearer. I'm thinking about trying to open up an internals thread to sketch out the overall plan and perhaps discuss how to get the wording right, which special cases to handle, etc. r? @estebank cc @davidtwco
2018-07-06Auto merge of #52018 - flip1995:rfc2103, r=oli-obkbors-0/+46
Implementation of tool lints. Tracking issue: #44690
2018-07-06Rollup merge of #52016 - oli-obk:dedup_static_errors, r=estebankkennytm-4/+0
Deduplicate error reports for statics fixes #51970
2018-07-04Remove rustc_mir_borrowck attribute and use rustc_mir insteadSantiago Pastorino-4/+4
2018-07-04Improving span of unknown lint tool error messageflip1995-2/+2
2018-07-04Tests for tool_lintsflip1995-0/+46
2018-07-04write code to extract region names and emit new style messageNiko Matsakis-7/+6
2018-07-03Auto merge of #51926 - matthewjasper:Initialization-span, r=nikomatsakisbors-2/+2
[NLL] Use better span for initializing a variable twice Closes #51217 When assigning to a (projection from a) local immutable local which starts initialised (everything except `let PATTERN;`): * Point to the declaration of that local * Make the error message refer to the local, rather than the projection. r? @nikomatsakis
2018-07-03Deduplicate error reports for staticsOliver Schneider-4/+0
2018-07-03Rollup merge of #51958 - euclio:attr-refactor, r=petrochenkovPietro Albini-37/+0
Show known meta items in unknown meta items error This PR adds a label to E0541. It also factors built-in attribute parsing into a submodule of `attr` for ease of future refactoring. Fixes #51469.
2018-07-01Auto merge of #51110 - alexreg:new-static-eval-rules, r=eddybbors-109/+27
Loosened rules involving statics mentioning other statics Before this PR, trying to mention a static in any way other than taking a reference to it caused a compile-time error. So, while ```rust static A: u32 = 42; static B: &u32 = &A; ``` compiles successfully, ```rust static A: u32 = 42; static B: u32 = A; // error ``` and ```rust static A: u32 = 42; static B: u32 = *&A; // error ``` are not possible to express in Rust. On the other hand, introducing an intermediate `const fn` can presently allow one to do just that: ```rust static A: u32 = 42; static B: u32 = foo(&A); // success! const fn foo(a: &u32) -> u32 { *a } ``` Preventing `const fn` from allowing to work around the ban on reading from statics would cripple `const fn` almost into uselessness. Additionally, the limitation for reading from statics comes from the old const evaluator(s) and is not shared by `miri`. This PR loosens the rules around use of statics to allow statics to evaluate other statics by value, allowing all of the above examples to compile and run successfully. Reads from extern (foreign) statics are however still disallowed by miri, because there is no compile-time value to be read. ```rust extern static A: u32; static B: u32 = A; // error ``` This opens up a new avenue of potential issues, as a static can now not just refer to other statics or read from other statics, but even contain references that point into itself. While it might seem like this could cause subtle bugs like allowing a static to be initialized by its own value, this is inherently impossible in miri. Reading from a static causes the `const_eval` query for that static to be invoked. Calling the `const_eval` query for a static while already inside the `const_eval` query of said static will cause cycle errors. It is not possible to accidentally create a bug in miri that would enable initializing a static with itself, because the memory of the static *does not exist* while being initialized. The memory is not uninitialized, it is not there. Thus any change that would accidentally allow reading from a not yet initialized static would cause ICEs. Tests have been modified according to the new rules, and new tests have been added for writing to `static mut`s within definitions of statics (which needs to fail), and incremental compilation with complex/interlinking static definitions. Note that incremental compilation did not need to be adjusted, because all of this was already possible before with workarounds (like intermediate `const fn`s) and the encoding/decoding already supports all the possible cases. r? @eddyb
2018-07-01Auto merge of #51969 - pietroalbini:rollup, r=pietroalbinibors-1/+19
Rollup of 7 pull requests Successful merges: - #51511 (Stabilize Iterator::flatten in 1.29, fixes #48213.) - #51853 (Fix some doc links) - #51890 (Fix inconsequential typo in GlobalAlloc doc example) - #51920 (use literal span for concrete type suggestion) - #51921 (improve the error message when `#[panic_implementation]` is missing) - #51922 (rename the llvm-tools component to llvm-tools-preview and tweak its image) - #51961 (Fix typo in /src/librustc_resolve/lib.rs) Failed merges: r? @ghost
2018-07-01Rollup merge of #51921 - japaric:panic-impl-error, r=nagisaPietro Albini-1/+19
improve the error message when `#[panic_implementation]` is missing closes #51341 r? @nagisa cc @phil-opp
2018-07-01Auto merge of #51833 - wesleywiser:faster_large_constant_arrays, r=oli-obkbors-0/+24
Speed up compilation of large constant arrays This is a different approach to #51672 as suggested by @oli-obk. Rather than write each repeated value one-by-one, we write the first one and then copy its value directly into the remaining memory. With this change, the [toy program](https://github.com/rust-lang/rust/blob/c2f4744d2db4e162df824d0bd0b093ba4b351545/src/test/run-pass/mir_heavy_promoted.rs) goes from 63 seconds to 19 seconds on my machine. Edit: Inlining `Size::bytes()` saves an additional 6 seconds dropping the total time to 13 seconds on my machine. Edit2: Now down to 2.8 seconds. r? @oli-obk cc @nnethercote @eddyb
2018-07-01Add two regression tests for const evalWesley Wiser-0/+24
2018-07-01Modified expected error messages in accordance with rebase.Alexander Regueiro-2/+7
2018-06-30move deprecation-sanity test to uiAndy Russell-37/+0
2018-06-30Minor refactoring.Alexander Regueiro-1/+1
2018-06-30Added tests fo referring to statics by value in other statics.Alexander Regueiro-0/+14
2018-06-30Added tests for writing to static mut's in statics.Alexander Regueiro-0/+22
2018-06-30Fixed bug with miri const evaluation where allocation is recursively borrowed.Alexander Regueiro-38/+1
2018-06-30Added miri error for evaluating foreign statics.Alexander Regueiro-67/+7
Updated tests accordingly.