Commit Graph

247488 Commits

Author SHA1 Message Date
lcnr
3b3514acec consider placeholders in fn term_is_fully_unconstrained 2024-02-26 11:51:01 +01:00
Ralf Jung
a3c0f3af9c miri: rename miri_start_panic → miri_start_unwind 2024-02-26 11:10:18 +01:00
Ralf Jung
b4ca582b89 rename 'try' intrinsic to 'catch_unwind' 2024-02-26 11:10:18 +01:00
lcnr
1c264ca9ca add regression tests 2024-02-26 11:01:31 +01:00
lcnr
2c7ede8f52 update tests 2024-02-26 10:57:46 +01:00
lcnr
a788be0aae use fulfillment in `Coerce::unify'
only checking whether nested goals hold means that we don't consider
their inference constraints. Given that we now emit `AliasRelate` when relating
aliases and infer vars, this previously resulted in an "unconstrained" inference var
in `coerce_unsized`.
2024-02-26 10:57:38 +01:00
Gurinder Singh
633c92cd6d Do not const pop unions
as they can made to produce values whose types don't
match their underlying layout types which can lead to
ICEs on eval
2024-02-26 15:22:22 +05:30
bors
ee933f6795 Auto merge of #121627 - GuillaumeGomez:rollup-udp3m0k, r=GuillaumeGomez
Rollup of 5 pull requests

Successful merges:

 - #120656 (Allow tests to specify a `//@ filecheck-flags:` header)
 - #120840 (Split Diagnostics for Uncommon Codepoints: Add Individual Identifier Types)
 - #121554 (Don't unnecessarily change `SIGPIPE` disposition in `unix_sigpipe` tests)
 - #121590 (Correctly handle if rustdoc JS script hash changed)
 - #121620 (Fix more #121208 fallout (round 3))

r? `@ghost`
`@rustbot` modify labels: rollup
2024-02-26 09:50:51 +00:00
Ralf Jung
297abc35b3 fix some references to no-longer-existing ReprOptions.layout_seed 2024-02-26 10:40:48 +01:00
Guillaume Gomez
76f303d658
Rollup merge of #121620 - nnethercote:fix-even-more-121208-fallout, r=lcnr
Fix more #121208 fallout (round 3)

#121208 converted lots of delayed bugs to bugs. Unsurprisingly, there were a few invalid conversion found via fuzzing.

r? `@lcnr`
2024-02-26 10:27:43 +01:00
Guillaume Gomez
a1593a678f
Rollup merge of #121590 - GuillaumeGomez:rustdoc-js-changed, r=notriddle
Correctly handle if rustdoc JS script hash changed

It's something that annoyed me for quite some time: I have nightly docs open (for both std and compiler). And often, I don't look at the page for some days. Then when I come back to it, I make a search... except nothing happens. Took me a while to figure out that it was because the hash of one of the JS files we load for the search (either `search.js` or `search-index.js`) was updated in the meantime, preventing the search to be done. To go around it, I added to press `ENTER` to make the form submitted (which would reload the same page but with the correct hashes this time and the search being run).

r? `@notriddle`
2024-02-26 10:27:42 +01:00
Guillaume Gomez
5bd909227d
Rollup merge of #121554 - Enselic:sigaction, r=oli-obk
Don't unnecessarily change `SIGPIPE` disposition in `unix_sigpipe` tests

In `auxiliary/sigpipe-utils.rs`, all we want to know is the current `SIGPIPE` disposition. We should not change it. So use `libc::sigaction` instead of `libc::signal`. That way we can also remove the code that restores it.

Part of https://github.com/rust-lang/rust/issues/97889.
2024-02-26 10:27:42 +01:00
Guillaume Gomez
91d337dfa8
Rollup merge of #120840 - HTGAzureX1212:HTGAzureX1212/unicode-identifier-types, r=fmease,Manishearth
Split Diagnostics for Uncommon Codepoints: Add Individual Identifier Types

This pull request further modifies the `uncommon_codepoints` lint, adding the individual identifier types of `Technical`, `Not_NFKC`, `Exclusion` and `Limited_Use` to the diagnostic message.

Example rendered diagnostic:
```
error: identifier contains a Unicode codepoint that is not used in normalized strings: 'ij'
  --> $DIR/lint-uncommon-codepoints.rs:6:4
   |
LL | fn dijkstra() {}
   |    ^^^^^^^
   = note: this character is included in the Not_NFKC Unicode general security profile
```

Second step of #120228.
2024-02-26 10:27:41 +01:00
Guillaume Gomez
0e08be5360
Rollup merge of #120656 - Zalathar:filecheck-flags, r=wesleywiser
Allow tests to specify a `//@ filecheck-flags:` header

This allows individual codegen/assembly/mir-opt tests to pass extra flags to the LLVM `filecheck` tool as needed.

---

The original motivation was noticing that `tests/run-make/instrument-coverage` was very close to being an ordinary codegen test, except that it needs some extra logic to set up platform-specific variables to be passed into filecheck.

I then saw the comment in `verify_with_filecheck` indicating that a `filecheck-flags` header might be useful for other purposes as well.
2024-02-26 10:27:41 +01:00
lcnr
1b3164f5c9 always emit AliasRelate goals when relating aliases
Add `StructurallyRelateAliases` to allow instantiating infer vars with rigid aliases.
Change `instantiate_query_response` to be infallible in the new solver. This requires canonicalization to not hide any information used by the query, so weaken
universe compression. It also modifies `term_is_fully_unconstrained` to allow
region inference variables in a higher universe.
2024-02-26 10:17:43 +01:00
lcnr
eeeb9b4d31 add additional logging 2024-02-26 10:12:40 +01:00
bors
b09fb8ab3b Auto merge of #12350 - hamirmahal:style/sync-GitHub-Corner-colors, r=xFrednet
style: sync GitHub Corner colors

fixes #12349.

*Please write a short comment explaining your change (or "none" for internal only changes)*

changelog: sync site GitHub Corner colors
2024-02-26 08:28:00 +00:00
Hamir Mahal
3ef693c555
refactor: remove CSS variables that are now unused 2024-02-26 00:00:33 -08:00
bors
dc00e8cdb6 Auto merge of #121317 - ChrisDenton:win10-sync, r=Mark-Simulacrum
Always use WaitOnAddress on Win10+

`WaitOnAddress` and `WakeByAddressSingle` are always available since Windows 8 so they can now be used without needing to delay load. I've also moved the Windows 7 thread parking fallbacks into a separate sub-module.
2024-02-26 06:31:30 +00:00
lucarlig
93deced553 change rs doc to no_run 2024-02-26 07:02:40 +04:00
HTGAzureX1212.
8bccceb8fc separate messages for individual categories 2024-02-26 10:09:03 +08:00
Michael Goulet
ff07f55db5 Actually use the right closure kind when checking async Fn goals 2024-02-26 01:36:14 +00:00
Chris Denton
35421c7461
Add synchronization library to run-make flags 2024-02-25 22:28:30 -03:00
bors
0250ef2571 Auto merge of #121461 - reitermarkus:generic-nonzero-tests, r=dtolnay
Use generic `NonZero` in tests.

Tracking issue: https://github.com/rust-lang/rust/issues/120257

r? `@dtolnay`
2024-02-26 01:16:16 +00:00
Nicholas Nethercote
edda2a7d3e Revert some span_bugs to span_delayed_bug.
Fixes #121503.
Fixes #121597.
2024-02-26 10:57:30 +11:00
Nicholas Nethercote
bf7d1b54e8 Move emit_stashed_diagnostic call in rustfmt.
This call was added to `parse_crate_mod` in #121487, to fix a case where
a stashed diagnostic wasn't emitted. But there is another path where a
stashed diagnostic might fail to be emitted if there's a parse error, if
the `build` call in `parse_crate_inner` fails before `parse_crate_mod`
is reached.

So this commit moves the `emit_stashed_diagnostic` call outwards, from
`parse_crate_mod` to `format_project`, just after the
`Parser::parse_crate` call. This should be far out enough to catch any
parsing errors.

Fixes #121517.
2024-02-26 10:45:45 +11:00
bors
aa2c94e416 Auto merge of #12308 - y21:more_implied_bounds, r=xFrednet
Look for `implied_bounds_in_impls` in more positions

With this, we lint `impl Trait` implied bounds in more positions:
- Type alias impl trait
- Associated type position impl trait
- Argument position impl trait
  - these are not opaque types, but instead are desugared to `where` clauses, so we need extra logic for finding them (`check_generics`), however the rest of the logic is the same

Before this, we'd only lint RPIT `impl Trait`s.
"Hide whitespaces" and reviewing commits individually might make this easier

changelog: [`implied_bounds_in_impls`]: start linting implied bounds in APIT, ATPIT, TAIT
2024-02-25 22:20:37 +00:00
y21
bbfe1c1ec3 lint implied bounds in APIT 2024-02-25 23:12:28 +01:00
y21
ec29b0d6b8 lint implied bounds in *all* opaque impl Trait types 2024-02-25 23:09:59 +01:00
bors
7353bd0341 Auto merge of #12256 - y21:single_call_fn_rm_visitor, r=llogiq
Merge `single_call_fn` post-crate visitor into lint pass

The `single_call_fn` lint worked by first collecting a list of function definitions in the lint pass, then populating the list of uses for each function in a second visitor after the crate is checked.
Doing another pass through the crate shouldn't be needed, and we should be able to do it in the same lint pass, by looking for path references to functions only and then processing them post-crate.

Other changes:
- `FxHashMap` -> `FxIndexMap` so that we emit warnings in a consistent order, as we see them (making the diff a bit confusing to look at, because warnings were moved around)
- no longer storing a `Vec<Span>` per function: an enum representing "seen once" or "seen more than once" should be enough (only the first element is used later)
- "used here" help is now a note

I also noticed that it lints on trait methods with a default implementation, but not on regular trait methods without a body (because that's what `check_fn` does). I'm not sure if that's useful though, maybe we shouldn't lint trait methods at all? It's not like you can avoid it sometimes (but then again it's a restriction lint). Either way, I left the behavior where it was before so that there are no functional changes made in this PR and it's purely a refactor. I can change it though

changelog: none
2024-02-25 22:02:55 +00:00
Lieselotte
34eae07ee5
Remove ast:: & base:: prefixes from some builtin macros 2024-02-25 22:25:26 +01:00
Lieselotte
c440a5b814
Add ErrorGuaranteed to ast::ExprKind::Err 2024-02-25 22:24:31 +01:00
Lieselotte
a3fce72a27
Add ast::ExprKind::Dummy 2024-02-25 22:22:09 +01:00
bors
0ecbd06057 Auto merge of #121182 - majaha:mingw_ci_new, r=Mark-Simulacrum
Improvements to building and CI for mingw/msys

I was getting error messages when trying to follow the build instructions the mingw build for Rust, and managed to track the issue down to an incomparability of Rust's bootstrap program with MSYS2's version of git. Essentially, the problem is that MSYS2's git works in emulated unix-y paths, but bootstrap expects a Windows path. I found a workaround for this by using relative paths instead of absolute paths.

Along with that fix, this PR also updates the build instructions for MinGW to be compatible with modern versions of MSYS2, and some changes to CI to make sure that MSYS2's version of git is tested. In particular, I'm suggesting using the [MSYS2 github action](https://github.com/marketplace/actions/setup-msys2) specially made for this purpose, which is much less hacky than the old approach and gives us more control of what packages are installed. I also cleaned up as many alternate versions of key tools as I could find from PATH, to avoid accidental usage, and cleaned up some abuses of the `CUSTOM_MINGW` environment variable.

This fixes https://github.com/rust-lang/rust/issues/105696 and fixes https://github.com/rust-lang/rust/issues/117567
2024-02-25 21:10:15 +00:00
Hamir Mahal
30ee7af2ca
style: sync GitHub Corner colors 2024-02-25 12:54:46 -08:00
lucarlig
5152050c5f move lint directly into check_attrs 2024-02-25 23:17:03 +04:00
bors
b0d3e04ca9 Auto merge of #120393 - Urgau:rfc3373-non-local-defs, r=WaffleLapkin
Implement RFC 3373: Avoid non-local definitions in functions

This PR implements [RFC 3373: Avoid non-local definitions in functions](https://github.com/rust-lang/rust/issues/120363).
2024-02-25 19:11:06 +00:00
lucarlig
ee50d5df90 correct wrong doc syntax 2024-02-25 22:52:44 +04:00
lucarlig
d84d9d32f1 lint on variant and fields as well 2024-02-25 22:33:16 +04:00
bors
10c99031ce Auto merge of #12348 - Alexendoo:remove-get-parent-node, r=y21
Remove `clippy_utils::get_parent_node`

Since it's forwarding to a single method it seems reasonable to use that one directly instead

changelog: none
2024-02-25 17:43:59 +00:00
lucarlig
f066be7e1e use span of fragments 2024-02-25 21:31:46 +04:00
lucarlig
d7ad85f521 move the the check into check_atr function 2024-02-25 21:26:43 +04:00
lucarlig
f32e92cdc9 add 1 more test and dont trim other code 2024-02-25 21:18:38 +04:00
Alex Macleod
bee4111a61 Remove clippy_utils::get_parent_node 2024-02-25 16:35:17 +00:00
bors
8c0b1fcd29 Auto merge of #121591 - matthiaskrgr:rollup-8wfhh3v, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #119590 (Stabilize `cfg_target_abi`)
 - #120805 (make non-PartialEq-typed consts as patterns a hard error)
 - #121060 (Add newtypes for bool fields/params/return types)
 - #121284 (Add test cases for inlining compiler-private items)
 - #121324 (pattern_analysis: factor out unspecialization)
 - #121409 (Prevent cycle in implied predicates computation)
 - #121513 (Fix sgx unit test compilation)
 - #121570 (Make most bootstrap step types !Copy)
 - #121586 (Don't use `unwrap()` in `ArrayIntoIter` lint when typeck fails)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-02-25 16:18:45 +00:00
y21
9a56153c5e [single_call_fn]: merge post-crate visitor into lint pass 2024-02-25 17:13:47 +01:00
Matthias Krüger
a4423884c1
Rollup merge of #121586 - gurry:121532-ice-unwrap-on-none, r=cjgillot
Don't use `unwrap()` in `ArrayIntoIter` lint when typeck fails

Fixes #121532
2024-02-25 17:05:23 +01:00
Matthias Krüger
3d5fd9d2c4
Rollup merge of #121570 - Nilstrieb:!copy, r=clubby789
Make most bootstrap step types !Copy

This makes all bootstrap types except for `Compiler` and `TargetSelection` `!Copy`. This makes it easier to modify them by adding !Copy types in the future, something that `@saethlin` has complained about before, and comes at no cost of code clarity, the impls were completely unused.

Making `Compiler` and `TargetSelection` `!Copy` (which would allow getting rid of interning) is highly nontrivial as they are used and copied **all over the place**. This should hopefully get most of the benefits.
2024-02-25 17:05:23 +01:00
Matthias Krüger
f54863636a
Rollup merge of #121513 - nshyrei:fix_tests_module, r=cuviper
Fix sgx unit test compilation

Fixes a compilation error:
```
error[E0583]: file not found for module `tests`
 --> library/std/src/sys/locks/rwlock/sgx.rs:2:1
  |
2 | mod tests;
  | ^^^^^^^^^^
  |
  = help: to create the module `tests`, create file "library/std/src/sys/locks/rwlock/sgx/tests.rs" or "library/std/src/sys/locks/rwlock/sgx/tests/mod.rs"
  = note: if there is a `mod tests` elsewhere in the crate already, import it with `use crate::...` instead

For more information about this error, try `rustc --explain E0583`.
error: could not compile `std` (lib test) due to 1 previous error`
```
When running command:
```
 `TF_BUILD=True RUST_TEST_THREADS=1 ./x.py test --stage 1 "library/std" tests/assembly tests/run-make --target=x86_64-fortanix-unknown-sgx --no-doc --exclude src/tools/linkchecker --exclude src/tools/rust-demangler --no-fail-fast 2>&1
```
The fix is done by moving a file to the location suggested by the compiler.

The issue was introduced by PR: https://github.com/rust-lang/rust/pull/121177
2024-02-25 17:05:22 +01:00
Matthias Krüger
4d442f5a58
Rollup merge of #121409 - compiler-errors:atb-cycle, r=cjgillot
Prevent cycle in implied predicates computation

Makes #65913 from hang -> fail. I believe fail is the correct state for this test to remain for the long term.
2024-02-25 17:05:22 +01:00