]> git.lizzy.rs Git - rust.git/log
rust.git
20 months agoSort target features alphabetically
nils [Fri, 14 Oct 2022 20:01:18 +0000 (22:01 +0200)]
Sort target features alphabetically

20 months agoAlso run alphabetical check in src and library
nils [Fri, 14 Oct 2022 20:00:44 +0000 (22:00 +0200)]
Also run alphabetical check in src and library

20 months agoAdd some tidy-alphabetical
nils [Fri, 14 Oct 2022 19:18:03 +0000 (21:18 +0200)]
Add some tidy-alphabetical

20 months agoAuto merge of #102529 - colinba:master, r=joshtriplett
bors [Fri, 14 Oct 2022 13:41:40 +0000 (13:41 +0000)]
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

20 months agoAuto merge of #103048 - Dylan-DPC:rollup-47r62js, r=Dylan-DPC
bors [Fri, 14 Oct 2022 10:54:32 +0000 (10:54 +0000)]
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

20 months agoRollup merge of #103031 - est31:match_guard_irrefutable_let, r=oli-obk
Dylan DPC [Fri, 14 Oct 2022 10:49:16 +0000 (16:19 +0530)]
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

20 months agoRollup merge of #103025 - notriddle:notriddle/search-container-star, r=GuillaumeGomez
Dylan DPC [Fri, 14 Oct 2022 10:49:16 +0000 (16:19 +0530)]
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.

https://github.com/rust-lang/rust/blob/6b3ede3f7bc502eba7bbd202b4b9312d812adcd7/src/librustdoc/html/static/css/rustdoc.css#L1406-L1411

20 months agoRollup merge of #103018 - Rageking8:more-dupe-word-typos, r=TaKO8Ki
Dylan DPC [Fri, 14 Oct 2022 10:49:15 +0000 (16:19 +0530)]
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.

20 months agoRollup merge of #103015 - whentojump:patch, r=compiler-errors
Dylan DPC [Fri, 14 Oct 2022 10:49:15 +0000 (16:19 +0530)]
Rollup merge of #103015 - whentojump:patch, r=compiler-errors

fix a typo

20 months agoRollup merge of #102938 - c410-f3r:here-we-go-again, r=petrochenkov
Dylan DPC [Fri, 14 Oct 2022 10:49:13 +0000 (16:19 +0530)]
Rollup merge of #102938 - c410-f3r:here-we-go-again, r=petrochenkov

Move some tests to more reasonable directories

r? ``@petrochenkov``

20 months agoRollup merge of #102914 - GuillaumeGomez:migrate-css-highlight-without-change, r...
Dylan DPC [Fri, 14 Oct 2022 10:49:13 +0000 (16:19 +0530)]
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``

20 months agoRollup merge of #102856 - cjgillot:impl-single-check, r=petrochenkov
Dylan DPC [Fri, 14 Oct 2022 10:49:12 +0000 (16:19 +0530)]
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``

20 months agoRollup merge of #102847 - joshtriplett:bugfix-impl-fd-traits-for-io-types, r=m-ou-se
Dylan DPC [Fri, 14 Oct 2022 10:49:12 +0000 (16:19 +0530)]
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.

20 months agoAuto merge of #102695 - compiler-errors:int-and-float-trivial-copy, r=lcnr
bors [Fri, 14 Oct 2022 07:41:55 +0000 (07:41 +0000)]
Auto merge of #102695 - compiler-errors:int-and-float-trivial-copy, r=lcnr

Int and float inference variables are trivially copy

Fixes #102645

20 months agoAdd test
Michael Goulet [Wed, 5 Oct 2022 03:35:50 +0000 (03:35 +0000)]
Add test

20 months agofloat and int vars are trivially copy
Michael Goulet [Wed, 5 Oct 2022 03:13:32 +0000 (03:13 +0000)]
float and int vars are trivially copy

20 months agomore dupe word typos
Rageking8 [Thu, 13 Oct 2022 16:25:34 +0000 (00:25 +0800)]
more dupe word typos

20 months agoAuto merge of #102684 - JhonnyBillM:delete-target-data-layout-errors-wrapper, r=davidtwco
bors [Fri, 14 Oct 2022 04:35:22 +0000 (04:35 +0000)]
Auto merge of #102684 - JhonnyBillM:delete-target-data-layout-errors-wrapper, r=davidtwco

Move `IntoDiagnostic` conformance for `TargetDataLayoutErrors` into `rustc_errors`

Addressed this suggestion https://github.com/rust-lang/rust/pull/101558#issuecomment-1243830009.

This way we comply with the Coherence rule given that `IntoDiagnostic` trait is defined in `rustc_errors`, and almost all other crates depend on it.

20 months agoAuto merge of #103026 - matthiaskrgr:rollup-gfmlfkt, r=matthiaskrgr
bors [Fri, 14 Oct 2022 01:28:06 +0000 (01:28 +0000)]
Auto merge of #103026 - matthiaskrgr:rollup-gfmlfkt, r=matthiaskrgr

Rollup of 7 pull requests

Successful merges:

 - #103000 (Add suggestion to the "missing native library" error)
 - #103006 (rustdoc: don't ICE on `TyKind::Typeof`)
 - #103008 (replace ReErased with fresh region vars in opaque types)
 - #103011 (Improve rustdoc `unsafe-fn` GUI test)
 - #103013 (Add new bootstrap entrypoints to triagebot)
 - #103016 (Ensure enum cast moves)
 - #103021 (Add links to relevant pages to find constraint information)

Failed merges:

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

20 months agoSuppress irrefutable let patterns lint for prefixes in match guards
est31 [Thu, 13 Oct 2022 23:46:24 +0000 (01:46 +0200)]
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.

20 months agoRollup merge of #103021 - GuillaumeGomez:constraint-pages, r=Amanieu
Matthias Krüger [Thu, 13 Oct 2022 22:45:20 +0000 (00:45 +0200)]
Rollup merge of #103021 - GuillaumeGomez:constraint-pages, r=Amanieu

Add links to relevant pages to find constraint information

I think it can be quite helpful to find this information more quickly.

r? `@Amanieu`

20 months agoRollup merge of #103016 - nbdd0121:enum, r=pnkfelix
Matthias Krüger [Thu, 13 Oct 2022 22:45:19 +0000 (00:45 +0200)]
Rollup merge of #103016 - nbdd0121:enum, r=pnkfelix

Ensure enum cast moves

Fix #102389

r? ``@pnkfelix``

20 months agoRollup merge of #103013 - Nilstrieb:patch-1, r=jyn514
Matthias Krüger [Thu, 13 Oct 2022 22:45:19 +0000 (00:45 +0200)]
Rollup merge of #103013 - Nilstrieb:patch-1, r=jyn514

Add new bootstrap entrypoints to triagebot

They haven't been added yet, as seen in #103007.

r? ``@jyn514``

20 months agoRollup merge of #103011 - GuillaumeGomez:improve-unsafe-fn-gui-test, r=notriddle
Matthias Krüger [Thu, 13 Oct 2022 22:45:18 +0000 (00:45 +0200)]
Rollup merge of #103011 - GuillaumeGomez:improve-unsafe-fn-gui-test, r=notriddle

Improve rustdoc `unsafe-fn` GUI test

r? ``@notriddle``

20 months agoRollup merge of #103008 - aliemjay:opaque-parent-substs, r=oli-obk
Matthias Krüger [Thu, 13 Oct 2022 22:45:18 +0000 (00:45 +0200)]
Rollup merge of #103008 - aliemjay:opaque-parent-substs, r=oli-obk

replace ReErased with fresh region vars in opaque types

See inline comments.

Prior art #102943. cc ``@compiler-errors`` ``@oli-obk``

Fixes #100267
Fixes #101940
Fixes #102649
Fixes #102510

20 months agoRollup merge of #103006 - WaffleLapkin:rustdoc_dont, r=compiler-errors
Matthias Krüger [Thu, 13 Oct 2022 22:45:17 +0000 (00:45 +0200)]
Rollup merge of #103006 - WaffleLapkin:rustdoc_dont, r=compiler-errors

rustdoc: don't ICE on `TyKind::Typeof`

Fixes #102986

I'm not sure why rustdoc started seeing `TyKind::Typeof` all of a sudden (the code being editted was last touched 3 months ago), probably something to do with error recovery? idk.

20 months agoRollup merge of #103000 - wesleywiser:suggest_libname, r=compiler-errors
Matthias Krüger [Thu, 13 Oct 2022 22:45:17 +0000 (00:45 +0200)]
Rollup merge of #103000 - wesleywiser:suggest_libname, r=compiler-errors

Add suggestion to the "missing native library" error

If we fail to locate a native library that we are linking with, it could be the case the user entered a complete file name like `foo.lib` or `libfoo.a` when we expect them to simply provide `foo`.

In this situation, we now detect that case and suggest the user only provide the library name itself.

20 months agoAuto merge of #102700 - oli-obk:0xDEAD_TAIT, r=compiler-errors
bors [Thu, 13 Oct 2022 22:39:05 +0000 (22:39 +0000)]
Auto merge of #102700 - oli-obk:0xDEAD_TAIT, r=compiler-errors

Check hidden types in dead code

fixes #99490

r? `@compiler-errors`

best reviewed commit by commit

20 months agorustdoc: remove unused CSS `.search-container > *`
Michael Howell [Thu, 13 Oct 2022 21:53:57 +0000 (14:53 -0700)]
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.

20 months agoAdd links to relevant pages to find constraint information
Guillaume Gomez [Thu, 13 Oct 2022 20:05:24 +0000 (22:05 +0200)]
Add links to relevant pages to find constraint information

20 months agoReport duplicate definition in impls with overlap check.
Camille GILLOT [Sat, 13 Aug 2022 10:32:01 +0000 (12:32 +0200)]
Report duplicate definition in impls with overlap check.

20 months agoFix test
Gary Guo [Thu, 13 Oct 2022 16:46:33 +0000 (17:46 +0100)]
Fix test

20 months agoBless tests
Gary Guo [Thu, 13 Oct 2022 16:24:27 +0000 (17:24 +0100)]
Bless tests

20 months agoAdd test for issue 102389
Gary Guo [Thu, 13 Oct 2022 16:24:19 +0000 (17:24 +0100)]
Add test for issue 102389

20 months agofix a typo
wtj [Thu, 13 Oct 2022 09:00:36 +0000 (17:00 +0800)]
fix a typo

20 months agoreplace ReErased with fresh region vars in opaque types
Ali MJ Al-Nasrawy [Thu, 13 Oct 2022 10:49:38 +0000 (13:49 +0300)]
replace ReErased with fresh region vars in opaque types

20 months agoEnsure enum cast moves
Gary Guo [Thu, 13 Oct 2022 15:44:31 +0000 (16:44 +0100)]
Ensure enum cast moves

20 months agoAdd new bootstrap entrypoints to triagebot
nils [Thu, 13 Oct 2022 15:38:30 +0000 (17:38 +0200)]
Add new bootstrap entrypoints to triagebot

20 months agoMove some tests to more reasonable directories
Caio [Thu, 13 Oct 2022 15:32:58 +0000 (12:32 -0300)]
Move some tests to more reasonable directories

20 months agoAuto merge of #103009 - Dylan-DPC:rollup-9c2tng6, r=Dylan-DPC
bors [Thu, 13 Oct 2022 14:59:39 +0000 (14:59 +0000)]
Auto merge of #103009 - Dylan-DPC:rollup-9c2tng6, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #102765 (Suggest `==` to the first expr which has `ExprKind::Assign` kind)
 - #102854 (openbsd: don't reallocate a guard page on the stack.)
 - #102904 (Print return-position `impl Trait` in trait verbosely if `-Zverbose`)
 - #102947 (Sort elaborated existential predicates in `object_ty_for_trait`)
 - #102956 (Use `full_res` instead of `expect_full_res`)
 - #102999 (Delay `is_intrinsic` query until after we've determined the callee is a function)

Failed merges:

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

20 months agoAdd test for issue 102986
Maybe Waffle [Thu, 13 Oct 2022 14:57:50 +0000 (14:57 +0000)]
Add test for issue 102986

