Mark attributes consumed by `check_mod_attrs` as normal
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.
Deduplicate identifier printing a bit
https://github.com/rust-lang/rust/pull/67010 introduced a couple more subtly different ways to print an identifier.
This PR attempts to restore the order.
The most basic identifier printing interface is `Formatter`-based now, so `String`s are not allocated unless required.
r? @Mark-Simulacrum
Add primitive module to libcore
This re-exports the primitive types from libcore at `core::primitive` to allow
macro authors to have a reliable location to use them from.
Fixes#44865
Cherry-pick the LLVM fix for #69225
An additional reproducer was provided in #69225 -- the new testcase here -- which still crashes even after #69241 reverted #67174. Now this pull request updates LLVM with the cherry-picked reversion of its own. This is also going to stable in #69444.
I have not tried to reapply #67174 yet -- cc @kraai @shahn
Update Clippy from 8fbb23f to fc5d0ccFixes#69419
```
Fix false positive in `missing_const_for_fn`
Rustup to rust-lang/rust#69366
Add new lint [`wildcard imports`]. Add suggestion to [`enum_glob_use`]
Add new lint `lossy_float_literal` to detect lossy whole number float literals
```
Rollup of 6 pull requests
Successful merges:
- #69220 (Add documentation for the `-Zself-profile` flag)
- #69391 (Add rustdoc aliases to `ptr::copy` and `ptr::copy_nonoverlapping`)
- #69427 (Cleanup e0368 e0369)
- #69433 (don't explicitly compare against true or false)
- #69435 (Replace uses of Cell::get + Cell::set with Cell::replace.)
- #69437 (no more codegen for miri_start_panic)
Failed merges:
r? @ghost
no more codegen for miri_start_panic
With https://github.com/rust-lang/miri/pull/1136 landed, we don't generate code any more for crates that will be run by Miri. So the LLVM backend does not have to implement the `miri_start_panic` intrinsic any more.
Cc @Aaron1011
Fix minor error in `MaybeUninit::get_mut()` doc example
In the `MaybeUninit::get_mut()` example I wanted to assert that the slice was sorted and mistakenly used `.chunks(2)` rather than `.windows(2)` to assert it, as @ametisf pointed out in https://github.com/rust-lang/rust/pull/65948#issuecomment-589988183 .
This fixes it.
Relax str::get_unchecked precondition to permit empty slicing
Prior to this commit, `str` documented that `get_unchecked` had
the precondition that "`begin` must come before `end`". This would appear
to prohibit empty slices (i.e. begin == end).
In practice, get_unchecked is called often with empty slices. Let's relax
the precondition so as to allow them.
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.
parse: unify item parsing & filter illegal item kinds
This PR fully unifies item parsing into a single `fn parse_item_common` method which produces `Option<Item>`. The `Item` is then mapped into `ForeignItem` and `AssocItem` as necessary by transforming the `*Kind` and converting contextually bad variants into `None`, thereby filtering them away.
The PR does not yet unmerge the definition of `ForeignItemKind` from `AssocItemKind`. I've left that as future work as it didn't feel like this parser-focused PR would be the best one to deal with it. Changes to the AST data structures are instead kept to a reasonable minimum.
Based on https://github.com/rust-lang/rust/pull/69361.
Fixes https://github.com/rust-lang/rust/issues/48137.
RELNOTES: Now, `item` macro fragments can be interpolated into `impl`, `trait`, and `extern` contexts. See `src/test/ui/parser/issue-48137-macros-cannot-interpolate-impl-items.rs` for the relevant test.
r? @petrochenkov
cc @estebank