Commit Graph

164020 Commits

Author SHA1 Message Date
Mara Bos
88a693c4f4 Rename LocalKey's with_{ref,mut} to with_borrow{,_mut}. 2022-03-05 11:39:03 +01:00
Mara Bos
52ce11996b Implement RFC 3184 - thread local cell methods. 2022-03-05 11:39:03 +01:00
bors
86067bb461 Auto merge of #94546 - JmPotato:std-features-cleanup, r=m-ou-se
Clean up the std library's #![feature]s

Signed-off-by: JmPotato <ghzpotato@gmail.com>

This is part of https://github.com/rust-lang/rust/issues/87766.

r? `@m-ou-se`
2022-03-05 07:26:54 +00:00
bors
be72308b7d Auto merge of #94634 - Dylan-DPC:rollup-8wx1yrj, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #94446 (UNIX `remove_dir_all()`: Try recursing first on the slow path)
 - #94460 (Reenable generator drop tracking tests and fix mutation handling)
 - #94620 (Edit docs on consistency of `PartialOrd` and `PartialEq`)
 - #94624 (Downgrade `#[test]` on macro call to warning)
 - #94626 (Add known-bug directive to issue #47511 test case)
 - #94631 (Fix typo in c-variadic)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-03-05 04:56:35 +00:00
Dylan DPC
e8a0a4e2af
Rollup merge of #94631 - nebulatgs:patch-1, r=Dylan-DPC
Fix typo in c-variadic

Fixes a typo in the Unstable Book
2022-03-05 04:46:41 +01:00
Dylan DPC
38e3b32dfa
Rollup merge of #94626 - marmeladema:issue-47511-known-bug, r=jackh726
Add known-bug directive to issue #47511 test case
2022-03-05 04:46:40 +01:00
Dylan DPC
e558040908
Rollup merge of #94624 - estebank:regression-94508, r=Dylan-DPC
Downgrade `#[test]` on macro call to warning

Follow up to #92959. Address #94508.
2022-03-05 04:46:39 +01:00
Dylan DPC
a3fe63e9fe
Rollup merge of #94620 - pierwill:partialord-constistency, r=yaahc
Edit docs on consistency of `PartialOrd` and `PartialEq`

Use ordered list to make the information about implementations more readable.
2022-03-05 04:46:38 +01:00
Dylan DPC
c7d200441b
Rollup merge of #94460 - eholk:reenable-drop-tracking-tests, r=tmiasko
Reenable generator drop tracking tests and fix mutation handling

The previous PR, #94068, was overly zealous in counting mutations as borrows, which effectively nullified drop tracking. We would have caught this except the drop tracking tests were still ignored, despite having the option of using the `-Zdrop-tracking` flag now.

This PR fixes the issue introduced by #94068 by only counting mutations as borrows the mutated place has a project. This is sufficient to distinguish `x.y = 42` (which should count as a borrow of `x`) from `x = 42` (which is not a borrow of `x` because the whole variable is overwritten).

This PR also re-enables the drop tracking regression tests using the `-Zdrop-tracking` flag so we will avoid introducing these sorts of issues in the future.

Thanks to ``@tmiasko`` for noticing this problem and pointing it out!

r? ``@tmiasko``
2022-03-05 04:46:37 +01:00
Dylan DPC
3e1e9b4866
Rollup merge of #94446 - rusticstuff:remove_dir_all-illumos-fix, r=cuviper
UNIX `remove_dir_all()`: Try recursing first on the slow path

This only affects the _slow_ code path - if there is no `dirent.d_type` or if it is `DT_UNKNOWN`.

POSIX specifies that calling `unlink()` or `unlinkat(..., 0)` on a directory is allowed to succeed:
> The _path_ argument shall not name a directory unless the process has appropriate privileges and the implementation supports using _unlink()_ on directories.

This however can cause dangling inodes requiring an fsck e.g. on Illumos UFS, so we have to avoid that in the common case. We now just try to recurse into it first and unlink() if we can't open it as a directory.

The other two commits integrate the Macos x86-64 implementation reducing redundancy. Split into two commits for better reviewing.

