Commit Graph

157422 Commits

Author SHA1 Message Date
Caleb Cartwright 9e31fab58c docs(rustc_ast): update crate descriptions 2021-11-02 21:11:17 -05:00
Will Crichton 4b5e08ad79 Fix URL for scrape-examples.js in rustdoc page template 2021-11-02 19:10:50 -07:00
bors 3802025f40 Auto merge of #90516 - matthiaskrgr:rollup-3dmfjkj, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #90084 (Make printed message match the code comment)
 - #90354 (Document clippy on nightly-rustc)
 - #90417 (stabilize `relaxed_struct_unsize`)
 - #90472 (Clarify what to do with accepted feature gates)
 - #90500 (Update Clippy dependencies)
 - #90502 (Split doc_cfg and doc_auto_cfg features)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-11-03 01:52:17 +00:00
inquisitivecrystal bd194da4c2 Implement `RefUnwindSafe` for `Rc<T>` 2021-11-02 16:30:55 -07:00
Matthias Krüger e38844a9d8
Rollup merge of #90502 - GuillaumeGomez:split-doc-cfg-feature, r=jyn514
Split doc_cfg and doc_auto_cfg features

Part of #90497.

With this feature, `doc_cfg` won't pick up items automatically anymore.

cc `@Mark-Simulacrum`
r? `@jyn514`
2021-11-02 23:48:50 +01:00
Matthias Krüger c2cbf55323 Rollup merge of #90500 - xFrednet:00000-update-clippy-deps, r=flip1995
Update Clippy dependencies

