Remove "static item recursion checking" in favor of relying on cycle checks in the query engine by Zoxc · Pull Request #47987 · rust-lang/rust (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation22 Commits2 Checks0 Files changed

Conversation

This file contains hidden or 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

[ Show hidden characters]({{ revealButtonHref }})

Zoxc

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

r? @eddyb

@eddyb

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

@kennytm

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

oli-obk

@@ -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.

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?

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...

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.

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.

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

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.

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

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"?

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

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

…checks in the query engine

@Zoxc

@Zoxc

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

@eddyb

@bors

📌 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

nikomatsakis

@bors

⌛ Testing commit 46a3f2f with merge d6005b3f3e50013a47a4e5269389a1343bba48b3...

@bors

@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

@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

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

@bors

@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

@kennytm

@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

@Manishearth

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

@bors

Rollup of 15 pull requests

bors added a commit that referenced this pull request

Feb 24, 2018

@bors

Rollup of 15 pull requests

@Zoxc Zoxc deleted the rm-recursion-checking branch

March 3, 2018 06:38

Labels

S-waiting-on-bors

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