Commit Graph

252724 Commits

Author SHA1 Message Date
Matthias Krüger
d783ea0c0e
Rollup merge of #124051 - dtolnay:emptyset, r=compiler-errors
Fix empty-set symbol in comments

The symbol in the original code is U+00D8 "LATIN CAPITAL LETTER O WITH STROKE" (https://en.wikipedia.org/wiki/%C3%98) which is an uppercase letter in Danish, Norwegian, Faroese, and Southern Sámi alphabets.

The symbol that was intended is U+2205 "EMPTY SET" (https://en.wikipedia.org/wiki/Empty_set#Notation).

| Before | After |
|---|---|
| ![Screenshot from 2024-04-16 18-25-01](https://github.com/rust-lang/rust/assets/1940490/9b8b0624-cfa5-4b89-84e5-4c2b39c2cb8f) | ![Screenshot from 2024-04-16 18-25-05](https://github.com/rust-lang/rust/assets/1940490/6f6b34c3-0e47-4ba0-856d-be1dc164c94c) |
2024-04-17 05:44:54 +02:00
Matthias Krüger
1134f442f9
Rollup merge of #124045 - nnethercote:add-nnethercote-review, r=nnethercote
Reinstate nnethercote to the review rotation.

I'm back from vacation.

r? nnethercote
2024-04-17 05:44:53 +02:00
Matthias Krüger
90af17ddcb
Rollup merge of #123997 - compiler-errors:self-res, r=fmease
Delay span bug when `Self` kw resolves to `DefKind::{Mod,Trait}`

Catch the case where `kw::Self` is recovered in the parser and causes us to subsequently resolve `&self`'s implicit type to something that's not a type.

This check could be made more accurate, though I'm not sure how hard we have to try here.

Fixes #123988
2024-04-17 05:44:53 +02:00
Matthias Krüger
8229a34102
Rollup merge of #122883 - onur-ozkan:clippy-build-step, r=albertlarsan68
refactor clippy in bootstrap

Previously, using clippy in bootstrap was not very useful as explained in #122825. In short, regardless of the given path clippy would always check the entire compiler and std tree. This makes it impossible to run clippy on different paths with different set of rules. This PR fixes that by allowing developers to run clippy with specific rules on specific paths (e.g., we can run `x clippy compiler -Aclippy::all -Dclippy::correctness` and `x clippy library/std -Dclippy::all` and none of them will affect each other).

Resolves #122825
2024-04-17 05:44:52 +02:00
Matthias Krüger
45940fe6d8
Rollup merge of #122813 - nnethercote:nicer-quals, r=compiler-errors
Qualifier tweaking

Adding and removing qualifiers in some cases that make things nicer. Details in individual commits.

r? `@compiler-errors`
2024-04-17 05:44:52 +02:00
beetrees
c021367de1
Make the comments for ReturnDest variants doc comments 2024-04-17 03:10:09 +01:00
bors
803e33a446 Auto merge of #124039 - weihanglo:update-cargo, r=weihanglo
Update cargo

11 commits in 48eca1b164695022295ce466b64b44e4e0228b08..6f06fe908a5ee0f415c187f868ea627e82efe07d
2024-04-12 21:16:36 +0000 to 2024-04-16 18:47:44 +0000
- fix(toml): Error on `[project]` in Edition 2024 (rust-lang/cargo#13747)
- feat(update): Include a Locking message (rust-lang/cargo#13759)
- chore(deps): update rust crate gix to 0.62.0 [security] (rust-lang/cargo#13760)
- test(schemas): Ensure tests cover the correct case (rust-lang/cargo#13761)
- feat(resolve): Tell the user the style of resovle done (rust-lang/cargo#13754)
- Make sure to also wrap the initial `-vV` invocation (rust-lang/cargo#13659)
- docs: update `checkout` GitHub action version (rust-lang/cargo#13757)
- Recategorize cargo test's `--doc` flag under "Target Selection" (rust-lang/cargo#13756)
- Reword sentence describing workspace toml for clarity (rust-lang/cargo#13753)
- docs(ref): Update unstable docs for msrv-policy (rust-lang/cargo#13751)
- refactor(config): Consistently use kebab-case (rust-lang/cargo#13748)

r? ghost
2024-04-17 02:06:45 +00:00
David Tolnay
e480cabe3a
Fix empty-set symbol in comments 2024-04-16 18:19:27 -07:00
Mark Rousskov
9ab6e36d8d Fix broken test
Testing for ASLR by casting &ZST to *const _ is not useful, there's no
guarantee that &ZST produces an ASLR'd pointer.
2024-04-16 21:13:21 -04:00
Mark Rousskov
649e80184b Codegen ZSTs without an allocation
This makes sure that &[] is just as efficient as indirecting through
unsafe code (from_raw_parts). No new stable guarantee is intended about
whether or not we do this, this is just an optimization.

Co-authored-by: Ralf Jung <post@ralfj.de>
2024-04-16 21:13:21 -04:00
Slanterns
b7f4332737
Stabilize const_io_structs 2024-04-17 08:09:13 +08:00
bors
7e3ba5b8b7 Auto merge of #124040 - GuillaumeGomez:rollup-hrrvsgh, r=GuillaumeGomez
Rollup of 7 pull requests

Successful merges:

 - #123673 (Don't ICE for kind mismatches during error rendering)
 - #123675 (Taint const qualifs if a static is referenced that didn't pass wfcheck)
 - #123975 (Port the 2 `rust-lld` run-make tests to `rmake`)
 - #124000 (Use `/* value */` as a placeholder)
 - #124013 (Box::into_raw: make Miri understand that this is a box-to-raw cast)
 - #124027 (Prefer identity equality over equating types during coercion.)
 - #124036 (Remove `default_hidden_visibility: false` from wasm targets)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-17 00:04:40 +00:00
Nicholas Nethercote
9a67a6cb04 Reinstate nnethercote to the review rotation. 2024-04-17 08:37:04 +10:00
DianQK
374b7821a5
Update LLVM to 1deeee3 2024-04-17 06:28:22 +08:00
Guillaume Gomez
a0ca1184da
Rollup merge of #124036 - alexcrichton:wasm-use-default-visbility, r=jieyouxu
Remove `default_hidden_visibility: false` from wasm targets

To the best of my ability I believe that this is no longer necessary. I don't fully recall why this was first added but I believe it had to do with symbols all being exported by default and this was required to undo that. Regardless nowadays the default output of rustc seems suitable so it seems best to keep wasm in line with other targets.
2024-04-17 00:00:25 +02:00
Guillaume Gomez
c7b009f38a
Rollup merge of #124027 - oli-obk:define_opaque_types9, r=compiler-errors
Prefer identity equality over equating types during coercion.

These types are always generic only over their own generic parameters with no inference variables involved.

r? `@compiler-errors`

I love touching code that [hasn't changed meaningfully since 2016](https://github.com/rust-lang/rust/pull/41937)
2024-04-17 00:00:24 +02:00
Guillaume Gomez
51cfa95668
Rollup merge of #124013 - RalfJung:box-to-raw, r=oli-obk
Box::into_raw: make Miri understand that this is a box-to-raw cast

Turns out https://github.com/rust-lang/rust/pull/122647 went a bit too far in cleaning up `Box`... we still need a hack in `Box::into_raw`. The nicer fix would be to make Stacked Borrows not care about reference-to-raw-pointer casts, but it's unclear whether that will ever be possible without going to full Tree Borrows.

Fixes https://github.com/rust-lang/miri/issues/3473.
2024-04-17 00:00:24 +02:00
Guillaume Gomez
4764dceb0f
Rollup merge of #124000 - compiler-errors:sugg-tweaks, r=wesleywiser
Use `/* value */` as a placeholder

The expression `value` isn't a valid suggestion; let's use `/* value */` as a placeholder (which is also invalid) since it more clearly signals to the user that they need to fill it in with something meaningful. This parallels the suggestions we have in a couple other places, like arguments.

We could also print the type name instead of `/* value */`, especially if it's suggestable, but I don't care strongly about that.
2024-04-17 00:00:23 +02:00
Guillaume Gomez
ec1618cf17
Rollup merge of #123975 - lqd:rust-lld-tests, r=jieyouxu
Port the 2 `rust-lld` run-make tests to `rmake`

In preparation for finalizing most of the `rust-lld` work, this PR ports the following tests to `rmake`:
- `tests/run-make/rust-lld`
- `tests/run-make/rust-lld-custom-target`

As they use `$(CGREP) -e` I added `regex` as an exported dependency to the `run_make_support` library.

Unfortunately, the most recent versions depend on `memchr` 2.6.0 but it's currently pinned at 2.5.0 in the workspace, and therefore had to settle for the older `regex-1.8.0`.

r? `@jieyouxu`
2024-04-17 00:00:23 +02:00
Guillaume Gomez
4885ddfa92
Rollup merge of #123675 - oli-obk:static_wf_ice, r=compiler-errors
Taint const qualifs if a static is referenced that didn't pass wfcheck

It is correct to only check the signature here, as the ICE is caused by `USE_WITH_ERROR` trying to allocate memory to store the result of `WITH_ERROR` before evaluating it.

fixes #123153
2024-04-17 00:00:22 +02:00
Guillaume Gomez
4aaa8f964f
Rollup merge of #123673 - oli-obk:sig_wfcheck_ice, r=jieyouxu,estebank
Don't ICE for kind mismatches during error rendering

fixes #123457

also some test suite cleanups to make backtraces easier to read
2024-04-17 00:00:22 +02:00
bors
3fba278231 Auto merge of #123537 - compiler-errors:shallow, r=lcnr
Simplify shallow resolver to just fold ty/consts

Probably faster than using a whole folder?
2024-04-16 21:59:36 +00:00
Maik Allgöwer
20414b8e1f Add another expression to weird-exprs.rs 2024-04-16 23:30:05 +02:00
Weihang Lo
cea6cb3a68
Update cargo 2024-04-16 16:53:29 -04:00
Michael Goulet
8bbaeee6f9 Don't proceed into parent bodies when collecting stmts for possible return suggestion 2024-04-16 15:56:48 -04:00
bors
1cec373f65 Auto merge of #124034 - GuillaumeGomez:rollup-ayztp9l, r=GuillaumeGomez
Rollup of 7 pull requests

Successful merges:

 - #122811 (Move `SourceMap` initialization)
 - #123512 (Match ergonomics 2024: Implement eat-one-layer)
 - #123811 (Use queue-based `RwLock` on more platforms)
 - #123859 (Remove uneeded clones now that TrustedStep implies Copy)
 - #123979 (Subtype predicates only exist on inference types, so we can allow them to register opaque types within them.)
 - #124016 (Outline default query and hook provider function implementations)
 - #124023 (Allow workproducts without object files.)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-16 19:52:48 +00:00
Alex Crichton
f25668cff5 Remove default_hidden_visibility: false from wasm targets
To the best of my ability I believe that this is no longer necessary. I
don't fully recall why this was first added but I believe it had to do
with symbols all being exported by default and this was required to undo
that. Regardless nowadays the default output of rustc seems suitable so
it seems best to keep wasm in line with other targets.
2024-04-16 12:41:44 -07:00
Guillaume Gomez
7709b7d44a
Rollup merge of #124023 - pacak:less-splody, r=jieyouxu
Allow workproducts without object files.

This pull request partially reverts changes from e16c3b4a44

Original motivation for this assert was described with "A WorkProduct without a saved file is useless"
which was true at the time but now it is possible to have work products with other types of files
(llvm-ir, asm, etc) and there are bugreports for this failure:

For example: https://github.com/rust-lang/rust/issues/123695

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

Now existing `assert` and `.unwrap_or_else` are unified into a single
check that emits slightly more user friendly error message if an object
files was meant to be produced but it's missing
2024-04-16 21:41:27 +02:00
Guillaume Gomez
4779115f2b
Rollup merge of #124016 - DaniPopes:dedup-default-providers, r=lcnr
Outline default query and hook provider function implementations

The default query and hook provider functions call `bug!` with a decently long message.
Due to argument inlining in `format_args!` ([`flatten_format_args`](https://github.com/rust-lang/rust/issues/78356)), this ends up duplicating the message for each query, adding ~90KB to `librustc_driver.so` of unreachable panic messages.
To avoid this, we can outline the common `bug!` logic.
2024-04-16 21:41:26 +02:00
Guillaume Gomez
f939d1ff48
Rollup merge of #123979 - oli-obk:define_opaque_types7, r=compiler-errors
Subtype predicates only exist on inference types, so we can allow them to register opaque types within them.

We were unable to come up with an example where this could be reached (subtype predicates with either side not being an infer var gets consumed during any `select_where_possible` invocation, of which we have a lot in typeck). To ensure we don't silently accept new behaviour in case we missed a situation where this could occur, I have added an assert that prevents opaque types from having their hidden type constrained.

r? `@compiler-errors`
2024-04-16 21:41:26 +02:00
Guillaume Gomez
183c706305
Rollup merge of #123859 - krtab:uneeded_clone, r=cuviper
Remove uneeded clones now that TrustedStep implies Copy

This is a follow up to 11fa1764ee (from #112083)
2024-04-16 21:41:25 +02:00
Guillaume Gomez
1176134114
Rollup merge of #123811 - joboet:queue_em_up, r=ChrisDenton
Use queue-based `RwLock` on more platforms

This switches over Windows 7, SGX and Xous to the queue-based `RwLock` implementation added in #110211, thereby fixing #121949 for Windows 7 and partially resolving #114581 on SGX. TEEOS can't currently be switched because it doesn't have a good thread parking implementation.

CC `@roblabla` `@raoulstrackx` `@xobs` Could you help me test this, please?
r? `@ChrisDenton` the Windows stuff should be familiar to you
2024-04-16 21:41:25 +02:00
Guillaume Gomez
239b3728d5
Rollup merge of #123512 - Jules-Bertholet:ref-pat-eat-one-layer-2024, r=Nadrieril
Match ergonomics 2024: Implement eat-one-layer

r? `@Nadrieril`

cc #123076

`@rustbot` label A-edition-2024 A-patterns
2024-04-16 21:41:24 +02:00
Guillaume Gomez
14496d561e
Rollup merge of #122811 - nnethercote:mv-SourceMap-init, r=WaffleLapkin
Move `SourceMap` initialization

So it happens at the same time as `SessionGlobals` initialization, rather than shortly afterward.

r? `@WaffleLapkin`
2024-04-16 21:41:23 +02:00
bors
468f115684 Auto merge of #124026 - matthiaskrgr:rollup-an6s6gq, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #122632 (fetch submodule before checking llvm stamp)
 - #123355 (Support type '/' to search)
 - #123501 (Stabilize checking of cfgs at compile-time: `--check-cfg` option)
 - #123535 (Match ergonomics 2024: `mut` doesn't reset binding mode)
 - #123711 (drop `changelog-seen`)
 - #123969 (The new solver ignores `DefineOpaqueTypes`, so switch it to `Yes`)
 - #124007 (Miri subtree update)
 - #124017 (Change a diagnostics-path-only `DefineOpaqueTypes` to `Yes`.)
 - #124018 (interpret: pass MemoryKind to before_memory_deallocation)
 - #124024 (interpret: remove outdated comment)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-16 17:37:00 +00:00
onur-ozkan
16cf0e6607 allow running clippy on most of the in-tree tools
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-16 19:24:19 +03:00
onur-ozkan
5253fe4520 update mingw-check clippy invocation
Previously this command was linting compiler and library together.
As we no longer run clippy on the entire tree unless it's explicitly
requested, we need to update this command by adding `library` path.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-16 19:23:02 +03:00
onur-ozkan
a01897345c fix sysroot bug and update step message format
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-16 19:22:59 +03:00
onur-ozkan
bbacfe0cb6 add simple top-level doc-comment for build_steps/clippy
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-16 19:22:56 +03:00
onur-ozkan
489e5d0ad0 for clippy, skip output handling in run_cargo
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-16 19:22:47 +03:00
onur-ozkan
77ba3f2891 support different Kinds in Builder::msg_tool
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-16 19:22:44 +03:00
onur-ozkan
8a865a0fa9 create Builder::msg_clippy
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-16 19:22:41 +03:00
onur-ozkan
81b7944163 create new build step clippy
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-16 19:22:37 +03:00
Oli Scherer
9cc4e2361e Prefer identity equality over equating types during coercion.
These types are always generic only over their own generic parameters with no inference variables involved.
2024-04-16 16:00:55 +00:00
Matthias Krüger
4971d9ffe4
Rollup merge of #124024 - RalfJung:interpret-comment, r=oli-obk
interpret: remove outdated comment

In https://github.com/rust-lang/rust/pull/107756, allocation became generally fallible, so the "only panic if there is provenance" no longer applies.

r? ``@oli-obk``
2024-04-16 17:54:46 +02:00
Matthias Krüger
864ab0cc36
Rollup merge of #124018 - RalfJung:dealloc-memory-kind, r=oli-obk
interpret: pass MemoryKind to before_memory_deallocation

This will be needed for https://github.com/rust-lang/miri/pull/3475.

r? ``@oli-obk``
2024-04-16 17:54:45 +02:00
Matthias Krüger
25fd90cea8
Rollup merge of #124017 - oli-obk:define_opaque_types8, r=compiler-errors
Change a diagnostics-path-only `DefineOpaqueTypes` to `Yes`.

This can't possibly affect compilation, so it's safe to flip, even if I couldn't come up with an affected test

r? ``@compiler-errors``
2024-04-16 17:54:45 +02:00
Matthias Krüger
cf7900476e
Rollup merge of #124007 - RalfJung:miri, r=RalfJung
Miri subtree update

r? ``@ghost``
2024-04-16 17:54:44 +02:00
Matthias Krüger
cad7d94e0f
Rollup merge of #123969 - oli-obk:define_opaque_types6, r=compiler-errors
The new solver ignores `DefineOpaqueTypes`, so switch it to `Yes`

We assert that we are in the new solver in the line above

r? ``@compiler-errors``
2024-04-16 17:54:43 +02:00
Matthias Krüger
0aa7235423
Rollup merge of #123711 - onur-ozkan:drop-changelog-seen, r=albertlarsan68
drop `changelog-seen`

It's been 7 months since we deprecated this. It should be fine to remove it now.
2024-04-16 17:54:42 +02:00