about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2020-03-28Rollup merge of #70418 - PankajChaudhary5:master, r=Dylan-DPCDylan DPC-0/+2
Add long error explanation for E0703 Add long explanation for the E0703 error code Part of #61137 r? @GuillaumeGomez
2020-03-28Auto merge of #70261 - Centril:angle-args-partition, r=varkorbors-69/+152
Move arg/constraint partition check to validation & improve recovery - In the first commit, we move the check rejecting e.g., `<'a, Item = u8, String>` from the parser into AST validation. - We then use this to improve the code for parsing generic arguments. - And we add recovery for e.g., `<Item = >` (missing), `<Item = 42>` (constant), and `<Item = 'a>` (lifetime). This is also preparatory work for supporting https://github.com/rust-lang/rust/issues/70256. r? @varkor
2020-03-28Auto merge of #70095 - jsgf:link-native, r=nagisabors-0/+8
Implement -Zlink-native-libraries This implements a flag `-Zlink-native-libraries=yes/no`. If set to true/yes, or unspecified, then native libraries referenced via `#[link]` attributes will be put on the linker line (ie, unchanged behaviour). If `-Zlink-native-libraries=no` is specified then rustc will not add the native libraries to the link line. The assumption is that the outer build system driving the build already knows about the native libraries and will specify them to the linker directly (for example via `-Clink-arg=`). Addresses issue #70093
2020-03-27Rollup merge of #70457 - Centril:non-exhaustive-scrutinee-type, r=estebankMazdak Farrokhzad-0/+263
non-exhastive diagnostic: add note re. scrutinee type This fixes https://github.com/rust-lang/rust/issues/67259 by adding a note: ``` = note: the matched value is of type &[i32] ``` to non-exhaustive pattern matching errors. r? @varkor @estebank
2020-03-27Rollup merge of #70434 - Centril:fix-34421, r=estebankMazdak Farrokhzad-0/+55
suggest `;` on expr `mac!()` which is good as stmt `mac!()` Fixes https://github.com/rust-lang/rust/issues/34421 by implementing @jseyfried's suggestion in https://github.com/rust-lang/rust/issues/34421#issuecomment-301578683. r? @petrochenkov
2020-03-27Rollup merge of #70345 - nnethercote:rm-no_integrated_as, r=alexcrichtonMazdak Farrokhzad-11/+0
Remove `no_integrated_as` mode. Specifically, remove both `-Z no_integrated_as` and `TargetOptions::no_integrated_as`. The latter was only used for the `msp430_none_elf` platform, for which it's no longer required. r? @alexcrichton
2020-03-27add the label back but make it shorterMazdak Farrokhzad-16/+32
2020-03-27Implement -Zlink-native-librariesJeremy Fitzhardinge-0/+8
This implements a flag `-Zlink-native-libraries=yes/no`. If set to true/yes, or unspecified, then native libraries referenced via `#[link]` attributes will be put on the linker line (ie, unchanged behaviour). If `-Zlink-native-libraries=no` is specified then rustc will not add the native libraries to the link line. The assumption is that the outer build system driving the build already knows about the native libraries and will specify them to the linker directly (for example via `-Clink-arg=`). Addresses issue #70093
2020-03-27Auto merge of #69916 - oli-obk:mir_bless, r=eddybbors-138/+795
Enable blessing of mir opt tests cc @rust-lang/wg-mir-opt cc @RalfJung Long overdue, but now you can finally just add a ```rust // EMIT_MIR rustc.function_name.MirPassName.before.mir ``` (or `after.mir` since most of the time you want to know the MIR after a pass). A `--bless` invocation will automatically create the files for you. I suggest we do this for all mir opt tests that have all of the MIR in their source anyway If you use `rustc.function.MirPass.diff` you only get the diff that the MIR pass causes on the MIR. Fixes #67865
2020-03-27Auto merge of #70282 - ssomers:btreemap_gdb_pretty_print, r=Mark-Simulacrumbors-4/+15
Test and fix gdb pretty printing more Over time I had oversimplified the test case for #68098: it does not have an internal node to print so it did not test what it pretended to test. And then I also realized not spotting the same mistake reviewing #70111, and more likely to occur in the wild. Now, both test cases fail if you put back the flawed python code. r? @Mark-Simulacrum
2020-03-27address some review commentsMazdak Farrokhzad-81/+56
2020-03-27parse: improve recovery for assoc eq constraints.Mazdak Farrokhzad-0/+68
2020-03-27parse: move constraint/arg restriction to ast_validation.Mazdak Farrokhzad-71/+95
2020-03-27suggest semi on expr mac!() good as stmt mac!().Mazdak Farrokhzad-0/+55
2020-03-27non-exhastive diagnostic: add note re. scrutinee typeMazdak Farrokhzad-0/+263
2020-03-27Auto merge of #68404 - Amanieu:llvm-asm, r=estebankbors-402/+422
Rename asm! to llvm_asm! As per https://github.com/rust-lang/rfcs/pull/2843, this PR renames `asm!` to `llvm_asm!`. It also renames the compiler's internal `InlineAsm` data structures to `LlvmInlineAsm` in preparation for the new `asm!` functionality specified in https://github.com/rust-lang/rfcs/pull/2850. This PR doesn't actually deprecate `asm!` yet, it just makes it redirect to `llvm_asm!`. This is necessary because we first need to update the submodules (in particular stdarch) to use `llvm_asm!`.
2020-03-27Remove `no_integrated_as` mode.Nicholas Nethercote-11/+0
Specifically, remove both `-Z no_integrated_as` and `TargetOptions::no_integrated_as`. The latter was only used for the `msp430_none_elf` platform, for which it's no longer required.
2020-03-27Rollup merge of #70435 - Alexendoo:test-66706, r=CentrilDylan DPC-0/+45
Add regression test for #66706 Adds the two cases that no longer ICE (https://github.com/rust-lang/rust/issues/66706#issuecomment-604098436)
2020-03-27Rollup merge of #70344 - Centril:hir-pretty, r=eddybDylan DPC-9/+9
Decouple `rustc_hir::print` into `rustc_hir_pretty` High level summary: - The HIR pretty printer, `rustc_hir::print` is moved into a new crate `rustc_hir_pretty`. - `rustc_ast_pretty` and `rustc_errors` are dropped as `rustc_hir` dependencies. - The dependence on HIR pretty is generally reduced, leaving `rustc_save_analysis`, `rustdoc`, `rustc_metadata`, and `rustc_driver` as the remaining clients. The main goal here is to reduce `rustc_hir`'s dependencies and its size such that it can start and finish earlier, thereby working towards https://github.com/rust-lang/rust/issues/65031. r? @Zoxc
2020-03-27Rollup merge of #69936 - Aaron1011:fix/suggestion-cycle, r=varkorDylan DPC-0/+71
Fix cycle error when emitting suggestion for mismatched `fn` type Fixes #66667 Previously, we called `tcx.typeck_tables_of` when determining whether or not to emit a suggestion for a type error. However, we might already be type-checking the `DefId` we pass to `typeck_tables_of` (it could be anywhere in the query stack). Fortunately, we only need the function signature, not the entire `TypeckTables`. By using `tcx.fn_sig`, we avoid the possibility of cycle errors while retaining the ability to emit a suggestion.
2020-03-26Test and fix gdb pretty printing againStein Somers-4/+15
2020-03-26Rollup merge of #70428 - Centril:move-to-mod, r=petrochenkovDylan DPC-0/+89
`error_bad_item_kind`: add help text For example, this adds: ``` = help: consider moving the `use` import out to a nearby module scope ``` r? @petrochenkov @estebank Fixes https://github.com/rust-lang/rust/issues/37205.
2020-03-26Rollup merge of #70413 - AminArria:match-pattern-incorrect-warning, ↵Dylan DPC-0/+22
r=Centril,Nadrieril,varkor Fix incorrect pattern warning "unreachable pattern" Fixes #70372 Added `is_under_guard` parameter to `_match::is_useful` and only add it to the matrix if `false` Tested with: ```rust #![feature(or_patterns)] fn main() { match (3,42) { (a,_) | (_,a) if a > 10 => {println!("{}", a)} _ => () } match Some((3,42)) { Some((a, _)) | Some((_, a)) if a > 10 => {println!("{}", a)} _ => () } match Some((3,42)) { Some((a, _) | (_, a)) if a > 10 => {println!("{}", a)} _ => () } } ```
2020-03-26Add regression test for #66706Alex Macleod-0/+45
2020-03-26Update tests to use llvm_asm!Amanieu d'Antras-400/+420
2020-03-26Rename asm! to llvm_asm!Amanieu d'Antras-2/+2
asm! is left as a wrapper around llvm_asm! to maintain compatibility.
2020-03-26Add tests based on issue #70372 commentsAmin Arria-0/+22
2020-03-26Enable `--bless`ing of MIR dumpsOliver Scherer-138/+795
2020-03-26error_bad_item_kind: add help textMazdak Farrokhzad-0/+89
2020-03-26Rollup merge of #70417 - rakshith-ravi:master, r=CentrilMazdak Farrokhzad-0/+36
parser: recover on `...` as a pattern, suggesting `..` Fixes #70388 My first PR to rust. So please let me know if I'm doing something wrong.
2020-03-26Rollup merge of #70411 - ogoffart:fix-62691, r=eddybMazdak Farrokhzad-0/+7
Fix for #62691: use the largest niche across all fields fixes #62691 (The second commit is a small optimization but it makes the code less pretty and i don't know if it is worth it.)
2020-03-26wip pacify the merciless ui testsNiko Matsakis-1/+1
2020-03-26add test for negative specializes negativeNiko Matsakis-0/+13
2020-03-26move stderr file tooNiko Matsakis-0/+0
2020-03-26give the negative-impls-builtin test a more sensible nameNiko Matsakis-0/+0
2020-03-26comment the `typeck-negative-impls-builtin` testNiko Matsakis-0/+3
2020-03-26move feature-gate-negative-impls test to traits/negative-implsNiko Matsakis-0/+0
2020-03-26create a tracking issue and link to itNiko Matsakis-3/+3
2020-03-26introduce `negative_impls` feature gate and documentNiko Matsakis-96/+159
They used to be covered by `optin_builtin_traits` but negative impls are now applicable to all traits, not just auto traits. This also adds docs in the unstable book for the current state of auto traits.
2020-03-26make a custom error for overlap with negative implsNiko Matsakis-107/+93
2020-03-26permit negative impls for non-auto traitsNiko Matsakis-74/+260
2020-03-26Throw error when encountering `...` instead of `..` while destructing a patternRakshith Ravi-0/+36
Added tests and stderr output
2020-03-26Refactor codePankajChaudhary5-0/+1
2020-03-26Add long error explanation for E0703PankajChaudhary5-0/+1
2020-03-26Rollup merge of #70389 - Centril:borrowck-no-underscores, r=mark-i-mMazdak Farrokhzad-41/+41
borrowck: prefer "value" over "`_`" in diagnostics Fixes https://github.com/rust-lang/rust/issues/67565. r? @pnkfelix @matthewjasper cc @mark-i-m
2020-03-26Rollup merge of #70386 - Centril:patty, r=estebankMazdak Farrokhzad-0/+25
typeck: minor pattern typing improvements r? @estebank
2020-03-26Rollup merge of #69878 - estebank:chained-ops, r=CentrilMazdak Farrokhzad-114/+99
Tweak chained operators diagnostic Use more selective spans Improve suggestion output Be more selective when displaying suggestions Silence some knock-down type errors r? @Centril
2020-03-26typeck/pat: address review commentsMazdak Farrokhzad-5/+5
2020-03-25Tweak chained operators diagnosticEsteban Küber-114/+99
Use more selective spans Improve suggestion output Be more selective when displaying suggestions Silence some knock-down type errors
2020-03-25Rollup merge of #69700 - anyska:layout-details-rename, r=oli-obkDylan DPC-8/+8
Rename LayoutDetails to just Layout.