Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Feb 24, 2018

Conversation

Zoxc
Copy link
Contributor

@Zoxc Zoxc commented Feb 3, 2018

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

r? @eddyb

@eddyb
Copy link
Member

eddyb commented Feb 3, 2018

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
Copy link
Member

kennytm commented Feb 4, 2018

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

[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
@@ -129,16 +129,18 @@ Please note that negative impls are only allowed for auto traits.
"##,

E0265: r##"
#### Note: this error code is no longer emitted by the compiler.
Copy link
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
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
Member

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
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
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
Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

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

Looks nice

@@ -129,16 +129,18 @@ Please note that negative impls are only allowed for auto traits.
"##,

E0265: r##"
#### Note: this error code is no longer emitted by the compiler.

This error indicates that a static or constant references itself.
Copy link
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?

@@ -0,0 +1,15 @@
error[E0391]: unsupported cyclic reference between types/traits detected
Copy link
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
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
Member

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
Copy link
Contributor Author

Zoxc commented Feb 10, 2018

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

@eddyb
Copy link
Member

eddyb commented Feb 10, 2018

@bors r+

@bors
Copy link
Contributor

bors commented Feb 10, 2018

📌 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
Copy link
Contributor

bors commented Feb 18, 2018

⌛ Testing commit 46a3f2f with merge d6005b3f3e50013a47a4e5269389a1343bba48b3...

@bors
Copy link
Contributor

bors commented Feb 18, 2018

💔 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
Copy link
Member

kennytm commented Feb 18, 2018

@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
Copy link
Contributor

bors commented Feb 18, 2018

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

@bors
Copy link
Contributor

bors commented Feb 18, 2018

💔 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
Contributor

@kennytm
Copy link
Member

kennytm commented Feb 20, 2018

@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