about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2020-03-29review comment: wordingEsteban Küber-21/+21
2020-03-29Suggest correct order for arguments when encountering early constraintsEsteban Küber-21/+21
When encountering constraints before type arguments or lifetimes, suggest the correct order.
2020-03-29add a build-pass test for issue 62220Dodo-0/+22
2020-03-29#[link]: mention wasm_import_module instead of cfgJonas Schievink-2/+2
2020-03-29More raw string testsRussell Cohen-1/+16
2020-03-29Cleanup error messages, improve docstringsRussell Cohen-4/+4
2020-03-29Rollup merge of #68692 - jyn514:vec-from-array, r=LukasKalbertodtMazdak Farrokhzad-7/+25
impl From<[T; N]> for Vec<T> Closes https://github.com/rust-lang/rust/issues/67963
2020-03-29Auto merge of #70370 - petrochenkov:nosmatch, r=Centrilbors-33/+33
Remove attribute `#[structural_match]` and any references to it A small remaining part of https://github.com/rust-lang/rust/issues/63438.
2020-03-29Improve error messages for raw strings (#60762)Russell Cohen-5/+25
This diff improves error messages around raw strings in a few ways: - Catch extra trailing `#` in the parser. This can't be handled in the lexer because we could be in a macro that actually expects another # (see test) - Refactor & unify error handling in the lexer between ByteStrings and RawByteStrings - Detect potentially intended terminators (longest sequence of "#*" is suggested)
2020-03-28Suggest correct order for args and constraintsEsteban Küber-0/+45
2020-03-28Point at all constraints before argsEsteban Küber-40/+58
2020-03-28Auto merge of #66938 - GuillaumeGomez:lint-for-no-crate-level-doc, r=Dylan-DPCbors-0/+15
Add lint when no doc is present at the crate-level Follow-up of #66267. r? @kinnison
2020-03-28Make fields in `MemoryBlock` publicTim Diekmann-13/+13
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-27Move raw string tests into the raw directoryRussell Cohen-0/+0
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-26Remove alignment from `MemoryBlock`Tim Diekmann-20/+13
2020-03-26Fix issues from review and unsoundness of `RawVec::into_box`Tim Diekmann-28/+33
2020-03-26Overhaul of the `AllocRef` trait to match allocator-wg's latest consensTim Diekmann-48/+64
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