Commit Graph

161192 Commits

Author SHA1 Message Date
lolo.branstett@numericable.fr
d5871d09f1 Fix and improve missing dot in the item heading 2022-01-13 20:48:43 +01:00
Noah Lev
aa0ce4a20e Remove &mut from io::read_to_string signature
`@m-ou-se` [realized][1] that because `Read` is implemented for `&mut impl
Read`, there's no need to take `&mut` in `io::read_to_string`.

Removing the `&mut` from the signature allows users to remove the `&mut`
from their calls (and thus pass an owned reader) if they don't use the
reader later.

[1]: https://github.com/rust-lang/rust/issues/80218#issuecomment-874322129
2022-01-13 10:57:45 -08:00
bors
22e491ac7e Auto merge of - nbdd0121:closure, r=wesleywiser
Closure capture cleanup & refactor

Follow up of 

Each commit is self-contained and the rationale/changes are documented in the commit message, so it's advisable to review commit by commit.

The code is significantly cleaner (at least IMO), but that could have some perf implication, so I'd suggest a perf run.

r? `@wesleywiser`
cc `@arora-aman`
2022-01-13 18:51:07 +00:00
hafeoz
7cc6a73936 Remove asm feature from lints example 2022-01-13 15:59:24 +00:00
Loïc BRANSTETT
b8ef148eff Regenerate the PNGs favicon with the updated Rust logo 2022-01-13 14:45:10 +01:00
Loïc BRANSTETT
bc6b199588 Use the updated Rust logo and change it's format to SVG 2022-01-13 14:44:30 +01:00
flip1995
b83c77cb7c
Fix Clippy sync fallout 2022-01-13 13:37:29 +01:00
flip1995
159d6c356e
Update Cargo.lock 2022-01-13 13:18:51 +01:00
flip1995
ba66384447
Merge commit '97a5daa65908e59744e2bc625b14849352231c75' into clippyup 2022-01-13 13:18:19 +01:00
bors
97a5daa659 Auto merge of - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

changelog: none
2022-01-13 11:55:36 +00:00
flip1995
6ad05bcbbe
Bump nightly version -> 2022-01-13 2022-01-13 12:48:17 +01:00
flip1995
8a2141bae4
Bump Clippy Version -> 0.1.60 2022-01-13 12:48:08 +01:00
flip1995
11be495bde
Merge remote-tracking branch 'upstream/master' into rustup 2022-01-13 12:47:48 +01:00
Matthias Krüger
1a95aa9a8b
Rollup merge of - ehuss:1.58-releases, r=Mark-Simulacrum
Update RELEASES for 1.58.

From what I can tell:

* `NonZero{unsigned}::is_power_of_two` was stabilized in 1.59: https://github.com/rust-lang/rust/pull/91301
* `MaybeUninit` const was added in 1.59: https://github.com/rust-lang/rust/pull/90896
2022-01-13 08:11:23 +01:00
Matthias Krüger
a9fe2b95da
Rollup merge of - ehuss:update-cargo, r=ehuss
Update cargo

6 commits in 358e79fe56fe374649275ca7aebaafd57ade0e8d..06b9d31743210b788b130c8a484c2838afa6fc27
2022-01-04 18:39:45 +0000 to 2022-01-11 23:47:29 +0000
- Port cargo to clap3 ()
- feat: support rustflags per profile ()
- Make bors ignore the PR template so it doesn't end up in merge messages ()
- Be resilient to most IO error and filesystem loop while walking dirs ()
- Remove the option to disable pipelining ()
- Always ask rustc for messages about artifacts, and always process them ()
2022-01-13 08:11:22 +01:00
Matthias Krüger
ac81a13640
Rollup merge of - dtolnay:rustdocmatcher, r=camelid,GuillaumeGomez
rustdoc: Preserve rendering of macro_rules matchers when possible

