| Age | Commit message (Collapse) | Author | Lines |
|
Use `FxIndexSet` to avoid sorting fake borrows
This fixes #96449, but I haven't yet been able to
make the reproducer work using `#[cfg]` attributes,
so we can't use the 'revision' infra to write a test
The previous implementation relied on sorting by `PlaceRef`.
This requires sorting by a `DefId`, which uses untracked state
(see #93315)
|
|
Rollup of 6 pull requests
Successful merges:
- #96717 (Handle mismatched generic param kinds in trait impls betterly)
- #96725 (Expose process windows_process_extensions_main_thread_handle on Windows)
- #96849 (Move some tests to more reasonable places)
- #96861 (Use Rust 2021 prelude in std itself.)
- #96879 (rustdoc: search result ranking fix)
- #96882 (Don't subst an AdtDef with its own substs)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
rustdoc: search result ranking fix
# Before

# After

|
|
Move some tests to more reasonable places
cc https://github.com/rust-lang/rust/issues/73494
r? `@petrochenkov`
|
|
Handle mismatched generic param kinds in trait impls betterly
- Check that generic params on a generic associated type are the same as in the trait definition
- Check that const generics are not used in place of type generics (and the other way round too)
r? `@lcnr`
|
|
Check hidden types for well formedness at the definition site instead of only at the opaque type itself
work towards #90409 . We'll need to look into closure and generator bodies of closures and generators nested inside the hidden type in order to fix that. In hindsight this PR is not necessary for that, but it may be a bit easier with it and we'll get better diagnostics from it on its own.
|
|
only at the opaque type itself
|
|
make sure ScalarPair enums have ScalarPair variants; add some layout sanity checks
`@eddyb` suggested that it might be reasonable for `ScalarPair` enums to simply adjust the ABI of their variants accordingly, such that the layout invariant Miri expects actually holds. This PR implements that. I should note though that I don't know much about this layout computation code and what non-Miri consumers expect from it, so tread with caution!
I also added a function to sanity-check that computed layouts are internally consistent. This helped a lot in figuring out the final shape of this PR, though I am also not 100% sure that these sanity checks are the right ones.
Cc `@oli-obk`
Fixes https://github.com/rust-lang/rust/issues/96221
|
|
Do not lint on explicit outlives requirements from external macros.
The current implementation of the list rightfully skipped where predicates from external macros.
However, if the where predicate came from the current macro but the bounds were from an external macro, the lint still fired.
Closes https://github.com/rust-lang/rust/issues/96640
|
|
This fixes #96449, but I haven't yet been able to
make the reproducer work using `#[cfg]` attributes,
so we can't use the 'revision' infra to write a test
The previous implementation relied on sorting by `PlaceRef`.
This requires sorting by a `DefId`, which uses untracked state
(see #93315)
|
|
Fortify handing of where bounds on trait & trait alias definitions
Closes https://github.com/rust-lang/rust/issues/96664
Closes https://github.com/rust-lang/rust/issues/96665
Since https://github.com/rust-lang/rust/pull/93803, when listing all bounds and predicates we now need to account for the possible presence of predicates on any of the generic parameters. Both bugs were hidden by the special handling of bounds at the generic parameter declaration position.
Trait alias expansion used to confuse predicates on `Self` and where predicates.
Exiting too late when listing all the bounds caused a cycle error.
|
|
|
|
|
|
|
|
Actually fix ICE from #96583
PR #96746 fixed a very similar bug, so the same logic is used in a different place.
I originally concluded that the two issues (#96583 and #96738) were identical by comparing the backtrace, but I didn't look close enough.
|
|
fmease:warn-on-useless-doc-hidden-on-assoc-impl-items, r=lcnr
Warn on unused `#[doc(hidden)]` attributes on trait impl items
[Zulip conversation](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/.E2.9C.94.20Validy.20checks.20for.20.60.23.5Bdoc.28hidden.29.5D.60).
Whether an associated item in a trait impl is shown or hidden in the documentation entirely depends on the corresponding item in the trait declaration. Rustdoc completely ignores `#[doc(hidden)]` attributes on impl items. No error or warning is emitted:
```rust
pub trait Tr { fn f(); }
pub struct Ty;
impl Tr for Ty { #[doc(hidden)] fn f() {} }
// ^^^^^^^^^^^^^^ ignored by rustdoc and currently
// no error or warning issued
```
This may lead users to the wrong belief that the attribute has an effect. In fact, several such cases are found in the standard library (I've removed all of them in this PR).
There does not seem to exist any incentive to allow this in the future either: Impl'ing a trait for a type means the type *fully* conforms to its API. Users can add `#[doc(hidden)]` to the whole impl if they want to hide the implementation or add the attribute to the corresponding associated item in the trait declaration to hide the specific item. Hiding an implementation of an associated item does not make much sense: The associated item can still be found on the trait page.
This PR emits the warn-by-default lint `unused_attribute` for this case with a future-incompat warning.
`@rustbot` label T-compiler T-rustdoc A-lint
|
|
|
|
checks
|
|
Remove `#[rustc_deprecated]`
This removes `#[rustc_deprecated]` and introduces diagnostics to help users to the right direction (that being `#[deprecated]`). All uses of `#[rustc_deprecated]` have been converted. CI is expected to fail initially; this requires #95958, which includes converting `stdarch`.
I plan on following up in a short while (maybe a bootstrap cycle?) removing the diagnostics, as they're only intended to be short-term.
|
|
Support tool lints with the `#[expect]` attribute (RFC 2383)
This PR fixes the ICE https://github.com/rust-lang/rust/issues/94953 by making the assert for converted expectation IDs conditional.
Additionally, it moves the lint expectation check into a separate query to support rustdoc and other tools. On the way, I've also added some tests to ensure that the attribute works for Clippy and rustdoc lints.
The number of changes comes from the long test file. This may look like a monster PR, this may smell like a monster PR and this may be a monster PR, but it's a harmless monster. :sauropod:
---
Closes: https://github.com/rust-lang/rust/issues/94953
cc: https://github.com/rust-lang/rust/issues/85549
r? `@wesleywiser`
cc: `@rust-lang/rustdoc`
|
|
Rollup of 5 pull requests
Successful merges:
- #96617 (Fix incorrect syntax suggestion with `pub async fn`)
- #96828 (Further elaborate the lack of guarantees from `Hasher`)
- #96829 (Fix the `x.py clippy` command)
- #96830 (Add and tweak const-generics tests)
- #96835 (Add more eslint rules)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|
|
Add and tweak const-generics tests
Closes #96654
Also correct the src/test/ui/const-generics/issues/issue-77357.rs test's issue number.
|
|
ken-matsui:fix-incorrect-syntax-suggestion-with-pub-async-fn, r=cjgillot
Fix incorrect syntax suggestion with `pub async fn`
This PR closes: https://github.com/rust-lang/rust/issues/96555
|
|
Add more diagnostic items
This just adds a handful diagnostic items I noticed were missing.
Would it be worth doing this for all of the remaining types? I'm willing to do it if it'd be helpful.
|
|
PR #96746 fixed a very similar bug, so the same logic is used in a
different place.
|
|
|
|
|
|
This ICE was reported by `@matthiaskrgr`. A big THANK YOU to him. See `rust#94953`
|
|
Followups for method call error change
Each commit is self-contained. Fixes most of the followup reviews from that PR.
r? `@estebank`
|
|
|
|
|
|
|
|
r=Mark-Simulacrum
Make the test `check-pass` not to produce a JSON file
`run-pass` produces a JSON file when enabling save analysis.
The original ICE happened on `cargo check`, moreover **without** the `generic_const_exprs` feature, so `check-pass` should be enough.
|
|
Add regression and bug tests
this tracks the behaviour from https://github.com/rust-lang/rust/issues/96572 in our test suite
|
|
Add regression test
fixes #69785
This issue seems to have been fixed in the meantime.
|
|
diagnostics: port more diagnostics to derive + add support for `Vec` fields
- Port "unconstrained opaque type" diagnostic to using the derive.
- Allow `Vec` fields in diagnostic derive - enables support for diagnostics that have multiple primary spans, or have subdiagnostics repeated at multiple locations. `Vec<..>` fields in the diagnostic derive become loops in the generated code.
- Add `create_{err,warning}` - there wasn't a way to create a diagnostic from a struct and not emit it straight away.
- Port "explicit generic args w/ impl trait" diagnostic to using the derive.
r? `````@oli-obk`````
cc `````@pvdrz`````
|
|
Fix jump to def regression
https://github.com/rust-lang/rust/pull/93803 introduced a regression in the "jump to def" feature. This fixes it.
Nice side-effect: it adds a new regression test. :)
I also used this opportunity to add documentation about this unstable feature in the rustdoc book.
cc ``@cjgillot``
r? ``@notriddle``
|
|
make Size and Align debug-printing a bit more compact
In particular in `{:#?}`-mode, these take up a lot of space, so I think this is the better alternative (even though it is a bit longer in `{:?}` mode, I think it is still more readable).
We could make it even smaller by deviating further from what the actual code looks like, e.g. via something like `Size(4 bytes)`. Not sure what people would think about that?
Cc `````@oli-obk`````
|
|
|
|
Rollup of 8 pull requests
Successful merges:
- #96660 ([bootstrap] Give a better error when trying to run a path with no registered step)
- #96701 (update `jemallocator` example to use 2018 edition import syntax)
- #96746 (Fix an ICE on #96738)
- #96758 (bootstrap: bsd platform flags for split debuginfo)
- #96778 (Remove closures on `expect_local` to apply `#[track_caller]`)
- #96781 (Fix an incorrect link in The Unstable Book)
- #96783 (Link to correct issue in issue-95034 known-bug)
- #96801 (Add regression test for #96319)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Add regression test for #96319
|
|
Link to correct issue in issue-95034 known-bug
fix a typo is issue number: 94034 -> 95034
|
|
Fix an ICE on #96738
In the block we don't know if the method actually exists thus `expect_local` panics.
Fixes #96738
Fixes #96583
|
|
|
|
|
|
|
|
r=cjgillot
Remove ItemLikeVisitor impls from rustc_typeck
Issue #95004
cc `@cjgillot`
|
|
|