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

regex: Make some general tweaks #13863

Merged
merged 2 commits into from
Apr 30, 2014
Merged

regex: Make some general tweaks #13863

merged 2 commits into from
Apr 30, 2014

Conversation

huonw
Copy link
Member

@huonw huonw commented Apr 30, 2014

Mostly code style e.g. avoiding ~ and using for + iterators.

huonw added 2 commits April 30, 2014 00:55
The AST doesn't need ~s everywhere, so we can save allocations this way
& the enum isn't particularly large (~4 words) nor are regexes
long (normally), so the space saved in the `Cat` vector is unlikely to
be very much.
For loops are nicer than manual whiles, etc.
@@ -309,7 +307,7 @@ fn exec<'t>(which: ::regex::native::MatchKind, input: &'t str,

::regex::Regex {
original: ~$regex,
names: ~$cap_names,
names: vec!$cap_names,
Copy link
Member

Choose a reason for hiding this comment

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

whoa, I had no idea that even worked!

bors added a commit that referenced this pull request Apr 30, 2014
Mostly code style e.g. avoiding `~` and using `for` + iterators.
@bors bors closed this Apr 30, 2014
@bors bors merged commit 33f98ad into rust-lang:master Apr 30, 2014
@huonw huonw deleted the re-tweaks branch June 27, 2014 06:47
arcnmx pushed a commit to arcnmx/rust that referenced this pull request Jan 9, 2023
minor: suppress 'clippy::approx_constant' lint in test case

suppresses a false positive clippy lint
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jan 9, 2025
…ang#13863)

Fixes rust-lang#13862

`missing_headers::check` is sometimes called from outside of a body
(specifically, from `check_attributes`, where the LateContext's ParamEnv
is not yet properly initialized for that item). Using that empty
ParamEnv for trait solving things from within the body can then lead to
various ICEs, like the linked issue where we have a const generic
parameter `DMA_INST` without a `ConstArgHasType` bound in the ParamEnv
so the const parameter has no type, which is normally not supposed to
happen.

We have the item's DefId so we can just get its ParamEnv/TypingEnv from
there, and using that one for trait solving should be safe.

changelog: none
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.

4 participants