diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2025-07-29 01:13:50 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2025-08-06 22:21:49 +0000 |
| commit | 025fbe8f698a85865d0e9dba7e97ec6a82eac59b (patch) | |
| tree | a31f3a36c2fde641f70a6f7e35f113cbcfec7f01 /tests/ui/recursion | |
| parent | 29cdc6a109ee98a382f974bf89d3971b4385399c (diff) | |
| download | rust-025fbe8f698a85865d0e9dba7e97ec6a82eac59b.tar.gz rust-025fbe8f698a85865d0e9dba7e97ec6a82eac59b.zip | |
Add support for shortening `Instance` and use it
Replace ad-hoc type path shortening logic for recursive mono instantiation errors to use `tcx.short_string()` instead.
Diffstat (limited to 'tests/ui/recursion')
4 files changed, 8 insertions, 6 deletions
diff --git a/tests/ui/recursion/recursion.rs b/tests/ui/recursion/recursion.rs index 5cd4012a9d2..ae927b1b4c6 100644 --- a/tests/ui/recursion/recursion.rs +++ b/tests/ui/recursion/recursion.rs @@ -1,5 +1,5 @@ //@ build-fail -//@ compile-flags:-C overflow-checks=off +//@ compile-flags:-C overflow-checks=off --diagnostic-width=100 -Zwrite-long-types-to-disk=yes enum Nil {NilValue} struct Cons<T> {head:isize, tail:T} diff --git a/tests/ui/recursion/recursion.stderr b/tests/ui/recursion/recursion.stderr index f959805defc..974f18ed103 100644 --- a/tests/ui/recursion/recursion.stderr +++ b/tests/ui/recursion/recursion.stderr @@ -1,4 +1,4 @@ -error: reached the recursion limit while instantiating `test::<Cons<Cons<Cons<Cons<Cons<...>>>>>>` +error: reached the recursion limit while instantiating `test::<Cons<Cons<Cons<Cons<Cons<Cons<...>>>>>>>` --> $DIR/recursion.rs:17:11 | LL | _ => {test (n-1, i+1, Cons {head:2*i+1, tail:first}, Cons{head:i*i, tail:second})} @@ -9,7 +9,8 @@ note: `test` defined here | LL | fn test<T:Dot> (n:isize, i:isize, first:T, second:T) ->isize { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: the full type name has been written to '$TEST_BUILD_DIR/recursion.long-type.txt' + = note: the full name for the type has been written to '$TEST_BUILD_DIR/recursion.long-type-$LONG_TYPE_HASH.txt' + = note: consider using `--verbose` to print the full type name to the console error: aborting due to 1 previous error diff --git a/tests/ui/recursion/recursive-impl-trait-iterator-by-ref-67552.rs b/tests/ui/recursion/recursive-impl-trait-iterator-by-ref-67552.rs index 0875d385ddc..4abca916423 100644 --- a/tests/ui/recursion/recursive-impl-trait-iterator-by-ref-67552.rs +++ b/tests/ui/recursion/recursive-impl-trait-iterator-by-ref-67552.rs @@ -1,5 +1,5 @@ //@ build-fail -//@ compile-flags: -Copt-level=0 +//@ compile-flags: -Copt-level=0 --diagnostic-width=100 -Zwrite-long-types-to-disk=yes fn main() { rec(Empty); diff --git a/tests/ui/recursion/recursive-impl-trait-iterator-by-ref-67552.stderr b/tests/ui/recursion/recursive-impl-trait-iterator-by-ref-67552.stderr index fe005984fab..8d6d44dcbe2 100644 --- a/tests/ui/recursion/recursive-impl-trait-iterator-by-ref-67552.stderr +++ b/tests/ui/recursion/recursive-impl-trait-iterator-by-ref-67552.stderr @@ -1,4 +1,4 @@ -error: reached the recursion limit while instantiating `rec::<&mut &mut &mut &mut &mut ...>` +error: reached the recursion limit while instantiating `rec::<&mut &mut &mut &mut &mut &mut &mut &mut ...>` --> $DIR/recursive-impl-trait-iterator-by-ref-67552.rs:28:9 | LL | rec(identity(&mut it)) @@ -11,7 +11,8 @@ LL | / fn rec<T>(mut it: T) LL | | where LL | | T: Iterator, | |________________^ - = note: the full type name has been written to '$TEST_BUILD_DIR/recursive-impl-trait-iterator-by-ref-67552.long-type.txt' + = note: the full name for the type has been written to '$TEST_BUILD_DIR/recursive-impl-trait-iterator-by-ref-67552.long-type-$LONG_TYPE_HASH.txt' + = note: consider using `--verbose` to print the full type name to the console error: aborting due to 1 previous error |
