]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agofix a suggestion message
Takayuki Maeda [Fri, 11 Mar 2022 12:26:06 +0000 (21:26 +0900)]
fix a suggestion message

2 years agosuggest using double colon when using single colon in struct field type path
Takayuki Maeda [Fri, 11 Mar 2022 07:15:57 +0000 (16:15 +0900)]
suggest using double colon when using single colon in struct field type path

2 years agoAuto merge of #94668 - fee1-dead:rollup-8e92bht, r=fee1-dead
bors [Sun, 6 Mar 2022 12:57:32 +0000 (12:57 +0000)]
Auto merge of #94668 - fee1-dead:rollup-8e92bht, r=fee1-dead

Rollup of 3 pull requests

Successful merges:

 - #92509 (doc: `Iterator::partition` use partial type hints)
 - #94621 (rustbuild: support RelWithDebInfo for lld)
 - #94649 (Unix path::absolute: Fix leading "." component)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoRollup merge of #94649 - ChrisDenton:unix-absolute-fix, r=Dylan-DPC
fee1-dead [Sun, 6 Mar 2022 11:35:31 +0000 (22:35 +1100)]
Rollup merge of #94649 - ChrisDenton:unix-absolute-fix, r=Dylan-DPC

Unix path::absolute: Fix leading "." component

Testing leading `.` and `..` components were missing from the unix tests.

This PR adds them and fixes the leading `.` case. It also fixes the test cases so that they do an exact comparison.

This problem reported by ``@axetroy``

2 years agoRollup merge of #94621 - ridwanabdillahi:lld-rel-dbg, r=Mark-Simulacrum
fee1-dead [Sun, 6 Mar 2022 11:35:30 +0000 (22:35 +1100)]
Rollup merge of #94621 - ridwanabdillahi:lld-rel-dbg, r=Mark-Simulacrum

rustbuild: support RelWithDebInfo for lld

r? ``@alexcrichton``

LLVM has flags that control the level of debuginfo generated when building via rustbuild. Since LLD is built separately, it currently has no way of generating any debuginfo. This change re-uses the same flags as LLVM for LLD to ensure it has the same level of debuginfo generated as LLVM.

2 years agoRollup merge of #92509 - Gentoli:partition-ex, r=camelid
fee1-dead [Sun, 6 Mar 2022 11:35:29 +0000 (22:35 +1100)]
Rollup merge of #92509 - Gentoli:partition-ex, r=camelid

doc: `Iterator::partition` use partial type hints

Switch to partial type hints to indicate only the collection type is needed.

2 years agoAuto merge of #90076 - jackh726:wherethewhere, r=nikomatsakis
bors [Sun, 6 Mar 2022 07:22:09 +0000 (07:22 +0000)]
Auto merge of #90076 - jackh726:wherethewhere, r=nikomatsakis

Change location of where clause on GATs

Closes #89122

~Blocked on lang FCP~

r? `@nikomatsakis`

2 years agoAuto merge of #94658 - RalfJung:miri, r=RalfJung
bors [Sun, 6 Mar 2022 04:41:25 +0000 (04:41 +0000)]
Auto merge of #94658 - RalfJung:miri, r=RalfJung

update Miri

Fixes https://github.com/rust-lang/rust/issues/94562
r? `@ghost`

2 years agoupdate Miri
Ralf Jung [Sun, 6 Mar 2022 03:44:34 +0000 (22:44 -0500)]
update Miri

2 years agoIgnore
Jack Huey [Sun, 6 Mar 2022 00:38:53 +0000 (19:38 -0500)]
Ignore

2 years agoAuto merge of #93805 - petrochenkov:doclinkself, r=camelid,GuillaumeGomez
bors [Sun, 6 Mar 2022 02:14:49 +0000 (02:14 +0000)]
Auto merge of #93805 - petrochenkov:doclinkself, r=camelid,GuillaumeGomez

rustdoc: Stop textually replacing `Self` in doc links before resolving them

Resolve it directly to a type / def-id instead.

