Commit Graph

253375 Commits

Author SHA1 Message Date
Ralf Jung
8b35be741f consistency rename: language item -> lang item 2024-04-17 13:00:43 +02:00
Ralf Jung
d101971ab1 weak lang items are not allowed to be #[track_caller] 2024-04-17 12:59:55 +02:00
bors
91b8441b3a Auto merge of #17055 - wyatt-herkamp:fix_panic_at_unused_variable, r=Veykril
fix: Replace Just the variable name in Unused Variable Diagnostic Fix

Changes Unused Variable diagnostic to just look at the variable name, not the entire syntax range.

Also added a test for an unused variable in an array destructure.

Closes #17053
2024-04-17 10:11:03 +00:00
Oli Scherer
182698fef2 Don't error on subtyping of equal types 2024-04-17 10:09:38 +00:00
Lukas Wirth
0eb7b6c7b5 Don't show unused_variables fixes if the name comes from a macro definition 2024-04-17 12:05:35 +02:00
Zalathar
d3c3051995 Move confusing comment about otherwise blocks in lower_match_tree
This comment was historically inside a block guarded by
`if let Some(otherwise_block) = otherwise`.

When #120978 made the otherwise block non-optional, it also flattened that
region of code. Doing so left this comment awkwardly stranded above an
unrelated line of code, without its original context.

We can restore that context by moving it above the declaration of `otherwise`.
2024-04-17 19:59:39 +10:00
Oli Scherer
126dcc618d Use less fragile error handling 2024-04-17 09:50:44 +00:00
Oli Scherer
77fe9f0a72 Validate before reporting interning errors.
validation produces much higher quality errors and already handles most of the cases
2024-04-17 09:50:44 +00:00
Oli Scherer
8b2a4f8b43 Simplify alloc id mutability check 2024-04-17 09:50:44 +00:00
Oli Scherer
140c9e10bb Deduplicate logic for checking the mutability of allocations 2024-04-17 09:50:44 +00:00
Oli Scherer
d87e9636d5 Run the "is this static mutable" logic the same way as in in_mutable_memory 2024-04-17 09:50:44 +00:00
Oli Scherer
8c9cba2be7 Validate nested static items 2024-04-17 09:50:15 +00:00
bors
9776f647e6 Auto merge of #3480 - RalfJung:alloc_error_handler, r=RalfJung
directly call handle_alloc_error

Also test more codepaths. There's like 5 different things that can happen on allocation failure! Between `-Zoom`, `#[alloc_error_handler]`, and `set_alloc_error_hook`, we have 3 layers of behavior overrides. It's all a bit messy.

https://github.com/rust-lang/rust/pull/112331 seems intended to clean this up, but has not yet reached consensus.
2024-04-17 09:41:06 +00:00
bors
14701efcaf Auto merge of #3479 - rust-lang:rustup-2024-04-17, r=RalfJung
Automatic Rustup
2024-04-17 09:08:55 +00:00
bors
cdd6336386 Auto merge of #12682 - cuviper:muopb-asm, r=llogiq
The `multiple_unsafe_ops_per_block` test needs `asm!`

changelog: none
2024-04-17 07:50:05 +00:00
Ralf Jung
9f156d38a5 no need to use miri's native stderr here 2024-04-17 09:47:16 +02:00
Ralf Jung
d7f79cc2b2 tests/utils: add fmt::Write implementations for miri's native stdout/stderr 2024-04-17 09:47:16 +02:00
Ralf Jung
d10f61313f alloc_error_handler tests: directly call handle_alloc_error; test more codepaths 2024-04-17 09:27:55 +02:00
bors
6c6b3027ef Auto merge of #123678 - DianQK:docker-local, r=Kobzol
Improve the experience of running Docker locally

When running locally, the absence of the `GITHUB_STEP_SUMMARY` environment variable will lead to the following error:

```
::endgroup::
./src/ci/docker/run.sh: line 349: : No such file or directory
```

I've also changed the output artifacts directory to `obj/$image_name`, allowing me to easily run all images locally. We always encounter various strange issues when modifying the test cases in the `codegen` directory.

r? Kobzol cc `@saethlin`
2024-04-17 06:47:39 +00:00
bors
1ba78212ff Auto merge of #12680 - Alexendoo:cargo-dev-setup-toolchain, r=llogiq
Add `cargo dev setup toolchain`

Adds a `cargo dev setup toolchain` subcommand that creates a rustup toolchain with symlinks to the local `cargo-clippy` and `clippy-driver`. Allows you to then do `cargo +clippy clippy` in other projects to run the locally built Clippy

Sometimes more convenient when you're testing changes on a separate project than `cd`ing back & forth to use `cargo dev lint [project]`

changelog: none
2024-04-17 05:46:07 +00:00
Ralf Jung
ae7b07f2dc interpret: rename base_pointer -> root_pointer
also in Miri, "base tag" -> "root tag"
2024-04-17 07:35:48 +02:00
Ralf Jung
9e239bdc76 interpret: pass MemoryKind to adjust_alloc_base_pointer 2024-04-17 07:35:48 +02:00
Noa
87db7c32a7
Address comments 2024-04-17 00:18:04 -05:00
The Miri Cronjob Bot
2cb03ef739 fmt 2024-04-17 05:09:14 +00:00
The Miri Cronjob Bot
e8739886f2 Merge from rustc 2024-04-17 05:08:05 +00:00
The Miri Cronjob Bot
af28716f19 Preparing for merge from rustc 2024-04-17 04:57:09 +00:00
bors
b7581490aa Auto merge of #124055 - matthiaskrgr:rollup-waq2e68, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #122813 (Qualifier tweaking)
 - #122883 (refactor clippy in bootstrap)
 - #123997 (Delay span bug when `Self` kw resolves to `DefKind::{Mod,Trait}`)
 - #124045 (Reinstate nnethercote to the review rotation.)
 - #124051 (Fix empty-set symbol in comments)
 - #124052 (Make the comments for `ReturnDest` variants doc comments)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-17 04:13:31 +00:00
Matthias Krüger
854303b1f9
Rollup merge of #124052 - beetrees:return-dest-doc-comment, r=fmease
Make the comments for `ReturnDest` variants doc comments

This PR converts the documentation for `ReturnDest` from comments to doc comments.
2024-04-17 05:44:54 +02:00
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
432bce6583 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
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
Zalathar
25b9f84413 coverage: Branch coverage tests for lazy boolean operators 2024-04-17 12:32:30 +10: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
Zalathar
40cfc2de77 coverage: Move branch coverage tests into a subdirectory 2024-04-17 11:41:40 +10: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
Josh Stone
245fbeef49 The multiple_unsafe_ops_per_block test needs asm! 2024-04-16 16:45:59 -07: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
Elisha Hollander
dd615004ea restore line-break 2024-04-16 22:23:15 +00:00
Elisha Hollander
9cdf3ca600 default to no testing 2024-04-16 22:23:12 +00:00
Elisha Hollander
f71d2a2af6 update cargo manifest 2024-04-16 22:22:49 +00:00
Elisha Hollander
2196d65cf2 update lockfile 2024-04-16 22:20:16 +00:00