| Age | Commit message (Collapse) | Author | Lines |
|
There are a few common abbreviations like `use rustc_ast as ast` and
`use rust_hir as hir` for names that are used a lot. But there are also
some cases where a crate is renamed just once in the whole codebase, and
that ends up making things harder to read rather than easier. This
commit removes them.
|
|
I found these with a hacky shell script.
|
|
Rollup of 7 pull requests
Successful merges:
- #124138 (Ignore LLVM ABI in dlltool tests since those targets don't use dlltool)
- #124414 (remove extraneous note on `UnableToRunDsymutil` diagnostic)
- #124579 (Align: add bytes_usize and bits_usize)
- #124622 (Cleanup: Rid the `rmake` test runners of `extern crate run_make_support;`)
- #124623 (shallow resolve in orphan check)
- #124624 (Use `tcx.types.unit` instead of `Ty::new_unit(tcx)`)
- #124627 (interpret: hide some reexports in rustdoc)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
interpret: hide some reexports in rustdoc
Cc https://github.com/rust-lang/rust/issues/124608
|
|
Use `tcx.types.unit` instead of `Ty::new_unit(tcx)`
I don't think there is any need for the function, given that we can just access the `.types`, similarly to all other primitives?
|
|
shallow resolve in orphan check
r? ``@compiler-errors`` cc https://github.com/rust-lang/rust/pull/124588#pullrequestreview-2036012292
|
|
Cleanup: Rid the `rmake` test runners of `extern crate run_make_support;`
`run_make_support` is part of the *extern prelude* of `rmake` test runners rendering `extern crate run_make_support` redundant:
https://github.com/rust-lang/rust/blob/80451a485b006bd32732c003a54ee7de457d8266/src/tools/compiletest/src/runtest.rs#L3826-L3827
~~Contains some fmt'ing changes because I've enabled format-on-save in my editor and because we don't run `x fmt` for `rmake` test runners yet (this gets addressed by #124613). I can revert those if you'd like me to.~~ (reverted)
r? jieyouxu or testing-devex(?) or boostrap(?)
|
|
Align: add bytes_usize and bits_usize
This matches `Size::bytes/bits_usize`. I recently wanted this in Miri as well.
|
|
remove extraneous note on `UnableToRunDsymutil` diagnostic
If I understand [this FIXME](https://github.com/rust-lang/rust/blob/1367827eac3d813a261a4c444037af9736996daa/compiler/rustc_macros/src/diagnostics/diagnostic.rs#L205) correctly, it seems we don't yet validate subdiagnostics, so `#[note]` and co in the `#[derive(Diagnostic]` item could be out-of-sync with the fluent message, without causing compile errors.
It was the case for `rustc_codegen_ssa::errors::UnableToRunDsymutil`, causing the ICE in #124392.
I've grepped and scripted my way through most of our diagnostics structs and fluent bundles and the above was the only such extraneous `#[note]`/`#[note(name)]`/`#[help]`/`#[warning]` I could find, so hopefully there aren't many others like it.
I haven't checked if the opposite can happen, a `.note = ` in a fluent message that is lacking a corresponding `#[note]` on the struct and not causing an error, but maybe it's possible?
r? ``@davidtwco``
fixes #124392
|
|
Ignore LLVM ABI in dlltool tests since those targets don't use dlltool
Otherwise those two tests fail when running `./x.py test` with this target.
|
|
|
|
Clippy subtree update
r? `@Manishearth`
|
|
|
|
|
|
|
|
|
|
|
|
clippy-subtree-update
|
|
Rollup of 3 pull requests
Successful merges:
- #124568 (Adjust `#[macro_export]`/doctest help suggestion for non_local_defs lint)
- #124582 (always print nice 'std not found' error when std is not found)
- #124597 (Use an explicit x86-64 cpu in tests that are sensitive to it)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Use an explicit x86-64 cpu in tests that are sensitive to it
There are a few tests that depend on some target features **not** being
enabled by default, and usually they are correct with the default x86-64
target CPU. However, in downstream builds we have modified the default
to fit our distros -- `x86-64-v2` in RHEL 9 and `x86-64-v3` in RHEL 10
-- and the latter especially trips tests that expect not to have AVX.
These cases are few enough that we can just set them back explicitly.
|
|
always print nice 'std not found' error when std is not found
Fixes https://github.com/rust-lang/miri/issues/3529
Arguably Miri is doing something odd by letting people create no-std sysroots for arbitrary targets -- but equally arguably, there's no good reason for rustc to special-case the host triple here. Being a non-host triple does not imply the target is a no-std target, after all.
|
|
r=michaelwoerister,GuillaumeGomez
Adjust `#[macro_export]`/doctest help suggestion for non_local_defs lint
This PR adjust the help suggestion of the `non_local_definitions` lint when encountering a `#[macro_export]` at top-level doctest.
So instead of a non-sentential help suggestion to move the `macro_rules!` up above the `rustdoc`-generated function. We now suggest users to declare their own function.
Fixes *(partially, needs backport)* #124534
|
|
Suggest collapsing nested or patterns if the MSRV allows it
Nested `or` patterns have been stable since 1.53, so we should be able to suggest `Some(1 | 2)` if the MSRV isn't set below that.
This change adds an msrv check and also moves it to `matches/mod.rs`, because it's also needed by `redundant_guards`.
changelog: [`collapsible_match`]: suggest collapsing nested or patterns if the MSRV allows it
|
|
Remove `dead_code` paths
The following paths are `dead_code` and can be removed:
### `clippy_utils::paths::VEC_RESIZE`
* Introduced when `vec_resize_to_zero` lint added in PR https://github.com/rust-lang/rust-clippy/pull/5637
* No longer used after commit https://github.com/rust-lang/rust-clippy/pull/8957/commits/8acc4d2f1e255e0e97e48b7a285a7d6db4a03bd6
### `clippy_utils::paths::SLICE_GET`
* Introduced when `get_first` lint added in PR https://github.com/rust-lang/rust-clippy/pull/8882
* No longer used after commit https://github.com/rust-lang/rust-clippy/pull/8957/commits/a8d80d531f1d358c26295eb3d81624594544dd4b
### `clippy_utils::paths::STR_BYTES`
* Introduced when `bytes_count_to_len` lint added in PR https://github.com/rust-lang/rust-clippy/pull/8711
* No longer used after commit https://github.com/rust-lang/rust-clippy/pull/8957/commits/ba6a4595285e38f35970e66db903475989e0be6f
When the lints were moved into the `Methods` lint pass, they switched from using paths to diagnostic items. However, the paths were never removed. This occurred in PR https://github.com/rust-lang/rust-clippy/pull/8957.
This relates to issue https://github.com/rust-lang/rust-clippy/issues/5393
changelog: none
|
|
fix `for x in y unsafe { }`
fixes #12514
----
changelog: [`needless_for_each`]: unsafe block in for loop body suggestion
|
|
Rustup
r? `@ghost`
changelog: none
|
|
|
|
|
|
|
|
Bump ui_test to 0.23
Notable changes: more control over run/rustfix/... and other rustc-specific features. All of these can in theory now be implemented entirely out of tree
changelog: none
|
|
Document never type fallback in `!`'s docs
Pulled the documentation I've written for #123939.
I want a single place where never type fallback is explained, which can be referred in all the lints and migration materials.
|
|
|
|
Changelog for Clippy 1.78 :magic_wand:
Roses and Violets have colors,
Red and Blue are the two,
I'm getting to the end of my masters,
what a cool goal to pursue
---
### The cat of this release is: *Shadow* submitted by `@benwh1:`
<img height=500 src="https://github.com/rust-lang/rust-clippy/assets/32911992/c56af314-4644-482a-a08e-f32f4c7d7b22" alt="The cats of this Clippy release" />
Cats for the next release can be nominated in the comments :D
---
changelog: none
|
|
Co-authored-by: Timo <30553356+y21@users.noreply.github.com>
|
|
Bump bootstrap compiler to latest beta
https://forge.rust-lang.org/release/process.html#master-bootstrap-update-t-2-day-tuesday
This also cherry-picks d716d72586548963f32e5c8d57c41db0065fa6e0 from the beta branching, to continue to workaround #122758.
r? bootstrap
|
|
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
|
|
Both clippy_utils::paths::SLICE_GET and clippy_utils::paths::STR_BYTES
are dead_code and can therefore be removed.
|
|
|
|
|
|
|
|
r=compiler-errors
Add a lint against never type fallback affecting unsafe code
~~I'm not very happy with the code quality... `VecGraph` not allowing you to get predecessors is very annoying. This should work though, so there is that.~~ (ended up updating `VecGraph` to support getting predecessors)
~~First few commits are from https://github.com/rust-lang/rust/pull/123934 https://github.com/rust-lang/rust/pull/123980~~
|
|
|
|
|
|
Co-authored-by: Kevin Reid <kpreid@switchb.org>
Co-authored-by: Herman Skogseth <herman.skogseth@me.com>
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
|
|
|
|
(never_type_fallback_flowing_into_unsafe)
|
|
|
|
|
|
|
|
|