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

Chalk upgrade #5319

Merged
merged 9 commits into from
Jul 12, 2020
Merged

Chalk upgrade #5319

merged 9 commits into from
Jul 12, 2020

Conversation

flodiebold
Copy link
Member

@flodiebold flodiebold commented Jul 11, 2020

  • upgrade Chalk
  • make use of Chalk's Unsize impls, remove ours
  • use Chalk's built-in array type
  • search efficiently for impls for an int/float variable
  • output Chalk tracing logs in hir_ty tests

Fixes #2534.
Fixes #5057.
Fixes #4374.
Fixes #4281.

@flodiebold
Copy link
Member Author

Finally!

2020-07-11-194459_560x108_scrot

> $ rust-analyzer analysis-stats -q .
Database loaded 773.315643ms
Crates in this dir: 36
Total modules found: 490
Total declarations: 9622
Total functions: 7486
Item Collection: 17.199864213s, 0b allocated 0b resident
Total expressions: 191235
Expressions of unknown type: 1593 (0%)
Expressions of partially unknown type: 973 (0%)
Type mismatches: 459
Inference: 27.639799388s, 0b allocated 0b resident
Total: 44.839675093s, 0b allocated 0b resident

> $ ./target/release/rust-analyzer analysis-stats .
Database loaded 271.666766ms
Crates in this dir: 36
Total modules found: 490
Total declarations: 9622
Total functions: 7486
Item Collection: 16.365877914s, 0b allocated 0b resident
Total expressions: 191235
Expressions of unknown type: 1468 (0%)
Expressions of partially unknown type: 805 (0%)
Type mismatches: 464
Inference: 30.854763824s, 0b allocated 0b resident
Total: 47.220653907s, 0b allocated 0b resident

crates/ra_hir_ty/src/tests.rs Outdated Show resolved Hide resolved

[dev-dependencies]
insta = "0.16.0"
expect = { path = "../expect" }

tracing = "0.1"
tracing-subscriber = { version = "0.2" }
Copy link
Contributor

Choose a reason for hiding this comment

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

You might be able to disable all default features and only enable the EnvFilter + the Registry to cut down on compile times, as you don't really need the formatters.

Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we can import only a single trait, like how we need only env_logger for logging. The problem with many crates is that you need to update several major versions sometimes.

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 thinking about that—one thing that I can do is re-export the important stuff from tracing-subscriber via tracing-tree, which could reduce the amount of imports to just tracing and tracing-tree.

Copy link
Member Author

Choose a reason for hiding this comment

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

I set the features, but I'm not sure it made any difference 🤔

crates/ra_hir_ty/src/tests/traits.rs Outdated Show resolved Hide resolved

[dev-dependencies]
insta = "0.16.0"
expect = { path = "../expect" }

tracing = "0.1"
tracing-subscriber = { version = "0.2" }
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we can import only a single trait, like how we need only env_logger for logging. The problem with many crates is that you need to update several major versions sometimes.

crates/ra_hir_ty/src/tests.rs Outdated Show resolved Hide resolved
@davidbarsky
Copy link
Contributor

I've released tracing-tree 0.1.3 that enables writing to arbitrary destinations, including stderr. Here are the release notes: https://github.com/davidbarsky/tracing-tree/releases/tag/v0.1.3)

@flodiebold
Copy link
Member Author

The Chalk publish failed to publish chalk-recursive, so I think we'll need to merge this with the git dependency if we don't want to wait a week...

@flodiebold flodiebold marked this pull request as ready for review July 12, 2020 18:06
@flodiebold
Copy link
Member Author

Actually apparently we might get a release...

@flodiebold
Copy link
Member Author

bors r+

@bors
Copy link
Contributor

bors bot commented Jul 12, 2020

@bors bors bot merged commit 39e049d into rust-lang:master Jul 12, 2020
@flodiebold flodiebold deleted the chalk-up branch July 12, 2020 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants