Implement special-cased projection error message for some common traits
Not sure what the best phrasing is, but I feel like these are more clear than the plain `<Type as Iterator>::Output == Type` messages.
If this is actually a good idea, are there any other traits this could benefit?
More proc-macro detection
fixes#6514fixes#8683fixes#6858fixes#6594
This is a more general way of checking if an expression comes from a macro and could be trivially applied to other lints. Ideally this would be fixed in rustc's proc-macro api, but I don't see that happening any time soon.
changelog: FPs: [`unit_arg`] [`default_trait_access`] [`missing_docs_in_private_items`]: No longer trigger in code generated from proc-macros.
Move `significant_drop_in_scrutinee` into `nursey`
The current suggestion of extending the lifetime of every sub-expression is not great and doesn't fix the error given in the lint's example, though it does make the potential deadlock easier to see, but it can also cause it's own issues by delaying the drop of the lock guard.
e.g.
```rust
match x.lock().foo {
..
}
// some stuff
let y = x.lock();
```
The suggestion would create a deadlock at the second `x.lock()` call.
This also lints even when a significant drop type isn't created as a temporary. (#9072)
I agree `@kpreid` (https://github.com/rust-lang/rust-clippy/issues/8987#issuecomment-1207464440) that this should be back-ported before the lint hits stable.
changelog: Move `significant_drop_in_scrutinee` into `nursey`
I haven't understood the difference between these before, but
`@compiler-errors` helped me clear it up. Hopefully this will help other
people who've been confused!
Add armv4t-none-eabi take2
This is the same as the previous PR (https://github.com/rust-lang/rust/pull/99226) but i just made a fresh branch without a merge commit in it.
---
### armv4t-none-eabi target quiz
> A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target.
That's me!
> Targets must use naming consistent with any existing targets
We're using the existing name as recognized by LLVM and GCC
> Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users.
No legal issues here.
>> The target must not introduce license incompatibilities.
No license requirements here.
>> Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0).
check
>> The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy.
no new deps, we're just adding a rustc target description file for a target llvm already knows about.
>> Compiling, linking, and emitting functional binaries, libraries, or other code for the target (whether hosted on the target itself or cross-compiling from another target) must not depend on proprietary (non-FOSS) libraries.
bare-metal target, doesn't rely on any libs at all.
> Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate
`core` only here. You could build `alloc` too, but you'd have to bring your own global allocator.
> The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible.
LLVM knows how to do it, you just need the GNU Binutils linker because LLVM's linker doesn't work that far back. That's in the docs as part of this PR.
> Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target.
No burdens, LLVM already knows how to do this. Further, because this is a cpu-feature variant of an existing tier3 target the `compiler-builtins` crate has already been updated as necessary to fix any missing builtin function gaps.
> Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target.
check.
Use start_point instead of next_point to point to elided lifetime amp…
Using `next_point` creates a span which points inside the multibyte token, ICEing.
Fixes https://github.com/rust-lang/rust/issues/100224
test: skip terminfo parsing in Miri
Terminfo parsing takes a significant amount of time in Miri, making libtest startup very slow. To work around that Miri in fact unsets the `TERM` variable. However, this means we don't get colors in `cargo miri test`.
So I propose we add some logic in libtest that skips parsing terminfo files under Miri, and just uses the regular basic coloring commands (taken from the `colored` crate).
As far as I can see, these two commands are all that libtest ever needs from terminfo, so Miri doesn't even lose any functionality through this. If you want I can entirely remove the terminfo parsing code and just use these commands instead.
Cc https://github.com/rust-lang/miri/issues/2292 `@saethlin`
Remove even more box syntax uses from src/test
Prior work, notably #88316 has removed box syntax from most of the testsuite.
However, some tests were left out.
This commit removes box_syntax uses from more locations in src/test.
This migrates the tests where `box` is mostly an "implementation detail" and not the primary thing being tested by the test.
Furthermore, some tests from the mir-opt test suite are not being migrated.
Fuchsia CI zircon lib improvement
Removing Zircon build process, instead pulling `sysroot` and related libs directly from Fuchsia SDK
cc. `@tmandry` `@djkoloski`
Multiple duplicate assignments of the same discriminant are now reported
in the samme error. We now point out the incrementation start point for
discriminants that are not explicitly assigned that are also duplicates.
Removed old test related to E0081 that is now covered by error-codes/E0081.rs.
Also refactored parts of the `check_enum` function.
When an item isn't found, we may suggest an appropriate import to
`use`. Along with that, we also suggest updating the path to work
with the `use`. Unfortunately, if the code in question originates
from a macro, the span used to indicate which part of the path
needs updating may not be suitable and cause an ICE. Since, such
code is not adjustable directly by the user without modifying the
macro, just skip the suggestion in such cases.
More methods and traits for `la_arena::ArenaMap`
Continue of #12931. Seems that I forgot some methods in the previous PR :(
I also changed `ArenaMap::insert` to return the old value, to match the map-like collection API of std. **So this is a breaking change.**
r? `@lnicola`