Commit Graph

197781 Commits

Author SHA1 Message Date
bors
4b695f7c4e Auto merge of #100765 - Xiretza:session-diagnostic-unification, r=compiler-errors
Kind-less SessionDiagnostic derive

From https://github.com/rust-lang/rust/pull/100730#discussion_r949712629:

> Hm, maybe we should expose some `sess.struct_$SOMETHING` (like `struct_diagnostic`?) that is generic over `EmissionGuarantee`, then make the `SessionDiagnostic` derive generic, i.e.
>
> ```rust
> impl<'tcx> SessionDiagnostic for UnusedGenericParams {
>   fn into_diagnostic<T: EmissionGuarantee>( .. ) -> DiagnosticBuilder<'tcx, T> {
>     let mut diag = sess.struct_diagnostic(rustc_errors:..);
>     ..
>   }
> }
> ```

Discussed [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/.23100717.20translation.20-.20kind-less.20derive).
2022-08-21 10:04:42 +00:00
Nelson Chen
7abbfa8c41 Make doc for stdin field of process consistent
The other fields use this format and example.
2022-08-21 01:56:26 -07:00
bors
39a9b88f4e Auto merge of #100627 - krasimirgg:lto-llvm-16, r=cuviper
llvm-wrapper: adapt for LLVM API change

No functional changes intended.

LLVM commit 633f5663c3 removed `createWriteThinLTOBitcodePass`.
This adapts PassWrapper similarly to the example mentioned upstream: 853b57fe80.

Detected via our experimental rust + llvm @ head bot: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/12768#0182a6be-ed6e-4dc6-a230-7a46f9d3a2c2/205-537
2022-08-21 07:19:49 +00:00
Xiretza
7f3a6fd7f6 Replace #[lint/warning/error] with #[diag] 2022-08-21 09:17:43 +02:00
Xiretza
bd0d3f745d Disallow #[primary_span] on LintDiagnostics 2022-08-21 09:17:43 +02:00
Xiretza
a960f8304c Make derived SessionDiagnostics generic on diagnostic level
Deriving SessionDiagnostic on a type no longer forces that diagnostic to
be one of warning, error, or fatal. The level is instead decided when
the struct is passed to the respective Handler::emit_*() method.
2022-08-21 09:17:43 +02:00
Xiretza
91ad4e38f5 Add Handler::struct_diagnostic()
This unifies the struct_{warn,error,fatal}() methods in one generic
method.
2022-08-21 09:17:43 +02:00
bors
aa8e761def Auto merge of #100624 - GuillaumeGomez:update-minifier-version, r=nnethercote
Update minifier version to 0.2.2

Following [this PR](https://github.com/GuillaumeGomez/minifier-rs/pull/98), the CSS minification should be much faster now (thanks to `@nnethercote).`

r? `@nnethercote`
2022-08-21 04:21:06 +00:00
Michael Goulet
d577eb09e5 Bless tests after #100769 2022-08-21 04:04:05 +00:00
Maybe Waffle
b2625e24b9 fix nitpicks from review 2022-08-21 06:36:11 +04:00
Michael Goulet
5212ac9dac Make check for overlapping closure span more accurate 2022-08-21 02:35:11 +00:00
Michael Goulet
d2f54b1990 Adjust messages, address some nits 2022-08-21 02:35:11 +00:00
Michael Goulet
2a16a127a0 More docs 2022-08-21 02:35:11 +00:00
Michael Goulet
8917894fda Targeted fixes addressing erroneous suggestions 2022-08-21 02:35:11 +00:00
Michael Goulet
6848ba2665 Comment a bit, use find_ancestor_in_same_ctxt to suppress some weird macro notes 2022-08-21 02:35:11 +00:00
Michael Goulet
292ab399b3 Point at struct field if possible 2022-08-21 02:35:11 +00:00
Michael Goulet
c0c6603c79 Deduplicate errors that come from places like normalization, sized 2022-08-21 02:35:11 +00:00
Michael Goulet
24559ce2fe Prefer non-Self non-method types over Self, first 2022-08-21 02:35:11 +00:00
Michael Goulet
c8746766cb Rework ambiguity errors 2022-08-21 02:35:11 +00:00
Michael Goulet
70b29f7c2d Note closure kind mismatch cause 2022-08-21 02:35:11 +00:00
Michael Goulet
52e2065ed4 Revert closure mismatch spans 2022-08-21 02:34:52 +00:00
Michael Goulet
3a1aa3c76e Do not favor projection type when pointing out arg causing fulfillment error 2022-08-21 02:34:52 +00:00
Michael Goulet
c9cb19d26e Skip mentioning lang item 2022-08-21 02:34:52 +00:00
Michael Goulet
d05fea6ac4 Account for relative paths 2022-08-21 02:34:52 +00:00
Michael Goulet
c005e760f5 Rework point-at-arg 2022-08-21 02:34:52 +00:00
bors
f2858b5cd3 Auto merge of #100536 - Alexendoo:bootstrap-tls-model, r=Mark-Simulacrum
bootstrap: don't apply `-Ztls-model=initial-exec` to proc macros

Potentially fixes #100530

r? `@bjorn3`
2022-08-21 01:34:05 +00:00
bors
fb80d2bfe4 Auto merge of #99967 - Mark-Simulacrum:download-llvm-ci, r=jyn514
Download, rather than sccache-cache, LLVM in CI

My hope/expectation is that we can do better than sccache in CI for cached builds -- currently it looks like on macOS those still take upwards of 10-11 minutes, which is a significant amount of time that we could potentially cut.

This enables this mode for all non-dist builders; this should avoid any problems with the artifacts we distribute, while also providing for faster test builders (since they'll make use of PGO'd LLVM on the platforms we do that on, which is hopefully a nice win). It slightly increases the chance of test builders starting to fail only after a PR is merged (if PGO changes runtime behavior), but that should hopefully never happen, so I think this is worthwhile.

Measurements on the PR for apple-1 don't show any noticeable improvement in CI times, but those can be pretty noisy -- I'm inclined to land this since it *should* pretty much always be better and we can reconsider if that ever turns out not to be the case.
2022-08-20 22:49:36 +00:00
Maybe Waffle
3ba393465f Make some docs nicer wrt pointer offsets 2022-08-21 02:22:20 +04:00
Maybe Waffle
e4720e1cf2 Replace most uses of pointer::offset with add and sub 2022-08-21 02:21:41 +04:00
Cameron Steffen
17ddcb434b Improve primitive/std docs separation and headers 2022-08-20 16:50:29 -05:00
scottmcm
03146471b5
Allow other directives before the ret 2022-08-20 21:08:56 +00:00
bors
878aef79dc Auto merge of #100810 - matthiaskrgr:rollup-xep778s, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #97963 (net listen backlog set to negative on Linux.)
 - #99935 (Reenable disabled early syntax gates as future-incompatibility lints)
 - #100129 (add miri-test-libstd support to libstd)
 - #100500 (Ban references to `Self` in trait object substs for projection predicates too.)
 - #100636 (Revert "Revert "Allow dynamic linking for iOS/tvOS targets."")
 - #100718 ([rustdoc] Fix item info display)
 - #100769 (Suggest adding a reference to a trait assoc item)
 - #100777 (elaborate how revisions work with FileCheck stuff in src/test/codegen)
 - #100796 (Refactor: remove unnecessary string searchings)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-08-20 20:08:26 +00:00
Nilstrieb
0c3ed968a2 Add /build-rust-analyzer/ to .gitignore
To avoid rust-analyzer and rustc having to wait for each other,
the dev guide mentions using another build directory for RA.

We should also put this into the .gitignore, just like the normal `build`.
2022-08-20 21:07:13 +02:00
Matthias Krüger
d793cd266c
Rollup merge of #100796 - TaKO8Ki:remove-unnecessary-string-searching, r=compiler-errors
Refactor: remove unnecessary string searchings

This patch removes unnecessary string searchings for checking if function arguments have `&` and `&mut`.
2022-08-20 19:45:17 +02:00
Matthias Krüger
44894a7c51
Rollup merge of #100777 - pnkfelix:expand-codegen-tests-readme, r=TaKO8Ki
elaborate how revisions work with FileCheck stuff in src/test/codegen

elaborate how revisions work with FileCheck stuff in src/test/codegen
2022-08-20 19:45:16 +02:00
Matthias Krüger
7f0289623c
Rollup merge of #100769 - TaKO8Ki:suggest-adding-reference-to-trait-assoc-item, r=cjgillot
Suggest adding a reference to a trait assoc item

fixes #100289
2022-08-20 19:45:15 +02:00
Matthias Krüger
aaa5574a18
Rollup merge of #100718 - GuillaumeGomez:fix-item-info, r=jsha
[rustdoc] Fix item info display

Fixes  #100369.

The solution I came up with was simply to wrap the "text part" of the `item-info` into another span so that `flex` wouldn't mess with it.

Live demo is [here](https://rustdoc.crud.net/imperio/fix-item-info/foo/struct.ItemInfo.html).

r? ``@jsha``
2022-08-20 19:45:14 +02:00
Matthias Krüger
e81b994868
Rollup merge of #100636 - cutsoy:revert-77716, r=davidtwco
Revert "Revert "Allow dynamic linking for iOS/tvOS targets.""

This reverts commit 16e10bf81e (PR #77716).

The original original PR enabled `cdylib` builds for iOS. However this caused problems because:

> This new feature in Rust 1.46 added a lot of headache for iOS builds with cdylib targets. cdylib target is near impossible to build if you are using any crate with native dependencies (ex. openssl, libsodium, zmq). You can't just find .so files for all architectures to perform correct linking. Usual workflow is the following:
>
> 1. You build staticlib and rely that native dependencies will be linked as frameworks later
> 2. You setup right cocoapods in ObjectiveC/Swift wrapper.
>
> As cargo doesn't support platform-dependent crate types https://github.com/rust-lang/rust/pull/4881 as a result a lot of projects now broken on Rust 1.46

However, this will be soon a thing of the past since 1.64 brings us the long awaited much anticipated `--crate-type` flag.

> I see that this got merged recently: https://github.com/rust-lang/cargo/issues/10083. The --crate-type flag will get stabilized in 1.64. In 1.64, you could still get a successful iOS staticlib with cargo build --crate-type=statclib even if the crate has cdylib targets too. If I'm not mistaken, this solves the problem too so this PR could be reverted in 1.64 with relatively little headache.

So summing up, I think this PR can be reverted in 1.64. 🤞
2022-08-20 19:45:13 +02:00
Matthias Krüger
33a40297d3
Rollup merge of #100500 - cjgillot:verify-self-predicate, r=lcnr
Ban references to `Self` in trait object substs for projection predicates too.

Fixes https://github.com/rust-lang/rust/issues/100484
Fixes https://github.com/rust-lang/rust/issues/100485

r? ````@lcnr````
2022-08-20 19:45:12 +02:00
Matthias Krüger
e93edf3335
Rollup merge of #100129 - RalfJung:miri-test-libstd, r=thomcc
add miri-test-libstd support to libstd

- The first commit mirrors what we already have in liballoc.
- The second commit adds some regression tests that only really make sense to be run in Miri, since they rely on Miri's extra checks to detect anything.
- The third commit makes the MPSC tests work in reasonable time in Miri by reducing iteration counts.
- The fourth commit silences some warnings due to code being disabled with `cfg(miri)`
2022-08-20 19:45:11 +02:00
Matthias Krüger
8828af4d88
Rollup merge of #99935 - CAD97:unstable-syntax-lints, r=petrochenkov
Reenable disabled early syntax gates as future-incompatibility lints

- MCP: https://github.com/rust-lang/compiler-team/issues/535

The approach taken by this PR is

- Introduce a new lint, `unstable_syntax_pre_expansion`, and reenable the early syntax gates to emit it
- Use the diagnostic stashing mechanism to stash warnings the early warnings
- When the hard error occurs post expansion, steal and cancel the early warning
- Don't display any stashed warnings if errors are present to avoid the same noise problem that hiding type ascription errors is avoiding

Commits are working commits, but in a coherent steps-to-implement manner. Can be squashed if desired.

The preexisting `soft_unstable` lint seems like it would've been a good fit, but it is deny-by-default (appropriate for `#[bench]`) and these gates should be introduced as warn-by-default.

It may be desirable to change the stash mechanism's behavior to not flush lint errors in the presence of other errors either (like is done for warnings here), but upgrading a stash-using lint from warn to error perhaps is enough of a request to see the lint that they shouldn't be hidden; additionally, fixing the last error to get new errors thrown at you always feels bad, so if we know the lint errors are present, we should show them.

Using a new flag/mechanism for a "weak diagnostic" which is suppressed by other errors may also be desirable over assuming any stashed warnings are "weak," but this is the first user of stashing warnings and seems an appropriate use of stashing (it follows the "know more later to refine the diagnostic" pattern; here we learn that it's in a compiled position) so we get to define what it means to stash a non-hard-error diagnostic.

cc `````@petrochenkov````` (seconded MCP)
2022-08-20 19:45:10 +02:00
Matthias Krüger
d9789b6903
Rollup merge of #97963 - devnexen:net_listener_neg, r=the8472
net listen backlog set to negative on Linux.

it will be 4076 (from 5.4) or 128.
2022-08-20 19:45:09 +02:00
bors
48853a361a Auto merge of #100809 - matthiaskrgr:rollup-xkpd5ii, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #99415 (Initial implementation of REUSE)
 - #99544 (Expose `Utf8Lossy` as `Utf8Chunks`)
 - #100585 (Fix trailing space showing up in example)
 - #100596 (Remove unnecessary stderr files)
 - #100642 (Update fortanix-sgx-abi and export some useful SGX usercall traits)
 - #100691 (Make `same_type_modulo_infer` a proper `TypeRelation`)
 - #100693 (Add LLVM15-specific codegen test for `try`/`?`s that now optimize away)
 - #100710 (Windows: Load synch functions together)
 - #100807 (Add TaKO8Ki to translation-related mention groups)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-08-20 17:38:29 +00:00
Matthias Krüger
0be081976c
Rollup merge of #100807 - TaKO8Ki:add-tako8ki-to-translation-related-mention-groups, r=Mark-Simulacrum
Add TaKO8Ki to translation-related mention groups

Can I join translation-related mention groups?

cc `@davidtwco`
2022-08-20 19:32:14 +02:00
Matthias Krüger
77db317eed
Rollup merge of #100710 - ChrisDenton:load-library, r=thomcc
Windows: Load synch functions together

Attempt to load all the required sync functions and fail if any one of them fails.

This fixes a FIXME by going back to optional loading of `WakeByAddressSingle`.

Also reintroduces a macro for optional loading of functions but keeps it separate from the fallback macro rather than having that do two different jobs.

r? `@thomcc`
2022-08-20 19:32:13 +02:00
Matthias Krüger
45568bdaf7
Rollup merge of #100693 - scottmcm:new-llvm15-nops, r=Mark-Simulacrum
Add LLVM15-specific codegen test for `try`/`?`s that now optimize away

These still generated a bunch of code back in Rust 1.63 (<https://rust.godbolt.org/z/z31P8h6rz>), but with LLVM 15 merged they no longer do 🎉
2022-08-20 19:32:12 +02:00
Matthias Krüger
51769af6ea
Rollup merge of #100691 - compiler-errors:issue-100690, r=estebank
Make `same_type_modulo_infer` a proper `TypeRelation`

Specifically, this fixes #100690 because we no longer consider a `ReLateBound` and a `ReVar` to be equal. `ReVar` can only be equal to free regions or static.
2022-08-20 19:32:11 +02:00
Matthias Krüger
c4fa35bb41
Rollup merge of #100642 - mzohreva:mz/update-sgx-abi-cancel-queue, r=Mark-Simulacrum
Update fortanix-sgx-abi and export some useful SGX usercall traits

Update `fortanix-sgx-abi` to 0.5.0 to add support for cancel queue (see https://github.com/fortanix/rust-sgx/pull/405 and https://github.com/fortanix/rust-sgx/pull/404).

Export some useful traits for processing SGX usercall. This is needed for https://github.com/fortanix/rust-sgx/pull/404 to avoid duplication.

cc `@raoulstrackx` and `@jethrogb`
2022-08-20 19:32:10 +02:00
Matthias Krüger
23a603aa4c
Rollup merge of #100596 - TaKO8Ki:remove-unnecessary-stderr-files, r=Mark-Simulacrum
Remove unnecessary stderr files

This patch removes stderr files corresponding to revisions that have already been removed.
2022-08-20 19:32:09 +02:00
Matthias Krüger
bd4a63cda2
Rollup merge of #100585 - wooorm:patch-1, r=Mark-Simulacrum
Fix trailing space showing up in example

The current text is rendered as: U+005B ..= U+0060 ``[ \ ] ^ _ ` ``, or (**note the final space!**)
This patch changes that to render as: U+005B ..= U+0060 `` [ \ ] ^ _ ` ``, or (**note no final space!**)

The reason for that, is that CommonMark has a solution for starting or ending inline code with a backtick/grave accent: padding both sides with a space, makes that padding disappear.
2022-08-20 19:32:08 +02:00