Commit Graph

163987 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Esteban Kuber
004f2ed219 Do not recover from Ty? in macro parsing
Follow up to #92746. Address #94510.
2022-03-04 02:03:55 +00:00
Dylan DPC
733a1a8ca4
Rollup merge of #94582 - nnethercote:fix-x-fmt-bug, r=Mark-Simulacrum
Fix a bug in `x.py fmt` that prevents some files being formatted.

If you have a file in the repository root with the same name as a file
somewhere within a directory, the latter currently won't get formatted.

I have experienced this multiple times and not understood what was
happening; I finally figured out the problem today. This commit fixes
the problem.

r? ```@Mark-Simulacrum```
2022-03-04 02:06:44 +01:00
Dylan DPC
72c0c08445
Rollup merge of #94575 - RalfJung:switchint-comment, r=oli-obk
CTFE SwitchInt: update comment

I just wondered why this doesn't use `binary_op`.

r? ```@oli-obk```
2022-03-04 02:06:43 +01:00
Dylan DPC
308efafc77
Rollup merge of #94572 - sunfishcode:sunfishcode/handle-or, r=joshtriplett
Use `HandleOrNull` and `HandleOrInvalid` in the Windows FFI bindings.

Use the new `HandleOrNull` and `HandleOrInvalid` types that were introduced
as part of [I/O safety] in a few functions in the Windows FFI bindings.

This factors out an `unsafe` block and two `unsafe` function calls in the
Windows implementation code.

And, it helps test `HandleOrNull` and `HandleOrInvalid`, and indeed, it
turned up a bug: `OwnedHandle` also needs to be `#[repr(transparent)]`,
as it's used inside of `HandleOrNull` and `HandleOrInvalid` which are also
`#[repr(transparent)]`.

r? ```@joshtriplett```

[I/O safety]: https://github.com/rust-lang/rust/issues/87074
2022-03-04 02:06:42 +01:00
Dylan DPC
958bd0268c
Rollup merge of #94466 - jonhoo:bootstrap-proper-env-flags, r=Mark-Simulacrum
bootstrap: correct reading of flags for llvm

First, this reverts the `CFLAGS`/`CXXFLAGS` of #93918. Those flags are
already read by `cc` and populated into `Build` earlier on in the
process. We shouldn't be overriding that based on `CFLAGS`, since `cc`
also respects overrides like `CFLAGS_{TARGET}` and `HOST_CFLAGS`, which
we want to take into account.

Second, this adds the same capability to specify target-specific
versions of `LDFLAGS` as we have through `cc` for the `C*` flags:
https://github.com/alexcrichton/cc-rs#external-configuration-via-environment-variables
2022-03-04 02:06:41 +01:00
Dylan DPC
aede21f42f
Rollup merge of #94404 - pierwill:newtype-index-noord-2, r=Aaron1011
Make Ord and PartialOrd opt-out in `newtype_index`

Part of work on #90317. This will allow us to do

```diff
rustc_index::newtype_index! {
    /// A unique ID associated with a macro invocation and expansion.
    pub struct LocalExpnId {
        ENCODABLE = custom
        DEBUG_FORMAT = "expn{}"
+       ORD_IMPL = off
    }
}
```
2022-03-04 02:06:41 +01:00
Dylan DPC
79c71d1f9e
Rollup merge of #94339 - Amanieu:arm-d32, r=nagisa
ARM: Only allow using d16-d31 with asm! when supported by the target

Support can be determined by checking for the "d32" LLVM feature.

r? ```````````````@nagisa```````````````
2022-03-04 02:06:40 +01:00
Dylan DPC
cdfb39ef07
Rollup merge of #93965 - Mark-Simulacrum:owned-stdio, r=dtolnay
Make regular stdio lock() return 'static handles

This also deletes the unstable API surface area previously added to expose this
functionality on new methods rather than built into the current set.

Closes #86845 (tracking issue for unstable API needed without this)