20 months agoImprove code for unsafe-fn rustdoc GUI test
Guillaume Gomez [Thu, 13 Oct 2022 14:51:04 +0000 (16:51 +0200)]
Improve code for unsafe-fn rustdoc GUI test

20 months agoUpdate browser-ui-test version to 0.12.3
Guillaume Gomez [Thu, 13 Oct 2022 14:50:11 +0000 (16:50 +0200)]
Update browser-ui-test version to 0.12.3

20 months agoRollup merge of #102999 - compiler-errors:issue-102985, r=fee1-dead
Dylan DPC [Thu, 13 Oct 2022 12:49:21 +0000 (18:19 +0530)]
Rollup merge of #102999 - compiler-errors:issue-102985, r=fee1-dead

Delay `is_intrinsic` query until after we've determined the callee is a function

Fixes #102985

20 months agoRollup merge of #102956 - TaKO8Ki:fix-102946, r=fee1-dead
Dylan DPC [Thu, 13 Oct 2022 12:49:21 +0000 (18:19 +0530)]
Rollup merge of #102956 - TaKO8Ki:fix-102946, r=fee1-dead

Use `full_res` instead of `expect_full_res`

Fixes #102946
Fixes #102978

20 months agoRollup merge of #102947 - compiler-errors:sort-elaborated-existentials, r=cjgillot
Dylan DPC [Thu, 13 Oct 2022 12:49:20 +0000 (18:19 +0530)]
Rollup merge of #102947 - compiler-errors:sort-elaborated-existentials, r=cjgillot

Sort elaborated existential predicates in `object_ty_for_trait`

r? `@cjgillot`

I think that #102845 caused #102933. Depending on the order that we elaborate these existential projection predicates, there's no guarantee that they'll be sorted by def id, which is what is failing the assertion in the issue.

Fixes #102933
Fixes #102973

20 months agoRollup merge of #102904 - compiler-errors:rpitit-verbosely, r=cjgillot
Dylan DPC [Thu, 13 Oct 2022 12:49:20 +0000 (18:19 +0530)]
Rollup merge of #102904 - compiler-errors:rpitit-verbosely, r=cjgillot

Print return-position `impl Trait` in trait verbosely if `-Zverbose`

Makes the behavior a bit closer to regular `impl Trait` printing

20 months agoRollup merge of #102854 - semarie:openbsd-immutablestack, r=m-ou-se
Dylan DPC [Thu, 13 Oct 2022 12:49:19 +0000 (18:19 +0530)]
Rollup merge of #102854 - semarie:openbsd-immutablestack, r=m-ou-se

openbsd: don't reallocate a guard page on the stack.

the kernel currently enforce that a stack is immutable. calling mmap(2) or  mprotect(2) to change it will result in EPERM, which generate a panic!().

so just do like for Linux, and trust the kernel to do the right thing.

20 months agoRollup merge of #102765 - TaKO8Ki:follow-up-to-102708, r=compiler-errors
Dylan DPC [Thu, 13 Oct 2022 12:49:18 +0000 (18:19 +0530)]
Rollup merge of #102765 - TaKO8Ki:follow-up-to-102708, r=compiler-errors

Suggest `==` to the first expr which has `ExprKind::Assign` kind

follow-up to #102708

[playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=4241dc33ed8af02e1ef530d6b14903fd)

20 months agoAuto merge of #102919 - luojia65:update-stdarch, r=Amanieu
bors [Thu, 13 Oct 2022 12:03:46 +0000 (12:03 +0000)]
Auto merge of #102919 - luojia65:update-stdarch, r=Amanieu

library: update stdarch submodule

It has been one month since we update `stdarch`  submodule into main branch Rust, it includes various fixes in code and more neat documents. This pull request also adds missing features to ensure we can build latest stdarch submodule.

The documents after this pull request:
<details>

