-
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
Rollup of 15 pull requests #64160
Rollup of 15 pull requests #64160
Conversation
This returns whether a `Place` references the same region of memory as its base, or equivalently whether it contains a `Deref` projection. This is helpful for analyses that must track state for locals, since an assignment to `x` or `x.field` is fundamentally different than one to `*x`, which may mutate any memory region.
Because of a compiler bug that adding `Self: ExactSizeIterator` makes the compiler forget `Self::Item` is `<I as Iterator>::Item`, we remove this specialization for now.
* Make it clear that type erasure is required, not just pointer indirection. * Don't make the message specific to direct recursion.
This prevents mutual `async fn` recursion
It's a hot enough path that moving it slightly earlier gives a tiny but easy speedup.
This is not a compelling change in isolation, but it is a necessary step.
It's unused.
It has a single use, which is easily changed to something better.
Add a `Place::is_indirect` method to determine whether a `Place` contains a `Deref` projection Working on rust-lang#63860 requires tracking some property about each local. This requires differentiating `Place`s like `x` and `x.field[index]` from ones like `*x` and `*x.field`, since the first two will always access the same region of memory as `x` while the latter two may access any region of memory. This functionality is duplicated in various places across the compiler. This PR adds a helper method to `Place` which determines whether that `Place` has a `Deref` projection at any point and changes some existing code to use the new method. I've not converted `qualify_consts.rs` to use the new method, since it's not a trivial conversion and it will get replaced anyway by rust-lang#63860. There may be other potential uses besides the two I change in this PR. r? @oli-obk
… r=nikomatsakis Harden `param_attrs` test wrt. usage of a proc macro `#[attr]` The `param-attrs-builtin-attrs.rs` test file uses the `#[test]` attribute which should cover this but `#[test]` isn't a proc macro attribute so we add another test to be on the safe side. This intends to address rust-lang#64010 (comment). r? @nikomatsakis cc @c410-f3r @petrochenkov cc rust-lang#60406
…t-recursion, r=varkor Check impl trait substs when checking for recursive types closes rust-lang#64004
…ts, r=alexcrichton Add some more tests for underscore imports
…rustc-book-1.37, r=alexcrichton Update xLTO compatibility table in rustc book. This is a combination known to work reliable when building Firefox on all the major platforms. r? @alexcrichton
Refer to "`self` type" instead of "receiver type" Fix rust-lang#42603.
…er, r=petrochenkov Move path parsing earlier It's a hot enough path that moving it slightly earlier gives a tiny but easy speedup. r? @petrochenkov
…ut_uninit_integers, r=Centril Added warning around code with reference to uninit bytes Officially, uninitialized integers, and therefore, Rust references to them are _invalid_ (note that this may evolve into official defined behavior (_c.f._, rust-lang/unsafe-code-guidelines#71)). However, `::std` uses references to uninitialized integers when working with the `Read::initializer` feature (rust-lang#42788), since it relies on this unstably having defined behavior with the current implementation of the compiler (IIUC). Hence the comment to disincentivize people from using this pattern outside the standard library.
unused_parens: account for or-patterns and `&(mut x)` Fixes rust-lang#55342. Fixes rust-lang#64106. cc rust-lang#54883 cc rust-lang#64111 r? @oli-obk
…tring, r=petrochenkov Minimize uses of `LocalInternedString` `LocalInternedString` is described as "An alternative to `Symbol` and `InternedString`, useful when the chars within the symbol need to be accessed. It is best used for temporary values." This PR makes the code match that comment, by removing all non-local uses of `LocalInternedString`. This allows the removal of a number of operations on `LocalInternedString` and a couple of uses of `unsafe`.
Fix doc links in `std::cmp` module r? @jonas-schievink
fix a few typos in comments
@bors r+ p=15 rollup=never |
📌 Commit 51ae5d0 has been approved by |
Rollup of 15 pull requests Successful merges: - #62860 (Stabilize checked_duration_since for 1.38.0) - #63549 (Rev::rposition counts from the wrong end) - #63985 (Stabilize pin_into_inner in 1.39.0) - #64005 (Add a `Place::is_indirect` method to determine whether a `Place` contains a `Deref` projection) - #64031 (Harden `param_attrs` test wrt. usage of a proc macro `#[attr]`) - #64038 (Check impl trait substs when checking for recursive types) - #64043 (Add some more tests for underscore imports) - #64092 (Update xLTO compatibility table in rustc book.) - #64110 (Refer to "`self` type" instead of "receiver type") - #64120 (Move path parsing earlier) - #64123 (Added warning around code with reference to uninit bytes) - #64128 (unused_parens: account for or-patterns and `&(mut x)`) - #64141 (Minimize uses of `LocalInternedString`) - #64142 (Fix doc links in `std::cmp` module) - #64148 (fix a few typos in comments) Failed merges: r? @ghost
☀️ Test successful - checks-azure |
📣 Toolstate changed by #64160! Tested on commit a24f636. 💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk @phansch @flip1995, @rust-lang/infra). |
Tested on commit rust-lang/rust@a24f636. Direct link to PR: <rust-lang/rust#64160> 💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk @phansch @flip1995, @rust-lang/infra). 💔 clippy-driver on linux: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk @phansch @flip1995, @rust-lang/infra).
Successful merges:
Place::is_indirect
method to determine whether aPlace
contains aDeref
projection #64005 (Add aPlace::is_indirect
method to determine whether aPlace
contains aDeref
projection)param_attrs
test wrt. usage of a proc macro#[attr]
#64031 (Hardenparam_attrs
test wrt. usage of a proc macro#[attr]
)self
type" instead of "receiver type" #64110 (Refer to "self
type" instead of "receiver type")&(mut x)
#64128 (unused_parens: account for or-patterns and&(mut x)
)LocalInternedString
#64141 (Minimize uses ofLocalInternedString
)std::cmp
module #64142 (Fix doc links instd::cmp
module)Failed merges:
r? @ghost