r? ``````@dtolnay`````` to kick off T-libs-api FCP
2022-03-04 02:06:39 +01:00
Dylan DPC
c1585a17a3
Rollup merge of #93913 - bjorn3:remove_everybody_loops, r=jackh726
Remove the everybody loops pass

It isn't used anymore by rustdoc.

Split out of https://github.com/rust-lang/rust/pull/92895. There has been some previous discussion there.
2022-03-04 02:06:38 +01:00
Dylan DPC
c695de05f2
Rollup merge of #93418 - ojeda:no-shortcut, r=camelid
rustdoc & doc: no `shortcut` for `rel="icon"`

According to https://html.spec.whatwg.org/multipage/links.html#rel-icon:

> For historical reasons, the `icon` keyword may be preceded by the keyword "`shortcut`".

And to https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types:

> **Warning:** The `shortcut` link type is often seen before `icon`, but this link type is non-conforming, ignored and **web authors must not use it anymore.**

While it was removed from the Rust logo case a while ago in commit 085679c ("Use theme-adaptive SVG favicon from other Rust sites"), it is still there for the custom logo case.

Also updated a few other instances.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2022-03-04 02:06:38 +01:00
Dylan DPC
4c70200476
Rollup merge of #88805 - krhancoc:master, r=dtolnay
Clarification of default socket flags

This PR outlines the decision to disable inheritance of socket objects when possible to child processes in the documentation.
2022-03-04 02:06:37 +01:00
bors
6d7684101a Auto merge of #94009 - compiler-errors:gat-rustdoc, r=GuillaumeGomez
Support GATs in Rustdoc

Implements:
1. Rendering GATs in trait definitions and impl blocks
2. Rendering GATs in types (e.g. in the return type of a function)

Fixes #92341

This is my first rustdoc PR, so I have absolutely no idea how to produce tests for this. Advice from the rustdoc team would be wonderful!

