about summary refs log tree commit diff
path: root/src/test/ui/infinite
AgeCommit message (Collapse)AuthorLines
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
2019-11-27Add memoization for const function evaluationsDavid Hewitt-58/+13
When a const function is being evaluated, as long as all its arguments are zero-sized-types (or it has no arguments) then we can trivially memoize the evaluation result using the existing query mechanism.
2019-10-01Change to use exprPrecedence instead of exprKind.Sam Radhakrishnan-1/+1
2019-09-08Give method not found a primary span labelEsteban Küber-1/+1
2019-07-07Raise the default recursion limit to 128Simonas Kazlauskas-5/+5
2019-04-22Continue evaluating after item-type checkingEsteban Küber-2/+13
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-1/+1
2019-03-11Update testsVadim Petrochenkov-4/+4
2019-01-11Update testsJohn Kåre Alsaker-0/+8
2018-12-25Remove licensesMark Rousskov-122/+62
2018-12-24make non_camel_case_types an early lintAndy Russell-11/+11
2018-11-21Enclose type in backticks for "reached the recursion limit while ↵varkor-3/+3
auto-dereferencing" error
2018-11-14put file and line into miri backtraceRalf Jung-51/+51
2018-10-25Rebase falloutOliver Schneider-1/+1
2018-10-25Report const eval error inside the queryOliver Schneider-10/+8
2018-10-16Check the type of statics and constants for `Sized`nessOliver Scherer-2/+2
2018-10-05Stabilize `min_const_fn`Oliver Schneider-2/+1
2018-08-31Restrict most uses of `const_fn` to `min_const_fn`Oliver Schneider-1/+1
2018-08-14Merged migrated compile-fail tests and ui tests. Fixes #46841.David Wood-0/+315