Commit graph

161343 commits

Author SHA1 Message Date
Ellen
73945fd620 fix bug 2022-01-14 00:27:12 +00:00
Esteban Kuber
cfc0bd1258 Parse Ty? as Option<Ty> and provide structured suggestion
Swift has specific syntax that desugars to `Option<T>` similar to our
`?` operator, which means that people might try to use it in Rust. Parse
it and gracefully recover.
2022-01-14 00:07:23 +00:00
Eric Holk
a1173cf074 Fix non-MSVC test 2022-01-13 15:56:51 -08:00
Eric Holk
05e1f0d769 Generate more precise generator names
Currently all generators are named with a `generator$N` suffix,
regardless of where they come from. This means an `async fn` shows up as
a generator in stack traces, which can be surprising to async
programmers since they should not need to know that async functions are
implementated using generators.

This change generators a different name depending on the generator kind,
allowing us to tell whether the generator is the result of an async
block, an async closure, an async fn, or a plain generator.
2022-01-13 15:38:03 -08:00
Andre Bogus
5431d5b58e Add rustc_diagnostic_item attribute to AtomicBool 2022-01-13 23:32:49 +01:00
pierwill
7e055c6837 librustdoc: Address some clippy lints
Also ignore clippy's "collapsible if..." lints.
2022-01-13 16:29:39 -06:00
Maxwase
a7092f91a6 Typos fix 2022-01-14 00:17:11 +03:00
Ibraheem Ahmed
f88b501914
fix stability attribute for tcp::IntoIncoming 2022-01-13 16:04:02 -05:00
Mahdi Dibaiee
ae20500d76
rustdoc: add intra-doc trait impl test for extern types 2022-01-13 20:23:24 +00:00
Mahdi Dibaiee
9ff8ae097e
rustdoc: fix intra-link for generic trait impls 2022-01-13 20:23:24 +00:00
Andrew Archibald
adc3e669fa Escape pipes in Markdown tables 2022-01-13 13:20:30 -07:00
Guillaume Gomez
241d97750f Update documentation for doc_cfg 2022-01-13 21:08:02 +01:00
Jack Huey
e8e32e48c4 Ignore static lifetimes for GATs outlives lint 2022-01-13 15:07:12 -05:00
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
5cada57f30 Auto merge of #8273 - SeeSpring:apply_not_unsafe_ptr_arg_deref_to_type_aliases, r=llogiq
Apply `not_unsafe_ptr_arg_deref` to type aliases

changelog: Apply [`not_unsafe_ptr_arg_deref`] to type aliases
2022-01-13 18:51:19 +00:00
bors
22e491ac7e Auto merge of #89861 - nbdd0121:closure, r=wesleywiser
Closure capture cleanup & refactor

Follow up of #89648

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
Andy Russell
51d7665be1
rustdoc: remove hand-rolled isatty 2022-01-13 11:13:01 -05:00
hafeoz
7cc6a73936 Remove asm feature from lints example 2022-01-13 15:59:24 +00:00
SeeSpring
875b240083 Apply not_unsafe_ptr_arg_deref to type aliases 2022-01-13 09:47:56 -05: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 #8272 - 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 #92832 - 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 #92807 - 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 (rust-lang/cargo#10265)
- feat: support rustflags per profile (rust-lang/cargo#10217)
- Make bors ignore the PR template so it doesn't end up in merge messages (rust-lang/cargo#10267)
- Be resilient to most IO error and filesystem loop while walking dirs (rust-lang/cargo#10214)
- Remove the option to disable pipelining (rust-lang/cargo#10258)
- Always ask rustc for messages about artifacts, and always process them (rust-lang/cargo#10255)
2022-01-13 08:11:22 +01:00
Matthias Krüger
ac81a13640
Rollup merge of #92334 - dtolnay:rustdocmatcher, r=camelid,GuillaumeGomez
rustdoc: Preserve rendering of macro_rules matchers when possible

Fixes #92331. This approach restores the behavior prior to #86282 **if** the matcher token held by the compiler **and** the matcher token found in the source code are identical TokenTrees. Thus #86208 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 #92277 - 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 #92142 - 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 #85461 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 #91661
Fixes #86177
Fixes #85718
Fixes #79622

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 #92006 - 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 #91938 - 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 #91687 - euclio:tuple-variant-field-section, r=GuillaumeGomez
rustdoc: do not emit tuple variant fields if none are documented

Fixes #90824.

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 #90001 - 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 #92553 - 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 #92526 - djc:rustdoc-askama, r=jsha
Migrate rustdoc from Tera to Askama

See #84419.

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
pierwill
68515cb668 Rename environment variable for overriding rustc version 2022-01-12 15:31:26 -06:00
bors
124555a69e Auto merge of #92169 - 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
Tomasz Miąsko
b085eb0b10 Error codes specific to LLVM-style inline asssembly are no longer emitted 2022-01-12 21:43:36 +01:00
Tomasz Miąsko
d4fb6ec683 Remove LLVM-style inline assembly from rustfmt 2022-01-12 21:43:35 +01: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