I tested locally and things looked correct:
![image](https://user-images.githubusercontent.com/3674314/153988325-9732cbf3-0645-4e1a-9e64-ddfd93877b55.png)
2022-03-04 00:27:23 +00:00
Nicholas Nethercote
fc142ebaf8 Fix a bug in x.py fmt that prevents some files being formatted.
If you have a file in the repository root with the same name as a file
somewhere within a directory, the latter currently won't get formatted.

I have experienced this multiple times and not understood what was
happening; I finally figured out the problem today. This commit fixes
the problem.
2022-03-04 09:30:12 +11:00
bors
40d3040ae1 Auto merge of #94571 - matthiaskrgr:rollup-4ul5ydb, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #92697 (Use cgroup quotas for calculating `available_parallelism`)
 - #94057 (improve comments for `simplify_type`)
 - #94547 (`parse_tt` cleanups)
 - #94550 (rustdoc: Add test for higher kinded functions generated by macros)
 - #94551 (Doc: Fix use of quote instead of backstick in Adapter::map.)
 - #94554 (Fix invalid lint_node_id being put on a removed stmt)
 - #94555 (all: fix some typos)
 - #94563 (Remove a unnecessary `..` pattern)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-03-03 21:40:28 +00:00
Michael Goulet
0e57a16c88 add tests 2022-03-03 13:01:35 -08:00
Michael Goulet
9f21514426 don't forget generics for GATs in impls 2022-03-03 13:01:35 -08:00
Michael Goulet
aefc0a223a make generic projection types print correctly 2022-03-03 13:01:35 -08:00
Ralf Jung
50e7450bac only disable SIMD for doctests in Miri (not for the stdlib build itself) 2022-03-03 15:11:06 -05:00
Ralf Jung
e9149b6773 Miri can run this test now 2022-03-03 14:54:18 -05:00
Ralf Jung
d233570fab fix a warning when building core tests with cfg(miri) 2022-03-03 14:54:18 -05:00
scottmcm
0c131861c9
Add a missing #[no_mangle] 2022-03-03 19:52:45 +00:00
Ralf Jung
0854781861 CTFE SwitchInt: update comment 2022-03-03 14:46:29 -05:00
Dan Gohman
35606490ab Use HandleOrNull and HandleOrInvalid in the Windows FFI bindings.
Use the new `HandleOrNull` and `HandleOrInvalid` types that were introduced
as part of [I/O safety] in a few functions in the Windows FFI bindings.

This factors out an `unsafe` block and two `unsafe` function calls in the
Windows implementation code.

And, it helps test `HandleOrNull` and `HandleOrInvalid`, which indeed turned
up a bug: `OwnedHandle` also needs to be `#[repr(transparent)]`, as it's
used inside of `HandleOrNull` and `HandleOrInvalid` which are also
`#[repr(transparent)]`.

[I/O safety]: https://github.com/rust-lang/rust/issues/87074
2022-03-03 11:20:49 -08:00
Matthias Krüger
cfa58dfd1c
Rollup merge of #94563 - TaKO8Ki:remove-unnecessary-patten-for-ignoring-remaining-parts, r=Dylan-DPC
Remove a unnecessary `..` pattern
2022-03-03 20:01:49 +01:00
Matthias Krüger
939c1585a4
Rollup merge of #94555 - cuishuang:master, r=oli-obk
all: fix some typos

Signed-off-by: cuishuang <imcusg@gmail.com>
2022-03-03 20:01:48 +01:00
Matthias Krüger
26cbf9158d
Rollup merge of #94554 - Urgau:stmt-node-id-ice, r=petrochenkov
Fix invalid lint_node_id being put on a removed stmt

This pull-request remove a invalid `assign_id!` being put on an stmt node.

The problem is that this node is being removed away by a cfg making it unreachable when triggering a buffered lint.
The comment in the other match arm already tell to not assign a id because it could have a `#[cfg()]` so this is just respecting the comment.

Fixes https://github.com/rust-lang/rust/issues/94523
r? ```````@petrochenkov```````
2022-03-03 20:01:48 +01:00
Matthias Krüger
40c146cebd
Rollup merge of #94551 - darnuria:doc-map-backstick, r=dtolnay
Doc: Fix use of quote instead of backstick in Adapter::map.

A little commit to fix documentation rendering and semantics in https://doc.rust-lang.org/std/iter/struct.Map.html#notes-about-side-effects `"` where used around an expression instead \`.

Screenshot on doc.rust-lang.org:
![2022-03-03 11-21-43_backstick](https://user-images.githubusercontent.com/2827553/156546536-569b7692-7ac4-4388-8e93-c1628ddc6a0f.png)

Looking forward: Maybe reworking the doc to use assert_eq like the upper paragraph:
```
let v: Vec<i32> = vec![1, 2, 3].into_iter().map(|x| x + 1).rev().collect();

assert_eq!(v, [4, 3, 2]);
```
2022-03-03 20:01:47 +01:00
Matthias Krüger
835eaaa77e
Rollup merge of #94550 - GuillaumeGomez:HKF-macros, r=notriddle
rustdoc: Add test for higher kinded functions generated by macros

Fixes #75564.

The problem has been solved apparently so adding a test to prevent a regression.

r? ```@notriddle```
2022-03-03 20:01:46 +01:00
Matthias Krüger
16c6594f34
Rollup merge of #94547 - nnethercote:parse_tt-cleanups, r=petrochenkov
`parse_tt` cleanups

I've been looking closely at this code, and saw some opportunities to improve its readability.

r? ```````@petrochenkov```````
2022-03-03 20:01:45 +01:00
Matthias Krüger
fec7a79088
Rollup merge of #94057 - lcnr:simplify_type-uwu, r=nikomatsakis
improve comments for `simplify_type`

Should now correctly describe what's going on. Experimented with checking the invariant for projections
but that ended up requiring fairly involved changes. I assume that it is not possible to get unsoundness here,
at least for now and I can pretty much guarantee that it's impossible to trigger it by accident.

r? `````@nikomatsakis````` cc #92721
2022-03-03 20:01:44 +01:00