Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

chore: Upgrade cargo #1764

Merged
merged 2 commits into from
Feb 10, 2022
Merged

chore: Upgrade cargo #1764

merged 2 commits into from
Feb 10, 2022

Conversation

epage
Copy link
Contributor

@epage epage commented Jan 26, 2022

Cargo has switched exclusively to toml_edit, so when downcasting
errors to get line and column, we need to downcast for those errors as
well.

This does not attempt to port rls to toml_edit and an analysis was not
done to verify if the find_toml_error code path only needs to check
for one toml library.

The downside to this solution is its brittle. Any time cargo upgrades
through a breaking toml_edit version, this test will break again and
we'll have to upgrade rls to fix it.

The tracking of manifest_error_range was changed because I was originally exploring removing it. Returning None didn't change the test to fail in a way I expected, so I pivoted to get line_col into toml_edit. I felt the change did make the code better match intent and since it was a distinct commit, I kept it here. I can remove it if needed.

epage added 2 commits January 26, 2022 16:01
Cargo has switched exclusively to `toml_edit`, so when downcasting
errors to get line and column, we need to downcast for those errors as
well.

This does not attempt to port rls to `toml_edit` and an analysis was not
done to verify if the `find_toml_error` code path only needs to check
for one toml library.

The downside to this solution is its brittle.  Any time cargo upgrades
through a breaking `toml_edit` version, this test will break again and
we'll have to upgrade rls to fix it.
Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

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

Thanks @epage!

@ehuss ehuss merged commit 3df7438 into rust-lang:master Feb 10, 2022
@epage epage deleted the cargo branch February 10, 2022 15:37
@ehuss ehuss mentioned this pull request Feb 10, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 10, 2022
Update rls

2 commits in f37425e33c864c697af06df66e7473444605c149..3df74381f37617ec800537c11fb0c3130f5f3616
2022-01-15 18:07:20 +0100 to 2022-02-10 07:33:33 -0800
- chore: Upgrade cargo (rust-lang/rls#1764)
- Bump rls-analysis version
bors added a commit to rust-lang/cargo that referenced this pull request Apr 27, 2022
chore: Upgrade toml_edit

### What does this PR try to resolve?

This upgrades toml_edit and tries to make future upgrades easier.  To do this, it officially adds `toml_edit` to the public API but this will let RLS use these errors and stay up-to-date without manual intervention.

### How should we test and review this PR?

The main question is if we should have toml_edit in the API

### Additional information

See rust-lang/rls#1764
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants