Commit Graph

221170 Commits

Author SHA1 Message Date
Yuki Okushi
2df3f490dd
Add regression test for #80409
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-04-05 21:20:07 +09:00
bors
90a9f69c80 Auto merge of #109945 - Kobzol:llvm-bolt-gnu-stack, r=nikic
Remove the use of `-use-gnu-stack` when BOLTing LLVM

This flag was (counterintuitively) removing the `GNU_STACK` ELF attribute, which caused the optimized `libLLVM.so` file to be flagged as having an executable stack on SELinux.

Removing the flag might cause issues with `strip`. I'm not aware that we're stripping `libLLVM.so` though. Does it happen anywhere?

Fixes: https://github.com/rust-lang/rust/issues/105783
2023-04-05 08:17:39 +00:00
bors
a412564f8c Auto merge of #109954 - clubby789:graphviz-path-trimming, r=compiler-errors
Disable path trimming during graphviz output

Fixes #109943

We can end up pretty-printing a path for the graphviz file without emitting a diagnostic, so disable path trimming at this point.
2023-04-05 05:47:33 +00:00
bors
8d321f7a88 Auto merge of #109843 - scottmcm:better-transmute, r=WaffleLapkin
Allow `transmute`s to produce `OperandValue`s instead of needing `alloca`s

LLVM can usually optimize these away, but especially for things like transmutes of newtypes it's silly to generate the `alloc`+`store`+`load` at all when it's actually a nop at LLVM level.
2023-04-05 03:26:38 +00:00
clubby789
422c33030f Disable path trimming during graphviz output 2023-04-05 03:06:37 +01:00
Scott McMurray
9aa9a846b6 Allow transmutes to produce OperandValues instead of always using allocas
LLVM can usually optimize these away, but especially for things like transmutes of newtypes it's silly to generate the `alloc`+`store`+`load` at all when it's actually a nop at LLVM level.
2023-04-04 18:44:29 -07:00
bors
f98a271814 Auto merge of #94786 - joshlf:patch-5, r=dtolnay
Document NonZeroXxx layout guarantees

Document that `NonZeroXxx` has the same layout and bit validity as `Xxx` with the exception of `0`.
2023-04-05 01:09:59 +00:00
bors
603270011e Auto merge of #109944 - cjgillot:lint-cstring-macro, r=Nilstrieb
Do not suppress temporary_cstring_as_ptr in macros.

There isn't really a reason to skip the lint when part of the expression comes from an expansion.

Fixes https://github.com/rust-lang/rust/issues/94694
2023-04-04 22:35:09 +00:00
bors
700938c078 Auto merge of #109808 - jyn514:debuginfo-options, r=michaelwoerister
Extend -Cdebuginfo with new options and named aliases

This is a rebase of https://github.com/rust-lang/rust/pull/83947, along with my best guess at what the new options mean. I tried to follow the LLVM source code to get a better idea but ran into quite a lot of trouble (https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/go-to-definition.20in.20src.2Fllvm-project.3F). The description for the original PR follows below.

Note that the changes in this PR have already been through FCP: https://github.com/rust-lang/rust/pull/83947#issuecomment-878384979

Closes https://github.com/rust-lang/rust/pull/109311. Helps with https://github.com/rust-lang/rust/pull/104968.
r? `@michaelwoerister` cc `@cuviper`

---

The -Cdebuginfo=1 option was never line tables only and can't be due to backwards compatibility issues. This was clarified and an option for emitting line tables only was added. Additionally an option for emitting line info directives only was added, which is needed for some targets, i.e. nvptx. The debug info options should now behave similarly to clang's debug info options.

Fix https://github.com/rust-lang/rust/issues/60020
Fix https://github.com/rust-lang/rust/issues/64405
2023-04-04 20:01:05 +00:00
Jakub Beránek
c32953f44f
Remove the use of -use-gnu-stack when BOLTing LLVM
This flag (counterintuitively) was removing the `GNU_STACK` ELF attribute, which caused the optimized `libLLVM.so` file to be flagged as having an executable stack on SELinux.
2023-04-04 21:07:19 +02:00
Camille GILLOT
8528ac6e35 Do not suppress temporary_cstring_as_ptr in macros. 2023-04-04 18:55:02 +00:00
bors
540a50df0f Auto merge of #109941 - compiler-errors:rollup-5lsst2u, r=compiler-errors
Rollup of 9 pull requests

Successful merges:

 - #109723 (Pull some tuple variant fields out into their own struct)
 - #109838 (Fix `non_exhaustive_omitted_patterns` lint span)
 - #109901 (Enforce VarDebugInfo::Place in MIR validation.)
 - #109913 (Doc-comment  `IndexVec::from_elem` and use it in a few more places)
 - #109914 (Emit feature error for parenthesized generics in associated type bounds)
 - #109919 (rustdoc: escape GAT args in more cases)
 - #109937 (Don't collect return-position impl traits for documentation)
 - #109938 (Move a const-prop-lint specific hack from mir interpret to const-prop-lint and make it fallible)
 - #109940 (Add regression test for #93911)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-04-04 16:39:26 +00:00
Michael Goulet
678d7c505d
Rollup merge of #109940 - JohnTitor:issue-93911, r=compiler-errors
Add regression test for #93911

r? `@compiler-errors`
Closes #93911
2023-04-04 09:27:48 -07:00
Michael Goulet
b0483e8004
Rollup merge of #109938 - oli-obk:try_norm, r=compiler-errors
Move a const-prop-lint specific hack from mir interpret to const-prop-lint and make it fallible

fixes #109743

This hack didn't need to live in the mir interpreter. For const-prop-lint it is entirely correct to avoid doing any const prop if normalization fails at this stage. Most likely we couldn't const propagate anything anyway, and if revealing was needed (so opaque types were involved), we wouldn't want to be too smart and leak the hidden type anyway.
2023-04-04 09:27:47 -07:00
Michael Goulet
d984671246
Rollup merge of #109937 - compiler-errors:rustdoc-rpit-cant-be-documented, r=GuillaumeGomez
Don't collect return-position impl traits for documentation

#104889 modified the rustdoc ast collection step to use a HIR visitor, which more thoroughly walks the HIR tree. that means that we're going to encounter inner items (incl return-position impl traits and async fn opaque futures) that are not possible to document.

FIxes (but does not close due to being a beta regression) #109931

r? `@GuillaumeGomez`
2023-04-04 09:27:47 -07:00
Michael Goulet
72e535ea99
Rollup merge of #109919 - fmease:rustdoc-fix-issue-109488, r=notriddle
rustdoc: escape GAT args in more cases

Fixes #109488.

Previously we printed the *un*escaped form of GAT arguments not only when `f.alternate()` was true but *also* when we failed to compute the URL of the trait associated with the type projection, i.e. when `href(…)` returned an `Err(_)`.

In this PR the argument printing logic is entirely separate from the link resolution code above as it should be.
Further, we now only try to compute the URL if the HTML format was requested with `!f.alternate()`. Before, we would sometimes compute the `href` only to throw it away later.
2023-04-04 09:27:46 -07:00
Michael Goulet
a5c395ed94
Rollup merge of #109914 - compiler-errors:rtn-bad-parens, r=oli-obk
Emit feature error for parenthesized generics in associated type bounds

We don't actually do AST->HIR lowering with some `-Zunpretty` flags, so it's not correct to just delay a bug instead of emitting a feature error.

Some diagnostics regressed because of the new errors, but oh well. 🤷

Fixes #109898
2023-04-04 09:27:46 -07:00
Michael Goulet
5485a54e19
Rollup merge of #109913 - scottmcm:index-slice, r=WaffleLapkin
Doc-comment  `IndexVec::from_elem` and use it in a few more places

Since this PR is a reply to https://github.com/rust-lang/rust/pull/109819#discussion_r1156128164,
r? ``@WaffleLapkin``
2023-04-04 09:27:45 -07:00
Michael Goulet
ed17b599df
Rollup merge of #109901 - cjgillot:validate-debuginfo, r=b-naber
Enforce VarDebugInfo::Place in MIR validation.
2023-04-04 09:27:44 -07:00
Michael Goulet
4d32de6fcb
Rollup merge of #109838 - clubby789:non-exhaustive-span, r=Nilstrieb
Fix `non_exhaustive_omitted_patterns` lint span

Fixes #109837

`DUMMY_SP` was being passed as the span in many cases where we have a span available to use. This meant that the location of the violating pattern wasn't shown, or the list of un-covered variants

r? `@Nilstrieb`
2023-04-04 09:27:44 -07:00
Michael Goulet
ec22850c2c
Rollup merge of #109723 - oli-obk:ast_refactor, r=Nilstrieb
Pull some tuple variant fields out into their own struct

This is groundwork for adding more fields to those new structs, but I believe the change to be useful on its own.

r? `@Nilstrieb` but feel free to reroll for `compiler`
2023-04-04 09:27:43 -07:00
Yuki Okushi
1a8612e723
Add regression test for #93911
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-04-05 01:01:45 +09:00
Oli Scherer
373807a95c Rename ast::Static to ast::StaticItem to match ast::ConstItem 2023-04-04 15:34:40 +00:00
Michael Goulet
72ef85d83e Don't collect return-position impl traits for documentation 2023-04-04 14:03:50 +00:00
Oli Scherer
4bebdd7104 box a bunch of large types 2023-04-04 13:58:50 +00:00
jyn
92b7591371 Add a best guess at what line-directives-only means 2023-04-04 07:37:33 -04:00
bors
be8e5ba157 Auto merge of #109917 - compiler-errors:remove-relation-methods, r=oli-obk
Remove `intercrate` and `mark_ambiguous` from `TypeRelation`

Fixes #109863

Pulls this logic into `super_combine_tys`, which has access to `InferCtxt` and takes a `ObligationEmittingRelation` -- both of which simplify the logic here.

r? `@oli-obk` `@aliemjay`
2023-04-04 11:08:23 +00:00
Oli Scherer
b5d96d5ec5 Move a const-prop-lint specific hack from mir interpret to const-prop-lint and make it fallible 2023-04-04 10:39:26 +00:00
Oli Scherer
ec74653652 Split out ast::ItemKind::Const into its own struct 2023-04-04 09:44:50 +00:00
Oli Scherer
e3828777a6 rust-analyzer guided tuple field to named field 2023-04-04 09:44:50 +00:00
Oli Scherer
b08a557f80 rust-analyzer guided enum variant structification 2023-04-04 09:44:45 +00:00
bors
7c96e40da8 Auto merge of #109891 - the8472:llvm-16-fixes-79308, r=nikic
llvm 16 finally reconizes some additional vec in-place conversions as noops

closes #79308

r? `@nikic`
2023-04-04 08:54:33 +00:00
bors
35d06f9c74 Auto merge of #109599 - notriddle:notriddle/use-redundant-glob, r=petrochenkov
diagnostics: account for glob shadowing when linting redundant imports

Fixes #92904
2023-04-04 06:41:27 +00:00
bors
bd991d9953 Auto merge of #109888 - Mark-Simulacrum:balanced-compression, r=pietroalbini
Remove optimal xz settings from CI

This is a companion PR to rust-lang/promote-release#58, which moves the relevant optimal code to rust-lang/promote-release. As mentioned in the comments of that PR, this is expected to cut CI costs (and time, though predominantly felt on fast builders) and reduce wasted resources due to in-practice single-threaded compression not using the full 8+ vCPU builders we have available.

This probably shouldn't land before that PR + a simpleinfra change to enable the recompression of xz artifacts. But if it does land, it's just a matter of a few nightlies with slightly larger artifacts, so not a big deal.

r? `@pietroalbini`
2023-04-04 03:54:22 +00:00
bors
eb48e9771a Auto merge of #109876 - jsha:uniquify-intra-doc, r=notriddle
rustdoc: make intra-doc link pass non-quadratic for repeated links

In the collect_intra_doc_links pass, links to a given item that occurred repeatedly were getting inserted into a `Vec<clean::ItemLink>` repeatedly. This led to n^2 behavior (where n = the number of pages generated), particularly for the intra-doc link on the `Into<U> for T where U: From<T>` blanket implementation, since that link appears on every single struct page.

Fixes #109851
2023-04-04 01:12:24 +00:00
León Orell Valerian Liehr
6567bc9a47
rustdoc: escape GAT args in more cases 2023-04-04 02:09:23 +02:00
Michael Goulet
a368316905 Remove intercrate and mark_ambiguous from Relation 2023-04-04 00:09:12 +00:00
bors
cf7ada217c Auto merge of #109911 - JohnTitor:rollup-7gjiqim, r=JohnTitor
Rollup of 6 pull requests

