summary refs log tree commit diff
path: root/src/test/ui/error-codes
AgeCommit message (Collapse)AuthorLines
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
2020-03-26Update tests to use llvm_asm!Amanieu d'Antras-37/+37
2020-03-26introduce `negative_impls` feature gate and documentNiko Matsakis-2/+2
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-26permit negative impls for non-auto traitsNiko Matsakis-23/+0
2020-03-24Rollup merge of #70077 - Aaron1011:feature/new-def-path-ident, r=petrochenkovMazdak Farrokhzad-3/+36
Store idents for `DefPathData` into crate metadata Previously, we threw away the `Span` associated with a definition's identifier when we encoded crate metadata, causing us to lose location and hygiene information. We now store the identifier's `Span` in a side table, which gets encoded into the crate metadata. When we decode items from the metadata, we combine the name and span back into an `Ident`. This improves the output of several tests, which previously had messages suppressed due to dummy spans. This is a prerequisite for #68686, since throwing away a `Span` means that we lose hygiene information.
2020-03-23Auto merge of #69649 - estebank:negative-impl-span, r=Centrilbors-3/+5
Tweak output for invalid negative impl errors Follow up to #69722. Tweak negative impl errors emitted in the HIR: ``` error[E0192]: invalid negative impl --> $DIR/E0192.rs:9:6 | LL | impl !Trait for Foo { } | ^^^^^^ | = note: negative impls are only allowed for auto traits, like `Send` and `Sync` ```
2020-03-23Rollup merge of #69942 - estebank:sized-verbose-sugg, r=matthewjasperMazdak Farrokhzad-11/+16
Increase verbosity when suggesting subtle code changes Do not suggest changes that are actually quite small inline, to minimize the likelihood of confusion. Fix #69243.
2020-03-23Ignore tests on some platforms due to #53081Aaron Hill-3/+18
2020-03-22Tweak output for invalid negative impl errorsEsteban Küber-3/+5
2020-03-22Store idents for `DefPathData` into crate metadataAaron Hill-0/+18
Previously, we threw away the `Span` associated with a definition's identifier when we encoded crate metadata, causing us to lose location and hygiene information. We now store the identifier's `Span` in the crate metadata. When we decode items from the metadata, we combine the name and span back into an `Ident`. This improves the output of several tests, which previously had messages suppressed due to dummy spans. This is a prerequisite for #68686, since throwing away a `Span` means that we lose hygiene information.
2020-03-22Use more targetted span for error labelEsteban Küber-2/+2
2020-03-22Normalize wording of privacy access labelsEsteban Küber-4/+4
2020-03-22Add span label to primary error spanEsteban Küber-5/+5
2020-03-22Increase verbosity when suggesting subtle code changesEsteban Küber-1/+6
2020-03-21Bless testsLeSeulArtichaut-12/+9
2020-03-18Rollup merge of #69839 - RalfJung:miri-error-cleanup, r=oli-obkMazdak Farrokhzad-1/+1
Miri error reform Some time ago we started moving Miri errors into a few distinct categories, but we never classified all the old errors. That's what this PR does. ~~This is on top of https://github.com/rust-lang/rust/pull/69762; [relative diff](https://github.com/RalfJung/rust/compare/validity-errors...RalfJung:miri-error-cleanup).~~ r? @oli-obk Fixes https://github.com/rust-lang/const-eval/issues/4
2020-03-18Rollup merge of #69838 - Centril:expand-module, r=petrochenkovMazdak Farrokhzad-2/+2
Expansion-driven outline module parsing After this PR, the parser will not do any conditional compilation or loading of external module files when `mod foo;` is encountered. Instead, the parser only leaves `mod foo;` in place in the AST, with no items filled in. Expansion later kicks in and will load the actual files and do the parsing. This entails that the following is now valid: ```rust #[cfg(FALSE)] mod foo { mod bar { mod baz; // `foo/bar/baz.rs` doesn't exist, but no error! } } ``` Fixes https://github.com/rust-lang/rust/issues/64197. r? @petrochenkov
2020-03-18tweak outline module parsing spansMazdak Farrokhzad-2/+2
2020-03-17Update tests for erasing regions in typeckMatthew Jasper-1/+1
2020-03-16Rollup merge of #69520 - kornelski:e69492, r=cramertjDylan DPC-1/+1
Make error message clearer about creating new module This is a partial improvement for #69492