forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#76843 - kornelski:longtypetofile, r=ecstatic-…
…morse Let user see the full type of type-length limit error Seeing the full type of the error is sometimes essential to diagnosing the problem, but the type itself is too long to be displayed in the terminal in a useful fashion. This change solves this dilemma by writing the full offending type name to a file, and displays this filename as a note. > note: the full type name been written to '$TEST_BUILD_DIR/issues/issue-22638/issue-22638.long-type.txt' Closes rust-lang#76777
- Loading branch information
Showing
17 changed files
with
71 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
error: reached the recursion limit while instantiating `function::<Option<Option<Option<...>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` | ||
--> $DIR/infinite-instantiation.rs:21:9 | ||
--> $DIR/infinite-instantiation.rs:22:9 | ||
| | ||
LL | function(counter - 1, t.to_option()); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: `function` defined here | ||
--> $DIR/infinite-instantiation.rs:19:1 | ||
--> $DIR/infinite-instantiation.rs:20:1 | ||
| | ||
LL | fn function<T:ToOpt + Clone>(counter: usize, t: T) { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
= note: the full type name has been written to '$TEST_BUILD_DIR/infinite/infinite-instantiation/infinite-instantiation.long-type.txt' | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
error: reached the recursion limit while instantiating `A::matches::$CLOSURE` | ||
--> $DIR/issue-22638.rs:55:9 | ||
--> $DIR/issue-22638.rs:56:9 | ||
| | ||
LL | a.matches(f) | ||
| ^^^^^^^^^^^^ | ||
| | ||
note: `A::matches` defined here | ||
--> $DIR/issue-22638.rs:14:5 | ||
--> $DIR/issue-22638.rs:15:5 | ||
| | ||
LL | pub fn matches<F: Fn()>(&self, f: &F) { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
= note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-22638/issue-22638.long-type.txt' | ||
|
||
error: aborting due to previous error | ||
|
1 change: 1 addition & 0 deletions
1
src/test/ui/issues/issue-37311-type-length-limit/issue-37311.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// build-fail | ||
// normalize-stderr-test: ".nll/" -> "/" | ||
|
||
trait Mirror { | ||
type Image; | ||
|
5 changes: 3 additions & 2 deletions
5
src/test/ui/issues/issue-37311-type-length-limit/issue-37311.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
error: reached the recursion limit while instantiating `<(&(&(&(&(&(&(&(&(&(&(&(&(&(&(&(.....), ...), ...) as Foo>::recurse` | ||
--> $DIR/issue-37311.rs:16:9 | ||
--> $DIR/issue-37311.rs:17:9 | ||
| | ||
LL | (self, self).recurse(); | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: `<T as Foo>::recurse` defined here | ||
--> $DIR/issue-37311.rs:15:5 | ||
--> $DIR/issue-37311.rs:16:5 | ||
| | ||
LL | fn recurse(&self) { | ||
| ^^^^^^^^^^^^^^^^^ | ||
= note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-37311-type-length-limit/issue-37311/issue-37311.long-type.txt' | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// build-fail | ||
// normalize-stderr-test: ".nll/" -> "/" | ||
|
||
fn main() { | ||
rec(Empty); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
error: reached the recursion limit while instantiating `rec::<&mut &mut &mut &mut &mut &... &mut &mut &mut &mut &mut Empty>` | ||
--> $DIR/issue-67552.rs:27:9 | ||
--> $DIR/issue-67552.rs:28:9 | ||
| | ||
LL | rec(identity(&mut it)) | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: `rec` defined here | ||
--> $DIR/issue-67552.rs:20:1 | ||
--> $DIR/issue-67552.rs:21:1 | ||
| | ||
LL | / fn rec<T>(mut it: T) | ||
LL | | where | ||
LL | | T: Iterator, | ||
| |________________^ | ||
= note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-67552/issue-67552.long-type.txt' | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
error: reached the recursion limit while instantiating `test::<Cons<Cons<Cons<Cons<Cons<...>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` | ||
--> $DIR/recursion.rs:17:11 | ||
--> $DIR/recursion.rs:18:11 | ||
| | ||
LL | _ => {test (n-1, i+1, Cons {head:2*i+1, tail:first}, Cons{head:i*i, tail:second})} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: `test` defined here | ||
--> $DIR/recursion.rs:15:1 | ||
--> $DIR/recursion.rs:16:1 | ||
| | ||
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/recursion/recursion.long-type.txt' | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters