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

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

@kennytmkennytm added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 4, 2018
@kennytm

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

@kennytmkennytm 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
Zoxcforce-pushed the rm-recursion-checking branch from fa0385b to a868d49CompareFebruary 4, 2018 13:46
Comment threadsrc/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.)

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

@nikomatsakisnikomatsakis 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 threadsrc/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 threadsrc/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
ContributorAuthor

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.

@kennytmkennytm 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
Zoxcforce-pushed the rm-recursion-checking branch from a868d49 to 46a3f2fCompareFebruary 10, 2018 02:28
@Zoxc

Zoxc commented Feb 10, 2018

Copy link
Copy Markdown
ContributorAuthor

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

@eddyb

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

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

@borsbors 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
Copy Markdown
Member

@bors retry #46903

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

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

Copy link
Copy Markdown
Member

@bors retry

@borsbors 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
bors added a commit that referenced this pull request Feb 24, 2018
@bors
bors merged commit 46a3f2f into rust-lang:masterFeb 24, 2018
@Zoxc
Zoxc deleted the rm-recursion-checking branch March 3, 2018 06:38
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: 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

@Zoxc@eddyb@kennytm@bors@nikomatsakis@oli-obk