Previously, this called `check_full_res` for values and types, but not
macros. This would result in not showing when there was a partial
resolution for a parent of the item.
This now calls `check_full_res`. Additionally, it checks if there was a
disambiguator, and if so, says that specific kind wasn't found instead
of saying generically 'associated item'.
Before:
```
warning: unresolved link to `m`
--> m.rs:1:6
|
1 | /// [value@m]
| ^^^^^^^
|
= note: `#[warn(broken_intra_doc_links)]` on by default
= note: no item named `m` is in scope
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
```
After:
```
warning: unresolved link to `m`
--> m.rs:1:6
|
1 | /// [value@m]
| ^^^^^^^ help: to link to the macro, use its disambiguator: `m!`
|
= note: `#[warn(broken_intra_doc_links)]` on by default
= note: this link resolves to the macro `m`, which is not in the value namespace
```
Previously, when looking for the associated items for primitives,
rustdoc would look for primitives in the current namespace.
But all primitives are in the type namespace. To fix this, rustdoc now
always looks for primitives in the namespace when considering them as a
stepping stone to the associated item.
However, fixing that bug caused several duplicate errors because rustdoc
now reports the same error in each namespace. To avoid this, rustdoc now
ignores all duplicate errors when issuing them.
Before:
```
= note: this link partially resolves to the struct `S`
= note: no `fmt` in `S`
```
After:
```
= note: the struct `S` has no field or associated item named `fmt`
```
Look at this beauty:
```rust
error: unresolved link to `S::h`
--> intra-link-errors.rs:51:6
|
51 | /// [type@S::h]
| ^^^^^^^^^ help: to link to the associated function, use its disambiguator: `S::h()`
|
= note: this link resolves to the associated function `h`, which is not in the type namespace
```
Enable some of profiler tests on Windows-gnu
CC https://github.com/rust-lang/rust/issues/61266
Because of force-push GitHub didn't let me reopen https://github.com/rust-lang/rust/pull/75184
Because of the GCC miscompilation, generated binaries either segfault or `.profraw` is malformed. Clang works fine but we can't use it on the CI.
However we can still test the IR for the proper instrumentation so let's do it.
Move jointness censoring to proc_macro
Proc-macro API currently exposes jointness in `Punct` tokens. That is,
`+` in `+one` is **non** joint.
Our lexer produces jointness info for all tokens, so we need to censor
it *somewhere*
Previously we did this in a lexer, but it makes more sense to do this
in a proc-macro server.
r? @petrochenkov
inliner: Check for codegen fn attributes compatibility
* Check for target features compatibility
* Check for no_sanitize attribute compatibility
Fixes#76259.
Fix intra-doc links on pub re-exports
Partial fix for https://github.com/rust-lang/rust/issues/76073 - This removes the incorrect error, but doesn't show the documentation anywhere.
r? @GuillaumeGomez
Remove disambiguators from intra doc link text
Closes https://github.com/rust-lang/rust/issues/65354.
r? @Manishearth
The commits are mostly atomic, but there might be some mix between them here and there. I recommend reading 'refactor ItemLink' and 'refactor RenderedLink' on their own though, lots of churn without any logic changes.
Refactor byteorder to std in rustc_middle
Use std::io::{Read, Write} and {to, from}_{le, be}_bytes methods in
order to remove byteorder from librustc_middle's dependency graph.
Add a regression test for issue-72793
Adds a regression test for #72793, which is fixed by #75443. Note that this won't close the issue as the snippet still shows ICE with `-Zmir-opt-level=2`. But it makes sense to add a test anyway.
do not apply DerefMut on union field
This implements the part of [RFC 2514](https://github.com/rust-lang/rfcs/blob/master/text/2514-union-initialization-and-drop.md) about `DerefMut`. Unlike described in the RFC, we only apply this warning specifically when doing `DerefMut` of a `ManuallyDrop` field; that is really the case we are worried about here.
@matthewjasper suggested I patch `convert_place_derefs_to_mutable` and `convert_place_op_to_mutable` for this, but I could not find anything to do in `convert_place_op_to_mutable` and this is sufficient to make the test pass. However, maybe there are some other cases this misses? I have no familiarity with this code.
This is a breaking change *in theory*, if someone used `ManuallyDrop<T>` in a union field and relied on automatic `DerefMut`. But on stable this means `T: Copy`, so the `ManuallyDrop` is rather pointless.
Cc https://github.com/rust-lang/rust/issues/55149
Show line count and max lines in too_many_lines lint message
This PR adds the current amount of lines and the current maximum number of lines in the message for the `too_many_lines` lint, in a similar way as the `too_many_arguments` lint currently does.
changelog: show the line count and the maximum lines in the message for the `too_many_lines` lint.