-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 #77301
Closed
Closed
Rollup of 9 pull requests #77301
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
This commit improves the diagnostic when a type parameter is expected and a closure is found, noting that each closure has a distinct type and therefore could not always match the caller-chosen type of the parameter. Signed-off-by: David Wood <david@davidtw.co>
fold is known in python and javascript as reduce, not sure about inject but it was written in doc there.
Previously, `BTreeMap` tried to link to `crate::collections`, intending for the link to go to `std/collections/index.html`. But `BTreeMap` is defined in `alloc`, so after the fix in the previous commit, the links instead went to `alloc/collections/index.html`, which has almost no information. This changes it to link to `index.html`, which only works when viewing from `std::collections::BTreeMap`, the most common place to visit the docs. Fixing it to work from anywhere would require the docs for `std::collections` to be duplicated in `alloc::collections`, which in turn would require HashMap to be `alloc` for intra-doc links to work (rust-lang#74481).
This was a hack to work around the lack of an escape hatch for the "min `const fn`" checks in const-stable functions. Now that we have co-opted `allow_internal_unstable` for this purpose, we no longer need the bespoke attribute.
The Liveness struct is the only user of body_owner field. Move the field there.
Avoiding FnKind will make it easier to run liveness analysis on all bodies in the future, not just fn-like things.
…atklad UI to unit test for those using Cell/RefCell/UnsafeCell Helps with rust-lang#76268. I'm working on all files using `Cell` and moving them to unit tests when possible. r? @matklad
…li-obk Add option to pass a custom codegen backend from a driver This allows the driver to pass information to the codegen backend. For example the headcrab debugger may in the future want to use cg_clif to JIT code to be injected in the debuggee. This would PR make it possible to tell cg_clif which symbol can be found at which address and to tell it to inject the JITed code into the right process. This PR may also help with rust-lang/miri#1540 by allowing miri to provide a codegen backend that only emits metadata and doesn't perform any codegen. cc @nbaksalyar (headcrab) cc @RalfJung (miri)
…, r=estebank diag: improve closure/generic parameter mismatch Fixes rust-lang#51154. This PR improves the diagnostic when a type parameter is expected and a closure is found, noting that each closure has a distinct type and therefore could not always match the caller-chosen type of the parameter. r? @estebank
Remove `#[rustc_allow_const_fn_ptr]` and add `#![feature(const_fn_fn_ptr_basics)]` `rustc_allow_const_fn_ptr` was a hack to work around the lack of an escape hatch for the "min `const fn`" checks in const-stable functions. Now that we have co-opted `allow_internal_unstable` for this purpose, we no longer need a bespoke attribute. Now this functionality is gated under `const_fn_fn_ptr_basics` (how concise!), and `#[allow_internal_unstable(const_fn_fn_ptr_basics)]` replaces `#[rustc_allow_const_fn_ptr]`. `const_fn_fn_ptr_basics` allows function pointer types to appear in the arguments and locals of a `const fn` as well as function pointer casts to be performed inside a `const fn`. Both of these were allowed in constants and statics already. Notably, this does **not** allow users to invoke function pointers in a const context. Presumably, we will use a nicer name for that (`const_fn_ptr`?). r? @oli-obk
Add doc alias for iterator fold fold is known in python and javascript as reduce, not sure about inject but it was written in doc there. This was my first confusion when coming into rust, I somehow cannot find where is reduce, sometimes I still forget that it is known as `fold`.
Resolve `crate` in intra-doc links properly across crates Closes rust-lang#77193; see rust-lang#77193 (comment) for an explanation of what's going on here. ~~This also fixes the BTreeMap docs that have been broken for a while; see the description on the second commit for why and how.~~ Nope, see the second commit for why the link had to be changed. r? @Manishearth cc @dylni @dylni note that this doesn't solve your original problem - now _both_ `with_code` and `crate::with_code` will be broken links. However this will fix a lot of other broken links (in particular I think https://docs.rs/sqlx/0.4.0-beta.1/sqlx/query/struct.Query.html is because of this bug). I'll open another issue for resolving additional docs in the new scope.
Liveness refactoring continued * Move body_owner field from IrMaps to Liveness (the only user of the field). * Use upvars instead of FnKind to check for closures (avoids FnKind, will be useful when checking all bodies, not just fns). * Use visit_param to add variables corresponding to params. * Store upvars_mentioned inside Liveness struct. * Inline visitor implementation for IrMaps, avoiding unnecessary indirection. * Test interaction with automatically_derived attribute (not covered by any of existing tests). No functional changes intended.
…nieu Change `AllocRef::by_ref` to take `&self` instead of `&mut self` r? @Amanieu
Prefer asm! in std - all in sgx module Similar to the change in rust-lang#76669 but all `llvm_asm!` is gate in x86/x86_64 target. Godbolt: - https://rust.godbolt.org/z/h7nG1h - https://rust.godbolt.org/z/xx39hW r? @ghost
☔ The latest upstream changes (presumably #77281) made this pull request unmergeable. Please resolve the merge conflicts. Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
|
bors
added
the
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
label
Sep 30, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
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.
Successful merges:
#[rustc_allow_const_fn_ptr]
and add#![feature(const_fn_fn_ptr_basics)]
#77170 (Remove#[rustc_allow_const_fn_ptr]
and add#![feature(const_fn_fn_ptr_basics)]
)crate
in intra-doc links properly across crates #77253 (Resolvecrate
in intra-doc links properly across crates)AllocRef::by_ref
to take&self
instead of&mut self
#77289 (ChangeAllocRef::by_ref
to take&self
instead of&mut self
)Failed merges:
r? @ghost