Also never pass `Self` to `Resolver`, it is useless because it's guaranteed that no resolution will be found.

This is a pre-requisite for https://github.com/rust-lang/rust/issues/83761.

2 years agodoc: `Iterator::partition` use partial type hints
Gentoli [Mon, 3 Jan 2022 11:25:42 +0000 (06:25 -0500)]
doc: `Iterator::partition` use partial type hints

2 years agoAuto merge of #94601 - csmoe:android-asan, r=nagisa
bors [Sat, 5 Mar 2022 22:52:08 +0000 (22:52 +0000)]
Auto merge of #94601 - csmoe:android-asan, r=nagisa

add address sanitizer fo android

We have been being using asan to debug the rust/cpp/c mixed android application in production for months: recompile the rust library with a patched rustc, everything just works fine. The patch is really small thanks to `@nagisa` 's refactoring in https://github.com/rust-lang/rust/pull/81866

r? `@nagisa`

2 years agoAuto merge of #94648 - RalfJung:rollup-4iorcrd, r=RalfJung
bors [Sat, 5 Mar 2022 19:53:45 +0000 (19:53 +0000)]
Auto merge of #94648 - RalfJung:rollup-4iorcrd, r=RalfJung

Rollup of 4 pull requests

Successful merges:

 - #94630 (Update note about tier 2 docs.)
 - #94633 (Suggest removing a semicolon after derive attributes)
 - #94642 (Fix source code pages scroll)
 - #94645 (do not attempt to open cgroup files under Miri)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoAdd commment covering the case with no where clause
Jack Huey [Sat, 5 Mar 2022 04:21:33 +0000 (23:21 -0500)]
Add commment covering the case with no where clause

2 years agoUpdate new tests
Jack Huey [Mon, 14 Feb 2022 19:10:01 +0000 (14:10 -0500)]
Update new tests

2 years agoReview changes
Jack Huey [Mon, 14 Feb 2022 18:00:10 +0000 (13:00 -0500)]
Review changes

2 years agoFallback to other where clause if preferred is missing
Jack Huey [Mon, 7 Feb 2022 17:20:09 +0000 (12:20 -0500)]
Fallback to other where clause if preferred is missing

2 years agoChange to lint
Jack Huey [Mon, 7 Feb 2022 06:23:37 +0000 (01:23 -0500)]
Change to lint

2 years agoChange syntax for TyAlias where clauses
Jack Huey [Tue, 19 Oct 2021 22:45:48 +0000 (18:45 -0400)]
Change syntax for TyAlias where clauses

2 years agoUse `as_os_str` to compare exact paths
Chris Denton [Sat, 5 Mar 2022 17:58:08 +0000 (17:58 +0000)]
Use `as_os_str` to compare exact paths

2 years agoUnix `path::absolute`: Fix leading "." component
Chris Denton [Sat, 5 Mar 2022 17:57:12 +0000 (17:57 +0000)]
Unix `path::absolute`: Fix leading "." component

Testing leading `.` and `..` components were missing from the unix tests.

2 years agoRollup merge of #94645 - RalfJung:available-parallelism-miri, r=the8472
Ralf Jung [Sat, 5 Mar 2022 17:53:17 +0000 (12:53 -0500)]
Rollup merge of #94645 - RalfJung:available-parallelism-miri, r=the8472

do not attempt to open cgroup files under Miri

Since https://github.com/rust-lang/rust/pull/92697, `cargo miri test` always fails under default flags, and one would have to use `MIRIFLAGS=-Zmiri-disable-isolation cargo miri test` instead. This PR fixes that problem.

Cc `@the8472` `@joshtriplett`

2 years agoRollup merge of #94642 - GuillaumeGomez:source-code-scroll, r=Urgau
Ralf Jung [Sat, 5 Mar 2022 17:53:17 +0000 (12:53 -0500)]
Rollup merge of #94642 - GuillaumeGomez:source-code-scroll, r=Urgau

Fix source code pages scroll

To reproduce the bug, go to https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_ast/ast.rs.html#537-541 and click on the `Path` link. The page won't scroll to the content.

r? `@Urgau`

2 years agoRollup merge of #94633 - TaKO8Ki:suggest-removing-semicolon-after-derive-attribute...
Ralf Jung [Sat, 5 Mar 2022 17:53:16 +0000 (12:53 -0500)]
Rollup merge of #94633 - TaKO8Ki:suggest-removing-semicolon-after-derive-attribute, r=cjgillot

Suggest removing a semicolon after derive attributes

closes #93942

2 years agoRollup merge of #94630 - ehuss:remove-tier-2-docs-note, r=Mark-Simulacrum
Ralf Jung [Sat, 5 Mar 2022 17:53:15 +0000 (12:53 -0500)]
Rollup merge of #94630 - ehuss:remove-tier-2-docs-note, r=Mark-Simulacrum

Update note about tier 2 docs.

As of #92800, docs are now available for tier-2 platforms.

2 years agoAuto merge of #92123 - m-ou-se:thread-local-cell-methods, r=joshtriplett
bors [Sat, 5 Mar 2022 17:13:03 +0000 (17:13 +0000)]
Auto merge of #92123 - m-ou-se:thread-local-cell-methods, r=joshtriplett

Implement RFC 3184 - thread local cell methods

