| Age | Commit message (Collapse) | Author | Lines |
|
notriddle:notriddle/short-links-jump-to-definition, r=GuillaumeGomez
rustdoc: use more precise URLs for jump-to-definition links
As an example, this cuts down <https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_middle/ty/mod.rs.html> by about 11%.
$ du -h new_mod.rs.html old_mod.rs.html
296K new_mod.rs.html
332K old_mod.rs.html
Like https://github.com/rust-lang/rust/pull/83237, but separate code since source links have a different URL structure.
Related to [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/RFC.20for.20.22jump.20to.20definition.22.20feature/near/299029786) and [the jump-to-definition pre-RFC](https://github.com/GuillaumeGomez/rfcs/pull/1).
|
|
Suggest associated const for incorrect use of let in traits
Fixes #101797
|
|
Replace `check_missing_items.py` with `jsondoclint`
[zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/check_missing_items.2Epy.20Replacement.2E)
check_missing_items.py was a python script that checked rustdoc json output to make sure all the Id's referenced existed in the JSON index. This PR replaces that with a rust binary (`jsondoclint`) that does the same thing.
### Motivation
1. Easier to change when `rustdoc-json-types` changes, as `jsondoclint` uses the types directly.
2. Better Errors:
- Multiple Errors can be emited for a single crate
- Errors can say where in JSON they occored
```
2:2889:408 not in index or paths, but refered to at '.index."2:2888:104".inner.items[0]'
2:2890:410 not in index or paths, but refered to at '.index."2:2888:104".inner.items[1]'
```
3. Catches more bugs.
- Because matches are exaustive, all posible variants considered for enums
- All Id's checked
- Has already found #101770, #101199 and #100973
- Id type is also checked, so the Id's in a structs fields can only be field items.
4. Allows the possibility of running from `rustdoc::json`, which we should do in a crator run at some point.
cc ``@CraftSpider``
r? ``@GuillaumeGomez``
|
|
Prefer explict closure sig types over expected ones
fixes #100800
Previously we only checked that given closure arguments are equal to expected closure arguments, but now we choose the given closure arguments for the signature that is used when type checking the closure body, and keep the other signature for the type of the closure as seen outside of it.
|
|
Fix `#[link kind="raw-dylib"]` to respect `#[link_name]`
Issue Details:
When using `#[link kind="raw-dylib"]` (#58713), the Rust compiler ignored any `#[link_name]` attributes when generating the import library and so the resulting binary would fail to link due to missing symbols.
Fix Details:
Use the name from `#[link_name]` if present when generating the `raw-dylib` import library, otherwise default back to the actual symbol name.
|
|
|
|
|
|
|
|
|
|
|
|
Normalize struct field types in `confirm_builtin_unsize_candidate`
Fixes #75899
---
edited to move the normalization into `confirm_builtin_unsize_candidate` instead of the coercion code.
|
|
|
|
Result of running:
rg -l "feature.let_else" src/test/ | xargs sed -s -i "s#^...feature.let_else..\$##"
Plus manual tidy fixes.
|
|
The let else suggestion added by 0d92752b8aac53e033541d04fc7d9677d8bca227
does not need a feature gate any more.
|
|
|
|
|
|
Co-Authored-By: Mark Rousskov <mark.simulacrum@gmail.com>
|
|
Reorder nesting scopes and declare bindings without drop schedule
Fix #99228
Fix #99975
Storages are previously not declared before entering the `else` block of a `let .. else` statement. However, when breaking out of the pattern matching into the `else` block, those storages are recorded as scheduled for drops. This is not expected.
This MR fixes this issue by not scheduling the drops for those storages.
cc `@est31`
|
|
|
|
|
|
|
|
|
|
Add test for #101743
The issue was closes as we stopped rendering `const`s like this, but if we move back to doing that, make sure we don't accidently generate tags
|
|
rustdoc: clean up DOM by removing `.dockblock-short p`
On https://doc.rust-lang.org/nightly/std/ this reduces the number out of `document.querySelectorAll("*").length` from 1278 to 1103.
Preview: https://notriddle.com/notriddle-rustdoc-test/docblock-short-p/std/index.html
|
|
Adding ignore-fuchsia arg to non-applicable compiler ui tests
Adding `ignore-fuchsia` flag to tests involving `std::process::Command` calls, and `execve` calls
|
|
|
|
|
|
|
|
|
|
Compute lint levels by definition
Lint levels are currently computed once for the whole crate. Any code that wants to emit a lint depends on this single `lint_levels(())` query. This query contains the `Span` for each attribute that participates in the lint level tree, so any code that wants to emit a lint basically depends on the spans in all files in the crate.
Contrary to hard errors, we do not clear the incremental session on lints, so this implicit world dependency pessimizes incremental reuse. (And is furthermore invisible for allowed lints.)
This PR completes https://github.com/rust-lang/rust/pull/99634 (thanks for the initial work `@fee1-dead)` and includes it in the dependency graph.
The design is based on 2 queries:
1. `lint_levels_on(HirId) -> FxHashMap<LintId, LevelAndSource>` which accesses the attributes at the given `HirId` and processes them into lint levels. The `TyCtxt` is responsible for probing the HIR tree to find the user-visible level.
2. `lint_expectations(())` which lists all the `#[expect]` attributes in the crate.
This PR also introduces the ability to reconstruct a `HirId` from a `DepNode` by encoding the local part of the `DefPathHash` and the `ItemLocalId` in the two `u64` of the fingerprint. This allows for the dep-graph to directly recompute `lint_levels_on` directly, without having to force the calling query.
Closes https://github.com/rust-lang/rust/issues/95094.
Supersedes https://github.com/rust-lang/rust/pull/99634.
|
|
|
|
|
|
|
|
Initial implementation of dyn*
This PR adds extremely basic and incomplete support for [dyn*](https://smallcultfollowing.com/babysteps//blog/2022/03/29/dyn-can-we-make-dyn-sized/). The goal is to get something in tree behind a flag to make collaboration easier, and also to make sure the implementation so far is not unreasonable. This PR does quite a few things:
* Introduce `dyn_star` feature flag
* Adds parsing for `dyn* Trait` types
* Defines `dyn* Trait` as a sized type
* Adds support for explicit casts, like `42usize as dyn* Debug`
* Including const evaluation of such casts
* Adds codegen for drop glue so things are cleaned up properly when a `dyn* Trait` object goes out of scope
* Adds codegen for method calls, at least for methods that take `&self`
Quite a bit is still missing, but this gives us a starting point. Note that this is never intended to become stable surface syntax for Rust, but rather `dyn*` is planned to be used as an implementation detail for async functions in dyn traits.
Joint work with `@nikomatsakis` and `@compiler-errors.`
r? `@bjorn3`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Update test output for drop tracking
#97334 has a lot of updates to test outputs that makes the PR larger than it needs to be. This PR pulls those changes out so we can keep the other one as simple as possible.
r? `@jyn514`
|
|
|
|
|
|
|
|
On https://doc.rust-lang.org/nightly/std/ this reduces the number out of
`document.querySelectorAll("*").length` from 1278 to 1103.
|
|
|
|
|
|
|
|
|
|
|