| Age | Commit message (Collapse) | Author | Lines |
|
Rollup of 11 pull requests
Successful merges:
- #75853 (Use more intra-doc-links in `core::fmt`)
- #75928 (Remove trait_selection error message in specific case)
- #76329 (Add check for doc alias attribute at crate level)
- #77219 (core::global_allocator docs link to std::alloc::GlobalAlloc)
- #77395 (BTreeMap: admit the existence of leaf edges in comments)
- #77407 (Improve build-manifest to work with the improved promote-release)
- #77426 (Include scope id in SocketAddrV6::Display)
- #77439 (Fix missing diagnostic span for `impl Trait` with const generics, and add various tests for `min_const_generics` and `const_generics`)
- #77471 (BTreeMap: refactoring around edges, missed spots)
- #77512 (Allow `Abort` terminators in all const-contexts)
- #77514 (Replace some once(x).chain(once(y)) with [x, y] IntoIter)
Failed merges:
r? `@ghost`
|
|
Re-land PR #71840 (Rework MIR drop tree lowering)
PR https://github.com/rust-lang/rust/pull/71840 was reverted in https://github.com/rust-lang/rust/pull/72989 to fix an LLVM error (https://github.com/rust-lang/rust/issues/72470). That LLVM error no longer occurs with the recent upgrade to LLVM 11 (https://github.com/rust-lang/rust/pull/73526), so let's try re-landing this PR.
I've cherry-picked the commits from the original PR (with the exception of the commit blessing test output), making as few modifications as possible. I addressed the rebase fallout in separate commits on top of those.
r? `@matthewjasper`
|
|
Allow `Abort` terminators in all const-contexts
We never unwind during const-eval, so we basically have these semantics already. Also I just figured out that these only appear along the cleanup path, which doesn't get const-checked. In other words, this doesn't actually change behavior: the `check-pass` test I added compiles just fine on nightly.
r? @RalfJung
cc @rust-lang/wg-const-eval
|
|
Fix missing diagnostic span for `impl Trait` with const generics, and add various tests for `min_const_generics` and `const_generics`
Closes https://github.com/rust-lang/rust/issues/61410.
Adds `min_const_generics` tests for:
- https://github.com/rust-lang/rust/issues/73727
- https://github.com/rust-lang/rust/issues/72293
- https://github.com/rust-lang/rust/issues/67375
- https://github.com/rust-lang/rust/issues/75153
- https://github.com/rust-lang/rust/issues/71922
- https://github.com/rust-lang/rust/issues/69913
- https://github.com/rust-lang/rust/issues/67945
- https://github.com/rust-lang/rust/issues/69239
Adds `const_generics` tests for:
- https://github.com/rust-lang/rust/issues/67375
- https://github.com/rust-lang/rust/issues/75153
- https://github.com/rust-lang/rust/issues/71922
- https://github.com/rust-lang/rust/issues/69913
- https://github.com/rust-lang/rust/issues/67945
- https://github.com/rust-lang/rust/issues/69239
(I only added separate `min_const_generics` and `const_generics` tests if they were handled differently by the two features.)
We need to figure out how to deduplicate when `const_generics` is stabilised, but we can discuss that later. For now, we should be checking neither feature breaks, so require regression tests for both. I've given them identical names when I've added both, which should make it easier to spot them later.
r? @lcnr
|
|
Add check for doc alias attribute at crate level
Fixes #76298, #64734, #69365.
r? @ollie27
|
|
Remove trait_selection error message in specific case
In the case that a trait is not implemented for an ADT with type errors, cancel the error.
Fixes #75627
|
|
Hint the maximum length permitted by invariant of slices
One of the safety invariants of references, and in particular of references to slices, is that they may not cover more than `isize::MAX` bytes. The unsafe `from_raw_parts` constructors of slices explicitly requires the caller to guarantee this fact. Violating it would also be UB with regards to the semantics of generated llvm code.
This effectively bounds the length of a (non-ZST) slice from above by a compile time constant. But when the length is loaded from a function argument it appears llvm is not aware of this requirement. The additional value range assertions allow some further elision of code branches, including overflow checks, especially in the presence of artithmetic on the indices.
This may have a performance impact, adding more code to a common method but allowing more optimization. I'm not quite sure, is the Rust side of const-prop strong enough to elide the irrelevant match branches?
Fixes: #67186
|
|
|
|
|
|
Uses assume to check the length against a constant upper bound. The
inlined result then informs the optimizer of the sound value range.
This was tried with unreachable_unchecked before which introduces a
branch. This has the advantage of not being executed in sound code but
complicates basic blocks. It resulted in ~2% increased compile time in
some worst cases.
Add a codegen test for the assumption, testing the issue from #67186
|
|
Support vectors with fewer than 8 elements for simd_select_bitmask
Resolves the issue raised here: https://github.com/rust-lang/stdarch/issues/310#issuecomment-693730094
|
|
Backport LLVM apfloat commit to rustc_apfloat
Backports LLVM commit: https://github.com/llvm/llvm-project/commit/e34bd1e0b03d20a506ada156d87e1b3a96d82fa2
Fixes #69532
|
|
Co-authored-by: matthewjasper <20113453+matthewjasper@users.noreply.github.com>
|
|
|
|
This was fixed with the upgrade to LLVM 11 in #73526.
It seems extremely unlikey that this exact issue will ever reoccur,
since slight modifications to the code caused the crash to stop
happening. However, it can't hurt to have a test for it.
|
|
|
|
|
|
Implement Make `handle_alloc_error` default to panic (for no_std + liballoc)
Related: https://github.com/rust-lang/rust/issues/66741
Guarded with `#![feature(default_alloc_error_handler)]` a default
`alloc_error_handler` is called, if a custom allocator is used and no
other custom `#[alloc_error_handler]` is defined.
|
|
Improve rustdoc error for failed intra-doc link resolution
The previous error was confusing since it made it sound like you can't
link to items that are defined outside the current module.
Also suggested importing the item.
r? @jyn514
|
|
Fix test name
Remove trailing `-`.
|
|
Create E0777 error code for invalid argument in derive
The second commit is to fix a nit reported by @jyn514 [here](https://github.com/rust-lang/rust/pull/76406/files#r485186592).
|
|
Add some regression tests
Closes #66501
Closes #68951
Closes #72565
Closes #74244
Closes #75299
The first issue is fixed in 1.43.0, other issues are fixed in the recent nightly.
|
|
Test and reject out-of-bounds shuffle vectors
Fixes #73542.
|
|
Uplift drop-bounds lint from clippy
Bounds on `T: Drop` do nothing, so they should warn.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The new error was confusing when there was partial resolution (something
like `std::io::nonexistent`); the old one is better for those cases.
|
|
Permit ty::Bool in const generics for v0 mangling
This should unbreak using new-symbol-mangling = true in config.toml (once it lands in beta anyway).
Fixes #76365 (well, it will, but seems fine to close as soon as we have support)
r? @eddyb (for mangling) but I'm okay with some other reviewer too :)
|
|
Revert "resolve: Avoid "self-confirming" import resolutions in one more case"
And remove the assert that https://github.com/rust-lang/rust/pull/70236 tried to avoid instead.
Closes https://github.com/rust-lang/rust/issues/74556.
|
|
Bypass const_item_mutation if const's type has Drop impl
Follow-up to #75573. This PR disables the const_item_mutation lint in cases that the const has a Drop impl which observes the mutation.
```rust
struct Log { msg: &'static str }
const LOG: Log = Log { msg: "" };
impl Drop for Log {
fn drop(&mut self) { println!("{}", self.msg); }
}
LOG.msg = "wow"; // prints "wow"
```
r? @Aaron1011
|
|
Move Wrapping<T> ui tests into library
Part of #76268
r? @matklad
|
|
|
|
The previous error was confusing since it made it sound like you can't
link to items that are defined outside the current module.
Also suggested importing the item.
|
|
Remove trailing `-`.
|
|
Rollup of 12 pull requests
Successful merges:
- #76101 (Update RELEASES.md for 1.47.0)
- #76739 (resolve: prohibit anon const non-static lifetimes)
- #76811 (Doc alias name restriction)
- #77405 (Add tracking issue of iter_advance_by feature)
- #77409 (Add example for iter chain struct)
- #77415 (Better error message for `async` blocks in a const-context)
- #77423 (Add `-Zprecise-enum-drop-elaboration`)
- #77432 (Use posix_spawn on musl targets)
- #77441 (Fix AVR stack corruption bug)
- #77442 (Clean up on example doc fixes for ptr::copy)
- #77444 (Fix span for incorrect pattern field and add label)
- #77453 (Stop running macOS builds on Azure Pipelines)
Failed merges:
r? `@ghost`
|
|
Fix span for incorrect pattern field and add label
Address #73750.
|
|
Better error message for `async` blocks in a const-context
Improves the error message for the case in #77361.
r? @oli-obk
|
|
r=oli-obk,ollie27
Doc alias name restriction
Fixes #76705.
|