-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 14 pull requests #73392
Closed
Closed
Rollup of 14 pull requests #73392
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
Namely closures and `async` blocks. We have to make a few modifications to closures to make them compile.
In rust-lang#72936 (comment), it was determined that some unusual code could cause rustc to overflow when evaluating a predicate of the form `T: AutoTrait`. Even if this is a bug, it will still be possible to cause overflow through writing explicit impls of auto traits, just like any other type of impl. In rustdoc, this overflow can happen simply as a result of defining certain types, since we will automatically generate and evaluate auto-trait predicates when generating documentation. For now, we just ignore overflow during selection if it occurs in rustdoc. We should probably come up with a better way to handle this - e.g. rendering some kind of error in the generated documentation. However, this is a very unusual corner case, and this PR is sufficient to unblock landing a Chalk update in PR rust-lang#72936 This adds additional hacks to `librustc_trait_selection`. The auto-trait-finding code should probably be completely rewritten, but I think this is good enough for the time being.
This should run much faster. There are also some drive-by cleanups here to try to simplify things. Also, the paths for in-tree crates are now displayed as relative in `x.py test -h -v`.
* Check for overflow when calculating the slice start & end position. * Align the pointer obtained from the allocator, ensuring that it satisfies user requested alignment (the allocator is only asked for layout compatible with u8 slice). * Remove an incorrect assertion from DroplessArena::align.
Return a pointer from `alloc_raw` instead of a slice. There is no practical use for slice as a return type and changing it to a pointer avoids forming references to an uninitialized memory.
- Suggest borrowing expression if it would allow cast to work. - Suggest using `<Type>::from(<expr>)` when appropriate. - Minor tweak to `;` typo suggestion. Partily address rust-lang#47136.
…epmaster Add tests for 'impl Default for [T; N]' Related: rust-lang#71690. This pull request adds two tests: - Even it T::default() panics, no leaks occur. - [T; 0] is Default even if T is not. I believe at some moment `Default` impl for arrays will be rewritten to use const generics instead of macros, and these tests will help to prevent behavior changes.
…, r=nikomatsakis Further tweak lifetime errors involving `dyn Trait` and `impl Trait` in return position * Suggest substituting `'static` lifetime in impl/dyn `Trait + 'static` instead of `Trait + 'static + '_` * When `'static` is explicit, also suggest constraining argument with it * Reduce verbosity of suggestion message and mention lifetime in label * Tweak output for overlapping required/captured spans * Give these errors an error code Follow up to rust-lang#72543. r? @nikomatsakis
…ies, r=shepmaster Complete the std::time documentation to warn about the inconsistencies between OS Fix for rust-lang#48980. I put the new documentation in `src/libstd/time.rs` at the module-level because it affects all types, even the one that are not directly system dependents if they are used with affected types, but there may be a better place for it.
…matthewjasper Export `#[inline]` fns with extern indicators In ancient history (rust-lang#36280) we stopped `#[inline]` fns being codegened if they weren't used. However, - rust-lang#72944 - rust-lang#72463 observe that when writing something like ```rust #![crate_type = "cdylib"] #[no_mangle] #[inline] pub extern "C" fn foo() { // ... } ``` we really _do_ want `foo` to be codegened. This change makes this the case. Resolves rust-lang#72944, resolves rust-lang#72463 (and maybe some more)
…op, r=pnkfelix Preserve `Expr`s that have `DefId`s in `ReplaceBodyWithLoop` This PR fixes rust-lang#71820 as well as the last part of rust-lang#71104 by preserving expressions that are assigned their own `DefId`s (closures and `async` blocks) when passing them to `rustdoc`. This avoids having a `DefId` without a corresponding `HirId`. The first commit in this PR makes `-Zunpretty=everybody_loops` actually work again, and the subsequent two are miscellaneous cleanup. They should probably get merged regardless of what we end up doing here. Sample input: ```rust fn foo() -> Box<i32> { let x = |a: i64| { const FOO: i64 = 1; }; let a = 4; Box::new(a) } ``` Sample output: ```rust fn foo() -> Box<i32> { || -> ! { const FOO: i64 = 1; loop { } }; loop { } } ``` r? @ghost
Ensure std benchmarks get tested. This ensures that the std benchmarks don't break in the future. Currently they aren't compiled or tested on CI, so they can easily bitrot. Testing a benchmark runs it with one iteration. Adding these should only add a few seconds to CI. Closes rust-lang#54176 Closes rust-lang#61913
Check for overflow in DroplessArena and align returned memory * Check for overflow when calculating the slice start & end position. * Align the pointer obtained from the allocator, ensuring that it satisfies user requested alignment (the allocator is only asked for layout compatible with u8 slice). * Remove an incorrect assertion from DroplessArena::align. * Avoid forming references to an uninitialized memory in DroplessArena. Helps with rust-lang#73007, rust-lang#72624.
…stebank Ignore overflow when finding auto-trait impls in Rustdoc In rust-lang#72936 (comment), it was determined that some unusual code could cause rustc to overflow when evaluating a predicate of the form `T: AutoTrait`. Even if this is a bug, it will still be possible to cause overflow through writing explicit impls of auto traits, just like any other type of impl. In rustdoc, this overflow can happen simply as a result of defining certain types, since we will automatically generate and evaluate auto-trait predicates when generating documentation. For now, we just ignore overflow during selection if it occurs in rustdoc. We should probably come up with a better way to handle this - e.g. rendering some kind of error in the generated documentation. However, this is a very unusual corner case, and this PR is sufficient to unblock landing a Chalk update in PR rust-lang#72936 This adds additional hacks to `librustc_trait_selection`. The auto-trait-finding code should probably be completely rewritten, but I think this is good enough for the time being.
Don't run generator transform when there's a TyErr Not sure if this might cause any problems later on, but we shouldn't be hitting codegen or const eval for the produced MIR anyways, so it should be fine. cc rust-lang#72685 (comment)
…mulacrum Speed up bootstrap a little. The bootstrap script was calling `cargo metadata` 3 times (or 6 with `-v`). This is a very expensive operation, and this attempts to avoid the extra calls. On my system, a simple command like `./x.py test -h -v` goes from about 3 seconds to 0.4. An overview of the changes: - Call `cargo metadata` only once with `--no-deps`. Optional dependencies are filtered in `in_tree_crates` (handling `profiler_builtins` and `rustc_codegen_llvm` which are driven by the config). - Remove a duplicate call to `metadata::build` when using `-v`. I'm not sure why it was there, it looks like a mistake or vestigial from previous behavior. - Remove check for `_shim`, I believe all the `_shim` crates are now gone. - Remove check for `rustc_` and `*san` for `test::Crate::should_run`, these are no longer dependencies in the `test` tree. - Use relative paths in `./x.py test -h -v` output. - Some code cleanup (remove unnecessary `find_compiler_crates`, etc.). - Show suite paths (`src/test/ui/...`) in `./x.py test -h -v` output. - Some doc comments.
Use `LocalDefId` for import IDs in trait map cc rust-lang#73291 (comment)
…dtwco Tweak "non-primitive cast" error - Suggest borrowing expression if it would allow cast to work. - Suggest using `<Type>::from(<expr>)` when appropriate. - Minor tweak to `;` typo suggestion. Partily address rust-lang#47136.
…tions, r=kinnison Re-order correctly the sections in the sidebar Before that, "trait implementations" and "implementors" titles in the sidebar were before "methods" for example. Which wasn't logical considering that the two sections come after in the "content". r? @kinnison
Use track caller for bug! macro
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.
Successful merges:
dyn Trait
andimpl Trait
in return position #72804 (Further tweak lifetime errors involvingdyn Trait
andimpl Trait
in return position)#[inline]
fns with extern indicators #73034 (Export#[inline]
fns with extern indicators)Expr
s that haveDefId
s inReplaceBodyWithLoop
#73103 (PreserveExpr
s that haveDefId
s inReplaceBodyWithLoop
)LocalDefId
for import IDs in trait map #73357 (UseLocalDefId
for import IDs in trait map)Failed merges:
r? @ghost