| Age | Commit message (Collapse) | Author | Lines |
|
Some "this expression has a field"-related fixes
Each commit does something different and is worth reviewing, but the final diff from `master..HEAD` contains the sum of the changes to the UI tests, since some commits added UI tests "regressions" which were later removed in other commits.
The only change I could see adding on top of this is suppressing `Clone::clone` from the "this expression has a field that has this method" suggestion, since it's so commonly implemented by types that it's not worthwhile suggesting in general.
|
|
rustdoc-json: Remove doc FIXME for Import::id and explain
Also add some test and refactor related code a bit.
``@rustbot`` labels +A-rustdoc-json +T-rustdoc
|
|
rustdoc: improve scroll locking in the rustdoc mobile sidebars
This PR prevents the main content area from scrolling while the mobile sidebar is open on documentation pages (porting the scroll locking behavior from the source sidebar to the regular sidebar), and also fixes some bad behavior where opening a "mobile" sidebar, and growing the viewport so that the "desktop" mode without scroll locking is activated, could potentially leave the page stuck.
This does not affect the behavior on larger screens. Only small ones, where the sidebar covers up the main content.
Split out from #98772
|
|
|
|
|
|
|
|
|
|
|
|
consider unnormalized types for implied bounds
extracted, and slightly modified, from #98900
The idea here is that generally, rustc is split into things which can assume its inputs are well formed[^1], and things which have verify that themselves.
Generally most predicates should only deal with well formed inputs, e.g. a `&'a &'b (): Trait` predicate should be able to assume that `'b: 'a` holds. Normalization can loosen wf requirements (see #91068) and must therefore not be used in places which still have to check well formedness. The only such place should hopefully be `WellFormed` predicates
fixes #87748 and #98543
r? `@jackh726` cc `@rust-lang/types`
[^1]: These places may still encounter non-wf inputs and have to deal with them without causing an ICE as we may check for well formedness out of order.
|
|
|
|
|
|
|
|
TaKO8Ki:suggest-adding-appropriate-missing-pattern-excluding-comments, r=compiler-errors
Suggest adding an appropriate missing pattern excluding comments
fixes #100272
|
|
Don't ICE while suggesting updating item path.
When an item isn't found, we may suggest an appropriate import to `use`. Along with that, we also suggest updating the path to work with the `use`. Unfortunately, if the code in question originates from a macro, the span used to indicate which part of the path needs updating may not be suitable and cause an ICE (*). Since, such code is not adjustable directly by the user without modifying the macro, just skip the suggestion in such cases.
(*) The ICE happens because the emitter want to indicate to the user what code to delete by referencing a certain span. But in this case, said span has `lo == hi == 0` which means it thinks it's a dummy span. Adding a space before the proc macro attribute is enough to stop it from ICE'ing but even then the suggestion doesn't really make any sense:
```
help: if you import `DataStore`, refer to it directly
|
1 - #[dbstruct::dbstruct]
1 + #[dbstruct::dbstruct]
```
Since suggestions are best-effort, I just gated this one on `can_be_used_for_suggestions` which catches cases like this.
Fixes #100199
|
|
r=lcnr,notriddle,camelid
Don't document impossible to call default trait items on impls
Closes #100176
This only skips documenting _default_ trait items on impls, not ones that are written inside the impl block. This is a conservative approach, since I think we should document all items written in an impl block (I guess unless hidden or whatever), but the existence of this new query I added makes this easy to extend to other rustdoc cases.
|
|
r=camelid,notriddle,GuillaumeGomez
Rustdoc-Json: Document HRTB's on DynTrait
Closes https://github.com/rust-lang/rust/issues/99118
Probably best reviewed commit by commit.
`@rustbot` modify labels: +A-rustdoc-json
cc `@Enselic`
r? `@CraftSpider`
|
|
Implement `#[rustc_default_body_unstable]`
This PR implements a new stability attribute — `#[rustc_default_body_unstable]`.
`#[rustc_default_body_unstable]` controls the stability of default bodies in traits.
For example:
```rust
pub trait Trait {
#[rustc_default_body_unstable(feature = "feat", isssue = "none")]
fn item() {}
}
```
In order to implement `Trait` user needs to either
- implement `item` (even though it has a default implementation)
- enable `#![feature(feat)]`
This is useful in conjunction with [`#[rustc_must_implement_one_of]`](https://github.com/rust-lang/rust/pull/92164), we may want to relax requirements for a trait, for example allowing implementing either of `PartialEq::{eq, ne}`, but do so in a safe way — making implementation of only `PartialEq::ne` unstable.
r? `@Aaron1011`
cc `@nrc` (iirc you were interested in this wrt `read_buf`), `@danielhenrymantilla` (you were interested in the related `#[rustc_must_implement_one_of]`)
P.S. This is my first time working with stability attributes, so I'm not sure if I did everything right 😅
|
|
this allows us to soundly use unnormalized projections for wf
|
|
@__llvm_profile_runtime is how an external hidden global.
|
|
|
|
Rollup of 6 pull requests
Successful merges:
- #100163 (Refactor: remove an unnecessary string search)
- #100212 (Remove more Clean trait implementations)
- #100238 (Further improve error message for E0081)
- #100268 (Add regression test for #79148)
- #100294 (Update Duration::as_secs doc to point to as_secs_f64/32 for including fractional part)
- #100303 (:arrow_up: rust-analyzer)
Failed merges:
- #100281 (Remove more Clean trait implementations)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
To get around the "following path contains more than 968 entries, you
should move the test to some relevant subdirectory" tidy error.
|
|
|
|
r=Mark-Simulacrum
Add regression test for #79148
closes #79148
|
|
Further improve error message for E0081
Closes #97533
|
|
r=wesleywiser
Refactor: remove an unnecessary string search
|
|
Avoid ICE in rustdoc when using `Fn` bounds
Fixes https://github.com/rust-lang/rust/issues/100143
|
|
Recover from mutable variable declaration where `mut` is placed before `let`
|
|
|
|
due to ordering, added/improved comments and removed redundant test
already caught by `E0081.rs`
|
|
|
|
|
|
|
|
Implement special-cased projection error message for some common traits
Not sure what the best phrasing is, but I feel like these are more clear than the plain `<Type as Iterator>::Output == Type` messages.
If this is actually a good idea, are there any other traits this could benefit?
|
|
Only fetch HIR for naked functions that have the attribute.
|
|
rustdoc: do not mark the contents of a skipped module as inlined
Fixes #100204
|
|
|
|
|
|
|
|
|
|
|
|
Use start_point instead of next_point to point to elided lifetime amp…
Using `next_point` creates a span which points inside the multibyte token, ICEing.
Fixes https://github.com/rust-lang/rust/issues/100224
|
|
Remove even more box syntax uses from src/test
Prior work, notably #88316 has removed box syntax from most of the testsuite.
However, some tests were left out.
This commit removes box_syntax uses from more locations in src/test.
This migrates the tests where `box` is mostly an "implementation detail" and not the primary thing being tested by the test.
Furthermore, some tests from the mir-opt test suite are not being migrated.
|
|
TaKO8Ki:suggest-boxed-trait-objects-instead-of-impl-trait, r=compiler-errors
Revive suggestions for boxed trait objects instead of impl Trait
The suggestion implemented in #75608 was not working properly, so I fixed it.
|
|
|
|
Multiple duplicate assignments of the same discriminant are now reported
in the samme error. We now point out the incrementation start point for
discriminants that are not explicitly assigned that are also duplicates.
Removed old test related to E0081 that is now covered by error-codes/E0081.rs.
Also refactored parts of the `check_enum` function.
|
|
|
|
|
|
|