summary refs log tree commit diff
path: root/src/test/ui/error-codes
AgeCommit message (Collapse)AuthorLines
2020-07-10Tweak wordingYuki Okushi-2/+2
2020-07-10Add a help to use `in_band_lifetimes` in nightlyYuki Okushi-0/+4
2020-07-06Rollup merge of #73953 - JohnTitor:audit-hidden-sugg, r=estebankManish Goregaokar-3/+27
Audit hidden/short code suggestions Should fix #73641. Audit uses of `span_suggestion_short` and `tool_only_span_suggestion` (`span_suggestion_hidden` is already tested with `run-rustfix`). Leave some FIXMEs for futher improvements/fixes. r? @estebank
2020-07-02resolve: disallow label use through closure/asyncDavid Wood-0/+21
This commit modifies resolve to disallow `break`/`continue` to labels through closures or async blocks. This doesn't make sense and should have been prohibited anyway. Signed-off-by: David Wood <david@davidtw.co>
2020-07-02Audit uses of `span_suggestion_short`Yuki Okushi-3/+27
2020-06-30Switch crate_extern_paths to a query, and tweak wording.Eric Huss-1/+1
2020-06-30Provide more information on duplicate lang item error.Eric Huss-1/+4
2020-06-26Show the values and computation that would overflow a const evaluation or ↵Oliver Scherer-3/+3
propagation
2020-06-23Rollup merge of #73398 - oli-obk:const_raw_ptr_cmp, r=varkor,RalfJung,nagisaManish Goregaokar-7/+3
A way forward for pointer equality in const eval r? @varkor on the first commit and @RalfJung on the second commit cc #53020
2020-06-20Refer just to the issue in the raw ptr cmp diagnostic instead of explaining ↵Oliver Scherer-4/+2
everything in the diagnostic
2020-06-19Rollup merge of #72934 - christianpoveda:mut-borrows-in-consts, r=oli-obkManish Goregaokar-45/+24
forbid mutable references in all constant contexts except for const-fns PR to address #71212 cc: @ecstatic-morse
2020-06-19Rollup merge of #71420 - RalfJung:specialization-incomplete, r=matthewjasperManish Goregaokar-2/+12
Specialization is unsound As discussed in https://github.com/rust-lang/rust/issues/31844#issuecomment-617013949, it might be a good idea to warn users of specialization that the feature they are using is unsound. I also expanded the "incomplete feature" warning to link the user to the tracking issue.
2020-06-19add new error codeChristian Poveda-16/+16
2020-06-19update diagnostics for &mut in constantsChristian Poveda-44/+23
2020-06-19Add fuzzy pointer comparison intrinsicsOliver Scherer-2/+3
2020-06-19Remove the const_raw_ptr_comparison feature gate.Oliver Scherer-8/+5
We can never supply a meaningful implementation of this. Instead, the follow up commits will create two intrinsics that approximate comparisons: * `ptr_maybe_eq` * `ptr_maybe_ne` The fact that `ptr_maybe_eq(a, b)` is not necessarily the same value as `!ptr_maybe_ne(a, b)` is a symptom of this entire problem.
2020-06-16bless allRalf Jung-2/+12
2020-06-15Tweak "non-primitive cast" errorEsteban Küber-7/+3
- Suggest borrowing expression if it would allow cast to work. - Suggest using `<Type>::from(<expr>)` when appropriate. - Minor tweak to `;` typo suggestion. Partily address #47136.
2020-06-02Improve E0433, so that it suggests missing importsPatryk Wychowaniec-4/+4
2020-05-30Rollup merge of #72540 - davidtwco:issue-67552-mono-collector-comparison, ↵Ralf Jung-3/+4
r=varkor mir: adjust conditional in recursion limit check Fixes #67552. This PR adjusts the condition used in the recursion limit check of the monomorphization collector, from `>` to `>=`. In #67552, the test case had infinite indirect recursion, repeating a handful of functions (from the perspective of the monomorphization collector): `rec` -> `identity` -> `Iterator::count` -> `Iterator::fold` -> `Iterator::next` -> `rec`. During this process, `resolve_associated_item` was invoked for `Iterator::fold` (during the construction of an `Instance`), and ICE'd due to substitutions needing inference. However, previous iterations of this recursion would have called this function for `Iterator::fold` - and did! - and succeeded in doing so (trivially checkable from debug logging, `()` is present where `_` is in the substs of the failing execution). The expected outcome of this test case would be a recursion limit error (which is present when the `identity` fn indirection is removed), and the recursion depth of `rec` is increasing (other functions finish collecting their neighbours and thus have their recursion depths reset). When the ICE occurs, the recursion depth of `rec` is 256 (which matches the recursion limit), which suggests perhaps that a different part of the compiler is using a `>=` comparison and returning a different result on this recursion rather than what it returned in every previous recursion, thus stopping the monomorphization collector from reporting an error on the next recursion, where `recursion_depth_of_rec > 256` would have been true. With grep and some educated guesses, we can determine that the recursion limit check at line 818 in `src/librustc_trait_selection/traits/project.rs` is the other check that is using a different comparison. Modifying either comparison to be `>` or `>=` respectively will fix the error, but changing the monomorphization collector produces the nicer error.
2020-05-29Auto merge of #72756 - RalfJung:rollup-tbjmtx2, r=RalfJungbors-2/+2
Rollup of 9 pull requests Successful merges: - #67460 (Tweak impl signature mismatch errors involving `RegionKind::ReVar` lifetimes) - #71095 (impl From<[T; N]> for Box<[T]>) - #71500 (Make pointer offset methods/intrinsics const) - #71804 (linker: Support `-static-pie` and `-static -shared`) - #71862 (Implement RFC 2585: unsafe blocks in unsafe fn) - #72103 (borrowck `DefId` -> `LocalDefId`) - #72407 (Various minor improvements to Ipv6Addr::Display) - #72413 (impl Step for char (make Range*<char> iterable)) - #72439 (NVPTX support for new asm!) Failed merges: r? @ghost
2020-05-29Rollup merge of #72383 - DarkEld3r:issue-72322, r=matthewjasperDylan DPC-1/+4
Suggest using std::mem::drop function instead of explicit destructor call I would prefer to give a better suggestion that includes code example, but I'm currently stuck on getting the correct span for that. Closes #72322.
2020-05-28standardize limit comparisons with `Limit` typeDavid Wood-3/+4
This commit introduces a `Limit` type which is used to ensure that all comparisons against limits within the compiler are consistent (which can result in ICEs if they aren't). Signed-off-by: David Wood <david@davidtw.co>
2020-05-27Fix rebaseEsteban Küber-2/+2
2020-05-26Simplify suggestionStanislav Tkach-4/+4
2020-05-23Merge spans for the suggestionStanislav Tkach-4/+4
2020-05-22Update testsMatthew Jasper-40/+120
2020-05-21Suggest using std::mem::drop function instead of explicit destructor callStanislav Tkach-1/+4
2020-05-19Alter wording for `use foo::self` helpmibac138-2/+2
2020-05-19Suggest fixes for `use foo::self`mibac138-2/+11
2020-05-09adjust testsRalf Jung-2/+3
2020-05-04Suggest to add missing feature when using gated const featuresmibac138-0/+7
2020-04-28Rollup merge of #71340 - Valloric:more-check-pass, r=nikomatsakisDylan DPC-1/+1
Moving more build-pass tests to check-pass One or two tests became build-pass without the FIXME because they really needed build-pass (were failing without it). Helps with #62277 --- <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/rust-lang/rust/71340) <!-- Reviewable:end -->
2020-04-26Tweak some suggestions in `rustc_resolve`Esteban Küber-3/+6
2020-04-23Moving more build-pass tests to check-passVal Markovic-1/+1
One or two tests became build-pass without the FIXME because they really needed build-pass (were failing without it). Helps with #62277
2020-04-20Suggest `-> impl Trait` and `-> Box<dyn Trait>` on fn that doesn't returnEsteban Küber-2/+2
During development, a function could have a return type set that is a bare trait object by accident. We already suggest using either a boxed trait object or `impl Trait` if the return paths will allow it. We now do so too when there are *no* return paths or they all resolve to `!`. We still don't handle cases where the trait object is *not* the entirety of the return type gracefully.
2020-04-17Rollup merge of #70578 - PankajChaudhary5:master, r=GuillaumeGomezDylan DPC-0/+1
Add long error explanation for E0657 Added proper error explanation for issue E0657 in the Rust compiler. Part of #61137 r? @GuillaumeGomez
2020-04-14Rename AssocKind::Method to AssocKind::FnRustin-Liu-2/+2
Rename fn_has_self_argument to fn_has_self_parameter Rename AssocItemKind::Method to AssocItemKind::Fn Refine has_no_input_arg Refine has_no_input_arg Revert has_no_input_arg Refine suggestion_descr Move as_def_kind into AssocKind Signed-off-by: Rustin-Liu <rustin.liu@gmail.com> Fix tidy check issue Signed-off-by: Rustin-Liu <rustin.liu@gmail.com>
2020-04-13Add proper explanation of error code E0657PankajChaudhary5-0/+1
2020-04-11rustc: Add a warning count upon completionRoccoDev-1/+4
2020-04-10Rollup merge of #69745 - estebank:predicate-obligations-3, r=nikomatsakis,eddybMazdak Farrokhzad-4/+4
Use `PredicateObligation`s instead of `Predicate`s Keep more information about trait binding failures. Use more specific spans by pointing at bindings that introduce obligations. Subset of #69709. r? @eddyb
2020-04-08Small tweaks to required bound spanEsteban Küber-3/+3
2020-04-08Use `PredicateObligation`s instead of `Predicate`sEsteban Küber-1/+1
Keep more information about trait binding failures.
2020-04-08Replace "rc"/"arc" lang items with Rc/Arc diagnostic items.Eduard-Mihai Burtescu-7/+7
2020-04-05"cannot resolve" → "cannot satisfy"Esteban Küber-1/+1
2020-04-02tests: remove ignore directives from tests that mention core/alloc/std spans.Eduard-Mihai Burtescu-18/+3
2020-03-30update tests, improve variable namesBastian Kauschke-8/+5
2020-03-30infer arr len from patternBastian Kauschke-4/+7
2020-03-27Rollup merge of #70457 - Centril:non-exhaustive-scrutinee-type, r=estebankMazdak Farrokhzad-0/+5
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-27non-exhastive diagnostic: add note re. scrutinee typeMazdak Farrokhzad-0/+5