![图片](https://user-images.githubusercontent.com/40385009/195123337-a6c4cfaa-a7b9-4574-b524-c43683e6540c.png)
</details>

Comparing to current nightly:
<details>

![图片](https://user-images.githubusercontent.com/40385009/195123430-e047cff1-a925-4d2d-ae1c-da9769383a9c.png)
</details>

r? `@Amanieu`

20 months agoAdd suggestion to the "missing native library" error
Wesley Wiser [Thu, 13 Oct 2022 02:52:31 +0000 (22:52 -0400)]
Add suggestion to the "missing native library" error

If we fail to locate a native library that we are linking with, it could
be the case the user entered a complete file name like `foo.lib` or
`libfoo.a` when we expect them to simply provide `foo`.

In this situation, we now detect that case and suggest the user only
provide the library name itself.

20 months agorustdoc: don't ICE on `TyKind::Typeof`
Maybe Waffle [Thu, 13 Oct 2022 07:33:34 +0000 (07:33 +0000)]
rustdoc: don't ICE on `TyKind::Typeof`

20 months agoAuto merge of #102655 - joboet:windows_tls_opt, r=ChrisDenton
bors [Thu, 13 Oct 2022 06:49:29 +0000 (06:49 +0000)]
Auto merge of #102655 - joboet:windows_tls_opt, r=ChrisDenton

Optimize TLS on Windows

This implements the suggestion in the current TLS code to embed the linked list of destructors in the `StaticKey` structure to save allocations. Additionally, locking is avoided when no destructor needs to be run. By using one Windows-provided `Once` per key instead of a global lock, locking is more finely-grained (this unblocks #100579).

20 months agoAuto merge of #102995 - JohnTitor:rollup-yomkwge, r=JohnTitor
bors [Thu, 13 Oct 2022 03:33:40 +0000 (03:33 +0000)]
Auto merge of #102995 - JohnTitor:rollup-yomkwge, r=JohnTitor

Rollup of 7 pull requests

Successful merges:

 - #102641 (Support casting boxes to dyn*)
 - #102836 (rustc_target: Fix json target specs using LLD linker flavors in link args)
 - #102949 (should-skip-this: add missing backslash)
 - #102967 (Add test for issue 102964)
 - #102971 (tidy: error if a lang feature is already present)
 - #102974 (Fix small word dupe typos)
 - #102980 (rustdoc: merge separate `.item-info` CSS)

Failed merges:

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

20 months agoDelay intrinsic call until after we've determined the callee is a function
Michael Goulet [Thu, 13 Oct 2022 03:10:00 +0000 (03:10 +0000)]
Delay intrinsic call until after we've determined the callee is a function

20 months agoPrint RPITIT verbosely if -Zverbose
Michael Goulet [Mon, 10 Oct 2022 22:45:02 +0000 (22:45 +0000)]
Print RPITIT verbosely if -Zverbose

20 months agoSort elaborated existential predicates in object_ty_for_trait
Michael Goulet [Wed, 12 Oct 2022 05:10:29 +0000 (05:10 +0000)]
Sort elaborated existential predicates in object_ty_for_trait

20 months agolibrary: update stdarch submodule
luojia65 [Tue, 11 Oct 2022 14:42:25 +0000 (22:42 +0800)]
library: update stdarch submodule

add feature target_feature_11 and riscv_target_feature

20 months agoRollup merge of #102980 - notriddle:notriddle/content, r=GuillaumeGomez
Yuki Okushi [Thu, 13 Oct 2022 00:41:28 +0000 (09:41 +0900)]
Rollup merge of #102980 - notriddle:notriddle/content, r=GuillaumeGomez

rustdoc: merge separate `.item-info` CSS

Rough timeline:

* The longer `.content .item-info` selector originated in 110e7270ab7b0700ce714b8b1c7e509195dea2c4. No reason seems to be given in the PR why it needed the `.content` part, but it was probably added because of <https://github.com/rust-lang/rust/blob/110e7270ab7b0700ce714b8b1c7e509195dea2c4/src/librustdoc/html/static/rustdoc.css#L476-L478>. That selector with the margin-bottom was removed when CSS containment was added in 8846c0853d8687fda0e5f23f6687b03b243980ee.
* `.stability` was renamed `.item-info` in caf6c5790a858893c1d32ed2054c9577d12e7493.
* The selector without the `.content` was added in d48a39a5e24ab08f727d1c919dc2af98c333ad14.

20 months agoRollup merge of #102974 - Rageking8:fix-small-word-dupe-typos, r=JohnTitor
Yuki Okushi [Thu, 13 Oct 2022 00:41:27 +0000 (09:41 +0900)]
Rollup merge of #102974 - Rageking8:fix-small-word-dupe-typos, r=JohnTitor

Fix small word dupe typos

20 months agoRollup merge of #102971 - est31:tidy_duplicate_lang_features, r=jyn514
Yuki Okushi [Thu, 13 Oct 2022 00:41:27 +0000 (09:41 +0900)]
Rollup merge of #102971 - est31:tidy_duplicate_lang_features, r=jyn514

tidy: error if a lang feature is already present

If a lang feature gets declared twice, like for example as a result of a mistake during stabilization, emit an error in tidy. Library features already have this logic.

Inspired by a mistake done during `half_open_range_patterns` stabilization: https://github.com/rust-lang/rust/pull/102275/files#r991292215

The PR requires #102883 to be merged before CI turns green because the check is doing its job.

For reviewers, I suggest [turning off whitespace changes](https://github.com/rust-lang/rust/pull/102971/files?w=1) in the diff by adding `?w=1` to the url, as a large part of the diff is just about removing one level of indentation.

20 months agoRollup merge of #102967 - Rageking8:add-test-for-issue-102964, r=TaKO8Ki
Yuki Okushi [Thu, 13 Oct 2022 00:41:26 +0000 (09:41 +0900)]
Rollup merge of #102967 - Rageking8:add-test-for-issue-102964, r=TaKO8Ki

Add test for issue 102964

Fixes #102964

20 months agoRollup merge of #102949 - RalfJung:should-skip-this, r=Dylan-DPC
Yuki Okushi [Thu, 13 Oct 2022 00:41:26 +0000 (09:41 +0900)]
Rollup merge of #102949 - RalfJung:should-skip-this, r=Dylan-DPC

should-skip-this: add missing backslash

I screwed this up in https://github.com/rust-lang/rust/pull/102780.

r? ``@Mark-Simulacrum``

20 months agoRollup merge of #102836 - petrochenkov:jsonspec, r=eholk
Yuki Okushi [Thu, 13 Oct 2022 00:41:25 +0000 (09:41 +0900)]
Rollup merge of #102836 - petrochenkov:jsonspec, r=eholk

rustc_target: Fix json target specs using LLD linker flavors in link args

Fixes https://github.com/rust-lang/rust/pull/101988#issuecomment-1272407248 (a regression introduced by https://github.com/rust-lang/rust/pull/101988).

20 months agoRollup merge of #102641 - eholk:dyn-star-box, r=compiler-errors
Yuki Okushi [Thu, 13 Oct 2022 00:41:25 +0000 (09:41 +0900)]
Rollup merge of #102641 - eholk:dyn-star-box, r=compiler-errors

Support casting boxes to dyn*

Boxes have a pointer type at codegen time which LLVM does not allow to be transparently converted to an integer. Work around this by inserting a `ptrtoint` instruction if the argument is a pointer.

r? ``@compiler-errors``

Fixes #102427

20 months agoAuto merge of #102372 - abrown:issue-102157, r=thomcc
bors [Thu, 13 Oct 2022 00:37:28 +0000 (00:37 +0000)]
Auto merge of #102372 - abrown:issue-102157, r=thomcc

Allow compiling the `wasm32-wasi` std library with atomics

The issue #102157 demonstrates how currently the `-Z build-std` option will fail when re-compiling the standard library with `RUSTFLAGS` like `RUSTFLAGS="-C target-feature=+atomics,+bulk-memory -C link-args=--shared-memory"`. This change attempts to resolve those build issues by depending on the the WebAssembly `futex` module and providing an implementation for `env_lock`. Fixes #102157.

20 months agoAdd a fixme
Eric Holk [Wed, 12 Oct 2022 21:26:22 +0000 (14:26 -0700)]
Add a fixme

20 months agotidy: error if a lang feature is already present
est31 [Wed, 12 Oct 2022 15:57:05 +0000 (17:57 +0200)]
tidy: error if a lang feature is already present

If a lang feature gets declared twice, like for example as
a result of a mistake during stabilization, emit an error
in tidy. Library features already have this logic.

20 months agoAuto merge of #101679 - compiler-errors:rpitit-default-body, r=nikomatsakis
bors [Wed, 12 Oct 2022 21:03:47 +0000 (21:03 +0000)]
Auto merge of #101679 - compiler-errors:rpitit-default-body, r=nikomatsakis

Support default-body trait functions with return-position `impl Trait` in traits

Introduce a new `Trait` candidate kind for the `ImplTraitInTrait` projection candidate, which just projects an RPITIT down to its opaque type form.

This is a hack until we lower RPITITs to regular associated types, after which we will need to rework how these default bodies are type-checked, so comments are left in a few places for us to clean up later.

Fixes #101665

20 months agoUPDATE - Move IntoDiagnosticArg implementations to diagnostic_impls file
Jhonny Bill Mena [Wed, 12 Oct 2022 20:55:28 +0000 (16:55 -0400)]
UPDATE - Move IntoDiagnosticArg implementations to diagnostic_impls file

20 months agoADD - IntoDiagnostic conformance for TargetDataLayoutErrors in rustc_errors
Jhonny Bill Mena [Wed, 5 Oct 2022 00:56:05 +0000 (20:56 -0400)]
ADD - IntoDiagnostic conformance for TargetDataLayoutErrors in rustc_errors

This way we comply with the Coherence rule given that IntoDiagnostic trait is defined in rustc_errors, and almost all other crates depend on it.

20 months agorustdoc: merge separate `.item-info` CSS
Michael Howell [Wed, 12 Oct 2022 18:24:23 +0000 (11:24 -0700)]
rustdoc: merge separate `.item-info` CSS

Rough timeline:

* The longer `.content .item-info` selector originated in
  110e7270ab7b0700ce714b8b1c7e509195dea2c4. No reason seems to be given in
  the PR why it needed the `.content` part, but it was probably added because
  of <https://github.com/rust-lang/rust/blob/110e7270ab7b0700ce714b8b1c7e509195dea2c4/src/librustdoc/html/static/rustdoc.css#L476-L478>.
  That selector with the margin-bottom was removed when CSS containment
  was added in 8846c0853d8687fda0e5f23f6687b03b243980ee.
* `.stability` was renamed `.item-info` in
  caf6c5790a858893c1d32ed2054c9577d12e7493.
* The selector without the `.content` was added in
  d48a39a5e24ab08f727d1c919dc2af98c333ad14.

20 months agoAuto merge of #102975 - Dylan-DPC:rollup-vzuwsh2, r=Dylan-DPC
bors [Wed, 12 Oct 2022 17:48:31 +0000 (17:48 +0000)]
Auto merge of #102975 - Dylan-DPC:rollup-vzuwsh2, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #102623 (translation: eager translation)
 - #102719 (Enforce alphabetical sorting with tidy)
 - #102830 (Unify `tcx.constness` query and param env constness checks)
 - #102883 (Fix stabilization of `feature(half_open_range_patterns)`)
 - #102927 (Fix `let` keyword removal suggestion in structs)
 - #102936 (rustdoc: remove unused CSS `nav.sum`)
 - #102940 (Update books)

Failed merges:

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

20 months agofix small word dupe typos
Rageking8 [Wed, 12 Oct 2022 16:12:19 +0000 (00:12 +0800)]
fix small word dupe typos

20 months agoRollup merge of #102940 - ehuss:update-books, r=ehuss
Dylan DPC [Wed, 12 Oct 2022 16:43:26 +0000 (22:13 +0530)]
Rollup merge of #102940 - ehuss:update-books, r=ehuss

Update books

## nomicon

1 commits in f53bfa056929217870a5d2df1366d2e7ba35096d..9c73283775466d22208a0b28afcab44db4c0cc10
2022-09-05 07:19:02 -0700 to 2022-09-30 07:31:22 +0900
- Fix typo (rust-lang/nomicon#380)

## reference

9 commits in a7cdac33ca7356ad49d5c2b5e2c5010889b33eee..f6ed74f582bddcec73f753eafaab3749c4f7df61
2022-09-19 17:39:58 -0700 to 2022-10-08 02:43:26 -0700
- Typo 'a' -&gt; 'an' (rust-lang/reference#1280)
- One line one sentence for expressions and statements main chapters (rust-lang/reference#1277)
- Document let else statements (rust-lang/reference#1156)
- Document `label_break_value` in the reference (rust-lang/reference#1263)
- Document target_has_atomic (rust-lang/reference#1171)
- update 'unsafe' (rust-lang/reference#1278)
- Update tokens.md (rust-lang/reference#1276)
- One sentence, one line Patterns chapter (rust-lang/reference#1275)
- Use semver-compliant example version (rust-lang/reference#1272)

## rust-by-example

9 commits in 767a6bd9727a596d7cfdbaeee475e65b2670ea3a..5e7b296d6c345addbd748f242aae28c42555c015
2022-09-14 09:17:18 -0300 to 2022-10-05 08:24:45 -0300
- Make it clear that rustdoc uses the commonmark spec (rust-lang/rust-by-example#1622)
- Update defaults.md (rust-lang/rust-by-example#1615)
- added "see also" for the @ binding sigil (rust-lang/rust-by-example#1612)
- add more precision to the effects of --bin flag (rust-lang/rust-by-example#1607)
- create bar project in cargo/dependencies example (rust-lang/rust-by-example#1606)
- use consistent wording about type annotation (rust-lang/rust-by-example#1603)
- cast.md improvements (rust-lang/rust-by-example#1599)
- Fix typo in macros.md (rust-lang/rust-by-example#1598)
- Corrected mistaken "The" instead of "There" (rust-lang/rust-by-example#1617)

## rustc-dev-guide

2 commits in 9a86c0467bbe42056f73fdf5b03fff757d7c4a9b..7518c3445dc02df0d196f5f84e568d633c5141fb
2022-10-07 18:34:51 +0200 to 2022-10-08 12:29:47 +0200
- Update debugging.md
- Use llvm subdomain for compiler-explorer link

## embedded-book

1 commits in 4ce51cb7441a6f02b5bf9b07b2eb755c21ab7954..c533348edd69f11a8f4225d633a05d7093fddbf3
2022-09-15 08:53:09 +0000 to 2022-10-10 10:16:49 +0000
- Fix a typo in registers.md  (rust-embedded/book#330)

20 months agoRollup merge of #102936 - notriddle:notriddle/nav-sum, r=Dylan-DPC
Dylan DPC [Wed, 12 Oct 2022 16:43:26 +0000 (22:13 +0530)]
Rollup merge of #102936 - notriddle:notriddle/nav-sum, r=Dylan-DPC

rustdoc: remove unused CSS `nav.sum`

This was added in 4fd061c426902b0904c65e64a3780b21f9ab3afb, but never actually used.

20 months agoRollup merge of #102927 - compiler-errors:let, r=davidtwco
Dylan DPC [Wed, 12 Oct 2022 16:43:26 +0000 (22:13 +0530)]
Rollup merge of #102927 - compiler-errors:let, r=davidtwco

Fix `let` keyword removal suggestion in structs

(1.) Fixes a bug where, given this code:
```rust
struct Foo {
  let x: i32,
}
```

We were parsing the field name as `let` instead of `x`, which causes issues later on in the type-checking phase.

(2.) Also, suggestions for `let: i32` as a field regressed, displaying this extra `help:` which is removed by this PR

```
help: remove the let, the `let` keyword is not allowed in struct field definitions
  |
2 -     let: i32,
2 +     : i32,
```

(3.) Makes the suggestion text a bit more succinct, since we don't need to re-explain that `let` is not allowed in this position (since it's in a note that follows). This causes the suggestion to render inline as well.

cc `@gimbles,` this addresses a few nits I mentioned in your PR.

20 months agoRollup merge of #102883 - Urgau:fix-stabilization-half_open_range_patterns, r=lcnr
Dylan DPC [Wed, 12 Oct 2022 16:43:25 +0000 (22:13 +0530)]
Rollup merge of #102883 - Urgau:fix-stabilization-half_open_range_patterns, r=lcnr

Fix stabilization of `feature(half_open_range_patterns)`

Fixes https://github.com/rust-lang/rust/pull/102275/files#r991292215 by removing the relevant code that was [already partial moved](https://github.com/rust-lang/rust/pull/102275/files#diff-307e0d3a2037c11a3fa16822fbaa0fec08e57ac7d0d6e7354f6005c9482a9e26).

cc `@Undin`

20 months agoRollup merge of #102830 - compiler-errors:constness-parity, r=fee1-dead
Dylan DPC [Wed, 12 Oct 2022 16:43:25 +0000 (22:13 +0530)]
Rollup merge of #102830 - compiler-errors:constness-parity, r=fee1-dead

Unify `tcx.constness` query and param env constness checks

The checks that we do in the `constness` query seem inconsistent with the checks that we do to determine if an item's param-env is const, so I merged them into the `constness` query and call that from the `param_env` query.

I'm not sure if this totally makes sense -- is there a case where `tcx.param_env()` would return a const param-env for an item whose `tcx.constness()` is `Constness::NotConst`? Because if not, it seems a bit dangerous that these two differ.

Luckily, not many places actually use `tcx.constness()`, and the checks in `tcx.param_env()` seem stricter than the checks in `tcx.constness()` (at least for the types of items we type-check).

Also, due to the way that `tcx.param_env()` is implemented, it _never_ used to return a const param-env for a item coming from a different crate, which also seems dangerous (though also probably not weaponizable currently, because we seldom actually compute the param-env for a non-local item).

20 months agoRollup merge of #102719 - Nilstrieb:tidy-alphabetical, r=jackh726
Dylan DPC [Wed, 12 Oct 2022 16:43:24 +0000 (22:13 +0530)]
Rollup merge of #102719 - Nilstrieb:tidy-alphabetical, r=jackh726

Enforce alphabetical sorting with tidy

We have many places where things are supposed to be sorted alphabetically. For the smaller and more recent size assertions, this is mostly upheld, but in other more... alive places it's very messy.

This introduces a new tidy directive to check that a section of code is sorted alphabetically and fixes all places where sorting has gone wrong.

20 months agoRollup merge of #102623 - davidtwco:translation-eager, r=compiler-errors
Dylan DPC [Wed, 12 Oct 2022 16:43:23 +0000 (22:13 +0530)]
Rollup merge of #102623 - davidtwco:translation-eager, r=compiler-errors

translation: eager translation

Part of #100717. See [Zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20lists!/near/295010720) for additional context.

- **Store diagnostic arguments in a `HashMap`**: Eager translation will enable subdiagnostics to be translated multiple times with different arguments - this requires the ability to replace the value of one argument with a new value, which is better suited to a `HashMap` than the previous storage, a `Vec`.
- **Add `AddToDiagnostic::add_to_diagnostic_with`**: `AddToDiagnostic::add_to_diagnostic_with` is similar to the previous `AddToDiagnostic::add_to_diagnostic` but takes a function that can be used by the caller to modify diagnostic messages originating from the subdiagnostic (such as performing translation eagerly). `add_to_diagnostic` now just calls `add_to_diagnostic_with` with an empty closure.
- **Add `DiagnosticMessage::Eager`**: Add variant of `DiagnosticMessage` for eagerly translated messages
(messages in the target language which don't need translated by the emitter during emission). Also adds `eager_subdiagnostic` function which is intended to be invoked by the diagnostic derive for subdiagnostic fields which are marked as needing eager translation.
- **Support `#[subdiagnostic(eager)]`**: Add support for `eager` argument to the `subdiagnostic` attribute which generates a call to `eager_subdiagnostic`.
- **Finish migrating `rustc_query_system`**: Using eager translation, migrate the remaining repeated cycle stack diagnostic.
- **Split formatting initialization and use in diagnostic derives**: Diagnostic derives have previously had to take special care when ordering the generated code so that fields were not used after a move.

  This is unlikely for most fields because a field is either annotated with a subdiagnostic attribute and is thus likely a `Span` and copiable, or is a argument, in which case it is only used once by `set_arg`
anyway.

  However, format strings for code in suggestions can result in fields being used after being moved if not ordered carefully. As a result, the derive currently puts `set_arg` calls last (just before emission), such as:

      let diag = { /* create diagnostic */ };

      diag.span_suggestion_with_style(
          span,
          fluent::crate::slug,
          format!("{}", __binding_0),
          Applicability::Unknown,
          SuggestionStyle::ShowAlways
      );
      /* + other subdiagnostic additions */

      diag.set_arg("foo", __binding_0);
      /* + other `set_arg` calls */

      diag.emit();

  For eager translation, this doesn't work, as the message being translated eagerly can assume that all arguments are available - so arguments _must_ be set first.

  Format strings for suggestion code are now separated into two parts - an initialization line that performs the formatting into a variable, and a usage in the subdiagnostic addition.

  By separating these parts, the initialization can happen before arguments are set, preserving the desired order so that code compiles, while still enabling arguments to be set before subdiagnostics are added.

      let diag = { /* create diagnostic */ };

      let __code_0 = format!("{}", __binding_0);
      /* + other formatting */

      diag.set_arg("foo", __binding_0);
      /* + other `set_arg` calls */

      diag.span_suggestion_with_style(
          span,
          fluent::crate::slug,
          __code_0,
          Applicability::Unknown,
          SuggestionStyle::ShowAlways
      );
      /* + other subdiagnostic additions */

      diag.emit();

- **Remove field ordering logic in diagnostic derive:** Following the approach taken in earlier commits to separate formatting initialization from use in the subdiagnostic derive, simplify the diagnostic derive by removing the field-ordering logic that previously solved this problem.

r? ```@compiler-errors```

20 months agoAdd broken test for AFIT with RPITIT
Michael Goulet [Wed, 5 Oct 2022 03:52:38 +0000 (03:52 +0000)]
Add broken test for AFIT with RPITIT

20 months agoAuto merge of #102732 - RalfJung:assert_unsafe_precondition2, r=bjorn3
bors [Wed, 12 Oct 2022 14:39:43 +0000 (14:39 +0000)]
Auto merge of #102732 - RalfJung:assert_unsafe_precondition2, r=bjorn3

nicer errors from assert_unsafe_precondition

This makes the errors shown by cargo-careful nicer, and since `panic_no_unwind` is `nounwind noreturn` it hopefully doesn't have bad codegen impact. Thanks to `@bjorn3` for the hint!

Would be nice if we could somehow supply our own (static) message to print, currently it always prints `panic in a function that cannot unwind`. But still, this is better than before.

20 months agoadd test for issue 102964
Rageking8 [Wed, 12 Oct 2022 14:32:20 +0000 (22:32 +0800)]
add test for issue 102964

20 months agoError if tidy-alphabetical-end was not found
Nilstrieb [Fri, 7 Oct 2022 17:38:38 +0000 (19:38 +0200)]
Error if tidy-alphabetical-end was not found

20 months agoUse `tidy-alphabetical` in the compiler
Nilstrieb [Wed, 5 Oct 2022 19:46:21 +0000 (21:46 +0200)]
Use `tidy-alphabetical` in the compiler

20 months agoAdd tidy directoy `tidy-alphabetical`
Nilstrieb [Tue, 4 Oct 2022 20:34:07 +0000 (22:34 +0200)]
Add tidy directoy `tidy-alphabetical`

It can be used to ensure that a list of things is sorted alphabetically.
It goes off lines, but contains several heuristics to work with normal
Rust code (looking at indentation, ignoring comments and attributes).

20 months agoAuto merge of #102460 - flba-eb:fix_85261_prevent_alloc_after_fork, r=thomcc
bors [Wed, 12 Oct 2022 10:51:31 +0000 (10:51 +0000)]
Auto merge of #102460 - flba-eb:fix_85261_prevent_alloc_after_fork, r=thomcc

Prevent UB in child process after calling libc::fork

After calling libc::fork, the child process tried to access a TLS variable when processing a panic. This caused a memory allocation which is UB in the child.
To prevent this from happening, the panic handler will not access the TLS variable in case `panic::always_abort` was called before.

Fixes #85261 (not only on Android systems, but also on Linux/QNX with TLS disabled, see issue for more details)

Main drawbacks of this fix:
* Panic messages can incorrectly omit `core::panic::PanicInfo` struct in case several panics (of multiple threads) occur at the same time. The handler cannot distinguish between multiple panics in different threads or recursive ones in the same thread, but the message will contain a hint about the uncertainty.
* `panic_count::increase()` will be a bit slower as it has an additional `if`, but this should be irrelevant as it is only called in case of a panic.

20 months agofix #102946
Takayuki Maeda [Wed, 12 Oct 2022 10:03:46 +0000 (19:03 +0900)]
fix #102946

20 months agoAuto merge of #102948 - Dylan-DPC:rollup-j8h74rb, r=Dylan-DPC
bors [Wed, 12 Oct 2022 06:57:24 +0000 (06:57 +0000)]
Auto merge of #102948 - Dylan-DPC:rollup-j8h74rb, r=Dylan-DPC

Rollup of 8 pull requests

Successful merges:

 - #102110 (Migrate rustc_passes diagnostics)
 - #102187 (Use correct location for type tests in promoted constants)
 - #102239 (Move style guide to rust-lang/rust)
 - #102578 (Panic for invalid arguments of `{integer primitive}::ilog{,2,10}` in all modes)
 - #102811 (Use memset to initialize readbuf)
 - #102890 (Check representability in adt_sized_constraint)
 - #102913 (unify `IsPattern` and `IsImport` enum in `show_candidates`)
 - #102924 (rustdoc: remove unused classes from sidebar links)

Failed merges:

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

20 months agoshould-skip-this: add missing backslash
Ralf Jung [Wed, 12 Oct 2022 06:19:50 +0000 (08:19 +0200)]
should-skip-this: add missing backslash

20 months agoRollup merge of #102924 - notriddle:notriddle/sidebar-link-class, r=GuillaumeGomez
Dylan DPC [Wed, 12 Oct 2022 05:41:27 +0000 (11:11 +0530)]
Rollup merge of #102924 - notriddle:notriddle/sidebar-link-class, r=GuillaumeGomez

rustdoc: remove unused classes from sidebar links

Since https://github.com/rust-lang/rust/commit/98f05a0282625a5fda6e90ebf3b05a4bd7608f65 removed separate colors from the currently-selected item, there's no need to have item classes on sidebar links.

Preview: https://notriddle.com/notriddle-rustdoc-demos/sidebar-link-class/std/vec/struct.Vec.html

While cleaning up the CSS to remove unneeded `.content` selectors, this PR changes the `h1.fqn a` CSS selector to just be `h1 a`, so that the header link color selector is less specific than the typed link at the end. Since https://github.com/rust-lang/rust/pull/89506 made docblocks start at `h2`, the main page link header should be the only h1 in the page now.

20 months agoRollup merge of #102913 - SparrowLii:import-candidate, r=compiler-errors
Dylan DPC [Wed, 12 Oct 2022 05:41:26 +0000 (11:11 +0530)]
Rollup merge of #102913 - SparrowLii:import-candidate, r=compiler-errors

unify `IsPattern` and `IsImport` enum in `show_candidates`

Follow-up of #102876
A binding cannot appear in both pattern and import at the same time, so it makes sense to unify them
r? `@compiler-errors`

20 months agoRollup merge of #102890 - camsteffen:adt-sized-representability, r=cjgillot
Dylan DPC [Wed, 12 Oct 2022 05:41:26 +0000 (11:11 +0530)]
Rollup merge of #102890 - camsteffen:adt-sized-representability, r=cjgillot

Check representability in adt_sized_constraint

Now that representability is a query, we can use it to preemptively avoid a cycle in `adt_sized_constraint`.

I moved the representability check into `check_mod_type_wf` to avoid a scenario where rustc quits before checking all the types for representability. This also removes the check from rustdoc, which is alright AFAIK.

r? ``@cjgillot``

20 months agoRollup merge of #102811 - the8472:bufread-memset, r=m-ou-se
Dylan DPC [Wed, 12 Oct 2022 05:41:25 +0000 (11:11 +0530)]
Rollup merge of #102811 - the8472:bufread-memset, r=m-ou-se

Use memset to initialize readbuf

The write loop was found to be slow in #102727

The proper fix is in #102760 but this might still help debug builds and code running under miri by using the write_bytes intrinsic instead of writing one byte at a time.

20 months agoRollup merge of #102578 - lukas-code:ilog-panic, r=m-ou-se
Dylan DPC [Wed, 12 Oct 2022 05:41:25 +0000 (11:11 +0530)]
Rollup merge of #102578 - lukas-code:ilog-panic, r=m-ou-se

Panic for invalid arguments of `{integer primitive}::ilog{,2,10}` in all modes

Decision made in https://github.com/rust-lang/rust/issues/100422#issuecomment-1245864700

resolves https://github.com/rust-lang/rust/issues/100422

tracking issue: https://github.com/rust-lang/rust/issues/70887

r? `@m-ou-se`

20 months agoRollup merge of #102239 - joshtriplett:style-guide, r=calebcartwright
Dylan DPC [Wed, 12 Oct 2022 05:41:24 +0000 (11:11 +0530)]
Rollup merge of #102239 - joshtriplett:style-guide, r=calebcartwright

Move style guide to rust-lang/rust

Per [RFC 3309](https://rust-lang.github.io/rfcs/3309-style-team.html).

20 months agoRollup merge of #102187 - b-naber:inline-const-source-info, r=eholk
Dylan DPC [Wed, 12 Oct 2022 05:41:24 +0000 (11:11 +0530)]
Rollup merge of #102187 - b-naber:inline-const-source-info, r=eholk

Use correct location for type tests in promoted constants

Previously we forgot to remap the location in a type test collected when visiting the body of a promoted constant back to the usage location, causing an ICE when trying to get span information for that type test.

Fixes https://github.com/rust-lang/rust/issues/102117

20 months agoRollup merge of #102110 - CleanCut:migrate_rustc_passes_diagnostics, r=davidtwco
Dylan DPC [Wed, 12 Oct 2022 05:41:23 +0000 (11:11 +0530)]
Rollup merge of #102110 - CleanCut:migrate_rustc_passes_diagnostics, r=davidtwco

Migrate rustc_passes diagnostics

Picks up abandoned work from https://github.com/rust-lang/rust/pull/100870

I would like to do this collaboratively, as there is a lot of work! Here's the process:

- Comment below that you are willing to help and I will add you as a collaborator to my `rust` fork (that gives you write access)
- Indicate which file/task you would like to work on (so we don't duplicate work) from the list below
- Do the work, push up a commit, comment that you're done with that file/task
- Repeat until done 😄

### Files to Migrate (in `compiler/rustc_passes/src/`)

- [x] check_attr.rs ``@CleanCut``
- [x] check_const.rs ``@CleanCut``
- [x] dead.rs ``@CleanCut``
- [x] debugger_visualizer.rs ``@CleanCut``
- [x] diagnostic_items.rs ``@CleanCut``
- [x] entry.rs ``@CleanCut``
- [x] lang_items.rs ``@CleanCut``
- [x] layout_test.rs ``@CleanCut``
- [x] lib_features.rs ``@CleanCut``
- [x] ~liveness.rs~ ``@CleanCut`` Nothing to do
- [x] loops.rs ``@CleanCut``
- [x] naked_functions.rs ``@CleanCut``
- [x] stability.rs ``@CleanCut``
- [x] weak_lang_items.rs ``@CleanCut``

### Tasks

- [x] Rebase on current `master` ``@CleanCut``
- [x] Review work from [the earlier PR](https://github.com/rust-lang/rust/pull/100870) and make sure it all looks good
  - [x] compiler/rustc_error_messages/locales/en-US/passes.ftl ``@CleanCut``
  - [x] compiler/rustc_passes/src/check_attr.rs ``@CleanCut``
  - [x] compiler/rustc_passes/src/errors.rs ``@CleanCut``
  - [x] compiler/rustc_passes/src/lang_items.rs ``@CleanCut``
  - [x] compiler/rustc_passes/src/lib.rs ``@CleanCut``
  - [x] compiler/rustc_passes/src/weak_lang_items.rs ``@CleanCut``

20 months agoTyAlias needs encoded constness too, for layout computation in rustdoc
Michael Goulet [Wed, 12 Oct 2022 04:17:21 +0000 (04:17 +0000)]
TyAlias needs encoded constness too, for layout computation in rustdoc