summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2018-09-07Add license header to the new testsPietro Albini-9/+69
Beta still requires them.
2018-09-07Validate syntax of `--cfg` command line argumentsVadim Petrochenkov-13/+15
2018-09-07Validate syntax of `cfg` attributesVadim Petrochenkov-0/+92
2018-09-04Properly prevent the promotion of unstable const fnsOliver Schneider-1/+92
2018-09-01Add a test for reset expansion infoVadim Petrochenkov-0/+29
2018-08-26Auto merge of #53425 - oli-obk:validation, r=nikomatsakisbors-0/+21
[beta] Don't sanity check function pointers in vtables cc https://github.com/rust-lang/rust/issues/53401 There's no beta nomination because the full fix (https://github.com/rust-lang/rust/pull/53424) is not backportable
2018-08-25Feature gate where clauses on associated type implsvarkor-4/+17
2018-08-25resolve: Reject some inaccessible candidates sooner during import resolutionVadim Petrochenkov-0/+21
This allows import resolution to progress in cases like #53140
2018-08-25fix testcasedylan_DPC-5/+18
2018-08-25add warning for missing docsdylan_DPC-4/+5
2018-08-25add testcase to existing macro testcasedylan_DPC-3/+22
2018-08-25Fix tidyOliver Schneider-1/+1
2018-08-25Remove an overly pedantic and wrong assertionOliver Schneider-0/+23
2018-08-25An attempt to fix NLL migration mode so that reports region errors when ↵Felix S. Klock II-5/+40
necessary. Namely, the code here was trying to be clever, and say "lets not report diagnostics when we 'know' NLL will report an error about them in the future." The problem is that in migration mode, when no error was reported here, the NLL error that we "knew" was coming was downgraded to a warning (!). This fixes that by only doing the "clever" skipping of region error reporting when we are not in migration mode. Rather than make a separate test for issue 53026, I just took the test that uncovered this in a first place, and extended it (via our revisions system) to explicitly show all three modes in action: ACT-borrowck, NLL, and NLL migration mode. (Tto be honest I hope not to have to add such revisions to many tests. Instead I hope to adopt some sort of new `compare-mode` for either borrowck=migrate or for the 2018 edition as a whole.)
2018-08-17Don't sanity check function pointers in vtablesOliver Schneider-0/+21
2018-07-31add regression test for #52057Niko Matsakis-0/+35
Fixes #52057
2018-07-30Auto merge of #52722 - alexcrichton:more-identifier-lints, r=oli-obkbors-0/+38
Tweak the raw_identifiers lints in 2018 * Enable the `raw_identifiers` feature automatically in the 2018 preview * Only emit lint warnings if the `raw_identifiers` feature is activated cc rust-lang/cargo#5783
2018-07-29Move a test that depends on the arch bitwidth to compile-failOliver Schneider-132/+0
2018-07-29Sanity-check all constantsOliver Schneider-13/+549
2018-07-29Auto merge of #52620 - mikhail-m1:51351, r=nikomatsakisbors-46/+139
fix simple case of issue #51351 and #52133 r? @nikomatsakis
2018-07-29fix issues #51351 and #52133Mikhail Modin-46/+139
2018-07-28Auto merge of #52761 - toidiu:ak-static-infer-fg, r=nikomatsakisbors-0/+121
static infer feature gate https://github.com/rust-lang/rust/issues/44493 r? @nikomatsakis
2018-07-28Auto merge of #52802 - kennytm:rollup, r=kennytmbors-0/+46
Rollup of 11 pull requests Successful merges: - #52702 (Suggest fix when encountering different mutability from impl to trait) - #52703 (Improve a few vectors - calculate capacity or build from iterators) - #52740 (Suggest underscore when using dashes in crate namet push fork) - #52759 (Impl Send & Sync for JoinHandle) - #52760 (rustc_metadata: test loading atoi instead of cos) - #52763 (Omit the vendor component in Fuchsia triple) - #52765 (Remove unused "-Zenable_nonzeroing_move_hints" flag) - #52769 (Incorporate a stray test) - #52777 (Fix doc comment for 'ptr::copy_to' method) - #52779 (revert accidental atty downgrade) - #52781 (Use a slice where a vector is not necessary) Failed merges: r? @ghost
2018-07-28Rollup merge of #52740 - estebank:crate-name, r=petrochenkovkennytm-0/+34
Suggest underscore when using dashes in crate namet push fork Fix #48437.
2018-07-28Rollup merge of #52702 - csmoe:mut_diff, r=estebankkennytm-0/+12
Suggest fix when encountering different mutability from impl to trait Closes https://github.com/rust-lang/rust/issues/52412 r? @estebank
2018-07-28Auto merge of #52678 - matthewjasper:better-spans, r=nikomatsakisbors-134/+272
[NLL] Use better spans in some errors * Use the span of the discriminant and patterns for "fake" statements created to properly check matches. I plan to special case these soon, but this felt like a good first step * Use the span of the statement, rather than the initialization, when reporting move errors for `let x = ...`, which avoids giving an unhelpful suggestion to use `&{ }`. r? @nikomatsakis cc @pnkfelix
2018-07-27Auto merge of #52648 - davidtwco:issue-52533, r=nikomatsakisbors-50/+162
[nll] improve the "fully elaborated type" case in region errors Fixes #52533. r? @nikomatsakis
2018-07-27Region inference error messages no longer start with 'free region'David Wood-8/+8
2018-07-27Auto merge of #52733 - ↵bors-0/+33
pnkfelix:issue-51348-make-temp-for-each-candidate-in-arm, r=nikomatsakis [NLL] make temp for each candidate in `match` arm In NLL, `ref mut` patterns leverage the two-phase borrow infrastructure to allow the shared borrows within a guard before the "activation" of the mutable borrow when we begin execution of the match arm's body. (There is further discussion of this on PR #50783.) To accommodate the restrictions we impose on two-phase borrows (namely that there is a one-to-one mapping between each activation and the original initialization), this PR is making separate temps for each candidate pattern. So in an arm like this: ```rust PatA(_, ref mut ident) | PatB(ref mut ident) | PatC(_, _, ref mut ident) | PatD(ref mut ident) if guard_stuff(ident) => ... ``` instead of 3 temps (two for the guard and one for the arm body), we now have 4 + 2 temps associated with `ident`: one for each candidate plus the actual temp that the guard uses directly, and then the sixth is the temp used in the arm body. Fix #51348
2018-07-27Improved mechanism for naming regions in non-annotated types.David Wood-10/+70
2018-07-27Change label from closure to function where appropriate.David Wood-34/+32
2018-07-27Fixed missing whitespace on some elaborated types.David Wood-3/+3
2018-07-27Update affected tests.David Wood-22/+22
2018-07-27Added fully elaborated type label for inferred arguments.David Wood-0/+54
2018-07-27Auto merge of #52681 - pnkfelix:z-borrowck-migrate, r=nikomatsakisbors-28/+155
Add `-Z borrowck=migrate` This adds `-Z borrowck=migrate`, which represents the way we want to migrate to NLL under Rust versions to come. It also hooks this new mode into `--edition 2018`, which means we're officially turning NLL on in the 2018 edition. The basic idea of `-Z borrowck=migrate` that there are cases where NLL is fixing old soundness bugs in the borrow-checker, but in order to avoid just breaking code by immediately rejecting the programs that hit those soundness bugs, we instead use the following strategy: If your code is accepted by NLL, then we accept it. If your code is rejected by both NLL and the old AST-borrowck, then we reject it. If your code is rejected by NLL but accepted by the old AST-borrowck, then we emit the new NLL errors as **warnings**. These warnings will be turned into hard errors in the future, and they say so in these diagnostics. Fix #46908
2018-07-27Auto merge of #52650 - oli-obk:associated_existential_types, r=nikomatsakisbors-0/+104
Implement associated existential types r? @nikomatsakis no idea if these work with generic traits. I'm going home for the day :rofl:
2018-07-27fix tidytoidiu-1/+0
2018-07-26fix test and add feature gate testtoidiu-4/+43
2018-07-26some comment about not infering static lifetimes testtoidiu-1/+7
2018-07-26feature gate for inferring 'static lifetimestoidiu-0/+77
2018-07-26Auto merge of #52673 - oli-obk:mutable_promoted, r=nagisa,cramertj,estebankbors-0/+17
Try to fix an ICE might fix #52671
2018-07-26Tweak the raw_identifiers lints in 2018Alex Crichton-0/+38
* Enable the `raw_identifiers` feature automatically in the 2018 preview * Only emit lint warnings if the `raw_identifiers` feature is activated cc rust-lang/cargo#5783
2018-07-26Use better spans for cannot-move errorsMatthew Jasper-4/+191
2018-07-26Use better spans for dummy accesses used in matchesMatthew Jasper-130/+81
2018-07-26Suggest underscore when using dashes in crate namet push forkEsteban Küber-0/+34
2018-07-26Auto merge of #52735 - Mark-Simulacrum:rollup, r=Mark-Simulacrumbors-116/+622
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-26Auto merge of #52488 - nikomatsakis:nll-issue-48071-universe-and-sub, r=pnkfelixbors-93/+456
introduce universes to NLL type check This branch aims to fix #48071 and also advance chalk integration a bit at the same time. It re-implements the subtyping/type-equating check so that NLL doesn't "piggy back" on the subtyping code of the old type checker. This new code uses the "universe-based" approach to handling higher-ranked lifetimes, which sidesteps some of the limitations of the current "leak-based" scheme. This avoids the ICE in #48071. At the same time, I aim for this to potentially be a kind of optimization. This NLL code is (currently) not cached, but it also generates constraints without doing as much instantiation, substitution, and folding. Right now, though, it still piggy backs on the `relate_tys` trait, which is a bit unfortunate -- it means we are doing more hashing and things than we have to. I want to measure the see the perf. Refactoring that trait is something I'd prefer to leave for follow-up work. r? @pnkfelix -- but I want to measure perf etc first
2018-07-26Rollup merge of #52721 - cramertj:try-poll, r=aturonMark Rousskov-0/+61
std::ops::Try impl for std::task::Poll I originally left out the `Try` impl for `Poll` because I was curious if we needed it, and @MajorBreakfast and I had discussed the potential for it to introduce confusion about exactly what control-flow was happening at different points. However, after porting a pretty significant chunk of Fuchsia over to futures 0.3, I discovered that I was *constantly* having to do repetitive matching on `Poll<Result<...>>` or `Poll<Option<Result<...>>>` in order to propagate errors correctly. `try_poll` (propagate `Poll::Ready(Err(..))`s) helped in some places, but it was far more common to need some form of conversion between `Result`, `Poll<Result<...>>`, and `Poll<Option<Result<...>>>`. The `Try` trait conveniently provides all of these conversions in addition to a more concise syntax (`?`), so I'd like to experiment with using these instead. cc @seanmonstar r? @aturon Note: this change means that far more futures 0.1 code can work without significant changes since it papers over the fact that `Result` is no longer at the top-level when using `Stream` and `Future` (since it's now `Poll<Result<...>>` or `Poll<Option<Result<...>>>` instead of `Result<Poll<..>>` and `Result<Poll<Option<...>>>`).
2018-07-26Rollup merge of #52695 - oli-obk:const_err_panic, r=petrochenkovMark Rousskov-0/+24
Hide some lints which are not quite right the way they are reported to the user fixes #52603
2018-07-26Rollup merge of #52649 - estebank:fmt-span, r=oli-obkMark Rousskov-13/+325
Point spans to inner elements of format strings - Point at missing positional specifiers in string literal ``` error: invalid reference to positional arguments 3, 4 and 5 (there are 3 arguments) --> $DIR/ifmt-bad-arg.rs:34:38 | LL | format!("{name} {value} {} {} {} {} {} {}", 0, name=1, value=2); | ^^ ^^ ^^ | = note: positional arguments are zero-based ``` - Point at named formatting specifier in string literal ``` error: there is no argument named `foo` --> $DIR/ifmt-bad-arg.rs:37:17 | LL | format!("{} {foo} {} {bar} {}", 1, 2, 3); | ^^^^^ ``` - Update label for formatting string in "multiple unused formatting arguments" to be more correct ``` error: multiple unused formatting arguments --> $DIR/ifmt-bad-arg.rs:42:17 | LL | format!("", 1, 2); //~ ERROR: multiple unused formatting arguments | -- ^ ^ | | | multiple missing formatting specifiers ``` - When using `printf` string formatting, provide a structured suggestion instead of a note ``` error: multiple unused formatting arguments --> $DIR/format-foreign.rs:12:30 | LL | println!("%.*3$s %s!/n", "Hello,", "World", 4); //~ ERROR multiple unused formatting arguments | -------------- ^^^^^^^^ ^^^^^^^ ^ | | | multiple missing formatting specifiers | = note: printf formatting not supported; see the documentation for `std::fmt` help: format specifiers in Rust are written using `{}` | LL | println!("{:.2$} {}!/n", "Hello,", "World", 4); //~ ERROR multiple unused formatting arguments | ^^^^^^ ^^ ```