Fixes #94335.
2022-03-05 04:46:37 +01:00
JmPotato
9b952b7d3a Clean up the std library's #![feature]s
Signed-off-by: JmPotato <ghzpotato@gmail.com>
2022-03-05 11:17:43 +08:00
bors
8c93948d6e Auto merge of #93142 - estebank:missing-main, r=wesleywiser
Do not point at whole file missing `fn main`

Only point at the end of the crate. We could try making it point at the
beginning of the crate, but that is confused with `DUMMY_SP`, causing
the output to be *worse*.

This change will make it so that VSCode will *not* underline the whole
file when `main` is missing, so other errors will be visible.
2022-03-05 02:46:24 +00:00
Esteban Kuber
91f3603299 Do not point at whole file missing fn main
Only point at the end of the crate. We could try making it point at the
beginning of the crate, but that is confused with `DUMMY_SP`, causing
the output to be *worse*.

This change will make it so that VSCode will *not* underline the whole
file when `main` is missing, so other errors will be visible.
2022-03-05 02:42:55 +00:00
Nebula
a4cb2bfe34
Fix typo in c-variadic 2022-03-04 21:34:38 -05:00
bors
69f11fff33 Auto merge of #94628 - Dylan-DPC:rollup-v2slupe, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #94362 (Add well known values to `--check-cfg` implementation)
 - #94577 (only disable SIMD for doctests in Miri (not for the stdlib build itself))
 - #94595 (Fix invalid `unresolved imports` errors for a single-segment import)
 - #94596 (Delay bug in expr adjustment when check_expr is called multiple times)
 - #94618 (Don't round stack size up for created threads in Windows)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-03-05 00:15:54 +00:00
Dylan DPC
629e7aa718
Rollup merge of #94618 - lewisclark:remove-stack-size-rounding, r=yaahc
Don't round stack size up for created threads in Windows

Fixes #94454

Windows does the rounding itself, so there isn't a need to explicity do the rounding beforehand, as mentioned by ```@ChrisDenton``` in #94454

> The operating system rounds up the specified size to the nearest multiple of the system's allocation granularity (typically 64 KB). To retrieve the allocation granularity of the current system, use the [GetSystemInfo](https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsysteminfo) function.

https://docs.microsoft.com/en-us/windows/win32/procthread/thread-stack-size
2022-03-04 22:58:37 +01:00
Dylan DPC
3064d6ec4d
Rollup merge of #94596 - compiler-errors:delay-adjustment-duplicate, r=estebank
Delay bug in expr adjustment when check_expr is called multiple times