Clippy has two outdated dependencies, where one indirect dependency has been flagged by rustsec for dropping a lifetime. See [RUSTSEC-2020-0146](https://rustsec.org/advisories/RUSTSEC-2020-0146). This PR updates these dependencies.

With previous dependency updates, it was tried to prevent duplicates in the `Cargo.lock` file of rust-lang/rust. I've tried to keep this in mind with this update.

* Dependency `semver`
    * Used in `src/tools/cargo/Cargo.toml` as version `1.0.3`
    * Used in `src/tools/rust-analyzer/crates/project_model/Cargo.toml` as version `1`
    * Updated in Clippy from `0.11` to `1.0` (Clippy usually defines the major and minor patch version). The `Cargo.lock` file lists `1.0.3` which is one patch version behind the most recent one but prevents a duplicate with cargo's pinned version.
* Dependency `cargo_metadata`
    * Used in several tools as `0.14`
    * Used in `src/tools/tidy` and `src/tools/rls` as `0.12`
    * Updated in Clippy from `0.12` to `0.14`

All updates to the `Cargo.lock` have been done automatically by `x.py`.

There are still some tools with these outdated dependencies. Clippy didn't require any changes, and it would be likely that the others could also be updated without any problem. Let me know if I should try to update them as well 🙃.

Keep up the good work, whoever is reading this 🦀

---

For Clippy:

changelog: none
2021-11-02 23:48:49 +01:00
Matthias Krüger 673aafe70e
Rollup merge of #90500 - xFrednet:00000-update-clippy-deps, r=flip1995
Update Clippy dependencies

Clippy has two outdated dependencies, where one indirect dependency has been flagged by rustsec for dropping a lifetime. See [RUSTSEC-2020-0146](https://rustsec.org/advisories/RUSTSEC-2020-0146). This PR updates these dependencies.

With previous dependency updates, it was tried to prevent duplicates in the `Cargo.lock` file of rust-lang/rust. I've tried to keep this in mind with this update.

* Dependency `semver`
    * Used in `src/tools/cargo/Cargo.toml` as version `1.0.3`
    * Used in `src/tools/rust-analyzer/crates/project_model/Cargo.toml` as version `1`
    * Updated in Clippy from `0.11` to `1.0` (Clippy usually defines the major and minor patch version). The `Cargo.lock` file lists `1.0.3` which is one patch version behind the most recent one but prevents a duplicate with cargo's pinned version.
* Dependency `cargo_metadata`
    * Used in several tools as `0.14`
    * Used in `src/tools/tidy` and `src/tools/rls` as `0.12`
    * Updated in Clippy from `0.12` to `0.14`

All updates to the `Cargo.lock` have been done automatically by `x.py`.

There are still some tools with these outdated dependencies. Clippy didn't require any changes, and it would be likely that the others could also be updated without any problem. Let me know if I should try to update them as well 🙃.

Keep up the good work, whoever is reading this 🦀

---

For Clippy:

changelog: none
2021-11-02 23:48:49 +01:00
Matthias Krüger bc26dbba11
Rollup merge of #90472 - joshtriplett:clarify-feature-acceptance, r=jyn514
Clarify what to do with accepted feature gates

The documentation only referenced `removed.rs`, but feature gates for
accepted features move to `accepted.rs`.
2021-11-02 23:48:48 +01:00
Matthias Krüger bc487f7dd2
Rollup merge of #90417 - lcnr:stabilize-relaxed-struct-unsizing, r=wesleywiser
stabilize `relaxed_struct_unsize`

closes #81793

the fcp is already complete.
2021-11-02 23:48:47 +01:00
Matthias Krüger 40f01aaa56
Rollup merge of #90354 - xFrednet:00000-lets-deploy-clippy-docs, r=Mark-Simulacrum
Document clippy on nightly-rustc

Adding Clippy's docs to nightly-rustc, based on commit 01cf0bde. This PR only adds `clippy_utils` to the documentation. I've decided to only document one crate for now, as `clippy_lints` etc. contain very specific and undocumented functions which aren't really reusable. I'm guessing that they would mostly clutter up the search results with little benefit.

`./x.py --stage 1 doc src/tools/clippy` if working fine now after the help that ```````@jyn514``````` and ```````@ehuss``````` have provided. A big THANK YOU to them!
2021-11-02 23:48:46 +01:00
Matthias Krüger 21d2f29533
Rollup merge of #90084 - noncombatant:patch-2, r=steveklabnik
Make printed message match the code comment

I think this code is getting L0, not L1 cache size, if I'm reading the Intel manual right. (I might not be.) Either way, the code comment and the printed message should match, whichever way is right. :)
2021-11-02 23:48:46 +01:00
bors 6f40fa4353 Auto merge of #90464 - lnicola:rust-analyzer-2021-11-01, r=lnicola
⬆️ rust-analyzer

r? `@ghost`
2021-11-02 22:45:27 +00:00
bors 4d26c5c82c Auto merge of #7904 - Serial-ATA:improve-doc-suggestion, r=xFrednet
Add suggestion to missing backticks error

changelog: Add a machine applicable suggestion for the [`doc_markdown`] missing backticks lint

closes: #7737
2021-11-02 21:07:21 +00:00
Serial 3732d117da Specify fixable doc tests 2021-11-02 17:04:35 -04:00
Serial 0db8c52291 Add suggestion to missing backticks error 2021-11-02 16:50:47 -04:00
bors c68af43b3d Auto merge of #7916 - samueltardieu:double-colon-prefix, r=xFrednet
Advise to put a :: prefix inside the ticks

Fixes #7914.

changelog: Keep an initial `::` when [`doc_markdown`] suggests to use ticks
2021-11-02 17:02:06 +00:00
Samuel Tardieu 7f8198acad Advise to put a :: prefix inside the ticks 2021-11-02 17:57:50 +01:00
Takayuki Maeda acb9f9ba38 add a suggestion about undeclared `alloc` module 2021-11-03 01:44:01 +09:00
bors b6c8168cff Auto merge of #7918 - samueltardieu:use-config-toml, r=flip1995
Use .cargo/config.toml instead of .cargo/config

`.cargo/config.toml` is the preferred form for the local configuration file. This is emphasized in _The Cargo Book_ with the following note:

> Note: Cargo also reads config files without the `.toml` extension, such as `.cargo/config`. Support for the `.toml` extension was added in version 1.39 and is the preferred form.

Moreover, this helps with toml-aware text editors as they will recognize the file extension.

changelog: none
2021-11-02 16:16:20 +00:00
Guillaume Gomez d7afbf61d8 Also check for feature gates in "src/test/rustdoc" 2021-11-02 17:15:11 +01:00
Samuel Tardieu a68c13563a Use .cargo/config.toml instead of .cargo/config
`.cargo/config.toml` is the preferred form for the local configuration
file. This is emphasized in _The Cargo Book_ with the following note:

> Note: Cargo also reads config files without the `.toml` extension, such
> as `.cargo/config`. Support for the `.toml` extension was added in version
> 1.39 and is the preferred form.

Moreover, this helps with toml-aware text editors as they will recognize
the file extension.
2021-11-02 17:08:10 +01:00
Guillaume Gomez d50a4753b8 Split doc_cfg and doc_auto_cfg features 2021-11-02 16:55:50 +01:00
bors 18bc4bee97 Auto merge of #90495 - lnicola:freebsd-kvm, r=Mark-Simulacrum
Pull in `libkvm` on FreeBSD

This is needed when updating `libc` after https://github.com/rust-lang/libc/pull/2451.

Spotted in #90464 where it caused `rust-analyzer` to fail to link.

Similar to #88676.
2021-11-02 15:19:15 +00:00
Josh Triplett eb23a7333f Add link to documentation about feature gates 2021-11-02 15:30:28 +01:00
bors 2ebd535eae Auto merge of #7906 - smoelius:master, r=camsteffen
Fix #7903

Fixes #7903 (cc: `@Arnavion)`

changelog: none (bug is in same release)

r? `@camsteffen`
2021-11-02 14:06:36 +00:00
xFrednet db9e012927 Update clippy dependencies
* semver = "0.11" -> "1.0"
* cargo_metadata = "0.12" -> "0.14"
2021-11-02 14:19:31 +01:00
xFrednet fd41336c4c Update clippy dependencies
* semver = "0.11" -> "1.0"
* cargo_metadata = "0.12" -> "0.14"
2021-11-02 14:19:31 +01:00
bors c3190c1eb4 Auto merge of #90442 - ChrisDenton:win-tls-dtor, r=alexcrichton
Windows thread-local keyless drop

`#[thread_local]` allows us to maintain a per-thread list of destructors. This also avoids the need to synchronize global data (which is particularly tricky within the TLS callback function).

r? `@alexcrichton`
2021-11-02 12:15:08 +00:00
bors 18cc4e74f8 Auto merge of #7907 - Alexendoo:non-ascii-restriction, r=flip1995
Move non_ascii_literal to restriction

It feels like the more apt category, since cases where you'd want it enabled would be pretty specific

changelog: Move [`non_ascii_literal`] to `restriction`
2021-11-02 10:36:26 +00:00
bors 9720619432 Auto merge of #7901 - samueltardieu:fix-7893, r=xFrednet,flip1995
Prevent clippy::needless_lifetimes false positive in async function definition

Scan `OpaqueDef` bounds for lifetimes as well. Those `OpaqueDef` instances are generated while desugaring an `async` function definition.

This fixes #7893

changelog: Prevent [`clippy::needless_lifetimes`] false positive in `async` function definition
2021-11-02 10:23:15 +00:00
bors 276e8951f1 Auto merge of #7851 - nbdd0121:master, r=flip1995
Fix manual_assert and match_wild_err_arm for `#![no_std]` and Rust 2021

Rust 2015 `std::panic!` has a wrapping block while `core::panic!` and Rust 2021 `std::panic!` does not. See rust-lang/rust#88919 for details.

Note that the test won't pass until clippy changes in rust-lang/rust#88860 is synced.

---

changelog: Fix [`manual_assert`] and [`match_wild_err_arm`] for `#![no_std]` and Rust 2021.

Fixes #7723
2021-11-02 10:09:47 +00:00
Samuel Tardieu 9bcf966e35 Add test case for `clippy::needless_lifetimes` in async context
Edition needs to be set to 2018 due to the use of `async`.
2021-11-02 10:57:23 +01:00
bors 38d80257d0 Auto merge of #7726 - dswij:unseparated-literal-suffix, r=flip1995
Unseparated literal suffix

Closes #7658

Since `literal_suffix` style is opinionated, we should disable by default and only enforce if it's stated as so.

changelog: [`unseparated_literal_suffix`] is renamed to `literal_suffix`, adds a new configuration `literal-suffix-style` to enforce a certain style writing literal_suffix. Possible values for `literal-suffix-style`: `"separated"`, `"unseparated"`
2021-11-02 09:57:12 +00:00
Samuel Tardieu 3f84010688 Examine lifetimes in `OpaqueDef` bounds as well
Fix #7893.
2021-11-02 10:54:58 +01:00
bors 4e355ebb6e Auto merge of #7819 - rust-lang:avoid-linting-impossible-truncation, r=flip1995
avoid linting `possible_truncation` on bit-reducing operations

---

*Please write a short comment explaining your change (or "none" for internal only changes)*

changelog: avoid linting `possible_truncation` on bit-reducing operations
2021-11-02 09:44:27 +00:00
Laurențiu Nicola ee3b46689b Pull in libkvm on FreeBSD 2021-11-02 10:44:14 +02:00
bors 6384dca100 Auto merge of #90439 - m-ou-se:thread-is-running, r=Mark-Simulacrum
Add JoinHandle::is_running.

This adds:
```rust
impl<T> JoinHandle<T> {
    /// Checks if the the associated thread is still running its main function.
    ///
    /// This might return `false` for a brief moment after the thread's main
    /// function has returned, but before the thread itself has stopped running.
    pub fn is_running(&self) -> bool;
}
```
The usual way to check if a background thread is still running is to set some atomic flag at the end of its main function. We already do that, in the form of dropping an Arc which will reduce the reference counter. So we might as well expose that information.

This is useful in applications with a main loop (e.g. a game, gui, control system, ..) where you spawn some background task, and check every frame/iteration whether the background task is finished to .join() it in that frame/iteration while keeping the program responsive.
2021-11-02 08:11:57 +00:00
bors dca3f1b786 Auto merge of #90490 - ehuss:update-cargo, r=ehuss
Update cargo

3 commits in 6c1bc24b8b49d4bc965f67d7037906dc199c72b7..94ca096afbf25f670e76e07dca754fcfe27134be
2021-10-24 17:51:41 +0000 to 2021-10-29 14:45:06 +0000
- Chore: prefer `HashMap::from` rather than collecting `Vec` of tuples (rust-lang/cargo#10018)
- Change --scrape-examples flag to -Z rustdoc-scrape-examples (rust-lang/cargo#10017)
- Scrape code examples from examples/ directory for Rustdoc (rust-lang/cargo#9525)
2021-11-02 03:18:41 +00:00
bors 08b7e87843 Auto merge of #7911 - giraffate:small_fixes_for_missing_backticks, r=Manishearth
Small fixes for missing backticks in doc

changelog: none
2021-11-02 00:19:57 +00:00
Takayuki Nakata ec456de2a3 Small fixes for missing backticks in doc 2021-11-02 09:09:22 +09:00
Samuel E. Moelius III 5edb02adad Fix #7903 2021-11-01 19:33:27 -04:00
Noah Lev 8e4bcdf84b List all cases explicitly in `Doc{Folder,Visitor}` 2021-11-01 16:15:46 -07:00
Eric Huss 6404dbaf8d Update cargo 2021-11-01 16:08:25 -07:00
bors 6225262562 Auto merge of #90457 - rusticstuff:use-curl-ca-bundle, r=Mark-Simulacrum
CI: Use ubuntu image to download openssl, curl sources, cacert.pem for x86 dist builds

The dist-x86_64 and dist-i686 docker builds are failing again (see [try build](https://github.com/rust-lang-ci/rust/runs/4060836540?check_suite_focus=true)) because python.org renewed its certificate with a CA cert that is too new for debian:6.

In order to solve this once and for all this PR moves the curl and openssl downloads to a new  ubuntu:20.04 "stage-0" docker build and copies the downloaded tarballs over to build them in the "stage-1" debian:6 context. It also downloads the cacert.pem file from the curl website and uses it by pointing the `CURL_CA_BUNDLE` environment variable to it.
2021-11-01 21:21:53 +00:00
Hans Kratz aef51a0697 Ignore files copied from previous stage when generating hash. 2021-11-01 19:20:07 +01:00
bors db062de72b Auto merge of #90406 - nbdd0121:panic, r=cjgillot
Collect `panic/panic_bounds_check` during monomorphization

This would prevent link time errors if these functions are `#[inline]` (e.g. when `panic_immediate_abort` is used).

Fix #90405
Fix rust-lang/cargo#10019

`@rustbot` label: T-compiler A-codegen
2021-11-01 17:18:57 +00:00
Hans Kratz 37476287bf Use apple-a14 as target CPU for aarch64-apple-darwin.
After updating the minimum required LLVM version to 12 we can use
apple-a14 as that is closer in features to the Apple M1 than the A12.
Once the minimum required LLVM version is updated to 13 we can use
apple-m1.
2021-11-01 17:03:07 +01:00
Gary Guo 14e0390fdf Account for revisions in missing-test-files 2021-11-01 15:47:34 +00:00
Gary Guo 7e5f99ab58 Fix manual_assert for `#![no_std]` and Rust 2021 2021-11-01 15:47:33 +00:00
Chris Denton 1048651fa3
Run destructors from existing tls callback 2021-11-01 15:19:49 +00:00