| Age | Commit message (Collapse) | Author | Lines |
|
fix multiple issues when promoting type-test subject
Multiple interdependent fixes. See linked issues for a short description of each.
When Promoting a type-test `T: 'a` from within the closure back to its parent function, there are a couple pre-existing bugs and limitations. They were exposed by the recent changes to opaque types because the type-test subject (`T`) is no longer a simple ParamTy.
Commit 1:
Fixes #108635
Fixes #107426
Commit 2:
Fixes #108639
Commit 3:
Fixes #107516
|
|
Rollup of 8 pull requests
Successful merges:
- #107801 (const_eval: `implies_by` in `rustc_const_unstable`)
- #108750 (Fix `ObligationCtxt::sub`)
- #108780 (Add regression tests for issue 70919)
- #108786 (Check for free regions in MIR validation)
- #108790 (Do not ICE when interpreting a cast between non-monomorphic types)
- #108803 (Do not ICE when failing to normalize in ConstProp.)
- #108807 (Emit the suspicious_auto_trait_impls for negative impls as well)
- #108812 (Add regression test for #98444)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Add regression test for #98444
cc #108730 this will need to be changed to a `check-fail` test once it lands.
Fixes #98444
|
|
Emit the suspicious_auto_trait_impls for negative impls as well
Fixes #108804
|
|
Do not ICE when failing to normalize in ConstProp.
There is no reason to delay a bug there, as we bubble up the failure as TooGeneric.
Fixes https://github.com/rust-lang/rust/issues/97728
|
|
Do not ICE when interpreting a cast between non-monomorphic types
Fixes https://github.com/rust-lang/rust/issues/101596
|
|
Add regression tests for issue 70919
Desugaring DropAndReplace at MIR build (#107844) fixed #70919.
Add regressions tests, borrowed from #102078, to ensure we check for this in the future.
cc ``@Aaron1011``
|
|
const_eval: `implies_by` in `rustc_const_unstable`
Fixes #107605.
Extend support for `implies_by` (from `#[stable]` and `#[unstable]`) to `#[rustc_const_stable]` and `#[rustc_const_unstable]`.
cc ``@steffahn``
|
|
|
|
|
|
|
|
|
|
Allow using `bool` instead of `Option<()>` in diagnostics
~~Disallow the unit type for `#[help]`, `#[note]` etc, instead using `bool` to express optional annotations without a span which I believe is more intuitive.~~
~~Test output ordering has changed in a few places, where a field was of type `()` and the annotation has been moved to the struct itself. If any of these changes are an issue, this can be restricted to allowing specifically `()`, and not `Option<()>`~~
~~Actual changes here: https://github.com/rust-lang/rust/pull/108402/files#diff-815b1d8debfc564112bd51093791d7c3f2ee288a37a8f5c0e89c11d1f609b4c0~~
Allows using `bool` in derive diagnostics to indicate an optional subdiagnostic without a span, where previously `Option<()>` had to be used
`@rustbot` label +A-diagnostics
|
|
|
|
|
|
Erase regions even when failing to normalize type in MIR opts
The first commit just moves the tests around.
Fixes https://github.com/rust-lang/rust/issues/108720
cc `@saethlin`
|
|
Rollup of 7 pull requests
Successful merges:
- #108244 (Add test for semicolon recovery ICE)
- #108746 (Don't project to RPITIT that has no default value)
- #108764 (Tweaks to -Zdrop-tracking-mir)
- #108770 (Improve documentation and argument naming of some TyCtxt methods)
- #108773 (x fmt: Only check modified files locally)
- #108775 (Use the correct bound vars in return type suggestion.)
- #108776 (Make `x test tidy` less noisy)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Use `partial_cmp` to implement tuple `lt`/`le`/`ge`/`gt`
In today's implementation, `(A, B)::gt` contains calls to *both* `A::eq` *and* `A::gt`.
That's fine for primitives, but for things like `String`s it's kinda weird -- `(String, usize)::gt` has a call to both `bcmp` and `memcmp` (<https://rust.godbolt.org/z/7jbbPMesf>) because when `bcmp` says the `String`s aren't equal, it turns around and calls `memcmp` to find out which one's bigger.
This PR changes the implementation to instead implement `(A, …, C, Z)::gt` using `A::partial_cmp`, `…::partial_cmp`, `C::partial_cmp`, and `Z::gt`. (And analogously for `lt`, `le`, and `ge`.) That way expensive comparisons don't need to be repeated.
Technically this is an observable change on stable, so I've marked it `needs-fcp` + `T-libs-api` and will
r? rust-lang/libs-api
I'm hoping that this will be non-controversial, however, since it's very similar to the observable changes that were made to the derives (#81384 #98655) -- like those, this only changes behaviour if a type overrode behaviour in a way inconsistent with the rules for the various traits involved.
(The first commit here is #108156, adding the codegen test, which I used to make sure this doesn't regress behaviour for primitives.)
Zulip conversation about this change: <https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/.60.3E.60.20on.20Tuples/near/328392927>.
|
|
|
|
Use the correct bound vars in return type suggestion.
Fixes https://github.com/rust-lang/rust/issues/107860
|
|
Tweaks to -Zdrop-tracking-mir
Split from https://github.com/rust-lang/rust/pull/107421
3 commits: 1 diagnostic improvement and 2 ICEs.
|
|
compiler-errors:rpitit-dont-project-default-w-no-valu, r=cjgillot
Don't project to RPITIT that has no default value
Replicates this behavior, but for RPITIT projection logic (which currently is separate)
https://github.com/rust-lang/rust/blob/b1719530f44e3c8ec903f76020a52bd8764d5d10/compiler/rustc_trait_selection/src/traits/project.rs#L2105-L2115
Fixes #108738
|
|
Add test for semicolon recovery ICE
closes https://github.com/rust-lang/rust/issues/108242
|
|
|
|
|
|
|
|
|
|
Desugaring DropAndReplace at MIR build (#107844) fixed issue
70919. Add regressions tests, borrowed from #102078, to ensure we
check for this in the future.
Co-authored-by: Aaron Hill <aa1ronham@gmail.com>
|
|
compiler-errors:non_lifetime_binders-bad-copy-clone, r=jackh726
Don't ICE when encountering bound var in builtin copy/clone bounds
Fixes #108742
|
|
rustdoc-json: switch from HashMap to FxHashMap to fix non-determinism
Using `HashMap` in `rustdoc_json_types::Crate` were causing creating randomly ordered objects in the json doc files. Which might cause problems to people who are doing comparison on those files specially in CI pipelines. See https://github.com/rust-lang/rust/issues/103785#issuecomment-1307425590
This PR fixes that issue and extends the coverage of `tests/run-make/rustdoc-verify-output-files` testing ability.
|
|
|
|
|
|
Desugaring of drop and replace at MIR build
This commit desugars the drop and replace deriving from an
assignment at MIR build, avoiding the construction of the
`DropAndReplace` terminator (which will be removed in a following PR).
In order to retain the same error messages for replaces a new
`DesugaringKind::Replace` variant is introduced.
The changes in the borrowck are also useful for future work in moving drop elaboration
before borrowck, as no `DropAndReplace` would be present there anymore.
Notes on test diffs:
* `tests/ui/borrowck/issue-58776-borrowck-scans-children`: the assignment deriving from the desugaring kills the borrow.
* `tests/ui/async-await/async-fn-size-uninit-locals.rs`, `tests/mir-opt/issue_41110.test.ElaborateDrops.after.mir`, `tests/mir-opt/issue_41888.main.ElaborateDrops.after.mir`: drop elaboration generates (or reads from) a useless drop flag due to an issue with the dataflow analysis. Will be fixed independently by https://github.com/rust-lang/rust/pull/106430.
See https://github.com/rust-lang/rust/pull/104488 for more context
|
|
Signed-off-by: ozkanonur <work@onurozkan.dev>
|
|
rustdoc: Note in a type's layout/size if it is uninhabited
Closes #87008

|
|
rustdoc: function signature search with traits in `where` clause
## Before

## After

|
|
Properly colorize multi-part suggestions in the same line
Fix #108547.
|
|
|
|
|
|
|
|
|
|
r=notriddle
Rustdoc search: Emit an error for unclosed generic
Now, search like `a<` will error as it should (and as written in the eBNF).
r? `@notriddle`
|
|
Fix ICE: check if snippet is `)`
Fixes #107705
|
|
|
|
Fix #108547.
|
|
Rollup of 8 pull requests
Successful merges:
- #104549 (add -Zexport-executable-symbols to unstable book)
- #108292 (Label opaque type for 'captures lifetime' error message)
- #108540 (Add `Atomic*::from_ptr`)
- #108634 (Add link to component dashboard)
- #108647 (Remove dead pgo.sh file)
- #108678 (Use `Option::as_slice` where applicable)
- #108681 (Improve comments in `needs_process_obligation`.)
- #108688 (Match unmatched backticks in library/)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
Label opaque type for 'captures lifetime' error message
Providing more information may help make this somewhat opaque (lol) error message a bit clearer.
|
|
Match unmatched backticks in compiler/
Found with GNU grep:
```
grep -rEn '^(([^`]*`){2})*[^`]*`[^`]*$' compiler/ | rg -v '\s*[//]?.{1,2}```'
```
|
|
Clippy Fix array-size-threshold config deserialization error
Complementary PR to https://github.com/rust-lang/rust/pull/108673 in order to also get this into the **next** beta.
r? ``@Mark-Simulacrum``
|