-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Avoid naming variables str
#135198
Avoid naming variables str
#135198
Conversation
r? @Noratrieb rustbot has assigned @Noratrieb. Use |
@bors rollup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The non-subtree ones (compiler, library, compiletest) make sense to me, but the subtree ones (even if managed by josh) is probably not worth changing here in r-l/r in case sync conflict?
@jieyouxu Sigh. The contribution model of anything similar to a submodule/subtree remains confusing. I'll drop those from this PR. |
This renames variables named `str` to other names, to make sure `str` always refers to a type. It's confusing to read code where `str` (or another standard type name) is used as an identifier. It also produces misleading syntax highlighting.
bd44fe2
to
bb6bbfa
Compare
Some changes occurred in src/tools/compiletest cc @jieyouxu Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri Some changes occurred to the CTFE machinery cc @rust-lang/wg-const-eval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Yeah, the subtree vs submodule vs none-of-the-above is indeed confusing. You can r=me after PR CI is green (library changes are just variable renames, so)
I actually find it quite convenient that I can name variables this way, exploiting that |
Speaking only for Miri, I think the risk of conflicts from changes like this is low so I would find landing patches like this via the monorepo completely fine. The point where issues can arise is that monorepo CI is less thorough than Miri's own CI, in particular for things that are target-specific, so any patch that actually adds functionality should preferably be de done in Miri. |
r? jieyouxu @bors r+ rollup |
…llaumeGomez Rollup of 9 pull requests Successful merges: - rust-lang#135081 (bootstrap: Build jemalloc with support for 64K pages) - rust-lang#135174 ([AIX] Port test case run-make/reproducible-build ) - rust-lang#135177 (llvm: Ignore error value that is always false) - rust-lang#135182 (Transmute from NonNull to pointer when elaborating a box deref (MCP807)) - rust-lang#135187 (apply a workaround fix for the release roadblock) - rust-lang#135189 (Remove workaround from pull request template) - rust-lang#135193 (don't bless `proc_macro_deps.rs` unless it's necessary) - rust-lang#135198 (Avoid naming variables `str`) - rust-lang#135199 (Eliminate an unnecessary `Symbol::to_string`; use `as_str`) r? `@ghost` `@rustbot` modify labels: rollup
I agree with Ralf, and I think str is clearer than s even. Though in most cases both names are not great and an even better name should be chosen :). Not that I'd r-, s is fine too |
Rollup merge of rust-lang#135198 - joshtriplett:str-is-a-type, r=jieyouxu Avoid naming variables `str` This renames variables named `str` to other names, to make sure `str` always refers to a type. It's confusing to read code where `str` (or another standard type name) is used as an identifier. It also produces misleading syntax highlighting.
This renames variables named
str
to other names, to make surestr
always refers to a type.
It's confusing to read code where
str
(or another standard type name)is used as an identifier. It also produces misleading syntax
highlighting.