Commit graph

207984 commits

Author SHA1 Message Date
Josh Triplett 326ef470a8 Add IsTerminal trait to determine if a descriptor or handle is a terminal
The UNIX and WASI implementations use `isatty`. The Windows
implementation uses the same logic the `atty` crate uses, including the
hack needed to detect msys terminals.

Implement this trait for `File` and for `Stdin`/`Stdout`/`Stderr` and
their locked counterparts on all platforms. On UNIX and WASI, implement
it for `BorrowedFd`/`OwnedFd`. On Windows, implement it for
`BorrowedHandle`/`OwnedHandle`.

Based on https://github.com/rust-lang/rust/pull/91121

Co-authored-by: Matt Wilkinson <mattwilki17@gmail.com>
2022-10-15 00:35:38 +01:00
bors 8147e6e427 Auto merge of #103069 - matthiaskrgr:rollup-xxsx6sk, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #102092 (refactor: use grep -E/-F instead of fgrep/egrep)
 - #102781 (Improved documentation for `std::io::Error`)
 - #103017 (Avoid dropping TLS Key on sgx)
 - #103039 (checktools: fix comments)
 - #103045 (Remove leading newlines from integer primitive doc examples)
 - #103047 (Update browser-ui-test version to fix some flaky tests)
 - #103054 (Clean up rust-logo rustdoc GUI test)
 - #103059 (Fix `Duration::{try_,}from_secs_f{32,64}(-0.0)`)
 - #103067 (More alphabetical sorting)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-10-14 22:56:53 +00:00
Matthias Krüger a96f1a8a1e
Rollup merge of #103067 - Nilstrieb:tidy-likes-the-alphabet, r=jackh726
More alphabetical sorting

Sort and enforce a few more things. The biggest change here is sorting all target features.
2022-10-14 23:43:46 +02:00
Matthias Krüger 03a521b4fe
Rollup merge of #103059 - beetrees:duration-from-negative-zero, r=thomcc
Fix `Duration::{try_,}from_secs_f{32,64}(-0.0)`

Make `Duration::{try_,}from_secs_f{32,64}(-0.0)` return `Duration::ZERO` (as they did before #90247) instead of erroring/panicking.

I'll update this PR to remove the `#![feature(duration_checked_float)]` if #102271 is merged before this PR.

Tracking issue for `try_from_secs_f{32,64}`: #83400
2022-10-14 23:43:46 +02:00
Matthias Krüger 62a9c32848
Rollup merge of #103054 - GuillaumeGomez:cleanup-rust-logo-test, r=notriddle
Clean up rust-logo rustdoc GUI test

r? `@notriddle`
2022-10-14 23:43:45 +02:00
Matthias Krüger fa1279fbb5
Rollup merge of #103047 - GuillaumeGomez:update-browser-ui-test, r=notriddle
Update browser-ui-test version to fix some flaky tests

Part of #93784.

It should fix the new spurious failure found in https://github.com/rust-lang/rust/pull/102744.

r? ``@notriddle``
2022-10-14 23:43:45 +02:00
Matthias Krüger 1a5d8a5c59
Rollup merge of #103045 - lukas-code:blank-lines, r=GuillaumeGomez
Remove leading newlines from integer primitive doc examples

fixes https://github.com/rust-lang/rust/issues/103043

```@rustbot``` label +A-docs
2022-10-14 23:43:44 +02:00
Matthias Krüger 9f22530bae
Rollup merge of #103039 - RalfJung:checktools, r=Dylan-DPC
checktools: fix comments

This bothers me each time I see it, time to fix it. ;)
r? ```@Mark-Simulacrum```
2022-10-14 23:43:44 +02:00
Matthias Krüger d47b755683
Rollup merge of #103017 - fortanix:raoul/sgx_tls_fix, r=ChrisDenton
Avoid dropping TLS Key on sgx

#102655 reenabled dropping thread local `Key` on every platform ([library/std/src/sys_common/thread_local_key.rs](fa0ca783f8 (diff-5cb9acf9e243f35c975fa9fbac4885519dc104626bc03610dfa7a20bc79641ceL237-R215))). That's causing problems at least for sgx.

cc: `@jethrogb` `@ChrisDenton`
2022-10-14 23:43:43 +02:00
Matthias Krüger fbb0c31544
Rollup merge of #102781 - StackOverflowExcept1on:master, r=joshtriplett
Improved documentation for `std::io::Error`
2022-10-14 23:43:43 +02:00
Matthias Krüger f72d76df5a
Rollup merge of #102092 - kxxt:patch-1, r=joshtriplett
refactor: use grep -E/-F instead of fgrep/egrep

`egrep` and `fgrep` are obsolescent now. This PR updates  all `egrep` and `fgrep` commands to `grep -E` and `grep -F`.

Running egrep/fgrep command with grep v3.8 will output the following warning to stderr:

```
egrep: warning: egrep is obsolescent; using grep -E
```

- https://www.phoronix.com/news/GNU-Grep-3.8-Stop-egrep-fgrep
- https://lists.gnu.org/archive/html/info-gnu/2022-09/msg00001.html
2022-10-14 23:43:42 +02:00
nils 24ce4cfa20
Remove the describe method from the QueryDescription trait
It was called directly already, but now it's even more useless since it
just forwards to the free function. Call it directly.
2022-10-14 22:35:56 +02:00
Nilstrieb 167b3bd3b2
Get rid of rustc_query_description!
Queries can provide an arbitrary expression for their description and
their caching behavior. Before, these expressions where stored in a
`rustc_query_description` macro emitted by the `rustc_queries` macro,
and then used in `rustc_query_impl` to fill out the methods for the
`QueryDescription` trait.

Instead, we now emit two new modules from `rustc_queries` containing the
functions with the expressions. `rustc_query_impl` calls these functions
now instead of invoking the macro.

Since we are now defining some of the functions in
`rustc_middle::query`, we now need all the imports for the key types
there as well.
2022-10-14 22:35:56 +02:00
Nilstrieb 1566273f48
Remove unsued variable in query macro 2022-10-14 22:32:05 +02:00
bors bf15a9e526 Auto merge of #101030 - woppopo:const_location, r=scottmcm
Constify `Location` methods

Tracking issue: #102911

Example: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=4789884c2f16ec4fb0e0405d86b794f5
2022-10-14 20:15:51 +00:00
nils b00cb04037
Sort target features alphabetically 2022-10-14 22:01:18 +02:00
nils 1b8012fa10
Also run alphabetical check in src and library 2022-10-14 22:00:44 +02:00
nils 3c0062641d
Add some tidy-alphabetical 2022-10-14 21:18:03 +02:00
Takayuki Maeda 062ea9ce4d remove no_core feature 2022-10-15 02:45:11 +09:00
bors 5819f419a7 Auto merge of #102783 - RalfJung:tls, r=thomcc
sync thread_local key conditions exactly with what the macro uses

This makes the `cfg` in `mod.rs` syntactically the same as those in `local.rs`.

I don't think this should actually change anything, but seems better to be consistent?
I looked into this due to https://github.com/rust-lang/rust/issues/102549, but this PR would make it *less* likely that `__OsLocalKeyInner` is going to get provided, so this cannot help with that issue.

r? `@thomcc`
2022-10-14 16:43:46 +00:00
bors 018b8429cf Auto merge of #13415 - lnicola:ovsx-timeout, r=lnicola
internal: Set a timeout when publishing to OVSX

CC https://github.com/rust-lang/rust-analyzer/issues/11080#issuecomment-1279212120
2022-10-14 16:39:16 +00:00
Laurențiu Nicola f94d8d8940 Set a timeout when publishing to OVSX 2022-10-14 19:38:50 +03:00
Raoul Strackx c46185bea0 Bugfix: keep TLS data in sync 2022-10-14 17:07:18 +02:00
beetrees c9948f5c5f
Fix Duration::{try_,}from_secs_f{32,64}(-0.0) 2022-10-14 16:07:09 +01:00
bors af987dafcb Auto merge of #13414 - lnicola:bump-cache, r=lnicola
minor: Bump `Swatinem/rust-cache` to move off Node 12
2022-10-14 14:32:00 +00:00
Laurențiu Nicola d2d1c1e3ca Bump Swatinem/rust-cache to move off Node 12 2022-10-14 17:31:22 +03:00
bors ee1c3b385b Auto merge of #102529 - colinba:master, r=joshtriplett
Detect and reject out-of-range integers in format string literals

Until now out-of-range integers in format string literals were silently ignored. They wrapped around to zero at usize::MAX, producing unexpected results.

When using debug builds of rustc, such integers in format string literals even cause an 'attempt to add with overflow' panic in rustc.

Fix this by producing an error diagnostic for integers in format string literals which do not fit into usize.

Fixes #102528
2022-10-14 13:41:40 +00:00
Guillaume Gomez 9787321841 Clean up rust-logo rustdoc GUI test 2022-10-14 14:55:11 +02:00
Josh Triplett f95e853222
Tweak grammar 2022-10-14 12:17:07 +01:00
bors 9b0a099dfc Auto merge of #103048 - Dylan-DPC:rollup-47r62js, r=Dylan-DPC
Rollup of 8 pull requests

Successful merges:

 - #102847 (impl AsFd and AsRawFd for io::{Stdin, Stdout, Stderr}, not the sys versions)
 - #102856 (Only test duplicate inherent impl items in a single place)
 - #102914 (Migrate css highlight without change)
 - #102938 (Move some tests to more reasonable directories)
 - #103015 (fix a typo)
 - #103018 (More dupe word typos)
 - #103025 (rustdoc: remove unused CSS `.search-container > *`)
 - #103031 (Suppress irrefutable let patterns lint for prefixes in match guards)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-10-14 10:54:32 +00:00
Dylan DPC 7cf09c57a2
Rollup merge of #103031 - est31:match_guard_irrefutable_let, r=oli-obk
Suppress irrefutable let patterns lint for prefixes in match guards

In match guards, irrefutable prefixes might use the bindings created by the match pattern. Ideally, we check for this, but we can do the next best thing and just not lint for irrefutable prefixes in match guards.

Fixes #98361
2022-10-14 16:19:16 +05:30
Dylan DPC 587b9c1a97
Rollup merge of #103025 - notriddle:notriddle/search-container-star, r=GuillaumeGomez
rustdoc: remove unused CSS `.search-container > *`

The two items it was really intended to target were the buttons, and those both need to have the style set directly on them anyway because the buttons are both child elements of wrappers.

6b3ede3f7b/src/librustdoc/html/static/css/rustdoc.css (L1406-L1411)
2022-10-14 16:19:16 +05:30
Dylan DPC 77064b7f0a
Rollup merge of #103018 - Rageking8:more-dupe-word-typos, r=TaKO8Ki
More dupe word typos

I only picked those changes (from the regex search) that I am pretty certain doesn't change meaning and is just a typo fix. Do correct me if any fix is undesirable and I can revert those. Thanks.
2022-10-14 16:19:15 +05:30
Dylan DPC 8c9ecbb7e3
Rollup merge of #103015 - whentojump:patch, r=compiler-errors
fix a typo
2022-10-14 16:19:15 +05:30
Dylan DPC 3017341dae
Rollup merge of #102938 - c410-f3r:here-we-go-again, r=petrochenkov
Move some tests to more reasonable directories

r? ``@petrochenkov``
2022-10-14 16:19:13 +05:30
Dylan DPC 20e1268d25
Rollup merge of #102914 - GuillaumeGomez:migrate-css-highlight-without-change, r=notriddle
Migrate css highlight without change

This is a "previous" version of https://github.com/rust-lang/rust/pull/102663: only migrating to CSS variables, no changes. It's a bit more verbose because rules are not coherent between themes.

r? ``@notriddle``
2022-10-14 16:19:13 +05:30
Dylan DPC b4906acbce
Rollup merge of #102856 - cjgillot:impl-single-check, r=petrochenkov
Only test duplicate inherent impl items in a single place