Successful merges:

 - #109783 (Update contributing links for rustc-dev-guide changes)
 - #109883 (Add links to <cell.rs>)
 - #109889 (Update book, rustc-dev-guide, rust-by-example)
 - #109896 (Never consider int and float vars for `FnPtr` candidates)
 - #109902 (Add async-await test for #107414)
 - #109903 (Add Chris Denton to `.mailmap`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-04-03 22:29:54 +00:00
Scott McMurray
5c3e5af2ed Doc-comment IndexVec::from_elem and use it in a few more places 2023-04-03 14:29:32 -07:00
Michael Goulet
ab0b9356e6 Emit feature error for parenthesized generics in associated type bounds 2023-04-03 21:20:48 +00:00
Yuki Okushi
b691507b73
Rollup merge of #109903 - ChrisDenton:map-me, r=compiler-errors
Add Chris Denton to `.mailmap`
2023-04-04 05:52:36 +09:00
Yuki Okushi
52dad9933b
Rollup merge of #109902 - Nilstrieb:107414test, r=compiler-errors
Add async-await test for #107414

fixes #107414

r? `@cjgillot`
2023-04-04 05:52:36 +09:00
Yuki Okushi
7d3207be97
Rollup merge of #109896 - Nilstrieb:integers-are-not-fn-ptrs-remember-this-dear-transmuter, r=compiler-errors
Never consider int and float vars for `FnPtr` candidates

This solves a regression where `0.0.cmp()` was ambiguous when a custom trait with a `cmp` method was in scope.

For integers it shouldn't be a problem in practice so I wasn't able to add a test.

I'm not sure whether there could be more issues hidden in the shadows as mentioned in the issue, but this should at least fix the problematic regression immediately.

fixes #109892

r? oli-obk
2023-04-04 05:52:35 +09:00
Yuki Okushi
4e25d20f95
Rollup merge of #109889 - ferrocene:pa-update-books, r=ehuss
Update book, rustc-dev-guide, rust-by-example

Changes from `rust-lang/book`:

* https://github.com/rust-lang/book/pull/3598

Changes from `rust-lang/rust-by-example`:

* https://github.com/rust-lang/rust-by-example/pull/1695
* https://github.com/rust-lang/rust-by-example/pull/1694
* https://github.com/rust-lang/rust-by-example/pull/1693
* https://github.com/rust-lang/rust-by-example/pull/1688
* https://github.com/rust-lang/rust-by-example/pull/1696

Changes from `rust-lang/rustc-dev-guide`:

* https://github.com/rust-lang/rustc-dev-guide/pull/1655
* https://github.com/rust-lang/rustc-dev-guide/pull/1657
* https://github.com/rust-lang/rustc-dev-guide/pull/1659
* d436bf134e...fca8af6c15

r? `@ehuss`
2023-04-04 05:52:35 +09:00
Yuki Okushi
ed5e2ddeed
Rollup merge of #109883 - skaunov:patch-1, r=thomcc
Add links to <cell.rs>

`UnsafeCell` page could benefit too from having links to these most popular structs in the module.
2023-04-04 05:52:34 +09:00
Yuki Okushi
bce7253178
Rollup merge of #109783 - jyn514:dev-guide-links, r=Mark-Simulacrum
Update contributing links for rustc-dev-guide changes

Companion PR to https://github.com/rust-lang/rustc-dev-guide/pull/1653.

- Remove unused reference link in CONTRIBUTING.md
- Change the contributing_url for triagebot to the getting started page
2023-04-04 05:52:34 +09:00
bors
48829ea74b Auto merge of #109771 - uweigand:s390x-miri-libffi, r=oli-obk
Increase libffi version to 3.2 to support s390x

libffi versions prior to 3.2 have no support for s390x, causing the Miri build to fail on our platform.
2023-04-03 19:53:24 +00:00
Chris Denton
07e3bd1ffb
Add Chris Denton to .mailmap 2023-04-03 20:07:35 +01:00
Nilstrieb
9e579cc10c Add test 2023-04-03 20:45:02 +02:00
Camille GILLOT
a84909c1e7 Enforce VarDebugInfo::Place in MIR validation. 2023-04-03 17:44:12 +00:00