This implements [RFC 3184](https://github.com/rust-lang/rfcs/pull/3184), with `@danielhenrymantilla's` [suggestion](https://github.com/rust-lang/rfcs/pull/3184#issuecomment-965773616) for the `with_` method names.

Tracking issue: https://github.com/rust-lang/rust/issues/92122

2 years agosuggest removing a semicolon after derive attributes
Takayuki Maeda [Sat, 5 Mar 2022 03:20:08 +0000 (12:20 +0900)]
suggest removing a semicolon after derive attributes

use current token span

2 years agodo not attempt to open cgroup files under Miri
Ralf Jung [Sat, 5 Mar 2022 16:23:25 +0000 (11:23 -0500)]
do not attempt to open cgroup files under Miri

2 years agoUpdate note about tier 2 docs.
Eric Huss [Sat, 5 Mar 2022 15:50:40 +0000 (07:50 -0800)]
Update note about tier 2 docs.

2 years agoAdd GUI test for source code viewer scroll handling
Guillaume Gomez [Sat, 5 Mar 2022 15:02:28 +0000 (16:02 +0100)]
Add GUI test for source code viewer scroll handling

2 years agoAuto merge of #94480 - bjorn3:no_build_helper, r=Mark-Simulacrum
bors [Sat, 5 Mar 2022 14:32:25 +0000 (14:32 +0000)]
Auto merge of #94480 - bjorn3:no_build_helper, r=Mark-Simulacrum

Remove build_helper

The majority of the code is only used by either rustbuild or
rustc_llvm's build script. Rust_build is compiled once for rustbuild and
once for every stage. This means that the majority of the code in this
crate is needlessly compiled multiple times. By moving only the code
actually used by the respective crates to rustbuild and rustc_llvm's
build script, this needless duplicate compilation is avoided.

2 years agoScroll when the anchor change and is linking outside of the displayed content
Guillaume Gomez [Sat, 5 Mar 2022 14:31:57 +0000 (15:31 +0100)]
Scroll when the anchor change and is linking outside of the displayed content

2 years agoMerge build_helper into util
bjorn3 [Thu, 3 Mar 2022 17:15:01 +0000 (18:15 +0100)]
Merge build_helper into util

2 years agoRemove build_helper
bjorn3 [Thu, 24 Feb 2022 12:30:50 +0000 (13:30 +0100)]
Remove build_helper

The majority of the code is only used by either rustbuild or
rustc_llvm's build script. Rust_build is compiled once for rustbuild and
once for every stage. This means that the majority of the code in this
crate is needlessly compiled multiple times. By moving only the code
actually used by the respective crates to rustbuild and rustc_llvm's
build script, this needless duplicate compilation is avoided.

2 years agoAuto merge of #94561 - Urgau:check-cfg-lint-help-remove, r=petrochenkov
bors [Sat, 5 Mar 2022 11:29:59 +0000 (11:29 +0000)]
Auto merge of #94561 - Urgau:check-cfg-lint-help-remove, r=petrochenkov

Improve unexpected_cfgs lint when their is no value expected

This pull-request improve the `unexpected_cfgs` when their is no value expected by suggesting to remove the value.

I also took the liberty to special case it for `feature` as it seems wrong to suggest to remove the value when the problem is most probably the absence of value(s) and also the fact that it doesn't make sense to only have `feature` without a value.

r? `@petrochenkov`

2 years agoImprove unexpected_cfgs lint when their is no value expected
Loïc BRANSTETT [Thu, 3 Mar 2022 14:56:19 +0000 (15:56 +0100)]
Improve unexpected_cfgs lint when their is no value expected

2 years agoUpdate tests.
Mara Bos [Mon, 20 Dec 2021 18:24:40 +0000 (19:24 +0100)]
Update tests.

2 years agoSmall fixes in thread local code.
Mara Bos [Mon, 20 Dec 2021 18:21:53 +0000 (19:21 +0100)]
Small fixes in thread local code.

2 years agoUpdate documentation in thread/local.rs.
Mara Bos [Mon, 20 Dec 2021 18:21:36 +0000 (19:21 +0100)]
Update documentation in thread/local.rs.

2 years agoAdd debug asserts in thread local cell set methods.
Mara Bos [Mon, 20 Dec 2021 18:20:56 +0000 (19:20 +0100)]
Add debug asserts in thread local cell set methods.

2 years agoAdd tracking issue number for local_key_cell_methods.
Mara Bos [Mon, 20 Dec 2021 12:49:10 +0000 (13:49 +0100)]
Add tracking issue number for local_key_cell_methods.

2 years agoRename LocalKey's with_{ref,mut} to with_borrow{,_mut}.
Mara Bos [Mon, 20 Dec 2021 12:38:07 +0000 (13:38 +0100)]
Rename LocalKey's with_{ref,mut} to with_borrow{,_mut}.

2 years agoImplement RFC 3184 - thread local cell methods.
Mara Bos [Tue, 19 Oct 2021 12:37:27 +0000 (14:37 +0200)]
Implement RFC 3184 - thread local cell methods.

2 years agoAuto merge of #94546 - JmPotato:std-features-cleanup, r=m-ou-se
bors [Sat, 5 Mar 2022 07:26:54 +0000 (07:26 +0000)]
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`

2 years agoAuto merge of #94634 - Dylan-DPC:rollup-8wx1yrj, r=Dylan-DPC
bors [Sat, 5 Mar 2022 04:56:35 +0000 (04:56 +0000)]
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

2 years agoRollup merge of #94631 - nebulatgs:patch-1, r=Dylan-DPC
Dylan DPC [Sat, 5 Mar 2022 03:46:41 +0000 (04:46 +0100)]
Rollup merge of #94631 - nebulatgs:patch-1, r=Dylan-DPC

Fix typo in c-variadic

Fixes a typo in the Unstable Book

2 years agoRollup merge of #94626 - marmeladema:issue-47511-known-bug, r=jackh726
Dylan DPC [Sat, 5 Mar 2022 03:46:40 +0000 (04:46 +0100)]
Rollup merge of #94626 - marmeladema:issue-47511-known-bug, r=jackh726

Add known-bug directive to issue #47511 test case

2 years agoRollup merge of #94624 - estebank:regression-94508, r=Dylan-DPC
Dylan DPC [Sat, 5 Mar 2022 03:46:39 +0000 (04:46 +0100)]
Rollup merge of #94624 - estebank:regression-94508, r=Dylan-DPC

Downgrade `#[test]` on macro call to warning

Follow up to #92959. Address #94508.

2 years agoRollup merge of #94620 - pierwill:partialord-constistency, r=yaahc
Dylan DPC [Sat, 5 Mar 2022 03:46:38 +0000 (04:46 +0100)]
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.

2 years agoRollup merge of #94460 - eholk:reenable-drop-tracking-tests, r=tmiasko
Dylan DPC [Sat, 5 Mar 2022 03:46:37 +0000 (04:46 +0100)]
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``

2 years agoRollup merge of #94446 - rusticstuff:remove_dir_all-illumos-fix, r=cuviper
Dylan DPC [Sat, 5 Mar 2022 03:46:37 +0000 (04:46 +0100)]
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.

2 years agoClean up the std library's #![feature]s
JmPotato [Thu, 3 Mar 2022 06:24:47 +0000 (14:24 +0800)]
Clean up the std library's #![feature]s

Signed-off-by: JmPotato <ghzpotato@gmail.com>
2 years agoAuto merge of #93142 - estebank:missing-main, r=wesleywiser
bors [Sat, 5 Mar 2022 02:46:24 +0000 (02:46 +0000)]
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.

2 years agoDo not point at whole file missing `fn main`
Esteban Kuber [Fri, 21 Jan 2022 00:15:39 +0000 (00:15 +0000)]
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.

2 years agoFix typo in c-variadic
Nebula [Sat, 5 Mar 2022 02:34:38 +0000 (21:34 -0500)]
Fix typo in c-variadic

2 years agoAuto merge of #94628 - Dylan-DPC:rollup-v2slupe, r=Dylan-DPC
bors [Sat, 5 Mar 2022 00:15:54 +0000 (00:15 +0000)]
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

2 years agoRollup merge of #94618 - lewisclark:remove-stack-size-rounding, r=yaahc
Dylan DPC [Fri, 4 Mar 2022 21:58:37 +0000 (22:58 +0100)]
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

2 years agoRollup merge of #94596 - compiler-errors:delay-adjustment-duplicate, r=estebank
Dylan DPC [Fri, 4 Mar 2022 21:58:36 +0000 (22:58 +0100)]
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

2 years agoRollup merge of #94595 - TaKO8Ki:fix-invalid-unresolved-imports-errors-for-asterisk...
Dylan DPC [Fri, 4 Mar 2022 21:58:35 +0000 (22:58 +0100)]
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

2 years agoRollup merge of #94577 - RalfJung:simd-miri, r=scottmcm
Dylan DPC [Fri, 4 Mar 2022 21:58:34 +0000 (22:58 +0100)]
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.

2 years agoRollup merge of #94362 - Urgau:check-cfg-values, r=petrochenkov
Dylan DPC [Fri, 4 Mar 2022 21:58:34 +0000 (22:58 +0100)]
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```

2 years agoAuto merge of #94298 - Urgau:rustbuild-check-cfg, r=Mark-Simulacrum
bors [Fri, 4 Mar 2022 21:52:34 +0000 (21:52 +0000)]
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`

2 years agoAdd known-bug directive to issue #47511 test case
marmeladema [Fri, 4 Mar 2022 21:47:56 +0000 (22:47 +0100)]
Add known-bug directive to issue #47511 test case

2 years agoDowngrade `#[test]` on macro call to warning
Esteban Kuber [Fri, 4 Mar 2022 20:34:10 +0000 (20:34 +0000)]
Downgrade `#[test]` on macro call to warning

Follow up to #92959. Address #94508.

2 years agoEdit docs on consistency of `PartialOrd` and `PartialEq`
pierwill [Fri, 4 Mar 2022 19:31:23 +0000 (13:31 -0600)]
Edit docs on consistency of `PartialOrd` and `PartialEq`

Use ordered list to make the information about implementations more readable.

2 years agoDistinguish binding assignments, use Ty::needs_drop
Eric Holk [Fri, 4 Mar 2022 19:03:24 +0000 (11:03 -0800)]
Distinguish binding assignments, use Ty::needs_drop

This better captures the actual behavior, rather than using hacks around
whether the assignment has any projections.

2 years agoAuto merge of #94494 - jonhoo:bump-autocfg, r=Mark-Simulacrum
bors [Fri, 4 Mar 2022 19:01:44 +0000 (19:01 +0000)]
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

2 years agoDon't round stack size up for created threads
Lewis Clark [Fri, 4 Mar 2022 18:04:43 +0000 (18:04 +0000)]
Don't round stack size up for created threads

2 years agoSupport RelWithDebInfo for lld.
ridwanabdillahi [Fri, 4 Mar 2022 17:57:40 +0000 (09:57 -0800)]
Support RelWithDebInfo for lld.

2 years agoAuto merge of #94612 - matthiaskrgr:rollup-2jm5wkr, r=matthiaskrgr
bors [Fri, 4 Mar 2022 16:37:46 +0000 (16:37 +0000)]
Auto merge of #94612 - matthiaskrgr:rollup-2jm5wkr, r=matthiaskrgr

Rollup of 6 pull requests

r? `@ghost`

2 years agoRollup merge of #94600 - est31:master, r=notriddle
Matthias Krüger [Fri, 4 Mar 2022 16:31:09 +0000 (17:31 +0100)]
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`.

2 years agoRollup merge of #94593 - estebank:issue-94510, r=davidtwco
Matthias Krüger [Fri, 4 Mar 2022 16:31:08 +0000 (17:31 +0100)]
Rollup merge of #94593 - estebank:issue-94510, r=davidtwco

Do not recover from `Ty?` in macro parsing

Follow up to #92746. Address #94510.

2 years agoRollup merge of #94568 - bjorn3:rustbuild_remove_dead_code, r=Mark-Simulacrum
Matthias Krüger [Fri, 4 Mar 2022 16:31:07 +0000 (17:31 +0100)]
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.

2 years agoRollup merge of #94549 - m-ou-se:thread-is-finished, r=yaahc
Matthias Krüger [Fri, 4 Mar 2022 16:31:06 +0000 (17:31 +0100)]
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

2 years agoRollup merge of #94524 - bjorn3:remove_num_cpus, r=Mark-Simulacrum
Matthias Krüger [Fri, 4 Mar 2022 16:31:05 +0000 (17:31 +0100)]
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```````````````````````````

2 years agoRollup merge of #94236 - reez12g:add_track_caller_87707, r=yaahc
Matthias Krüger [Fri, 4 Mar 2022 16:31:04 +0000 (17:31 +0100)]
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.

2 years agoAuto merge of #94570 - shampoofactory:reopen-91719, r=workingjubilee
bors [Fri, 4 Mar 2022 13:06:14 +0000 (13:06 +0000)]
Auto merge of #94570 - shampoofactory:reopen-91719, r=workingjubilee

Reopen 91719

Reopened #91719, which was closed inadvertently due to technical difficulties.

2 years agoIntegrate macos x86-64 remove_dir_all() impl. Step 2: readd
Hans Kratz [Mon, 28 Feb 2022 11:30:23 +0000 (12:30 +0100)]
Integrate macos x86-64 remove_dir_all() impl. Step 2: readd

2 years agoIntegrate macos x86-64 remove_dir_all() impl. Step 1: remove
Hans Kratz [Mon, 28 Feb 2022 11:53:12 +0000 (12:53 +0100)]
Integrate macos x86-64 remove_dir_all() impl. Step 1: remove

2 years agoremove_dir_all(): try recursing first instead of trying to unlink()
Hans Kratz [Mon, 28 Feb 2022 09:34:06 +0000 (10:34 +0100)]
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.

2 years agoEnable conditional compilation checking on the Rust codebase
Loïc BRANSTETT [Wed, 23 Feb 2022 17:27:36 +0000 (18:27 +0100)]
Enable conditional compilation checking on the Rust codebase

2 years agoAuto merge of #94539 - tmiasko:string-attributes, r=nikic
bors [Fri, 4 Mar 2022 10:38:11 +0000 (10:38 +0000)]
Auto merge of #94539 - tmiasko:string-attributes, r=nikic

Pass LLVM string attributes as string slices

2 years agoAdd #![allow(unexpected_cfgs)] in preparation of global --check-cfg
Loïc BRANSTETT [Sat, 26 Feb 2022 00:31:36 +0000 (01:31 +0100)]
Add #![allow(unexpected_cfgs)] in preparation of global --check-cfg

2 years agoRemove invalid #[cfg(tests)] in index_map
Loïc BRANSTETT [Wed, 23 Feb 2022 17:22:28 +0000 (18:22 +0100)]
Remove invalid #[cfg(tests)] in index_map

2 years agoadd address sanitizer fo android
csmoe [Fri, 4 Mar 2022 09:28:29 +0000 (09:28 +0000)]
add address sanitizer fo android

2 years agoAdd well known values to --check-cfg implementation
Loïc BRANSTETT [Fri, 25 Feb 2022 15:10:26 +0000 (16:10 +0100)]
Add well known values to --check-cfg implementation

2 years agoUse if let instead of manual match
est31 [Fri, 4 Mar 2022 09:35:00 +0000 (10:35 +0100)]
Use if let instead of manual match

2 years agoAuto merge of #94159 - erikdesjardins:align-load, r=nikic
bors [Fri, 4 Mar 2022 08:14:31 +0000 (08:14 +0000)]
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)

