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

error parsing lifetime following by Sized and message + between them #103020

Merged
merged 1 commit into from
Dec 27, 2022

Conversation

lyming2007
Copy link

@lyming2007 lyming2007 commented Oct 13, 2022

Fixes #102598

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 13, 2022
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @wesleywiser (or someone else) soon.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 13, 2022
Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

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

I still don't know if this code should live in parse_param_general -- it seems like a very specific place to put this fix, so similar typos still don't have a suggestion, both in different positions (e.g. return position) and similar in nature (e.g. impl Sized 'a)

@lyming2007
Copy link
Author

I still don't know if this code should live in parse_param_general -- it seems like a very specific place to put this fix, so similar typos still don't have a suggestion, both in different positions (e.g. return position) and similar in nature (e.g. impl Sized 'a)

at least parse_param_general is safe for this code, because that 'lifetime + trait appears as parameters for function, though the code is rare as you mentioned before.

@wesleywiser
Copy link
Member

r? @compiler-errors

since you're already looking at it 🙂

Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

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

Sorry I have neglected reviewing this.

I'm still not convinced this is worth the extra code, since it's not as general as I would like it to be -- but that's just my opinion, and I'd rather not continue accidentally blocking this PR since I've been distracted.

compiler/rustc_parse/src/parser/item.rs Outdated Show resolved Hide resolved
compiler/rustc_parse/src/parser/item.rs Outdated Show resolved Hide resolved
@compiler-errors
Copy link
Member

Let's get someone else's opinion on this. Sorry again about letting this PR sit around for so long, totally my fault.

r? compiler

@rustbot rustbot assigned jackh726 and unassigned compiler-errors Dec 8, 2022
@lyming2007
Copy link
Author

Let's get someone else's opinion on this. Sorry again about letting this PR sit around for so long, totally my fault.

r? compiler

Thanks Michael. Your suggestions are really helpful. I'll investigate more.

detect the pattern at the general site parse_impl_ty()
this will fix rust-lang#102598
@lyming2007
Copy link
Author

I still don't know if this code should live in parse_param_general -- it seems like a very specific place to put this fix, so similar typos still don't have a suggestion, both in different positions (e.g. return position) and similar in nature (e.g. impl Sized 'a)

I think you're right, the code shouldn't be in parse_param_general after carefully thinking about it. Now I moved it to parse_impl_ty which seems to be more general.

@jackh726
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Dec 26, 2022

📌 Commit 419df5f has been approved by jackh726

It is now in the queue for this repository.

@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 Dec 26, 2022
@bors
Copy link
Contributor

bors commented Dec 26, 2022

⌛ Testing commit 419df5f with merge 58f5a01...

@bors
Copy link
Contributor

bors commented Dec 27, 2022

☀️ Test successful - checks-actions
Approved by: jackh726
Pushing 58f5a01 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 27, 2022
@bors bors merged commit 58f5a01 into rust-lang:master Dec 27, 2022
@rustbot rustbot added this to the 1.68.0 milestone Dec 27, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (58f5a01): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.9% [2.9%, 2.9%] 1
Improvements ✅
(primary)
-0.8% [-0.8%, -0.8%] 1
Improvements ✅
(secondary)
-3.4% [-3.4%, -3.4%] 1
All ❌✅ (primary) -0.8% [-0.8%, -0.8%] 1

Cycles

This benchmark run did not return any relevant results for this metric.

Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Jan 6, 2023
error parsing lifetime following by Sized and message + between them

Fixes rust-lang#102598
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

impl 'a Trait in argument position emits multible wrong diagnostics
8 participants