Based on https://github.com/rust-lang/rust/pull/100387

r? ``@petrochenkov``
2022-10-14 16:19:12 +05:30
Dylan DPC b03bece6f3
Rollup merge of #102847 - joshtriplett:bugfix-impl-fd-traits-for-io-types, r=m-ou-se
impl AsFd and AsRawFd for io::{Stdin, Stdout, Stderr}, not the sys versions

https://github.com/rust-lang/rust/pull/100892 implemented AsFd for the
sys versions, rather than for the public types. Change the
implementations to apply to the public types.
2022-10-14 16:19:12 +05:30
Guillaume Gomez 0313fbe5a9 Update browser-ui-test version to fix some flaky tests 2022-10-14 12:47:20 +02:00
Lukas Markeffsky b8bb40664c remove leading newlines from integer primitive doc examples 2022-10-14 12:14:29 +02:00
Guillaume Gomez 6f0c2470db Add UI test for invalid doc(cfg_hide(...)) attributes 2022-10-14 11:29:54 +02:00
Guillaume Gomez f528414e40 Add missing checks for doc(cfg_hide(...)) attribute 2022-10-14 11:29:54 +02:00
Weihang Lo 40bb4b740b
Update cargo
12 commits in b8f30cb23c4e5f20854a4f683325782b7cff9837..b332991a57c9d055f1864de1eed93e2178d49440
2022-10-10 19:16:06 +0000 to 2022-10-13 22:05:28 +0000
- Differentiate the warning when an alias (built-in or user-defined) shadows an external subcommand (rust-lang/cargo#11170)
- chore: Update tests for latest clap (rust-lang/cargo#11235)
- feat(publish): Support 'publish.timeout' config behind '-Zpublish-timeout' (rust-lang/cargo#11230)
- Add missing edition (rust-lang/cargo#11231)
- doc(profiles): add module level doc (rust-lang/cargo#11219)
- refactor(publish): Clarify which SourceId is being used (rust-lang/cargo#11216)
- Add new SourceKind::SparseRegistry to differentiate sparse registries (rust-lang/cargo#11209)
- Fix deadlock when build scripts are waiting for input on stdin (rust-lang/cargo#11205)
- refactor: New variant `FeaturesFor::ArtifactDep` (rust-lang/cargo#11184)
- Fix rustdoc warning about unclosed HTML tag (rust-lang/cargo#11221)
- refactor(tests): Prepare for wait-for-publish test changes (rust-lang/cargo#11210)
- Add configuration option for controlling crates.io protocol (rust-lang/cargo#11215)
2022-10-14 09:59:15 +01:00
Ralf Jung 5218e24f2c wasm-ignore some tests that access thread-local private details 2022-10-14 09:42:27 +02:00
bors 32717603f6 Auto merge of #102695 - compiler-errors:int-and-float-trivial-copy, r=lcnr
Int and float inference variables are trivially copy

Fixes #102645
2022-10-14 07:41:55 +00:00
bors 44fbe522e3 Auto merge of #13413 - rust-lang:revert-13367-fix-problem-matchers, r=jonas-schievink
Revert "fix: in VSCode, correctly resolve relative paths to errors"

Reverts rust-lang/rust-analyzer#13367

I didn't manage to figure out what exactly is the issue, so reverting this to fix https://github.com/rust-lang/rust-analyzer/issues/13404 before monday.
2022-10-14 07:32:44 +00:00
Jonas Schievink 55fdcbe339
Revert "fix: in VSCode, correctly resolve relative paths to errors" 2022-10-14 09:28:44 +02:00
bors 36a70b7435 Auto merge of #13401 - lnicola:opt-tests, r=lnicola
Run `analysis-stats` on CI, with `opt-level = 1`

We might want to run `analysis-stats` on PRs, and this makes it less unbearable.
2022-10-14 07:00:38 +00:00
Ralf Jung dbb4271bb4 checktools: fix comments 2022-10-14 08:41:59 +02:00
Michael Goulet 8c7e836abb Address nits, add test for implicit dyn-star coercion without feature gate 2022-10-14 05:47:09 +00:00