Skip to content

Conversation

@Veykril
Copy link
Member

@Veykril Veykril commented Dec 23, 2020

Groundwork for #6966

Comment on lines 379 to 381
pub fn label_syntax(&self, label: LabelId) -> Result<LabelSource, SyntheticSyntax> {
self.label_map_back[label].clone()
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think labels can't be synthetic (ie, we don't produce labels during desugaring), so this should return a value rather than a result. And, more generally, we shouldn't store a Result in the source map in the frist palce.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, I partially based this off of patterns hence why I used this here but I think you are right, we aren't producing new labels.

Copy link
Contributor

@matklad matklad left a comment

Choose a reason for hiding this comment

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

LGTM, although it maybe makes sense to fold basic goto definition support here as well, just to be able to implement a smoke test.

@Veykril
Copy link
Member Author

Veykril commented Dec 24, 2020

I already have everything done for the the entire rename and goto scheme so its all tested in a sense, I just split the work up to get smaller PRs hence this only contains the changes to HIR.

@matklad
Copy link
Contributor

matklad commented Dec 24, 2020

bors r+

Splitting is generally good, but I personally also strongly prefer at least a hello-world test. There's no crisp and clear solutions here, ideally, it should be possible to spike the main functionality such that it has smoke tests, and then add extra bells&whistles in follow ups

@bors
Copy link
Contributor

bors bot commented Dec 24, 2020

@bors bors bot merged commit 0632001 into rust-lang:master Dec 24, 2020
@Veykril
Copy link
Member Author

Veykril commented Dec 24, 2020

Fair point, I'll keep that in mind 👍

@Veykril Veykril deleted the hir-label branch May 20, 2022 13: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

Development

Successfully merging this pull request may close these issues.

2 participants