diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-04-30 19:37:35 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-04-30 19:37:35 +0100 |
commit | 745bd45ddb2f8b6165ab7eacfd482d8530cab05a (patch) | |
tree | 9e36b55112d3ea5f9d913d36597884b82aa87f68 /crates/ra_ide/src/syntax_highlighting.rs | |
parent | 861652ffa6b6440a022a353d2e6b9f5ca780d2ec (diff) | |
parent | 513a3615f6d462852c0135dc4ac30a2086e25c5a (diff) |
Merge #4227
4227: Report invalid, nested, multi-segment crate-paths r=matklad a=djrenren
There was a bug in the previous path-validating code that didn't detect multi-segment paths that started with `crate`.
```rust
// Successfully reported
use foo::{crate};
// BUG: was not being reported
use foo::{crate::bar};
```
This was due to my confusion about path-associativity. That is, the path with no qualifier is the innermost path, not the outermost. I've updated the code with a lot of comments to explain what's going on.
This bug was discovered when I found an erroneous `ok` test which I reported here:
https://github.com/rust-analyzer/rust-analyzer/issues/4226
This test now fails and has been modified, hopefully in the spirit of the original test, to be correct. Sorry about submitting the bug in the first place!
Co-authored-by: John Renner <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/syntax_highlighting.rs')
0 files changed, 0 insertions, 0 deletions