-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Rename things in std::ascii for consistency #14436
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@alexcrichton I removed the |
Closed
Don't special-case zero-sized values in Vec.ptr(). Doing that prevents the following from working: // v is a Vec<T> let newv = Vec::from_raw_parts(v.len(), v.cap(), v.mut_ptr()); mem::forget(v); Instead, teach slice::Items/MutItems to handle zero-sized values better.
std::string::raw has one function, from_utf(), that converts a Vec<u8> to a String without testing for valid UTF-8.
Rename a few traits in std::ascii to have more descriptive names. Also reimplement a few methods to avoid unnecessary allocation. And add a trait for Vec<Ascii> to do things like casemapping in-place. - Rename AsciiCast to ToAscii - Rename OwnedAsciiCast to IntoAscii - Split AsciiStr into two traits, the second called AsciiSlice - Add trait AsciiVec - Rename OwnedStrAsciiExt to StringAsciiExt This just barely qualifies as a breaking change. Every trait except StringAsciiExt is in the prelude. [breaking-change]
Rename the various *_lower and *_upper methods to the equivalent *_lowercase and *_uppercase names. [breaking-change]
This includes updating for the previous rename of to_lower/upper on Ascii.
@kballard are you still working on this? |
@aochagavia Between WWDC and work, I have very little time to work on Rust this week. I'm still planning on finishing up the |
Closing due to inactivity, but feel free to reopen with a rebase! |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 5, 2023
…th-expr, r=HKalbasi Normalize associated types in paths in expressions Part of rust-lang#14393 When we resolve paths in expressions (either path expressions or paths in struct expressions), there's a need of projection normalization, which `TyLoweringContext` cannot do on its own. We've been properly applying normalization for paths in struct expressions without type anchor, but not for others: ```rust enum E { S { v: i32 } Empty, } impl Foo for Bar { type Assoc = E; fn foo() { let _ = Self::Assoc::S { v: 42 }; // path in struct expr without type anchor; we already support this let _ = <Self>::Assoc::S { v: 42 }; // path in struct expr with type anchor; resolves with this PR let _ = Self::Assoc::Empty; // path expr; resolves with this PR } } ``` With this PR we correctly resolve the whole path, but we need some more tweaks in HIR and/or IDE layers to properly resolve a qualifier (prefix) of such paths and provide IDE features that are pointed out in rust-lang#14393 to be currently broken.
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Mar 20, 2025
changelog: [`question_mark`]: Now respects the [`msrv`] configuration
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tweak the names of various things in
std::ascii
to be more descriptive and consistent.Also fix
Vec.ptr()
to always return the correct pointer even for zero-sized types; handle the issues with iteration over zero-sized types in the iterators instead.[breaking-change]