Fixes . This approach restores the behavior prior to  **if** the matcher token held by the compiler **and** the matcher token found in the source code are identical TokenTrees. Thus  remains fixed, but without regressing formatting for the vast majority of macros which are not macro-generated.
2022-01-13 08:11:22 +01:00
Matthias Krüger
f84d35f0b8
Rollup merge of - petrochenkov:cmrval2, r=jackh726
rustc_metadata: Stop passing `CrateMetadataRef` by reference (step 1)

It's already a (fat) reference.
Double referencing it creates lifetime issues for its methods that want to return iterators.

---
Extracted from https://github.com/rust-lang/rust/pull/92245 for a perf run.
The PR changes a lot of symbol names due to function signature changes, so it's hard to do differential profiling, let's spend some machine time instead.
2022-01-13 08:11:21 +01:00
Matthias Krüger
5e04f513cd
Rollup merge of - wesleywiser:fix_codecoverage_partitioning, r=tmandry
[code coverage] Fix missing dead code in modules that are never called

The issue here is that the logic used to determine which CGU to put the dead function stubs in doesn't handle cases where a module is never assigned to a CGU (which is what happens when all of the code in the module is dead).

The partitioning logic also caused issues in  where inline functions were duplicated into multiple CGUs resulting in duplicate symbols.

This commit fixes the issue by removing the complex logic used to assign dead code stubs to CGUs and replaces it with a much simpler model: we pick one CGU to hold all the dead code stubs. We pick a CGU which has exported items which increases the likelihood the linker won't throw away our dead functions and we pick the smallest to minimize the impact on compilation times for crates with very large CGUs.

Fixes 
Fixes 
Fixes 
Fixes 

r? ```@tmandry```
cc ```@richkadel```

This PR is not urgent so please don't let it interrupt your holidays! 🎄 🎁
2022-01-13 08:11:20 +01:00
Matthias Krüger
b45a819bef
Rollup merge of - oli-obk:welcome_opaque_types_into_the_fold, r=nikomatsakis
Welcome opaque types into the fold

r? ```@nikomatsakis``` because idk who else to bug on the type_op changes

The commits have explanations in them. The TLDR is that

* 5c46002273 stops the "recurse and replace" scheme that replaces opaque types with their canonical inference var by just doing that ahead of time
* bdeeb07bf6 does not affect anything on master afaict, but since opaque types generate obligations when instantiated, and lazy TAIT instantiates opaque types *everywhere*, we need to properly handle obligations here instead of just hoping no problematic obligations ever come up.
2022-01-13 08:11:19 +01:00
Matthias Krüger
e045c79c2d
Rollup merge of - yaahc:error-reporter, r=m-ou-se
Add `std::error::Report` type

This is a continuation of https://github.com/rust-lang/rust/pull/90174, split into a separate PR since I cannot push to ```````@seanchen1991``````` 's fork
2022-01-13 08:11:18 +01:00
Matthias Krüger
3e7bc08b6c
Rollup merge of - euclio:tuple-variant-field-section, r=GuillaumeGomez
rustdoc: do not emit tuple variant fields if none are documented

Fixes .

Before:

![2021-12-15T22:26:41](https://user-images.githubusercontent.com/1372438/146302871-4d265433-b9aa-4e53-adfb-e7cb92107180.png)

After:

![2021-12-15T22:27:01](https://user-images.githubusercontent.com/1372438/146302872-e39eda3d-2fb2-4fb9-aae7-2008e4e1b4dd.png)
2022-01-13 08:11:17 +01:00
Matthias Krüger
c7ada001ec
Rollup merge of - Fearyncess:master, r=alexcrichton
Make rlib metadata strip works with MIPSr6 architecture

Because MIPSr6 has many differences with previous MIPSr2 arch, the previous rlib metadata stripping code in `rustc_codegen_ssa` is only for MIPSr2/r3/r5 (which share the same elf e_flags).

This commit fixed this problem. It makes `rustc_codegen_ssa` happy when compiling rustc for MIPSr6 target or hosts.

e_flags REF: e356027016/llvm/include/llvm/BinaryFormat/ELF.h (L562)
2022-01-13 08:11:16 +01:00
hafeoz
7b74ded9a0 Fix lints documents 2022-01-13 03:57:44 +00:00
bors
256721ee51 Auto merge of - m-ou-se:thread-join-simplify, r=Mark-Simulacrum
Simpilfy thread::JoinInner.

`JoinInner`'s `native` field was an `Option`, but that's unnecessary.

Also, thanks to `Arc::get_mut`, there's no unsafety needed in `JoinInner::join()`.
2022-01-13 03:46:19 +00:00
bors
e916815d21 Auto merge of - djc:rustdoc-askama, r=jsha
Migrate rustdoc from Tera to Askama

See .

Should probably get a benchmarking run to verify if it has the intended effect on rustdoc performance.

cc `@jsha` `@jyn514.`
2022-01-13 00:29:34 +00:00
Eric Huss
5b2d5da0d3 Update RELEASES for 1.58. 2022-01-12 16:05:30 -08:00
Camille GILLOT
441c1a6c50 Bless tests. 2022-01-12 23:41:28 +01:00
Camille GILLOT
2e0a80c8c0 Err about fn traits in a single place. 2022-01-12 23:13:52 +01:00
bors
124555a69e Auto merge of - In-line:no-cache-selector-lrc, r=Mark-Simulacrum
Remove ArenaCacheSelector for visible_parent_map query ( + LRC)
2022-01-12 21:04:40 +00:00
Michael Goulet
8568f44fe1 suggest deref/unboxing before wrapping variant 2022-01-12 12:01:01 -08:00
Camille GILLOT
7b285925c8 Ensure res and module are consistent with each other.
The `record_used` parameter changes the result, so we must pass the same
value for initial and module resolution.
2022-01-12 20:04:06 +01:00
bors
60e68d68c6 Auto merge of - Jarcho:manual_memcpy_8160, r=flip1995
`manual_memcpy` fix

fixes 

Ideally this would work with `VecDeque`, but the current interface is unsuitable for it. At a minimum something like `range_as_slices` would be needed.

changelog: Don't lint `manual_memcpy` on `VecDeque`
changelog: Suggest `copy_from_slice` for `manual_memcpy` when applicable
2022-01-12 18:44:34 +00:00
bors
1bd4fdc943 Auto merge of - matthiaskrgr:rollup-wrctcef, r=matthiaskrgr
Rollup of 14 pull requests

Successful merges:

 -  (Tweak sentence in `transmute` docs)
 -  (Error when selected impl is not const in constck)
 -  (Document Box<T> FFI guarantee in 1.41.0 release notes)
 -  (rustdoc: Display "private fields" instead of "fields omitted")
 -  (RELEASES.md: Add 1.58 release note for `File::options` stabilization)
 -  (Extended the note on the use of `no_run` attribute)
 -  (Improve documentation for File::options to give a more likely example)
 -  (Fix doc formatting for time.rs)
 -  (Add note about upstream commit musl-patch-configure.diff is derived from)
 -  (Add missing suffix for sidebar-items script path)
 -  (Eliminate "boxed" wording in `std::error::Error` documentation)
 -  (Update AsmArgs field visibility for rustfmt)
 -  (⬆️ rust-analyzer)
 -  (Fix rust logo style)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-01-12 17:57:50 +00:00
Jason Newcomb
062db10c12 Add manual_memcpy_test for VecDeque 2022-01-12 12:33:47 -05:00
bors
5479024250 Auto merge of - camsteffen:test-tweaks, r=flip1995
Some test code cleanup

changelog: none

Mainly moves /clippy_workspace_tests into /tests and combines the two dogfood tests which can't run concurrently.
2022-01-12 17:19:58 +00:00
bors
133b3668bb Auto merge of - camsteffen:which-rustfmt, r=xFrednet
Cache rustfmt path

changelog: none

Call `rustup which rustfmt` and use the output. This shaves off  ~0.7 seconds for `cargo dev fmt` for me.
2022-01-12 17:03:52 +00:00
Cameron Steffen
90bf72c2cd Only run dogfood on linux in CI 2022-01-12 11:00:26 -06:00
bors
6f33f690ea Auto merge of - Alexendoo:disallowed_methods_primitives, r=flip1995
Allow primitive types in disallowed_methods

Fixes 

changelog: `disallowed_methods`: Now can disallow methods of primitive types
2022-01-12 16:47:45 +00:00
Alex Macleod
04eb27aeaf Use method name from conf::DisallowedMethod
Since def_path_str returns e.g. "core::f32::<impl f32>::clamp" for
"f32::clamp"
2022-01-12 16:23:22 +00:00
bors
7c82ae1c12 Auto merge of - paolobarbolini:size-of-as-bits, r=flip1995
Add `manual_bits` lint

Closes 

---

changelog: new lint: [`manual_bits`]
2022-01-12 16:21:14 +00:00
Alex Macleod
91581f6d5e Resolve primitive impls in clippy_utils::path_to_res 2022-01-12 16:20:23 +00:00
Paolo Barbolini
166737f3cb Add manual_bits lint 2022-01-12 16:46:57 +01:00
bors
b9cae79d7f Auto merge of - ojeda:doc-codegen-change, r=camsteffen
`README`: document that Clippy may change codegen

Currently, Clippy does not guarantee the same codegen will be produced.
Therefore, it should not be used as an universal replacement for `rustc`.

See https://github.com/rust-lang/rust-clippy/issues/8035.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

fixes 
changelog: document that Clippy may change codegen
2022-01-12 15:11:08 +00:00
lcnr
962582981f remove unused FIXME 2022-01-12 16:09:01 +01:00
bors
ae01c4ab3c Auto merge of - camsteffen:no-in-band-liftetimes, r=flip1995
Stop using `in_band_lifetimes`

Per 

changelog: none
2022-01-12 14:25:11 +00:00
Oli Scherer
956db072a8 Don't fall back to crate-level opaque type definitions.
That would just hide bugs, as it works accidentally if the opaque type
is defined at the crate level.
2022-01-12 14:06:11 +00:00
bors
0d94167a23 Auto merge of - camsteffen:no-method-call-macro, r=flip1995
Remove method_call! macro

This is possible now that `SymbolStr` is removed from rustc.

changelog: none
2022-01-12 13:59:12 +00:00
bors
37e9985e86 Auto merge of - Jarcho:deref_addrof_8247, r=flip1995
Fix `deref_addrof`

fixes 

This would supersede 

changelog: Don't lint `deref_addrof` when the dereference and the borrow occur in different contexts
2022-01-12 13:25:58 +00:00
Matthias Krüger
05dd1e4a2b
Rollup merge of - GuillaumeGomez:fix-rust-logo-style, r=jsha
Fix rust logo style

The style on the rust logo is currently broken:

![Screenshot from 2022-01-11 13-36-30](https://user-images.githubusercontent.com/3050060/148946754-a1a57253-bed0-44cf-a41c-83e0eecbd6b5.png)

With this fix, we're back to normal:

![Screenshot from 2022-01-11 13-42-07](https://user-images.githubusercontent.com/3050060/148946778-99f44678-aac1-419f-bb8c-ffa837e0c1ee.png)

I also used a GUI test to prevent future silent regressions.

r? ```@jsha```
2022-01-12 07:12:19 +01:00
Matthias Krüger
8f002a0a83
Rollup merge of - lnicola:rust-analyzer-2022-01-11, r=lnicola
⬆️ rust-analyzer

r? ```@ghost```
2022-01-12 07:12:17 +01:00