2 years agoAuto merge of #94096 - cjgillot:ensure-stability, r=lcnr
bors [Fri, 4 Mar 2022 05:49:14 +0000 (05:49 +0000)]
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`

2 years agofix invalid `unresolved imports` errors the asterisk wildcard syntax causes
Takayuki Maeda [Fri, 4 Mar 2022 04:07:39 +0000 (13:07 +0900)]
fix invalid `unresolved imports` errors the asterisk wildcard syntax causes

use a path variabale

2 years agodelay bug instead of skipping check_expr
Michael Goulet [Fri, 4 Mar 2022 04:39:50 +0000 (20:39 -0800)]
delay bug instead of skipping check_expr

2 years agoAdd #[track_caller] to track callers when initializing poisoned Once
reez12g [Mon, 21 Feb 2022 23:37:52 +0000 (08:37 +0900)]
Add #[track_caller] to track callers when initializing poisoned Once

2 years agoAuto merge of #94588 - Dylan-DPC:rollup-7pxd0i3, r=Dylan-DPC
bors [Fri, 4 Mar 2022 02:53:40 +0000 (02:53 +0000)]
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

2 years agoDo not recover from `Ty?` in macro parsing
Esteban Kuber [Fri, 4 Mar 2022 02:03:55 +0000 (02:03 +0000)]
Do not recover from `Ty?` in macro parsing

Follow up to #92746. Address #94510.

2 years agoRollup merge of #94582 - nnethercote:fix-x-fmt-bug, r=Mark-Simulacrum
Dylan DPC [Fri, 4 Mar 2022 01:06:44 +0000 (02:06 +0100)]
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```

2 years agoRollup merge of #94575 - RalfJung:switchint-comment, r=oli-obk
Dylan DPC [Fri, 4 Mar 2022 01:06:43 +0000 (02:06 +0100)]
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```

2 years agoRollup merge of #94572 - sunfishcode:sunfishcode/handle-or, r=joshtriplett
Dylan DPC [Fri, 4 Mar 2022 01:06:42 +0000 (02:06 +0100)]
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

2 years agoRollup merge of #94466 - jonhoo:bootstrap-proper-env-flags, r=Mark-Simulacrum
Dylan DPC [Fri, 4 Mar 2022 01:06:41 +0000 (02:06 +0100)]
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

2 years agoRollup merge of #94404 - pierwill:newtype-index-noord-2, r=Aaron1011
Dylan DPC [Fri, 4 Mar 2022 01:06:41 +0000 (02:06 +0100)]
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
    }
}
```