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

rustc: hide HirId's fmt::Debug output from -Z span_free_formats. #66850

Merged
merged 1 commit into from
Dec 2, 2019

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented Nov 28, 2019

This replaces the only occurrences of HirId {...} from tests with paths, i.e.:

[closure@HirId { owner: DefIndex(4), local_id: 15 } q:&i32, t:&T]

becomes, after this PR:

[closure@foo<T>::{{closure}}#0 q:&i32, t:&T]

r? @oli-obk cc @michaelwoerister

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 28, 2019
@eddyb
Copy link
Member Author

eddyb commented Nov 28, 2019

I'm not that happy with [closure@PATH::{{closure}}#n ...], but it's consistent with what we have so far, if we want to go further I'd prefer something like this:

foo<T>::{closure#0} { q:&i32, t:&T }

(yes, {{closure}}#n -> {closure#n} is a change we should do eventually, IMO)
and without -Z span_free_formats we could perhaps go for:

closure(src/main.rs:10:13) { q:&i32, t:&T }

(and we need to remember to fix generators as well)

Oh and we could also change fn definition types from:

fn(bool) -> bool {std::convert::identity::<bool>}

to:

fn std::convert::identity::<bool>(bool) -> bool

@oli-obk
Copy link
Contributor

oli-obk commented Nov 29, 2019

This is definitely an improvement. I opened #66869 to track the further improvements.

@bors r+

@bors
Copy link
Contributor

bors commented Nov 29, 2019

📌 Commit 7171060 has been approved by oli-obk

@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 Nov 29, 2019
@bors
Copy link
Contributor

bors commented Nov 30, 2019

⌛ Testing commit 7171060 with merge 868da0d8e5560bbfa3042b6cab74d950a968e7a9...

@rust-highfive
Copy link
Collaborator

Your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-11-30T01:52:08.8917178Z TMP=/tmp
2019-11-30T01:52:08.8917764Z TOOLSTATE_ISSUES_API_URL=https://api.github.com/repos/rust-lang/rust/issues
2019-11-30T01:52:08.8918260Z TOOLSTATE_PUBLISH=1
2019-11-30T01:52:08.8918459Z TOOLSTATE_REPO=https://github.com/rust-lang-nursery/rust-toolstate
2019-11-30T01:52:08.8918874Z This replaces the only occurrences of `HirId {...}` from tests with paths, i.e.:
2019-11-30T01:52:08.8919812Z USERDOMAIN=fv-az433
2019-11-30T01:52:08.8919886Z USERDOMAIN_ROAMINGPROFILE=fv-az433
2019-11-30T01:52:08.8920000Z USERNAME=VssAdministrator
2019-11-30T01:52:08.8920163Z USERPROFILE=C:\Users\VssAdministrator
2019-11-30T01:52:08.8920163Z USERPROFILE=C:\Users\VssAdministrator
2019-11-30T01:52:08.8920363Z VCPKG_INSTALLATION_ROOT=C:\vcpkg
2019-11-30T01:52:08.8920580Z VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
2019-11-30T01:52:08.8920982Z VSTS_AGENT_PERFLOG=c:\vsts\perflog
2019-11-30T01:52:08.8921226Z VSTS_PROCESS_LOOKUP_ID=vsts_cb842039-d098-4c0b-b64f-d8dbf2c4b813
2019-11-30T01:52:08.8921455Z WINDIR=C:\windows
2019-11-30T01:52:08.8921645Z WIX=C:\Program Files (x86)\WiX Toolset v3.11\
2019-11-30T01:52:08.8921739Z [closure@HirId { owner: DefIndex(4), local_id: 15 } q:&i32, t:&T]
2019-11-30T01:52:08.8921887Z [closure@foo<T>::{{closure}}#0 q:&i32, t:&T]
2019-11-30T01:52:08.8922127Z ```
2019-11-30T01:52:08.8922185Z ```
2019-11-30T01:52:08.8922263Z ```rust
2019-11-30T01:52:08.8922320Z ```rust
2019-11-30T01:52:08.8922320Z ```rust
2019-11-30T01:52:08.8922402Z agent.jobstatus=Succeeded
2019-11-30T01:52:08.8922475Z becomes, after this PR:
2019-11-30T01:52:08.8922566Z r? @oli-obk cc @michaelwoerister
2019-11-30T01:52:08.8922672Z rustc: hide HirId's fmt::Debug output from -Z span_free_formats.
2019-11-30T01:52:08.8922855Z disk usage:
2019-11-30T01:52:08.9553719Z Filesystem            Size  Used Avail Use% Mounted on
2019-11-30T01:52:08.9554000Z C:/Program Files/Git  256G  141G  116G  55% /
2019-11-30T01:52:08.9554637Z D:                     14G  2.0G   13G  15% /d
---
2019-11-30T01:53:17.6624752Z Chocolatey installed 0/1 packages. 1 packages failed.
2019-11-30T01:53:17.6624860Z  See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2019-11-30T01:53:17.6630260Z 
2019-11-30T01:53:17.6636989Z Failures
2019-11-30T01:53:17.6644053Z  - msys2 (exited 1) - msys2 not installed. An error occurred during installation:
2019-11-30T01:53:17.6644187Z  The remote server returned an error: (503) Server Unavailable. Service Unavailable
2019-11-30T01:53:18.2033079Z 
2019-11-30T01:53:18.2121683Z ##[error]Bash exited with code '1'.
2019-11-30T01:53:18.2252715Z ##[section]Starting: Checkout
2019-11-30T01:53:18.2370809Z ==============================================================================
2019-11-30T01:53:18.2370917Z Task         : Get sources
2019-11-30T01:53:18.2371162Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors
Copy link
Contributor

bors commented Nov 30, 2019

💔 Test failed - checks-azure

@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 Nov 30, 2019
@eddyb
Copy link
Member Author

eddyb commented Nov 30, 2019

@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 Nov 30, 2019
@bors
Copy link
Contributor

bors commented Nov 30, 2019

⌛ Testing commit 7171060 with merge 3f3be3290107086a324d27dbac1bf46df56dbb45...

@rust-highfive
Copy link
Collaborator

Your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-11-30T05:56:19.6079731Z TMP=/tmp
2019-11-30T05:56:19.6079826Z TOOLSTATE_ISSUES_API_URL=https://api.github.com/repos/rust-lang/rust/issues
2019-11-30T05:56:19.6079908Z TOOLSTATE_PUBLISH=1
2019-11-30T05:56:19.6080780Z TOOLSTATE_REPO=https://github.com/rust-lang-nursery/rust-toolstate
2019-11-30T05:56:19.6080910Z This replaces the only occurrences of `HirId {...}` from tests with paths, i.e.:
2019-11-30T05:56:19.6081446Z USERDOMAIN=fv-az433
2019-11-30T05:56:19.6081514Z USERDOMAIN_ROAMINGPROFILE=fv-az433
2019-11-30T05:56:19.6081595Z USERNAME=VssAdministrator
2019-11-30T05:56:19.6082422Z USERPROFILE=C:\Users\VssAdministrator
2019-11-30T05:56:19.6082422Z USERPROFILE=C:\Users\VssAdministrator
2019-11-30T05:56:19.6082518Z VCPKG_INSTALLATION_ROOT=C:\vcpkg
2019-11-30T05:56:19.6083104Z VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
2019-11-30T05:56:19.6083226Z VSTS_AGENT_PERFLOG=c:\vsts\perflog
2019-11-30T05:56:19.6083330Z VSTS_PROCESS_LOOKUP_ID=vsts_d8876ecf-f293-48d2-8078-008dc57e4319
2019-11-30T05:56:19.6083412Z WINDIR=C:\windows
2019-11-30T05:56:19.6083593Z WIX=C:\Program Files (x86)\WiX Toolset v3.11\
2019-11-30T05:56:19.6083686Z [closure@HirId { owner: DefIndex(4), local_id: 15 } q:&i32, t:&T]
2019-11-30T05:56:19.6083790Z [closure@foo<T>::{{closure}}#0 q:&i32, t:&T]
2019-11-30T05:56:19.6083945Z ```
2019-11-30T05:56:19.6084004Z ```
2019-11-30T05:56:19.6084074Z ```rust
2019-11-30T05:56:19.6084185Z ```rust
2019-11-30T05:56:19.6084185Z ```rust
2019-11-30T05:56:19.6084245Z agent.jobstatus=Succeeded
2019-11-30T05:56:19.6084335Z becomes, after this PR:
2019-11-30T05:56:19.6084407Z r? @oli-obk cc @michaelwoerister
2019-11-30T05:56:19.6084509Z rustc: hide HirId's fmt::Debug output from -Z span_free_formats.
2019-11-30T05:56:19.6084945Z disk usage:
2019-11-30T05:56:19.7277277Z Filesystem            Size  Used Avail Use% Mounted on
2019-11-30T05:56:19.7277469Z C:/Program Files/Git  256G  141G  116G  55% /
2019-11-30T05:56:19.7277562Z D:                     14G  2.0G   13G  15% /d
---
2019-11-30T05:57:58.7844806Z Chocolatey installed 0/1 packages. 1 packages failed.
2019-11-30T05:57:58.7845133Z  See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2019-11-30T05:57:58.7858069Z 
2019-11-30T05:57:58.7858212Z Failures
2019-11-30T05:57:58.7865278Z  - msys2 (exited 1) - msys2 not installed. An error occurred during installation:
2019-11-30T05:57:58.7865412Z  The remote server returned an error: (503) Server Unavailable. Service Unavailable
2019-11-30T05:57:59.3165112Z 
2019-11-30T05:57:59.3253007Z ##[error]Bash exited with code '1'.
2019-11-30T05:57:59.3410371Z ##[section]Starting: Checkout
2019-11-30T05:57:59.3541313Z ==============================================================================
2019-11-30T05:57:59.3541419Z Task         : Get sources
2019-11-30T05:57:59.3541501Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors
Copy link
Contributor

bors commented Nov 30, 2019

💔 Test failed - checks-azure

@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 Nov 30, 2019
@Centril
Copy link
Contributor

Centril commented Nov 30, 2019

@bors retry spurious

@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 Nov 30, 2019
Centril added a commit to Centril/rust that referenced this pull request Dec 1, 2019
rustc: hide HirId's fmt::Debug output from -Z span_free_formats.

This replaces the only occurrences of `HirId {...}` from tests with paths, i.e.:
```rust
[closure@HirId { owner: DefIndex(4), local_id: 15 } q:&i32, t:&T]
```
becomes, after this PR:
```rust
[closure@foo<T>::{{closure}}#0 q:&i32, t:&T]
```

r? @oli-obk cc @michaelwoerister
Centril added a commit to Centril/rust that referenced this pull request Dec 1, 2019
rustc: don't just show raw DefIndex's in BrNamed's fmt::Debug impl.

Context: these `fmt::Debug` impls only get used with `-Z verbose` (which some tests use).

I was going to print the path like in rust-lang#66850 (or rather, use `DefId`'s `fmt::Debug`, which is close but not as nice), but then I realized that most of the `DefId`s were `crate0:DefIndex(0)`, i.e. the crate root.
As the crate root is not a lifetime, they're clearly dummies of some sort, and we don't have to print anything other than the name for them.

This means that out of all the tests, there's only 5 instances of `BrNamed` that now print the full path to the lifetime parameter, and everything else is shorter instead, which doesn't feel too bad.

cc @nikomatsakis
bors added a commit that referenced this pull request Dec 1, 2019
Rollup of 7 pull requests

Successful merges:

 - #66346 (Replace .unwrap() with ? in std::os::unix::net)
 - #66789 (rustc: move mir::SourceScopeLocalData to a field of SourceScopeData.)
 - #66822 (libunwind_panic: adjust miri panic hack)
 - #66827 (handle diverging functions forwarding their return place)
 - #66828 (Less minification)
 - #66850 (rustc: hide HirId's fmt::Debug output from -Z span_free_formats.)
 - #66907 (rustc: don't just show raw DefIndex's in BrNamed's fmt::Debug impl.)

Failed merges:

 - #66874 (Miri engine: proper support for `Assert` MIR terminators)

r? @ghost
bors added a commit that referenced this pull request Dec 1, 2019
Rollup of 7 pull requests

Successful merges:

 - #66346 (Replace .unwrap() with ? in std::os::unix::net)
 - #66789 (rustc: move mir::SourceScopeLocalData to a field of SourceScopeData.)
 - #66822 (libunwind_panic: adjust miri panic hack)
 - #66827 (handle diverging functions forwarding their return place)
 - #66828 (Less minification)
 - #66850 (rustc: hide HirId's fmt::Debug output from -Z span_free_formats.)
 - #66907 (rustc: don't just show raw DefIndex's in BrNamed's fmt::Debug impl.)

Failed merges:

 - #66874 (Miri engine: proper support for `Assert` MIR terminators)

r? @ghost
Centril added a commit to Centril/rust that referenced this pull request Dec 2, 2019
rustc: hide HirId's fmt::Debug output from -Z span_free_formats.

This replaces the only occurrences of `HirId {...}` from tests with paths, i.e.:
```rust
[closure@HirId { owner: DefIndex(4), local_id: 15 } q:&i32, t:&T]
```
becomes, after this PR:
```rust
[closure@foo<T>::{{closure}}#0 q:&i32, t:&T]
```

r? @oli-obk cc @michaelwoerister
Centril added a commit to Centril/rust that referenced this pull request Dec 2, 2019
rustc: don't just show raw DefIndex's in BrNamed's fmt::Debug impl.

Context: these `fmt::Debug` impls only get used with `-Z verbose` (which some tests use).

I was going to print the path like in rust-lang#66850 (or rather, use `DefId`'s `fmt::Debug`, which is close but not as nice), but then I realized that most of the `DefId`s were `crate0:DefIndex(0)`, i.e. the crate root.
As the crate root is not a lifetime, they're clearly dummies of some sort, and we don't have to print anything other than the name for them.

This means that out of all the tests, there's only 5 instances of `BrNamed` that now print the full path to the lifetime parameter, and everything else is shorter instead, which doesn't feel too bad.

cc @nikomatsakis
bors added a commit that referenced this pull request Dec 2, 2019
Rollup of 7 pull requests

Successful merges:

 - #66346 (Replace .unwrap() with ? in std::os::unix::net)
 - #66789 (rustc: move mir::SourceScopeLocalData to a field of SourceScopeData.)
 - #66850 (rustc: hide HirId's fmt::Debug output from -Z span_free_formats.)
 - #66905 (rustc_plugin: Remove some remaining plugin features)
 - #66907 (rustc: don't just show raw DefIndex's in BrNamed's fmt::Debug impl.)
 - #66918 (Add crc and crypto to target feature whitelist on arm)
 - #66926 (add reusable MachineStop variant to Miri engine error enum)

Failed merges:

r? @ghost
@bors bors merged commit 7171060 into rust-lang:master Dec 2, 2019
RalfJung added a commit to RalfJung/rust that referenced this pull request Dec 2, 2019
…wjasper

rustc_mir: use nicer path printing for #[rustc_regions] NLL tests.

Similar to rust-lang#66850, spotted while working on rust-lang#66907.

r? @matthewjasper
@eddyb eddyb deleted the span-free-formats branch December 2, 2019 10:33
bors added a commit that referenced this pull request Dec 6, 2019
rustc_mir: use nicer path printing for #[rustc_regions] NLL tests.

Similar to #66850, spotted while working on #66907.

r? @matthewjasper
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.

None yet

5 participants