-
Couldn't load subscription status.
- Fork 13.9k
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
Conversation
|
@alexcrichton I removed the |
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! |
…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.
changelog: [`question_mark`]: Now respects the [`msrv`] configuration
Tweak the names of various things in
std::asciito 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]