Instead of including slightly more complicated logic in `check_argument_types` to fix the bug (#94516) I introduced in #94438, and inevitably have this bug appear once again when some other diagnostic is written that causes `check_expr` to be called an expression during a (bad) code path, just delay the bug in adjustment logic.

I am open to other implementations that don't delay the bug here.

Fixes #94516
2022-03-04 22:58:36 +01:00
Dylan DPC
f27466d7e2
Rollup merge of #94595 - TaKO8Ki:fix-invalid-unresolved-imports-errors-for-asterisk-wildcard-syntax, r=estebank
Fix invalid `unresolved imports` errors for a single-segment import

closes #90248
2022-03-04 22:58:35 +01:00
Dylan DPC
18a07a78a5
Rollup merge of #94577 - RalfJung:simd-miri, r=scottmcm
only disable SIMD for doctests in Miri (not for the stdlib build itself)

Also we can enable library/core/tests/simd.rs now, Miri supports enough SIMD for that.
2022-03-04 22:58:34 +01:00
Dylan DPC
afa85f0841
Rollup merge of #94362 - Urgau:check-cfg-values, r=petrochenkov
Add well known values to `--check-cfg` implementation

This pull-request adds well known values for the well known names via `--check-cfg=values()`.

[RFC 3013: Checking conditional compilation at compile time](https://rust-lang.github.io/rfcs/3013-conditional-compilation-checking.html#checking-conditional-compilation-at-compile-time) doesn't define this at all, but this seems a nice improvement.
The activation is done by a empty `values()` (new syntax) similar to `names()` except that `names(foo)` also activate well known names while `values(aa, "aa", "kk")` would not.

As stated this use a different activation logic because well known values for the well known names are not always sufficient.
In fact this is problematic for every `target_*` cfg because of non builtin targets, as the current implementation use those built-ins targets to create the list the well known values.

The implementation is straight forward, first we gather (if necessary) all the values (lazily or not) and then we apply them.

r? ```@petrochenkov```
2022-03-04 22:58:34 +01:00
bors
5a7e4c6b5a Auto merge of #94298 - Urgau:rustbuild-check-cfg, r=Mark-Simulacrum
Enable conditional compilation checking on the Rust codebase

This pull-request enable conditional compilation checking on every rust project build by the `bootstrap` tool.

To be more specific, this PR only enable well known names checking + extra names (bootstrap, parallel_compiler, ...).

r? `@Mark-Simulacrum`
2022-03-04 21:52:34 +00:00
marmeladema
9e03d7ddbe Add known-bug directive to issue #47511 test case 2022-03-04 22:47:56 +01:00
Esteban Kuber
050d589991 Downgrade #[test] on macro call to warning
Follow up to #92959. Address #94508.
2022-03-04 20:34:10 +00:00
pierwill
f0257b1b4c Edit docs on consistency of PartialOrd and PartialEq
Use ordered list to make the information about implementations more readable.
2022-03-04 13:31:32 -06:00
Eric Holk
add169d414 Distinguish binding assignments, use Ty::needs_drop
This better captures the actual behavior, rather than using hacks around
whether the assignment has any projections.
2022-03-04 11:03:24 -08:00
bors
9fcbc32053 Auto merge of #94494 - jonhoo:bump-autocfg, r=Mark-Simulacrum
Bump autocfg to 1.1.0

autocfg 1.1.0 makes it so that rustflags from the build are correctly
passed to the compiler probes, which in turn means those probes more
accurately reflect the outer build conditions. This is particularly
important if rustflags includes _required_ `-Clink-arg=` flags without
which builds will fail, as older versions of `autocfg` will then fail
the probe and erroneously report the probed feature as unavailable.

See also
https://github.com/rust-lang/rust/issues/94007#issuecomment-1040668261
2022-03-04 19:01:44 +00:00
Lewis Clark
6843dd5013 Don't round stack size up for created threads 2022-03-04 18:04:43 +00:00
bors
1b14fd3b10 Auto merge of #94612 - matthiaskrgr:rollup-2jm5wkr, r=matthiaskrgr
Rollup of 6 pull requests

r? `@ghost`
2022-03-04 16:37:46 +00:00
Matthias Krüger
b4baef5675
Rollup merge of #94600 - est31:master, r=notriddle
Use if let instead of manual match

Factored out of #94139 . `if let` is better here than both `let ... else` and `let ... = match`.
2022-03-04 17:31:09 +01:00
Matthias Krüger
f9b4976d60
Rollup merge of #94593 - estebank:issue-94510, r=davidtwco
Do not recover from `Ty?` in macro parsing

Follow up to #92746. Address #94510.
2022-03-04 17:31:08 +01:00
Matthias Krüger
4014e159c9
Rollup merge of #94568 - bjorn3:rustbuild_remove_dead_code, r=Mark-Simulacrum
Remove some dead code from rustbuild

This should reduce build time a tiny bit.
2022-03-04 17:31:07 +01:00
Matthias Krüger
ee3a2c7a8c
Rollup merge of #94549 - m-ou-se:thread-is-finished, r=yaahc
Rename JoinHandle::is_running to is_finished.

This is renaming `is_running` to `is_finished` as discussed on the tracking issue here: https://github.com/rust-lang/rust/issues/90470#issuecomment-1050188499

Taking some of the docs suggestions from https://github.com/rust-lang/rust/pull/94033
2022-03-04 17:31:06 +01:00
Matthias Krüger
5115bdc2e2
Rollup merge of #94524 - bjorn3:remove_num_cpus, r=Mark-Simulacrum
Remove num_cpus dependency from bootstrap, build-manifest and rustc_s…

…ession

`std::threads::available_parallelism` was stabilized in rust 1.59.

r? ```````````````````````````@Mark-Simulacrum```````````````````````````
2022-03-04 17:31:05 +01:00
Matthias Krüger
904c6ca95c
Rollup merge of #94236 - reez12g:add_track_caller_87707, r=yaahc
Add #[track_caller] to track callers when initializing poisoned Once

This PR is for this Issue.
https://github.com/rust-lang/rust/issues/87707

With this fix, we expect to be able to track the caller when poisoned Once is initialized.
2022-03-04 17:31:04 +01:00
bors
b4bf56cd66 Auto merge of #94570 - shampoofactory:reopen-91719, r=workingjubilee
Reopen 91719

Reopened #91719, which was closed inadvertently due to technical difficulties.
2022-03-04 13:06:14 +00:00
Hans Kratz
735f60c34f Integrate macos x86-64 remove_dir_all() impl. Step 2: readd 2022-03-04 13:47:50 +01:00
Hans Kratz
41b4423cdf Integrate macos x86-64 remove_dir_all() impl. Step 1: remove 2022-03-04 13:47:36 +01:00
Hans Kratz
e427333071 remove_dir_all(): try recursing first instead of trying to unlink()
This only affects the `slow` code path, if there is no `dirent.d_type` or if
the type is `DT_UNKNOWN`.

POSIX specifies that calling `unlink()` or `unlinkat(..., 0)` on a directory can
succeed:
> "The _path_ argument shall not name a directory unless the process has
> appropriate privileges and the implementation supports using _unlink()_ on
> directories."
This however can cause orphaned directories requiring an fsck e.g. on Illumos
UFS, so we have to avoid that in the common case. We now just try to recurse
into it first and unlink() if we can't open it as a directory.
2022-03-04 13:33:35 +01:00
Loïc BRANSTETT
976fdb18c9 Enable conditional compilation checking on the Rust codebase 2022-03-04 12:14:29 +01:00
bors
047f9c4bc4 Auto merge of #94539 - tmiasko:string-attributes, r=nikic
Pass LLVM string attributes as string slices
2022-03-04 10:38:11 +00:00
Loïc BRANSTETT
a93c7abc69 Add #![allow(unexpected_cfgs)] in preparation of global --check-cfg 2022-03-04 11:34:51 +01:00
Loïc BRANSTETT
08e1e67b49 Remove invalid #[cfg(tests)] in index_map 2022-03-04 11:34:50 +01:00
Loïc BRANSTETT
4aa92aff05 Add well known values to --check-cfg implementation 2022-03-04 11:15:38 +01:00
est31
18528a2ddb Use if let instead of manual match 2022-03-04 10:35:56 +01:00
bors
62ff2bcf94 Auto merge of #94159 - erikdesjardins:align-load, r=nikic
Add !align metadata on loads of &/&mut/Box

Note that this refers to the alignment of what the loaded value points
to, _not_ the alignment of the loaded value itself.

r? `@ghost` (blocked on #94158)
2022-03-04 08:14:31 +00:00
bors
65f6d33b77 Auto merge of #94096 - cjgillot:ensure-stability, r=lcnr
Ensure stability directives are checked in all cases

Split off  #93017

Stability and deprecation were not checked in all cases, for instance if a type error happened.
This PR moves the check earlier in the pipeline to ensure the errors are emitted in all cases.

r? `@lcnr`
2022-03-04 05:49:14 +00:00
Takayuki Maeda
068a233d4d fix invalid unresolved imports errors the asterisk wildcard syntax causes
use a path variabale
2022-03-04 14:06:27 +09:00
Michael Goulet
8af683de34 delay bug instead of skipping check_expr 2022-03-03 20:39:50 -08:00
reez12g
bca67fe02f Add #[track_caller] to track callers when initializing poisoned Once 2022-03-03 22:41:27 -05:00
bors
8fa5d74a7c Auto merge of #94588 - Dylan-DPC:rollup-7pxd0i3, r=Dylan-DPC
Rollup of 10 pull requests

Successful merges:

 - #88805 (Clarification of default socket flags)
 - #93418 (rustdoc & doc: no `shortcut` for `rel="icon"`)
 - #93913 (Remove the everybody loops pass)
 - #93965 (Make regular stdio lock() return 'static handles)
 - #94339 (ARM: Only allow using d16-d31 with asm! when supported by the target)
 - #94404 (Make Ord and PartialOrd opt-out in `newtype_index`)
 - #94466 (bootstrap: correct reading of flags for llvm)
 - #94572 (Use `HandleOrNull` and `HandleOrInvalid` in the Windows FFI bindings.)
 - #94575 (CTFE SwitchInt: update comment)
 - #94582 (Fix a bug in `x.py fmt` that prevents some files being formatted.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-03-04 02:53:40 +00:00