| Age | Commit message (Collapse) | Author | Lines |
|
Also removes any code used only to populate `promotion_candidates`
during const checking.
|
|
We no longer compare the results of
`promote_consts::validate_candidates` with
`checker.promotion_candidates`, and `promote_consts` becomes the
canonical source for determining promotability.
|
|
|
|
|
|
|
|
|
|
use American spelling for `pluralize!`
|
|
bump smallvec to 1.0
This includes https://github.com/servo/rust-smallvec/pull/162, fixing an unsoundness in smallvec.
See https://github.com/servo/rust-smallvec/pull/175 for the 1.0 release announcement.
Cc @mbrubeck @emilio
|
|
caller_location: point to macro invocation sites, like file!/line!, and use in core::panic!.
The main change here is to `core::panic!`, trying to fix this remaining regression: https://github.com/rust-lang/rust/pull/65927#issuecomment-547625147
However, in order for `caller_location` to be usable from macros the same way `file!()`/`line!()` are, it needs to have the same behavior (of extracting the macro invocation site `Span` and using that).
Arguably we would've had to do this at some point anyway, if we want to use `#[track_caller]` to replace the `file!()`/`line!()` uses from macros, but I'm not sure the RFC mentions this at all.
r? @petrochenkov cc @anp @nnethercote
|
|
r=estebank
Rename `LocalInternedString` and more
This PR renames `LocalInternedString` as `SymbolStr`, removes an unnecessary `impl` from it, improves comments, and cleans up some `SymbolStr` uses.
r? @estebank
|
|
let caller of check_ptr_access_align control the error message
This is needed for https://github.com/rust-lang/miri/pull/1031
|
|
Rollup of 8 pull requests
Successful merges:
- #65948 (Improve MaybeUninit::get_{ref,mut} documentation)
- #65953 (Allow specifying LLVM's MCTargetOptions::ABIName in target specification files)
- #66012 (De-querify `trivial_dropck_outlives`.)
- #66025 (`Span` cannot represent `span.hi < span.lo`)
- #66047 (Don't double-count `simd_shuffle` promotion candidates)
- #66053 (when Miri tests are not passing, do not add Miri component)
- #66082 (clean highlightSourceLines code)
- #66091 (Implemented the home_dir for VxWorks)
Failed merges:
r? @ghost
|
|
|
|
The previous behaviour ignored slice lengths above a certain length
because it could not do otherwise. We now have VarLenSlice however, that
can represent the ignored lengths to make the algorithm more consistent.
This does not change the correctness of the algorithm, but makes it
easier to reason about.
As a nice side-effect, exhaustiveness errors have improved: they now
capture all missing lengths instead of only the shortest.
|
|
Note that where we previously ran `max_slice_len` with input having not
only matrix.heads() but also v.head(). Now we run it on matrix.heads()
only, but also take into account the currently processed constructor.
This preserves behavior since `pat_constructors` returns only one
constructor in the case that is of interest for us.
|
|
I tracked the origins of `pat_constructors` returning a `Vec` to commit
9b3f9d94441340f0cdf6ec59aab739baef0f1ac0. It was indeed specifically
for variable-length slice patterns.
|
|
|
|
This improves error messages by indicating when slices above a certain
lengths have not been matched. Previously, we would only report examples
of such lengths, but of course never all of them.
|
|
This alters error messages slightly, but that'll be improved later
|
|
|
|
|
|
|
|
Don't double-count `simd_shuffle` promotion candidates
Resolves #66016.
The `#[rustc_args_required_const]` attribute was added to `simd_shuffle*` in rust-lang/stdarch#825. This caused `promote_consts` to double-count its second argument when recording promotion candidates, which caused the promotion candidate compatibility check to fail.
Once `stdarch` is updated in-tree to include rust-lang/stdarch#825, all special logic around `simd_shuffle` can and should be removed.
|
|
fix Miri offset_from
This is needed to make https://github.com/rust-lang/miri/pull/1032 pass.
|
|
|
|
|
|
Clarify pattern-matching usefulness algorithm
This PR clarifies a bit the usefulness algorithm by emphasizing that each row of the matrix can be seen as a sort of stack from which we pop constructors. It also moves code around to increase separation of concerns.
This is part of my splitting of https://github.com/rust-lang/rust/pull/65160 into smaller PRs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Make <*const/mut T>::offset_from `const fn`
This reenables offset_of cc @mjbshaw after https://github.com/rust-lang/rust/pull/63075 broke it
|
|
The proper attribute was added to `simd_shuffle*` in
rust-lang/stdarch#825. This caused `promote_consts` to double-count its
second argument when recording promotion candidates, which caused
the promotion candidate compatibility check to fail.
|
|
Including removing a bunch of unnecessary `.as_str()` calls, and a bunch
of unnecessary sigils.
|
|
Make `promote_consts` emit the errors when required promotion fails
A very minimal version of #65942.
This will cause a generic "argument X is required to be a constant" message for `simd_shuffle` LLVM intrinsics instead of the [custom one](https://github.com/rust-lang/rust/blob/caa1f8d7b3b021c86a70ff62d23a07d97acff4c4/src/librustc_mir/transform/qualify_consts.rs#L1616). It may be possible to remove this special-casing altogether after rust-lang/stdarch#825.
r? @eddyb
|
|
Add lint and tests for unnecessary parens around types
This is my first contribution to the Rust project, so I apologize if I'm not doing things the right way.
The PR fixes #64169. It adds a lint and tests for unnecessary parentheses around types. I've run `tidy` and `rustfmt` — I'm not totally sure it worked right, though — and I've tried to follow the instructions linked in the readme.
I tried to think through all the variants of `ast::TyKind` to find exceptions to this lint, and I could only find the one mentioned in the original issue, which concerns types with `dyn`. I'm not a Rust expert, thought, so I may well be missing something.
There's also a problem with getting this to build. The new lint catches several things in the, e.g., `core`. Because `x.py` seems to build with an equivalent of `-Werror`, what would have been warnings cause the build to break. I got it to build and the tests to pass with `--warnings warn` on my `x.py build` and `x.py test` commands.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This is equivalent to the previous code in terms of performance. The
expensive path is clearly identical. The fast path is also the same,
because in both cases we loop until we get a non-empty `refined_ctors`,
and then stop there. So the new code doesn't compute anything more
than the previous did.
|
|
|
|
|