-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 9 pull requests #23946
Closed
Closed
Rollup of 9 pull requests #23946
+3,009
−1,653
Conversation
This file contains 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
reallocation strategy since extend() calls reserve() and/or push() for us.
context private.
… and onto the `UnificationTable`, and renaming/collapsing some methods.
so that it is closer to standalone.
trait matching more tailored. We now detect recursion where the obligations "match" -- meaning basically that they are the same for some substitution of any unbound type variables.
F`, so that if we have `x: &mut FnMut()`, then `x()` is translated to `FnMut::call_mut(&mut *x, ())` rather than `&mut x`. The latter would require `mut x: &mut FnMut()`, which is really a lot of mut. (Actually, the `mut` is normally required except for the special case of a `&mut F` reference, because that's the one case where we distinguish a unique path like `x` from a mutable path.)
local only if matches `FUNDAMENTAL(LocalType)`, where `FUNDAMENTAL` includes `&T` and types marked as fundamental (which includes `Box`). Also apply these tests to negative reasoning.
`Fn` traits are considered fundamental, along with `Box` (though that is mostly for show; the real type is `~T` in the compiler).
probing the specifics of `Fundamental`. Fixes rust-lang#23086. Fixes rust-lang#23516.
since `Option` is not fundamental and hence the old impls run afoul of the orphan rules.
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
@bors: r+ p=20 force |
📌 Commit fc29285 has been approved by |
⌛ Testing commit fc29285 with merge ed3b7b3... |
💔 Test failed - auto-win-32-nopt-t |
…pnkfelix This PR solves rust-lang#21559 by making sure that unreachable if-expressions are not further translated. Could someone who knows their way around `trans` take a look at the changes in `controlflow.rs`? I'm not sure if any other code relies on any side-effects of translating unreachable things. cc @nikomatsakis @nrc @eddyb
While trying to implement parallel ECS processing, I stumbled upon the need to mutate `Arc` contents. The only existed method that allowed that was `make_unique`, but it has issues: - it may clone the data as if nothing happened, where the program may just need to crash - it forces `Clone` bound, which I don't have The new `try_unique` allows accessing the contents mutably without `Clone` bound and error out if the pointer is not unique.
…kler This introduces no functional changes except for reducing a few unnecessary operations and variables. Vec has the behavior that, if you request space past the capacity with reserve(), it will round up to the nearest power of 2. What that effectively means is that after the first call to reserve(16), we are doubling our capacity every time. So using the DEFAULT_BUF_SIZE and doubling cap_size() here is meaningless and has no effect on the call to reserve(). Note that with rust-lang#23842 implemented this will hopefully have a clearer API and less of a need for commenting. If rust-lang#23842 is not implemented then the most clear implementation would be to call reserve_exact(buf.capacity()) at every step (and making sure that buf.capacity() is not zero at the beginning of the function of course). Edit- functional change now introduced. We will now zero 16 bytes of the vector first, then double to 32, then 64, etc. until we read 64kB. This stops us from zeroing the entire vector when we double it, some of which may be wasted work. Reallocation still follows the doubling strategy, but the responsibility has been moved to vec.extend(), which calls reserve() and push_back().
…pnkfelix This PR implements rust-lang/rfcs#1023. In the process it fixes rust-lang#23086 and rust-lang#23516. A few impls in libcore had to be updated, but the impact is generally pretty minimal. Most of the fallout is in the tests that probed the limits of today's coherence. I tested and we were able to build the most popular crates along with iron (modulo errors around errors being sendable). Fixes rust-lang#23918.
…dd-impls, r=pnkfelix The primary purpose of this PR is to add blanket impls for the `Fn` traits of the following (simplified) form: impl<F:Fn> Fn for &F impl<F:FnMut> FnMut for &mut F However, this wound up requiring two changes: 1. A slight hack so that `x()` where `x: &mut F` is translated to `FnMut::call_mut(&mut *x, ())` vs `FnMut::call_mut(&mut x, ())`. This is achieved by just autoderef'ing one time when calling something whose type is `&F` or `&mut F`. 2. Making the infinite recursion test in trait matching a bit more tailored. This involves adding a notion of "matching" types that looks to see if types are potentially unifiable (it's an approximation). The PR also includes various small refactorings to the inference code that are aimed at moving the unification and other code into a library (I've got that particular change in a branch, these changes just lead the way there by removing unnecessary dependencies between the compiler and the more general unification code). Note that per rust-lang/rfcs#1023, adding impls like these would be a breaking change in the future. cc @japaric cc @alexcrichton cc @aturon Fixes rust-lang#23015.
Basically stuff I did for unqualified assoc types which is worth landing by itself.
Fixes rust-lang#22914 Said issue was mostly fixed, as there wasn't any examples when it was initially posted. This is mostly just some re-wording of some things and some cleanup
@bors: r+ force |
📌 Commit ec6c2c3 has been approved by |
⌛ Testing commit ec6c2c3 with merge 9f18f80... |
💔 Test failed - auto-mac-32-opt |
Continued in #23955, thanks @Manishearth! |
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.
&F
/&mut F
whereF: Fn
/F:FnMut
respectively #23895, Pretty printing ids for assoc items and some tidying up in resolve/ast conv #23924, Improvements to PhantomData<T>'s docs 👻 #23925, Simplifymatch
branches in iter.rs example #23927, Add examples + documentation for std::path #23932, Fix rust book error-handling.md for new std::io. #23933, iOS: os::last_os_error fallout #23942PhantomFn
/MarkerTrait
#23938