Commit Graph

243346 Commits

Author SHA1 Message Date
bors
387e7a5e42 Auto merge of #119760 - matthiaskrgr:rollup-ti2xpp7, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #117744 (Add -Zuse-sync-unwind)
 - #118649 (Make inductive cycles in coherence ambiguous always)
 - #118979 (Use `assert_unsafe_precondition` for `char::from_u32_unchecked`)
 - #119619 (mir-opt and custom target fixes)
 - #119632 (Fix broken build for ESP IDF due to #119026)
 - #119712 (Adding alignment to the cases to test for specific error messages.)
 - #119734 (Miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-01-09 04:58:53 +00:00
Matthias Krüger
91fcc17117
Rollup merge of #119734 - RalfJung:miri, r=RalfJung
Miri subtree update

r? ``@ghost``
2024-01-09 05:33:23 +01:00
Matthias Krüger
deb504b777
Rollup merge of #119712 - madsravn:parsing-errors, r=estebank
Adding alignment to the cases to test for specific error messages.

Adding alignment to the list of cases to test for specific error message. Covers `>`, `^` and `<`.

Pinging people who chimed in last time ( https://github.com/rust-lang/rust/pull/106805 ): ``@estebank`` , ``@compiler-errors`` and ``@Nilstrieb``
2024-01-09 05:33:22 +01:00
Matthias Krüger
50982bd4ab
Rollup merge of #119632 - ivmarkov:master, r=Nilstrieb,dtolnay
Fix broken build for ESP IDF due to #119026

`target_os = "espidf"` in `libc` lacks the `SOMAXCONN` constant, but that's probably irrelevant in this context, as `UnixListener` is not supported on ESP IDF - it being a single process "OS" only.

The PR just re-uses the `128` constant so that the code builds. Trying to use the listener on ESP IDF will fail with `ENOSYS`, which is fine.

*UPDATE* Might not fail with `ENOSYS` - need to test what error code would be returned, but that doesn`t change anything.
2024-01-09 05:33:22 +01:00
Matthias Krüger
985b2ce70d
Rollup merge of #119619 - onur-ozkan:panic-abort-mir-opt, r=oli-obk
mir-opt and custom target fixes

From https://github.com/rust-lang/rust/issues/115642#issuecomment-1879589022

> > Could you please test the last two commits from https://github.com/onur-ozkan/rust/commits/panic-abort-mir-opt when you have the time? The first commit should resolve the error of using the nightly flag with a stable compiler, and the second one should resolve the custom target issue.

> I tested with the two commits and the errors of using nightly flag and custom target specs were not seen.
Testing was completed for the test suites like ui, run-pass-valgrind, coverage, mir-opt, codegen, assembly, incremental.

Fixes #115642
2024-01-09 05:33:22 +01:00
Matthias Krüger
b0c492cd6e
Rollup merge of #118979 - ChrisDenton:unwrap-const, r=Nilstrieb,dtolnay
Use `assert_unsafe_precondition` for `char::from_u32_unchecked`

Use `assert_unsafe_precondition` in `char::from_u32_unchecked` so that it can be stabilized as `const`.
2024-01-09 05:33:21 +01:00
Matthias Krüger
1974f5cba9
Rollup merge of #118649 - compiler-errors:coherence-ambig, r=lcnr
Make inductive cycles in coherence ambiguous always

Logical conclusion of https://github.com/rust-lang/rust/issues/114040
One step after #116493

cc https://github.com/rust-lang/trait-system-refactor-initiative/issues/20

r? lcnr to kick off the FCP after review... maybe we should wait until 1.75 is landed? In that case, I'd still like to get the FCP boxes checked sooner since that'll be near the holidays which means everyone's away.
2024-01-09 05:33:21 +01:00
Matthias Krüger
9e4843e42e
Rollup merge of #117744 - quininer:add-z-sync-uw, r=bjorn3
Add -Zuse-sync-unwind

Currently Rust uses async unwind by default, but async unwind will bring non-negligible size overhead. it would be nice to allow users to choose this.

In addition, async unwind currently prevents LLVM from generate compact unwind for MachO, if one wishes to generate compact unwind for MachO, then also needs this flag.
2024-01-09 05:33:20 +01:00
bors
a399117774 Auto merge of #119732 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? ghost
2024-01-09 03:01:30 +00:00
Erik Desjardins
c8ded52601 GNU/Hurd: unconditionally use inline stack probes
LLVM 11 has been unsupported since 45591408b1,
so this doesn't need to be conditional on the LLVM version.
2024-01-08 21:36:02 -05:00
Michael Howell
c3cd657210 rustdoc-search: intern function search types
This takes advantage of more reuse opportunities.
Along with the empty object commit, they
bringing memory usage down about 20% over the original.
2024-01-08 18:57:06 -07:00
bors
d6affcf520 Auto merge of #119754 - matthiaskrgr:rollup-7cht4m5, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #118903 (Improved support of collapse_debuginfo attribute for macros.)
 - #119033 (coverage: `llvm-cov` expects column numbers to be bytes, not code points)
 - #119598 (Fix a typo in core::ops::Deref's doc)
 - #119660 (remove an unnecessary stderr-per-bitwidth)
 - #119663 (tests: Normalize `\r\n` to `\n` in some run-make tests)
 - #119681 (coverage: Anonymize line numbers in branch views)
 - #119704 (Fix two variable binding issues in lint let_underscore)
 - #119725 (Add helper for when we want to know if an item has a host param)
 - #119738 (Add `riscv32imafc-esp-espidf` tier 3 target for the ESP32-P4.)
 - #119740 (Remove crossbeam-channel)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-01-09 00:04:47 +00:00
Matthias Krüger
1c9e862a3e
Rollup merge of #119740 - Mark-Simulacrum:drop-crossbeam, r=davidtwco
Remove crossbeam-channel

The standard library's std::sync::mpsc basically is a crossbeam channel, and for the use case here will definitely suffice. This drops this dependency from librustc_driver.
2024-01-09 00:19:36 +01:00
Matthias Krüger
eb6ce92473
Rollup merge of #119738 - esp-rs:esp32p4-espidf, r=Nilstrieb
Add `riscv32imafc-esp-espidf` tier 3 target for the ESP32-P4.

The tier 3 target answers in the original PR are still relevant, so please review them here: https://github.com/rust-lang/rust/pull/87666#issue-957268176

cc: ``@ivmarkov``
2024-01-09 00:19:36 +01:00
Matthias Krüger
cd93114deb
Rollup merge of #119725 - compiler-errors:has_effect_param, r=fmease
Add helper for when we want to know if an item has a host param

r? ````@fmease```` since you're a good reviewer and no good deed goes unpunished

This helper will see far more usages as built-in traits get constified.
2024-01-09 00:19:36 +01:00
Matthias Krüger
5efa69d979
Rollup merge of #119704 - chenyukang:yukang-fix-let_underscore, r=Nilstrieb
Fix two variable binding issues in lint let_underscore

Fixes #119696
Fixes #119697
2024-01-09 00:19:35 +01:00
Matthias Krüger
867a87d342
Rollup merge of #119681 - Zalathar:anon-branch, r=clubby789
coverage: Anonymize line numbers in branch views

Extracted from #118305, as this is now the only part of that PR that needs to touch compiletest.

---

Coverage tests run the `llvm-cov` tool to generate a coverage report for a test program, and then compare the report against a known-good snapshot.

We use the `anonymize_coverage_line_numbers` function to replace line numbers in coverage reports with `LL`, so that they are less sensitive to lines being added or removed. This PR augments the existing code by making it also support the slightly different line number syntax used when reporting branch regions.

Currently the compiler never emits branch regions, so there is no way to write a coverage test that makes use of this new capability. Instead, I've added a unit test that checks against some sample reports taken from #118305. That unit test can be removed when some form of branch coverage support gets merged, and real branch coverage tests are added to the coverage test suite.

(I have also manually tested this change as part of my draft branch-coverage PR.)
2024-01-09 00:19:35 +01:00
Matthias Krüger
e6bc9f0637
Rollup merge of #119663 - petrochenkov:rmakefix, r=Mark-Simulacrum
tests: Normalize `\r\n` to `\n` in some run-make tests

The output is produced by printf from C code in these cases, and printf prints in text mode, which means `\n` will be printed as `\r\n` on Windows.

In --bless mode the new output with `\r\n` will replace expected output in `tests/run-make/raw-dylib-*\output.txt` files, which use \n, always resulting in dirty files in the repo.
2024-01-09 00:19:34 +01:00
Matthias Krüger
34771e2f9a
Rollup merge of #119660 - RalfJung:const-ub-enum, r=oli-obk
remove an unnecessary stderr-per-bitwidth

also update some regexp, `a(lloc)?` would no longer match now that we have compiletest itself do alloc ID normalization.

r? ````@oli-obk````
2024-01-09 00:19:34 +01:00
Matthias Krüger
668e8b5541
Rollup merge of #119598 - Laura7089:fix/deref-typo, r=Nilstrieb
Fix a typo in core::ops::Deref's doc
2024-01-09 00:19:33 +01:00
Matthias Krüger
70e3f8d240
Rollup merge of #119033 - Zalathar:unicode, r=davidtwco
coverage: `llvm-cov` expects column numbers to be bytes, not code points

Normally the compiler emits column numbers as a 1-based number of Unicode code points.

But when we embed coverage mappings for `-Cinstrument-coverage`, those mappings will ultimately be read by the `llvm-cov` tool. That tool assumes that column numbers are 1-based numbers of *bytes*, and relies on that assumption when slicing up source code to apply highlighting (in HTML reports, and in text-based reports with colour).

For the very common case of all-ASCII source code, bytes and code points are the same, so the difference isn't noticeable. But for code that contains non-ASCII characters, emitting column numbers as code points will result in `llvm-cov` slicing strings in the wrong places, producing mangled output or fatal errors.

(See https://github.com/taiki-e/cargo-llvm-cov/issues/275 as an example of what can go wrong.)
2024-01-09 00:19:33 +01:00
Matthias Krüger
ee7d4c1561
Rollup merge of #118903 - azhogin:azhogin/skip_second_stmt_debuginfo.rs, r=petrochenkov
Improved support of collapse_debuginfo attribute for macros.

Added walk_chain_collapsed function to consider collapse_debuginfo attribute in parent macros in call chain.
Fixed collapse_debuginfo attribute processing for cranelift (there was if/else branches error swap).

cc https://github.com/rust-lang/rust/issues/100758
2024-01-09 00:19:32 +01:00
Nicholas Nethercote
a2b765fc37 Remove -Zdont-buffer-diagnostics.
It was added in #54232. It seems like it was aimed at NLL development,
which is well in the past. Also, it looks like `-Ztreat-err-as-bug` can
be used to achieve the same effect. So it doesn't seem necessary.
2024-01-09 09:47:36 +11:00
Camille GILLOT
5d6463c26c Make match exhaustive. 2024-01-08 22:42:07 +00:00
Camille GILLOT
cae0dc2833 Simplify code flow. 2024-01-08 22:42:07 +00:00
Camille GILLOT
8356802862 Move promote_consts back to rustc_mir_transform. 2024-01-08 22:42:07 +00:00
Michael Goulet
9a756034a9 Last nits 2024-01-08 20:32:06 +00:00
Michael Goulet
841184bcae Make cycle error more resilient to where it starts
Also don't recomment recursive_async crate anymore

Co-authored-by: lcnr <rust@lcnr.de>
2024-01-08 20:30:24 +00:00
Michael Goulet
fa2ff51ace Only compute layout of opaque if coroutine is the cause of an opaque cycle 2024-01-08 20:30:24 +00:00
Michael Goulet
199af7cef0 Point out source of recursion 2024-01-08 20:30:24 +00:00
Michael Goulet
82a2215481 Don't check for recursion in generator witness fields 2024-01-08 20:30:21 +00:00
Michael Goulet
89f511e4dd Rustdoc and Clippy stop misusing Key for Ty -> (adt) DefId 2024-01-08 20:30:10 +00:00
Michael Goulet
dfb9f5df2c Rustdoc and Clippy stop misusing Key for Ty -> (adt) DefId 2024-01-08 20:30:10 +00:00
Michael Goulet
755b2da841 Value recovery can take the whole CycleError 2024-01-08 20:30:10 +00:00
David Koloski
684aa2c9d1 Add support for shell argfiles 2024-01-08 15:25:55 -05:00
bors
3b8323d790 Auto merge of #12049 - cocodery:fix/issue#11243, r=Alexendoo
fix/issue#11243: allow 3-digit-grouped binary in non_octal_unix_permissions

fixes [Issue#11243](https://github.com/rust-lang/rust-clippy/issues/11243)

Issue#11243 suggest lint `non_octal_unix_permissions` should not report binary format literal unix permissions as an error, and we think binary format is a good way to understand these permissions.

To solve this problem, we need to add check for binary literal, which is written in function `check_binary_unix_permissions` , only `binary, 3 groups and each group length equals to 3` is a legal format.

changelog: [`non_octal_unix_permissions`]: Add check for binary format literal unix permissions like 0b111_111_111
2024-01-08 19:09:42 +00:00
Michael Howell
e61be1bfae rustdoc-search: reuse empty map/array in function signatures
Map is implemented as a pointer to a mutable object.
Rustdoc never mutates function signatures after constructing them,
but the JS engine doesn't know that.

To save a bunch of memory, use a single immutable map
for every decoded type object with no bindings or generics.
2024-01-08 12:00:40 -07:00
Mads Ravn
506c06636b Removing redudant note from parse error 2024-01-08 19:41:01 +01:00
bors
ca663b06c5 Auto merge of #119606 - nnethercote:consuming-emit, r=oli-obk
Consuming `emit`

This PR makes `DiagnosticBuilder::emit` consuming, i.e. take `self` instead of `&mut self`. This is good because it doesn't make sense to emit a diagnostic twice.

This requires some changes to `DiagnosticBuilder` method changing -- every existing non-consuming chaining method gets a new consuming partner with a `_mv` suffix -- but permits a host of beneficial follow-up changes: more concise code through more chaining, removal of redundant diagnostic construction API methods, and removal of machinery to track the possibility of a diagnostic being emitted multiple times.

r? `@compiler-errors`
2024-01-08 16:06:28 +00:00
Arthur Carcano
5b041abc8c A more efficient slice comparison implementation for T: !BytewiseEq
The previous implementation was not optimized properly by the compiler,
which didn't leverage the fact that both length were equal.
2024-01-08 16:36:48 +01:00
Michael Goulet
760673e97d Remove logic in one_bound in astconv that prefers non-const bounds 2024-01-08 15:31:53 +00:00
Michael Goulet
8abf133c4b Make inductive cycles in coherence ambiguous always 2024-01-08 15:03:59 +00:00
Michael Goulet
e44b11f695 ~const trait or projection bounds do not imply non-const bounds 2024-01-08 15:01:14 +00:00
onur-ozkan
b888e2f82b fix the incorrect target on stage1 ui-fulldeps tests
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-01-08 16:07:44 +03:00
onur-ozkan
26c71cbcf1 detect user-specified custom targets in compiletest
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-01-08 16:07:41 +03:00
onur-ozkan
8aa7dd06f6 enable RUSTC_BOOTSTRAP on panic=abort mir-opt test
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-01-08 16:07:30 +03:00
Scott Mabin
43ce53375c Add riscv32imafc-esp-espidf target for the ESP32-P4. 2024-01-08 12:54:06 +00:00
Zalathar
6971e9332d coverage: llvm-cov expects column numbers to be bytes, not code points 2024-01-08 21:58:46 +11:00
Andrew Zhogin
f2dbebafad Improved support of collapse_debuginfo attribute for macros. 2024-01-08 17:47:18 +07:00
Zalathar
88f5759ace coverage: Allow make_code_region to fail 2024-01-08 21:43:22 +11:00