Updates links in various Compiler Error Index entries
Currently many of the links in the online https://doc.rust-lang.org/error-index.html are not clickable, and many of them don't resolve correctly as they point to older versions of rustbyexample and the reference.
Split non macro portion of unused_doc_comment from macro part into two passes/lints
## Motivation
This change is motivated by the needs of the [spandoc library](https://github.com/yaahc/spandoc). The specific use case is that my macro is removing doc comments when an attribute is applied to a fn with doc comments, but I would like the lint to still appear when I forget to add the `#[spandoc]` attribute to a fn, so I don't want to have to silence the lint globally.
## Approach
This change splits the `unused _doc_comment` lint into two lints, `unused_macro_doc_comment` and `unused_doc_comment`. The non macro portion is moved into an `early_lint_pass` rather than a pre_expansion_pass. This allows proc macros to silence `unused_doc_comment` warnings by either adding an attribute to silence it or by removing the doc comment before the early_pass runs.
The `unused_macro_doc_comment` lint however will still be impossible for proc-macros to silence, but the only alternative that I can see is to remove this lint entirely, which I don't think is acceptable / is a decision I'm not comfortable making personally, so instead I opted to split the macro portion of the check into a separate lint so that it can be silenced globally with an attribute if necessary without needing to globally silence the `unused_doc_comment` lint as well, which is still desireable.
fixes https://github.com/rust-lang/rust/issues/67838
Formatting fixes
Now that I can actually run `python x.py test src/tools/tidy` locally
... my god it takes a long time to compile when you're on a cellular
connection.
Removing unnecessary whitespaces
Updates src/test/ui/json-short.stderr golden test file
Fixes test failure by updating the golden file for changes
in src/librustc_error_codes/error_codes/E0601.md
Update src/librustc_error_codes/error_codes/E0080.md
Co-Authored-By: varkor <github@varkor.com>
Update src/librustc_error_codes/error_codes/E0080.md
Co-Authored-By: varkor <github@varkor.com>
Update src/librustc_error_codes/error_codes/E0080.md
Co-Authored-By: varkor <github@varkor.com>
Update src/librustc_error_codes/error_codes/E0154.md
Co-Authored-By: varkor <github@varkor.com>
Update src/librustc_error_codes/error_codes/E0154.md
Co-Authored-By: varkor <github@varkor.com>
Update src/librustc_error_codes/error_codes/E0661.md
Co-Authored-By: varkor <github@varkor.com>
Update src/librustc_error_codes/error_codes/E0662.md
Co-Authored-By: varkor <github@varkor.com>
Update src/librustc_error_codes/error_codes/E0663.md
Co-Authored-By: varkor <github@varkor.com>
Update src/librustc_error_codes/error_codes/E0664.md
Co-Authored-By: varkor <github@varkor.com>
Update src/test/ui/json-short.stderr
Co-Authored-By: varkor <github@varkor.com>
Update src/librustc_error_codes/error_codes/E0260.md
Co-Authored-By: varkor <github@varkor.com>
Update src/librustc_error_codes/error_codes/E0154.md
Co-Authored-By: varkor <github@varkor.com>
Update src/librustc_error_codes/error_codes/E0260.md
Co-Authored-By: varkor <github@varkor.com>
Apply suggestions from code review
Co-Authored-By: varkor <github@varkor.com>
Fixing 1 character over 80 cascade
parse: allow `type Foo: Ord` syntactically
This addresses:
> (Work still remains to fuse this with free type aliases, but this can be done later.)
in https://github.com/rust-lang/rust/pull/69194.
r? @petrochenkov
Take advantage of the fact that `check_mod_attrs` marks attributes as
used and change their type to normal, so that any remaining uses will be
warned about by the unused attribute lint.
This is a modified version of estebank's suggestion, with a bit of
extra cleanup now that we don't need the different cases for if we can
turn a span into a string or not.
Previously, when inserting the entry function, we only checked for
duplicate _definitions_ of `main`. However, it's possible to cause
problems even only having a duplicate _declaration_. For example,
shadowing `main` using an extern block isn't caught by the current
check, and causes an assertion failure down the line in in LLVM code.
Rollup of 7 pull requests
Successful merges:
- #68984 (Make `u8::is_ascii` a stable `const fn`)
- #69339 (Add test for #69312)
- #69346 (Clean up E0323, E0324, E0325 and E0326 explanations)
- #69348 (Wrong error message for move_ref_pattern)
- #69349 (MIR is not an experiment anymore)
- #69354 (Test `Duration::new` panics on overflow)
- #69370 (move const_eval.rs into the module folder)
Failed merges:
r? @ghost
Wrong error message for move_ref_pattern
The current error message states that move occurs *because of `Copy`*:
```Rust
"move occurs because `{}` has type `{}` which does implement the `Copy` trait."
```
I found this randomly when surfing through the sources. This means, I don't have any context and might be completely wrong.
r? @Centril
Make `u8::is_ascii` a stable `const fn`
`char::is_ascii` was already stabilized as `const fn` in #55278, so there is no reason for `u8::is_ascii` to go through an unstable period.
cc @rust-lang/libs
All of these functions can be implemented simply and naturally as
const functions, e.g. u32::from_le_bytes can be implemented as
(bytes[0] as u32)
| (bytes[1] as u32) << 8
| (bytes[2] as u32) << 16
| (bytes[3] as u32) << 24
So stabilizing the constness will not expose that internally they are
implemented using transmute which is not const in stable.
Revert #69280Resolves#69313 by reverting #69280.
After #69280, `#[rustc_args_required_const(2)]` is required on the declaration of `simd_shuffle` intrinsics. This is allowed breakage, since you can't define platform intrinsics on stable. However, the latest release of the widely used `packed_simd` crate defines these intrinsics without the requisite attribute. Since there's no urgency to merge #69280, let's revert it. We can reconsider when rust-lang/packed_simd#278 is included in a point release of `packed_simd`.
r? @petrochenkov