Skip to content

Remove "static item recursion checking" in favor of relying on cycle checks in the query engine#47987

Merged
bors merged 2 commits into
rust-lang:masterfrom
Zoxc:rm-recursion-checking
Feb 24, 2018
Merged

Remove "static item recursion checking" in favor of relying on cycle checks in the query engine#47987
bors merged 2 commits into
rust-lang:masterfrom
Zoxc:rm-recursion-checking

Conversation

@Zoxc

@Zoxc Zoxc commented Feb 3, 2018

Copy link
Copy Markdown
Contributor

Tests are changed to use the cycle check error message instead. Some duplicate tests are removed.

r? @eddyb

@eddyb

eddyb commented Feb 3, 2018

Copy link
Copy Markdown
Contributor

LGTM. r? @nikomatsakis for rubber-stamping (in case there's some forgotten odd case here).

@rust-highfive rust-highfive assigned nikomatsakis and unassigned eddyb Feb 3, 2018
@kennytm kennytm added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 4, 2018
@kennytm

kennytm commented Feb 4, 2018

Copy link
Copy Markdown
Member

Please update the documentation for E0265 "a static or constant references itself" in the error index.

Details
[01:41:47] failures:
[01:41:47] 
[01:41:47] ---- /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md - Rust_Compiler_Error_Index::E0265 (line 4308) stdout ----
[01:41:47] 	error[E0391]: unsupported cyclic reference between types/traits detected
[01:41:47]  --> /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md:4309:16
[01:41:47]   |
[01:41:47] 3 | const X: u32 = X;
[01:41:47]   |                ^ cyclic reference
[01:41:47]   |
[01:41:47] note: the cycle begins when processing `main::X`...
[01:41:47]  --> /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md:4309:1
[01:41:47]   |
[01:41:47] 3 | const X: u32 = X;
[01:41:47]   | ^^^^^^^^^^^^^^^^^
[01:41:47]   = note: ...which then again requires processing `main::X`, completing the cycle.
[01:41:47] 
[01:41:47] error: aborting due to previous error
[01:41:47] 
[01:41:47] thread 'rustc' panicked at 'Some expected error codes were not found: ["E0265"]', librustdoc/test.rs:303:9
[01:41:47] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[01:41:47] 
[01:41:47] ---- /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md - Rust_Compiler_Error_Index::E0265 (line 4312) stdout ----
[01:41:47] 	error[E0391]: unsupported cyclic reference between types/traits detected
[01:41:47]  --> /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md:4313:16
[01:41:47]   |
[01:41:47] 3 | const X: u32 = Y;
[01:41:47]   |                ^ cyclic reference
[01:41:47]   |
[01:41:47] note: the cycle begins when processing `main::Y`...
[01:41:47]  --> /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md:4314:1
[01:41:47]   |
[01:41:47] 4 | const Y: u32 = X;
[01:41:47]   | ^^^^^^^^^^^^^^^^^
[01:41:47] note: ...which then requires processing `main::X`...
[01:41:47]  --> /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md:4314:16
[01:41:47]   |
[01:41:47] 4 | const Y: u32 = X;
[01:41:47]   |                ^
[01:41:47]   = note: ...which then again requires processing `main::Y`, completing the cycle.
[01:41:47] 
[01:41:47] error: aborting due to previous error

@kennytm kennytm added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 4, 2018
@Zoxc Zoxc force-pushed the rm-recursion-checking branch from fa0385b to a868d49 Compare February 4, 2018 13:46
Comment thread src/librustc_passes/diagnostics.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been removing unused errors entirely before. Is there any reason not to do that?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, but E0001 and E0002 are being kept...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not consistent in doing this. I don't even like error codes at all.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we usually leave a tombstone. It doesn't matter so much for these older errors, but it's particularly useful if the error is the last one that was made, so that it doesn't get reused.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I too would sort of like to reform error codes somewhat, though I'm not entirely sure to what.)

@kennytm kennytm added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 5, 2018

@nikomatsakis nikomatsakis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice

Comment thread src/librustc_passes/diagnostics.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I think we can remove this text, no?

Comment thread src/test/ui/issue-23302-2.stderr Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like our message should include consts. Or maybe just change altogether. Something like "unsupported cyclic dependency detected"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a good idea

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's about time. Maybe not even "unsupported", that always seemed a bit unnecessary.

@kennytm kennytm added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 5, 2018
@Zoxc Zoxc force-pushed the rm-recursion-checking branch from a868d49 to 46a3f2f Compare February 10, 2018 02:28
@Zoxc

Zoxc commented Feb 10, 2018

Copy link
Copy Markdown
Contributor Author

I removed the unused error message and changed E0391 to say cyclic dependency detected.

@eddyb

eddyb commented Feb 10, 2018

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Feb 10, 2018

Copy link
Copy Markdown
Collaborator

📌 Commit 46a3f2f has been approved by eddyb

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 10, 2018
@bors

bors commented Feb 18, 2018

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 46a3f2f with merge d6005b3f3e50013a47a4e5269389a1343bba48b3...

@bors

bors commented Feb 18, 2018

Copy link
Copy Markdown
Collaborator

💔 Test failed - status-appveyor

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 18, 2018
@kennytm

kennytm commented Feb 18, 2018

Copy link
Copy Markdown
Member

@bors retry #46903

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 18, 2018
@bors

bors commented Feb 18, 2018

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 46a3f2f with merge 7b6d35cc5bb9a8ff432d0a3e933359a68ed42130...

@bors

bors commented Feb 18, 2018

Copy link
Copy Markdown
Collaborator

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 18, 2018
@nikomatsakis

Copy link
Copy Markdown
Contributor

@kennytm

kennytm commented Feb 20, 2018

Copy link
Copy Markdown
Member

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 20, 2018
Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 24, 2018
Remove "static item recursion checking" in favor of relying on cycle checks in the query engine

Tests are changed to use the cycle check error message instead. Some duplicate tests are removed.

r? @eddyb
bors added a commit that referenced this pull request Feb 24, 2018
Rollup of 15 pull requests

- Successful merges: #47987, #48056, #48061, #48084, #48143, #48185, #48206, #48208, #48232, #48246, #48258, #48317, #48353, #48356, #48402
- Failed merges:
bors added a commit that referenced this pull request Feb 24, 2018
Rollup of 15 pull requests

- Successful merges: #47987, #48056, #48061, #48084, #48143, #48185, #48206, #48208, #48232, #48246, #48258, #48317, #48353, #48356, #48402
- Failed merges:
@bors bors merged commit 46a3f2f into rust-lang:master Feb 24, 2018
@Zoxc Zoxc deleted the rm-recursion-checking branch March 3, 2018 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants