summary refs log tree commit diff
path: root/src/test/ui/issues
AgeCommit message (Collapse)AuthorLines
2018-11-25resolve: Fix bad span arithmetics in import conflict diagnosticsVadim Petrochenkov-3/+20
2018-11-22add compile-pass annotationNiko Matsakis-0/+2
2018-11-22add regression testNiko Matsakis-0/+13
2018-11-17resolve: Avoid sentence breaks in diagnosticsVadim Petrochenkov-17/+17
2018-11-17resolve: Tweak some articles in ambiguity diagnosticsVadim Petrochenkov-7/+7
2018-11-15Sidestep ICE in `type_of_def_id()` when called from `return_type_impl_trait`Esteban Küber-0/+72
2018-11-10Bubble up an overflow error so that rustdoc can ignore itOliver Scherer-1/+2
2018-10-29back out bogus `Ok`-wrapping suggestion on `?` arm type mismatchZack M. Davis-33/+2
This suggestion was introduced in #51938 / 6cc78bf8d7 (while introducing different language for type errors coming from `?` rather than a `match`), but it has a lot of false-positives (as repeatedly reported in Issues #52537, #52598, #54578, #55336), and incorrect suggestions carry more badness than marginal good suggestions do goodness. Just get rid of it (unless and until someone figures out how to do it correctly). Resolves #52537, resolves #54578.
2018-10-29resolve: Desugar empty import groups into synthetic dummy importsVadim Petrochenkov-5/+5
so that they are correctly resolved on 2018 edition
2018-10-29resolve: More precise spans for privacy errorsVadim Petrochenkov-26/+26
2018-10-25Rollup merge of #55173 - estebank:suggest-static, r=oli-obkPietro Albini-6/+3
Suggest appropriate syntax on missing lifetime specifier in return type Suggest using `'static` when a lifetime is missing in the return type with a structured suggestion instead of a note. Fix #55170.
2018-10-23Auto merge of #55229 - nikomatsakis:issue-54692-closure-signatures, ↵bors-7/+5
r=MatthewJasper enforce user annotations in closure signatures Not *quite* ready yet but I'm opening anyway. Still have to finish running tests locally. Fixes #54692 Fixes #54124 r? @matthewjasper
2018-10-23check the self type is well-formedNiko Matsakis-7/+5
This fixes `issue-28848.rs` -- it also handles another case that the AST region checker gets wrong (`wf-self-type.rs`). I don't actually think that this is the *right way* to be enforcing this constraint -- I think we should probably do it more generally, perhaps by editing `predicates_of` for the impl itself. The chalk-style implied bounds setup ought to fix this.
2018-10-23Auto merge of #55113 - mockersf:master, r=estebankbors-17/+401
#45829 when a renamed import conflict with a previous import Fix the suggestion when a renamed import conflict. It check if the snipped contains `" as "`, and if so uses everything before for the suggestion.
2018-10-23Auto merge of #54778 - scottmcm:stabilize-ihle, r=pnkfelixbors-56/+93
Stabilize impl_header_lifetime_elision in 2015 ~~This is currently blocked on https://github.com/rust-lang/rust/issues/54902; it should be good after that~~ It's already stable in 2018; this finishes the stabilization. FCP completed (https://github.com/rust-lang/rust/issues/15872#issuecomment-417953153), proposal (https://github.com/rust-lang/rust/issues/15872#issuecomment-412759783). Tracking issue: https://github.com/rust-lang/rust/issues/15872 Usage examples (from libcore): https://github.com/rust-lang/rust/pull/54687
2018-10-22review commentsEsteban Küber-12/+3
2018-10-22Suggest appropriate syntax on missing lifetime specifier in return typeEsteban Küber-6/+12
Suggest using `'static` when a lifetime is missing in the return type with a structured suggestion instead of a note.
2018-10-21Auto merge of #55069 - matthewjasper:explain-free-region-liveness, ↵bors-205/+130
r=nikomatsakis [NLL] Use new region infer errors when explaining borrows Use the new free region infer errors for explaining borrows This gives at least some explanation for why a borrow is expected to last for a certain free region. Also: * Reports E0373: "closure may outlive the current function" with NLL. * Special cases the case of returning a reference to (or value referencing) a local variable or temporary (E0515). * Special case assigning a reference to a local variable in a closure to a captured variable. (E0521) Closes #51026 - `regions-nested-fns-2.rs` isn't changed to that diagnostic, since that would not be the correct error here. Closes #51169 cc #53882 - The error is (IMO) better now, but it could be better when we trace lifetimes in these error messages. r? @nikomatsakis cc @pnkfelix
2018-10-21Use new region infer errors for explaining borrowsMatthew Jasper-205/+130
This gives at least some explanation for why a borrow is expected to last for a certain free region. Also: * Reports E0373: "closure may outlive the current function" with NLL. * Special cases the case of returning a reference to (or value referencing) a local variable or temporary (E0515). * Special case assigning a reference to a local variable in a closure to a captured variable.
2018-10-21manage cases with tabs or other whitespacesFrançois Mockers-0/+160
2018-10-20Auto merge of #55156 - PramodBisht:issue/52717, r=estebankbors-13/+6
Fixed: Multiple errors on single typo in match pattern Here we have fixed the case where we were throwing two diagnostic messages `E0026` and `E0027` for same case. Example ``` error[E0026]: variant `A::A` does not have a field named `fob` --> src/test/ui/issue-52717.rs:20:12 | 20 | A::A { fob } => { println!("{}", fob); } | ^^^ variant `A::A` does not have this field error[E0027]: pattern does not mention field `foo` --> src/test/ui/issue-52717.rs:20:5 | 20 | A::A { fob } => { println!("{}", fob); } | ^^^^^^^^^^^^ missing field `foo` error: aborting due to 2 previous errors ``` Here above we can see that both `E0026` and `E0027` are depicting same thing. So, to fix this issue, we are simply checking if for last element of `inexistent_fields` is there any value lies in `unmentioned_fields` using levenshtein algorithm, if it does then for that case we are simply deleting element from `unmentioned_fields`. More or less, now instead of showing separate message in `E0027` we are giving extra hint on `E0026` r? @estebank
2018-10-1917905 also no longer errors, thanks to IHLEScott McMurray-12/+76
But its test was written in an outdated way that hits a different error despite IHLE, so keep a variant around for that case.
2018-10-19Hooray! 19982 finally works the way people wanted in December 2014 :)Scott McMurray-44/+17
2018-10-20Auto merge of #55007 - davidtwco:issue-39175, r=petrochenkovbors-0/+40
Help suggests non-existent package std::os::ext::process::CommandExt Fixes #39175.
2018-10-19Only suggest paths that exist.David Wood-0/+40
In order to output a path that could actually be imported (valid and visible), we need to handle re-exports correctly. For example, take `std::os::unix::process::CommandExt`, this trait is actually defined at `std::sys::unix::ext::process::CommandExt` (at time of writing). `std::os::unix` rexports the contents of `std::sys::unix::ext`. `std::sys` is private so the "true" path to `CommandExt` isn't accessible. In this case, the visible parent map will look something like this: (child) -> (parent) `std::sys::unix::ext::process::CommandExt` -> `std::sys::unix::ext::process` `std::sys::unix::ext::process` -> `std::sys::unix::ext` `std::sys::unix::ext` -> `std::os` This is correct, as the visible parent of `std::sys::unix::ext` is in fact `std::os`. When printing the path to `CommandExt` and looking at the current segment that corresponds to `std::sys::unix::ext`, we would normally print `ext` and then go to the parent - resulting in a mangled path like `std::os::ext::process::CommandExt`. Instead, we must detect that there was a re-export and instead print `unix` (which is the name `std::sys::unix::ext` was re-exported as in `std::os`).
2018-10-19Fixed: Multiple errors on single typo in match patternPramod Bisht-13/+6
Here we have fixed the case where we were throwing two diagnostic messages `E0026` and `E0027` for same case like this Example error[E0026]: variant `A::A` does not have a field named `fob` --> src/test/ui/issue-52717.rs:20:12 | 20 | A::A { fob } => { println!("{}", fob); } | ^^^ variant `A::A` does not have this field error[E0027]: pattern does not mention field `foo` --> src/test/ui/issue-52717.rs:20:5 | 20 | A::A { fob } => { println!("{}", fob); } | ^^^^^^^^^^^^ missing field `foo` error: aborting due to 2 previous errors Here above we can see that both `E0026` and `E0027` are depicting same thing. So, to fix this issue, we are simply checking element of `inexistent_fields` is there any value lies in `unmentioned_fields` using Levenshtein algorithm, if does then for that case we are simply deleting element from `unmentioned_fields`. More or less now instead of showing separate message in `E0027` we are giving extra hint on `E0026` Address: #52717
2018-10-19Auto merge of #55004 - oli-obk:sized_static, r=cramertjbors-28/+26
Check the type of statics and constants for `Sized`ness fixes #54410
2018-10-18Rollup merge of #55104 - estebank:addtest, r=alexcrichtonkennytm-0/+16
Add test for #34229 Fix #34229.
2018-10-17Auto merge of #55134 - davidtwco:issue-55118, r=pnkfelixbors-151/+166
NLL: change compare-mode=nll to use borrowck=migrate Fixes #55118. This PR is split into two parts: The first commit is a minor change that fixes a flaw in the existing `borrowck=migrate` implementation whereby a lint that was promoted to an error in the AST borrow checker would result in the same lint from the NLL borrow checker being downgraded to a warning in migrate mode. This PR fixes this by ensuring lints are exempt from buffering in the NLL borrow checker. The second commit updates `compiletest` to make the NLL compare mode use `-Z borrowck=migrate` rather than `-Z borrowck=mir`. The third commit shows all the test output changes that result from this. r? @pnkfelix
2018-10-17Auto merge of #54946 - estebank:iterator, r=varkorbors-21/+68
Add filtering option to `rustc_on_unimplemented` and reword `Iterator` E0277 errors - Add more targetting filters for arrays to `rustc_on_unimplemented` (Fix #53766) - Detect one element array of `Range` type, which is potentially a typo: `for _ in [0..10] {}` where iterating between `0` and `10` was intended. (Fix #23141) - Suggest `.bytes()` and `.chars()` for `String`. - Suggest borrowing or `.iter()` on arrays (Fix #36391) - Suggest using range literal when iterating on integers (Fix #34353) - Do not suggest `.iter()` by default (Fix #50773, fix #46806) - Add regression test (Fix #22872)
2018-10-17fix other tests failing due to change in case or new suggestion for extern crateFrançois Mockers-17/+17
2018-10-17apply reviewFrançois Mockers-30/+60
2018-10-17Update output for borrowck=migrate compare mode.David Wood-151/+166
This commit updates the test output for the updated NLL compare mode that uses `-Z borrowck=migrate` rather than `-Z borrowck=mir`. The previous commit changes `compiletest` and this commit only updates `.nll.stderr` files.
2018-10-16updates to expected output for other ui tests.Felix S. Klock II-3/+3
2018-10-16Use platform independent typesOliver Scherer-5/+4
2018-10-16Check the type of statics and constants for `Sized`nessOliver Scherer-28/+27
2018-10-16#45829 when a renamed import conflict with a previous importFrançois Mockers-0/+194
2018-10-15Add test for #34229Esteban Küber-0/+16
2018-10-15Rollup merge of #55025 - ehuss:missing-lifetime-err-msg, r=petrochenkovManish Goregaokar-1/+1
Add missing lifetime fragment specifier to error message. A very minor issue, `lifetime` was missing from the error list. I left `literal` in the list, even though it is unstable. It looks like it may stabilize soon anyways.
2018-10-15Rollup merge of #54991 - euclio:issue-23189, r=tmandryManish Goregaokar-0/+24
add test for #23189 Fixes #23189
2018-10-13Auto merge of #55017 - memoryruins:add-tests, r=alexcrichtonbors-0/+49
Add tests for issues #54966 and #52240 Closes #54966 Closes #52240
2018-10-13Auto merge of #54980 - zackmdavis:and_the_case_of_the_universal_call, r=oli-obkbors-6/+2
structured suggestion for E0223 ambiguous associated type (routine (and when are we going to be done finding these, anyway?) but something that stuck out to me while glancing at #54970) r? @estebank
2018-10-12Add missing lifetime fragment specifier to error message.Eric Huss-1/+1
A very minor issue, `lifetime` was missing from the error list. I left `literal` in the list, even though it is unstable. It looks like it may stabilize soon anyways.
2018-10-12Add nll stderr to #52240memoryruins-0/+9
2018-10-12Add test for issue #52240memoryruins-0/+25
Closes #52240
2018-10-12Add test for issue #54966memoryruins-0/+15
Closes #54966
2018-10-12add test for #23189Andy Russell-0/+24
Fixes #23189.
2018-10-12Rollup merge of #54825 - davidtwco:issue-52663-deref-raw-pointer, r=pnkfelixkennytm-4/+4
NLL says "borrowed content" instead of more precise "dereference of raw pointer" Part of #52663. Previously, move errors involving the dereference of a raw pointer would say "borrowed content". This commit changes it to say "dereference of raw pointer". r? @nikomatsakis cc @pnkfelix
2018-10-11structured suggestion for E0223 ambiguous associated typeZack M. Davis-6/+2
It looks like we tend to use angle-brackets around the placeholder in the few other places we use `Applicability::HasPlaceholders`, but that would be confusing here, so ...
2018-10-11review commentsEsteban Küber-1/+1
- reword messages - apply custom comments to all types of ranges - fix indentation