about summary refs log tree commit diff
path: root/src/test/ui/infinite
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-1106/+0
2022-12-18Rollup merge of #105419 - YC:issue-41731, r=petrochenkovMatthias Krüger-0/+106
Add tests for #41731 Closes #41731
2022-12-07Add tests for #41731Steven Tang-0/+106
Closes #41731
2022-12-06Change CTFE backtraces to use `note` instead of `label` to preserve their orderOli Scherer-135/+640
labels are reordered within the file in which they are reported, which can mess up the stack trace
2022-12-06Remove now-redundant file/line info from const backtracesOli Scherer-128/+128
2022-11-18Make "long type" printing type awareEsteban Küber-1/+1
Instead of simple string cutting, use a custom printer to hide parts of long printed types.
2022-10-07Rewrite representabilityCameron Steffen-7/+23
2022-07-07Track implicit `Sized` obligations in type paramsEsteban Küber-1/+1
Suggest adding a `?Sized` bound if appropriate on E0599 by inspecting the HIR Generics. (Fix #98539)
2022-07-04fully move dropck to mirlcnr-26/+4
2022-07-01Shorten def_span for more items.Camille GILLOT-7/+6
2022-06-22point to type param definition when not finding variant, method and assoc typeTakayuki Maeda-1/+1
use `def_ident_span` , `body_owner_def_id` instead of `in_progress_typeck_results`, `guess_head_span` use `body_id.owner` directly add description to label
2022-03-20Filter OnceNote in diagnostic infra.Camille GILLOT-8/+7
2022-01-11Deduplicate box deref and regular deref suggestionsMichael Goulet-3/+6
2021-12-12Revert "Auto merge of #91491 - spastorino:revert-91354, r=oli-obk"Deadbeef-2/+2
This reverts commit ff2439b7b9bafcfdff86b7847128014699df8442, reversing changes made to 2a9e0831d6603d87220cedd1b1293e2eb82ef55c.
2021-12-03Revert "Auto merge of #91354 - fee1-dead:const_env, r=spastorino"Santiago Pastorino-2/+2
This reverts commit 18bb8c61a975fff6424cda831ace5b0404277145, reversing changes made to d9baa361902b172be716f96619b909f340802dea.
2021-11-29Fixup add const to param envOli Scherer-2/+2
2021-09-28Improve help for recursion limit errorsRoss MacArthur-4/+4
2021-09-26Remove box syntax from most places in src/test outside of the issues direst31-9/+6
2021-08-27Add test for type alias mutual recursionNoah Lev-0/+40
2021-08-27Note that trait aliases cannot be recursiveNoah Lev-0/+1
2021-08-27Add test of recursive trait aliasesNoah Lev-0/+51
2021-08-27Note that type aliases cannot be recursiveNoah Lev-0/+3
2021-08-21Improve errors for recursive type aliasesNoah Lev-4/+4
2021-08-18Auto merge of #87738 - lqd:polonius-master, r=nikomatsakisbors-0/+15
Update `polonius-engine` to 0.13.0 This PR updates the use of `polonius-engine` to the recently released 0.13.0: - this version renamed a lot of relations to match the current terminology - "illegal subset relationships errors" (AKA "subset errors" or "universal region errors" in rustc parlance) have been implemented in all variants, and therefore the `Hybrid` variant can be the rustc default once again - some of the blessed expectations were updated: new tests have been added since the last time I updated the tests, diagnostics have changed, etc. In particular: - a few tests had trivial expectations changes such as basic diagnostics changes for the migrate-mode and full NLLs - others were recursion and lengths limits which emits a file, and under the polonius compare-mode, the folder has a different name - a few tests were ignored in the NLL compare-mode for reasons that obviously also apply to Polonius - some diagnostics were unified so that older expectations no longer made sense: the NLL and Polonius outputs were identical. - in a few cases Polonius gets a chance to emit more errors than NLLs A few tests in the compare-mode still are super slow and trigger the 60s warning, or OOM rustc during fact generation, and I've detailed these [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/Challenges.20for.20move.2Finit.2C.20liveness.2C.20and.20.60Location.3A.3AAll.60): - `src/test/ui/numbers-arithmetic/saturating-float-casts.rs` -> OOM during rustc fact generation - `src/test/ui/numbers-arithmetic/num-wrapping.rs` - `src/test/ui/issues/issue-72933-match-stack-overflow.rs` - `src/test/ui/issues/issue-74564-if-expr-stack-overflow.rs` - `src/test/ui/repr/repr-no-niche.rs` In addition, 2 tests don't currently pass and I didn't want to bless them now: they deal with HRTBs and miss errors that NLLs emit. We're currently trying to see if we need chalk to deal with HRTB errors (as we thought we would have to) but during the recent sprint, we discovered that we may be able to detect some of these errors in a way that resembles subset errors: - `ui/hrtb/hrtb-just-for-static.rs` -> 3 errors in NLL, 2 in polonius: a missing error about HRTB + needing to outlive 'static - `ui/issues/issue-26217.rs` -> missing HRTB that makes the test compile instead of emitting an error We'll keep talking about this at the next sprint as well. cc `@rust-lang/wg-polonius` r? `@nikomatsakis`
2021-08-11Modify structured suggestion outputEsteban Küber-3/+3
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2021-08-03bless a few trivial tests under poloniusRémy Rakic-0/+15
These are all about reaching some type and recursion limits and saving the full type in a file, whose folder changes in this compare-mode.
2021-07-30Use multispan suggestions more oftenEsteban Küber-4/+6
* Use more accurate span for `async move` suggestion * Use more accurate span for deref suggestion * Use `multipart_suggestion` more often
2021-05-12Show macro name in 'this error originates in macro' messageAaron Hill-1/+1
When there are multiple macros in use, it can be difficult to tell which one was responsible for producing an error.
2020-12-05Auto merge of #79445 - SNCPlay42:struct-tail-recursion-limit, r=oli-obkbors-0/+37
check the recursion limit when finding a struct's tail fixes #79437 This does a `delay_span_bug` (via `ty_error_with_message`) rather than emit a new error message, under the assumption that there will be an error elsewhere (even if the type isn't infinitely recursive, just deeper than the recursion limit, this appears to be the case).
2020-12-04check the recursion limit when finding struct tailSNCPlay42-0/+37
2020-12-02rename MemoryKind::Heap to ConstHeap; bless testVishnunarayan K I-1/+1
2020-12-02add comment and bless some testsVishnunarayan K I-18/+141
2020-09-25Move from {{closure}}#0 syntax to {closure#0} for (def) path componentsmarmeladema-1/+1
2020-09-21Let user see the full type of type-length limit errorKornel Lesiński-2/+4
2020-09-19Address review commentsOliver Scherer-11/+16
2020-09-17Better handling for exponential-sized types in misc placesValerii Lashmanov-1/+1
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-09Remove def_id field from ParamEnvBram van den Heuvel-1/+1
2020-09-02pretty: trim paths of unique symbolsDan Aloni-2/+2
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-06-22Point at the call spawn when overflow occurs during monomorphizationAaron Hill-12/+9
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-4/+4
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-13run const_eval_raw with root_spanRalf Jung-4/+4
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/+5
2020-02-06rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros.Eduard-Mihai Burtescu-0/+1
2020-02-05`#![recursion_limit = "X"]`: note current crate name.Mazdak Farrokhzad-4/+4
2020-01-26rustc_span: move pretty syntax from macro_backtrace to ExpnKind::descr.Eduard-Mihai Burtescu-2/+2
2020-01-08Unify output of "variant not found" errorsEsteban Küber-1/+1
2019-12-21rework run-fail and support check,build-failMazdak Farrokhzad-1/+3