about summary refs log tree commit diff
path: root/src/test/ui/recursion
AgeCommit message (Collapse)AuthorLines
2021-04-06Point at `impl` and type defs introducing requirements on E0277Esteban Küber-3/+15
2021-03-31prevent very long compilation runtimes in LateBoundRegionNameCollectorb-naber-0/+19
2021-03-09Deprecate items that accidentally weren't deprecatedbstrie-2/+2
Fixes #82080
2021-02-06path trimming: ignore type aliasesDan Aloni-1/+1
2020-10-26simplify-locals: Remove unused assignments regardless of rvalue kindTomasz Miąsko-0/+1
2020-09-21Record `tcx.def_span` instead of `item.span` in crate metadataAaron Hill-16/+4
This was missed in PR #75465. As a result, a few places have been using the full body span of functions, instead of just the header span.
2020-09-21Let user see the full type of type-length limit errorKornel Lesiński-2/+7
2020-09-19Address review commentsOliver Scherer-4/+4
2020-09-19Stop using the `const_eval` query for initializers of staticsOliver Scherer-5/+1
As a side effect, we now represent most promoteds as `ConstValue::Scalar` again. This is useful because all implict promoteds are just references anyway and most explicit promoteds are numeric arguments to `asm!` or SIMD instructions.
2020-09-17Better handling for exponential-sized types in misc placesValerii Lashmanov-2/+2
Mostly to fix ui/issues/issue-37311-type-length-limit/issue-37311.rs. Most parts of the compiler can handle deeply nested types with a lot of duplicates just fine, but some parts still attempt to naively traverse type tree. Before such problems were caught by type length limit check, but now these places will have to be changed to handle duplicated types gracefully.
2020-09-02pretty: trim paths of unique symbolsDan Aloni-5/+5
If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path and print only the name. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere. This adds a new '-Z trim-diagnostic-paths=false' option to control this feature. On the good path, with no diagnosis printed, we should try to avoid issuing this query, so we need to prevent trimmed_def_paths query on several cases. This change also relies on a previous commit that differentiates between `Debug` and `Display` on various rustc types, where the latter is trimmed and presented to the user and the former is not.
2020-08-22Use smaller def span for functionsAaron Hill-7/+2
Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-07-29Update ui testsOliver Scherer-3/+3
2020-07-27mv std libs to library/mark-3/+3
2020-06-30Bless failing testsLeSeulArtichaut-2/+6
2020-06-22Point at the call spawn when overflow occurs during monomorphizationAaron Hill-5/+27
This improves the output for issue #72577, but there's still more work to be done. Currently, an overflow error during monomorphization results in an error that points at the function we were unable to monomorphize. However, we don't point at the call that caused the monomorphization to happen. In the overflow occurs in a large recursive function, it may be difficult to determine where the issue is. This commit tracks and `Span` information during collection of `MonoItem`s, which is used when emitting an overflow error. `MonoItem` itself is unchanged, so this only affects `src/librustc_mir/monomorphize/collector.rs`
2020-06-15Rollup merge of #72879 - RalfJung:miri-tctx-at, r=oli-obkRalf Jung-2/+2
Miri: avoid tracking current location three times Miri tracks the current instruction to execute in the call stack, but it also additionally has two `TyCtxtAt` that carry a `Span` that also tracks the current instruction. That is quite silly, so this PR uses `TyCtxt` instead, and then uses a method for computing the current span when a `TyCtxtAt` is needed. Having less redundant (semi-)global state seems like a good improvement to me. :D To keep the ConstProp errors the same, I had to add the option to `error_to_const_error` to overwrite the span. Also for some reason this changes cycle errors a bit -- not sure if we are now better or worse as giving those queries the right span. (It is unfortunately quite easy to accidentally use `DUMMY_SP` by calling the query on a `TyCtxt` instead of a `TyCtxtAt`.) r? @oli-obk @eddyb
2020-06-12fix const_prop spans and re-bless testsRalf Jung-2/+2
2020-06-10review comments: only suggest one substitutionEsteban Küber-5/+1
2020-06-10On recursive ADT, provide indirection structured suggestionEsteban Küber-1/+8
2020-05-31Add descriptions for all queriesMatthew Jasper-5/+10
2020-04-08Small tweaks to required bound spanEsteban Küber-2/+2
2020-04-08Use `PredicateObligation`s instead of `Predicate`sEsteban Küber-2/+2
Keep more information about trait binding failures.
2020-04-02tests: remove ignore directives from tests that mention core/alloc/std spans.Eduard-Mihai Burtescu-6/+1
2020-03-27non-exhastive diagnostic: add note re. scrutinee typeMazdak Farrokhzad-0/+1
2020-03-23Ignore tests on some platforms due to #53081Aaron Hill-1/+6
2020-03-22Store idents for `DefPathData` into crate metadataAaron Hill-0/+5
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-02-12Auto merge of #68679 - matthewjasper:needs-type-op, r=varkorbors-1/+2
Improve `ty.needs_drop` * Handle cycles in `needs_drop` correctly * Normalize types when computing `needs_drop` * Move queries from rustc to rustc_ty * Avoid query in simple cases reopens #65918
2020-02-11Specify overflow checks behaviour in testMatthew Jasper-1/+2
2020-02-01Update existing tests for or-patternsMatthew Jasper-10/+2
2020-01-19fix real_drop_in_place in commentsRalf Jung-1/+1
2020-01-18adjust ui testsRalf Jung-1/+1
2019-12-30Handle recursive instantiation of drop shimsMatthew Jasper-0/+47
2019-12-21rework run-fail and support check,build-failMazdak Farrokhzad-1/+3
2019-10-09Suggest `if let` on `let` refutable bindingEsteban Küber-0/+7
2019-09-06Fixed grammar/style in error messages and reblessed tests.Alexander Regueiro-3/+3
2019-08-31Use span label instead of note for cause in E0631Esteban Küber-10/+6
2019-08-10diagnostics: Describe crate root modules in `DefKind::Mod` as "crate"Vadim Petrochenkov-2/+2
2019-08-05Make use of possibly uninitialized data a hard errorTyler Mandry-25/+3
This is one of the behaviors we no longer allow in NLL. Since it can lead to undefined behavior, I think it's definitely worth making it a hard error without waiting to turn off migration mode (#58781). Closes #60450. My ulterior motive here is making it impossible to leave variables partially initialized across a yield (see discussion at #63035), so tests are included for that.
2019-07-07Raise the default recursion limit to 128Simonas Kazlauskas-1/+1
2019-05-21Add FAQ for NLL migrationJethro Beekman-0/+1
2019-05-12Change compare mode to use -Zborrowck=mirMatthew Jasper-0/+16
2019-04-23Auto merge of #60125 - estebank:continue-evaluating, r=oli-obkbors-1/+14
Don't stop evaluating due to errors before borrow checking r? @oli-obk Fix #60005. Follow up to #59903. Blocked on #53708, fixing the ICE in `src/test/ui/consts/match_ice.rs`.
2019-04-22Never stop due to errors before borrow checkingEsteban Küber-1/+14
2019-04-22Remove double trailing newlinesvarkor-1/+0
2019-03-11Update testsVadim Petrochenkov-2/+2
2018-12-25Remove licensesMark Rousskov-81/+11
2018-12-24make non_camel_case_types an early lintAndy Russell-5/+5
2018-10-25Deduplicate all the ~~things~~ errorsOliver Schneider-0/+5
2018-10-25Report const eval error inside the queryOliver Schneider-0/+5