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

Make examples and generated code work with rust_2018_idioms lint. #367

Merged
merged 1 commit into from
Nov 3, 2022

Conversation

ratmice
Copy link
Collaborator

@ratmice ratmice commented Nov 3, 2022

This is an update to my previous pull request #365, towards the end of writing this patch
my understanding of rust_2018_idioms changed, e.g. for some reason I thought it was a 2018 -> 2021 thing,
but it's actually a 2015 -> 2018 change. It lints against code which was previously accepted by 2015 compilers,
was deprecated in the 2018 edition.

But the lints which deprecated have never been completed to the satisfaction of being enabled by default.
tracking issue: rust-lang/rust#54910

As such i'm really not sure about the conditional code generation being necessary for this.
the new code generated for > 2015 was accepted by 2015 edition, and expect the old code to have lints enabled for them
in the future.

But perhaps this edition stuff would be useful to have everything in place for future edition changes?
As such I figure i'll just make the PR with what I have, and we can trim it down if we want...

@@ -68,6 +68,15 @@ impl Visibility {
}
}

/// Specifies the [^Rust Edition] that will be emitted during code generation.
Copy link
Member

Choose a reason for hiding this comment

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

Is the ^ intentional?

Copy link
Collaborator Author

@ratmice ratmice Nov 3, 2022

Choose a reason for hiding this comment

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

It was part of the footnote syntax of cargo doc, but looking at the generated doc (oops),
it looked terrible with the footnote style. I managed to get it working so the link text shows up inline.
while not making line-length terrible asymmetric.

Should be fixed in bb1e970

Copy link
Member

Choose a reason for hiding this comment

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

There are still a couple of other [^s in the PR -- should they disappear too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry still 😴 ☕, they probably should.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed the one in lrlex now in 931202f

lrpar/src/lib/ctbuilder.rs Outdated Show resolved Hide resolved
@ltratt
Copy link
Member

ltratt commented Nov 3, 2022

Please squash.

@ratmice
Copy link
Collaborator Author

ratmice commented Nov 3, 2022

Squashed.

@ltratt
Copy link
Member

ltratt commented Nov 3, 2022

bors r+

@bors
Copy link
Contributor

bors bot commented Nov 3, 2022

Build succeeded:

@bors bors bot merged commit 99ef6c6 into softdevteam:master Nov 3, 2022
@ratmice ratmice deleted the rust_2018_idioms branch November 3, 2022 14:54
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