Note that the output of `unpretty-debug.stdout` has changed. In that
test the hash values are normalized from a symbol numbers to small
numbers like "0#0" and "0#1". The increase in the number of static
symbols must have caused the original numbers to contain more digits,
resulting in different pretty-printing prior to normalization.
lint: use `transparent_newtype_field` to avoid ICE
Fixes#73747.
This PR re-uses the `transparent_newtype_field` function instead of manually calling `is_zst` on normalized fields to determine which field in a transparent type is the non-zero-sized field, thus avoiding an ICE.
typeck: use `item_name` in cross-crate packed diag
Fixes#73112.
This PR replaces the use of `expect_local` and `hir().get` to fetch the identifier for a ADT with `item_name` - which works across crates.
pprust: support multiline comments within lines
Fixes#73626.
This PR adds support to `rustc_ast_pretty` for multiline comments that start and end within a line of source code.
Fun fact: [the commit which added this assert](d12ea39896) was from 2011!
d12ea39896/src/comp/pretty/pprust.rs (L1146-L1150)
Slight reorganization of sys/(fast_)thread_local
I was long confused by the `thread_local` and `fast_thread_local` modules in the `sys(_common)` part of libstd. The names make it *sound* like `fast_thread_local` is just a faster version of `thread_local`, but really these are totally different APIs: one provides thread-local "keys", which are non-addressable pointer-sized pieces of local storage with an associated destructor; the other (the "fast" one) provides just a destructor.
So I propose we rename `fast_thread_local` to `thread_local_dtor`, and `thread_local` to `thread_local_key`. That's what this PR does.
Don't allow `DESTDIR` to influence LLVM builds
When running a command like `DESTDIR=foo x.py install` in a completely
clean build directory, this will cause LLVM to be installed into
`DESTDIR`, which then causes the build to fail later when it attempts
to *use* those LLVM files.
This commit re-uses the `transparent_newtype_field` function instead of
manually calling `is_zst` on normalized fields to determine which field
in a transparent type is the non-zero-sized field, thus avoiding an ICE.
Signed-off-by: David Wood <david@davidtw.co>
When encountering a unit or tuple pattern for a struct-like item, suggest
using the correct pattern.
Use `insert_field_names_local` when evaluating variants and store field
names even when the list is empty in order to produce accurate
structured suggestions.
This commit replaces the use of `expect_local` and `hir().get` to fetch
the identifier for a ADT with `item_name` - which works across crates.
Signed-off-by: David Wood <david@davidtw.co>
Update Clippy
~~I'm not sure, if we can/should land this before beta is branched.~~ (Nvm, beta is already branched) The last Clippy update was 3 weeks ago: #73660
This includes, besides other minor things:
- New lints
- One lint deprecation
- One lint was moved to pedantic
- Some FP fixes
- I think an ICE fix?
cc @Mark-Simulacrum
r? @Manishearth
---
We probably should also think of some process when and how often we should sync Clippy to the rust repo, so that we don't end up with those huge updates. Maybe every 2 weeks? Or even every week? cc @rust-lang/clippy
Remove unnecessary type hints from Wake internals
While working on https://github.com/rust-lang/rust/pull/74304 I noticed we were writing out the type signature twice in some internal `Wake` impl methods; this streamlines that. Thanks!
Clarify the description for rfind
Changes the wording in rfind description to be clearer and the example code to illustrate the difference between
find and rfind
typeck: report placeholder type error w/out span
Fixes#74086.
This PR fixes a regression introduced in rust-lang/rust#70369 which meant that an error was not being emitted for invalid placeholder types when there wasn't a span available.
r? @estebank
add (unchecked) indexing methods to raw (and NonNull) slices
This complements the existing (unstable) `len` method. Unfortunately, for non-null slices, we cannot call this method `as_ptr` as that overlaps with the existing method of the same name.
If this looks reasonable to accept, I propose to reuse the https://github.com/rust-lang/rust/issues/71146 tracking issue and rename the feature get to `slice_ptr_methods` or so.
Cc @SimonSapin
Fixes https://github.com/rust-lang/rust/issues/60639
typeck: check for infer before type impls trait
Fixes#73886.
This PR checks that the target type of the cast (an error related to which is being reported) does not have types to be inferred before checking if it implements the `From` trait.
r? @estebank
Obviate #[allow(improper_ctypes_definitions)]
Modifies the return type for `fn entry` so that allowing
improper_ctypes_definitions is no longer necessary. This change is
derived from a similar pattern in `libstd/sys/sgx/abi/usercalls/raw.rs`
with `UsercallReturn`.
cc @jethrogb
Rename collapsable_if fix suggestion to "collapse nested if block"
The name "try" is confusing when shown as quick fix by rust-analyzer
changelog: Rename `collapsable_if` fix suggestion to "collapse nested if block"
Use step_unchecked more liberally in range iter impls
Without these `_unchecked`, these operations on iterators of `char` fail to optimize out the unreachable panicking condition on overflow.
cc @cuviper https://github.com/rayon-rs/rayon/pull/771 where this was discovered.