Commit Graph

260472 Commits

Author SHA1 Message Date
bors 6be96e3865 Auto merge of #127234 - ZhuUx:inlined-expr, r=davidtwco,Zalathar
[Coverage][MCDC] Group mcdc tests and fix panic when generating mcdc code for inlined expressions.

### Changes

1. Group all mcdc tests to one directory.
2. Since mcdc instruments different mappings for boolean expressions with normal branch coverage as #125766 introduces, it would be better also trace branch coverage results in mcdc tests.
3. So far rustc does not call `CoverageInfoBuilderMethods::init_coverage` for inlined functions. As a result, it could panic if it tries to instrument mcdc statements for inlined functions due to uninitialized cond bitmaps. We can reproduce this issue by current nightly rustc and [the test](https://github.com/rust-lang/rust/pull/127234/files#diff-c81af6bf4869aa42f5c7334e3e86344475de362f673f54ce439ec75fcb5ac3e5) with flag `--release`. This patch fixes it.
2024-07-09 20:24:30 +00:00
Oneirical 37599b2072 rewrite and rename issue-83112-incr-test-moved-file to rmake 2024-07-09 16:13:45 -04:00
bors 279494eced Auto merge of #13080 - xFrednet:00000-lintcheck-mv-stuff-and-things, r=Alexendoo
Lintcheck: Refactor structs and only take one version per crate

For some time now I had the feeling that lintcheck's main file has been too large. This PR simply moves some structs into new submodules.

I've also changed the `.toml` structure slightly to only accept one version per crate. AFAIK, we haven't use multiple versions before. If we want to test different versions, we can simply just add a second entry. That's what lintcheck does internally anyways.

I wanted to have these changes in separate commits, but then accidentally squashed them... So sorry 😅

---

r? `@Alexendoo` If you think this is not really worth a proper review, since it's mostly a move refactoring in an internal tool, you can also `r=xFrednet` on this PR.

changelog: none
2024-07-09 20:11:00 +00:00
xFrednet c3a240608b
Lintcheck: Refactor structs and only take one version per crate 2024-07-09 22:00:58 +02:00
simonLeary42 dfac6fa5c6
cmake version is from LLVM, link to LLVM docs 2024-07-09 15:23:59 -04:00
Oneirical d44732120c rewrite symbols-include-type-name to rmake 2024-07-09 14:30:57 -04:00
Vincenzo Palazzo 568e78f366 tests: adds cargo fix tests
Co-Developed-by: Eric Holk
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2024-07-09 17:41:13 +00:00
Vincenzo Palazzo 25637e2c8e Adds expr_2024 migration lit
This is adding a migration lint for the current (in the 2021 edition and previous)
to move expr to expr_2021 from expr

Co-Developed-by: Eric Holk
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2024-07-09 17:41:13 +00:00
bors 9dcaa7f92c Auto merge of #127028 - Nadrieril:fix-or-pat-expansion, r=matthewjasper
Fix regression in the MIR lowering of or-patterns

In https://github.com/rust-lang/rust/pull/126553 I made a silly indexing mistake and regressed the MIR lowering of or-patterns. This fixes it.

r? `@compiler-errors` because I'd like this to be merged quickly 🙏
2024-07-09 16:33:59 +00:00
Santiago Pastorino 4700b5b01f
Remove spastorino from SMIR 2024-07-09 12:50:47 -03:00
bors 8fa406b03f Auto merge of #13069 - Jarcho:misc_small4, r=Manishearth
Misc refactorings part 4

And even more rearrangements to check the HIR tree before other checks.

changelog: none
2024-07-09 15:47:24 +00:00
Michael Goulet bbbff80603 Split out fulfillment error reporting a bit more 2024-07-09 09:57:16 -04:00
Michael Goulet cd68a28daa Move some stuff into the ambiguity and suggestion modules 2024-07-09 09:51:56 -04:00
Michael Goulet 7af825fea4 Split out overflow handling into its own module 2024-07-09 09:51:56 -04:00
bors f25e92bd42 Auto merge of #127500 - compiler-errors:consolidate-region-errors, r=lcnr
Consolidate region error reporting in `rustc_infer`

More work on https://github.com/rust-lang/rust/issues/127492. Separate but important step, since I'm gonna likely pull everything else here into another module.

I don't think I'm confident whether `nice_region_error` should be a submodule of the new `rustc_infer::infer::error_reporting::region` module, so I left it alone for now.

r? lcnr
2024-07-09 13:43:15 +00:00
Nicholas Nethercote f5527949f2 Move `Spacing` into `FlatToken`.
It's only needed for the `FlatToken::Token` variant. This makes things a
little more concise.
2024-07-09 21:54:32 +10:00
bors a2d58197a7 Auto merge of #127493 - compiler-errors:crate-level-import, r=lcnr
Move trait selection error reporting to its own top-level module

This effectively moves `rustc_trait_selection::traits::error_reporting` to `rustc_trait_selection::error_reporting::traits`. There are only a couple of actual changes to the code, like moving the `pretty_impl_header` fn out of the specialization module for privacy reasons.

This is quite pointless on its own, but having `error_reporting` as a top-level module in `rustc_trait_selection` is very important to make sure we have a meaningful file structure for when we move **type** error reporting (and region error reporting, with which it's incredibly entangled currently) into `rustc_trait_selection`. I've opened a tracking issue here: #127492

r? lcnr
2024-07-09 11:23:13 +00:00
bjorn3 96fa075225 Fix rustc test suite 2024-07-09 10:46:21 +00:00
bjorn3 7292fa2a90 Update dependencies 2024-07-09 10:40:29 +00:00
bjorn3 344e4ef787 Fix rustc test suite 2024-07-09 10:30:12 +00:00
bjorn3 cf25d25de3 Rustup to rustc 1.81.0-nightly (35b658fb1 2024-07-08) 2024-07-09 10:16:04 +00:00
bjorn3 29bc1a5cc0 Sync from rust 35b658fb10 2024-07-09 10:08:02 +00:00
bors 8672b2b763 Auto merge of #127001 - beetrees:f16-debuginfo, r=michaelwoerister
Add Natvis visualiser and debuginfo tests for `f16`

To render `f16`s in debuggers on MSVC targets, this PR changes the compiler to output `f16`s as `struct f16 { bits: u16 }`, and includes a Natvis visualiser that manually converts the `f16`'s bits to a `float` which is can then be displayed by debuggers. `gdb`, `lldb` and `cdb` tests are also included for `f16` .

`f16`/`f128` MSVC debug info issue: #121837
Tracking issue: #116909
2024-07-09 09:07:42 +00:00
Pietro Albini b4b2643c11
set the correct rustc and cargo even for tests invoking parse_inner 2024-07-09 10:12:51 +02:00
lcnr dd175feb25 cycle_participants to nested_goals 2024-07-09 09:51:50 +02:00
Oli Scherer aece06482e Remove HirTyLowerer::set_tainted_by_errors, since it is now redundant 2024-07-09 07:44:17 +00:00
Oli Scherer fd9a92542c Automatically taint when reporting errors from ItemCtxt 2024-07-09 07:44:17 +00:00
Sander Saares a04dbb0ab9 Tidy the example code and ensure it builds as standalone snippets 2024-07-09 10:28:11 +03:00
lcnr e38109d7f0 use `update_parent_goal` for lazy updates 2024-07-09 09:22:58 +02:00
Sander Saares a067cd24ac Replace incorrect suggested fix for `float_cmp`
Using `f32::EPSILON` or `f64::EPSILON` as the floating-point equality comparison error margin is incorrect, yet `float_cmp` has until now recommended this be done. This change fixes the given guidance (both in docs and compiler hints) to not reference these unsuitable constants.

Instead, the guidance now clarifies that the scenarios in which an absolute error margin is usable, provides a reference implementation of using a user-defined absolute error margin (as an absolute error margin can only be used-defined and may be different for different comparisons) and references the floating point guide for a reference implementation of relative error based equaltiy comparison for when absolute error margin cannot be used.

changelog: Fix guidance of [`float_cmp`] and [`float_cmp_const`] to not incorrectly recommend `f64::EPSILON` as the error margin.

Fixes #6816
2024-07-09 10:12:09 +03:00
lcnr 7097dbc50c exhaustively destructure external constraints 2024-07-09 09:10:19 +02:00
bors 5be2ec7245 Auto merge of #127200 - fee1-dead-contrib:trait_def_const_trait, r=compiler-errors
Add `constness` to `TraitDef`

Second attempt at fixing the regression @ https://github.com/rust-lang/rust/pull/120639#issuecomment-2198373716

r? project-const-traits
2024-07-09 06:51:35 +00:00
zhuyunxing 83fa6b726a coverage. Fix panic when generating mcdc code for inlined functions 2024-07-09 14:28:40 +08:00
zhuyunxing c77788f011 coverage. MCDC tests also report branches coverage 2024-07-09 14:28:40 +08:00
zhuyunxing 4f6140258f coverage. Group mcdc tests in one directory 2024-07-09 14:28:40 +08:00
bors cd3d98b3be Auto merge of #127357 - oli-obk:structureddiag, r=fmease
Remove `StructuredDiag`

follow-up to https://github.com/rust-lang/rust/pull/127319

This trait was an experiment that didn't pan out.
2024-07-09 04:31:11 +00:00
beetrees b058de90a3
Add Natvis visualiser and debuginfo tests for `f16` 2024-07-09 03:47:50 +01:00
bors 99b7134389 Auto merge of #127378 - Oneirical:cetestial-meteorite, r=jieyouxu
Migrate `issue-37839`, `track-path-dep-info` and `track-pgo-dep-info` `run-make` tests to rmake

Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

Please try:

try-job: test-various
try-job: dist-x86_64-musl
2024-07-09 02:17:37 +00:00
asquared31415 87856c4461 add lint for inline asm labels that look like binary 2024-07-09 01:23:49 +00:00
Michael Goulet 9a92526b98 Consolidate region error reporting in rustc_infer 2024-07-08 20:35:30 -04:00
bors 87f8a5b374 Auto merge of #13056 - y21:rm-compiler-lint-functions, r=Manishearth
Remove internal `compiler_lint_functions` lint

This internal lint has effectively been superseded by `disallowed_methods` when we started using that in #11811 (I didn't even know that we also had this internal lint at the time of when I created that PR).

Some of the methods that this looks for also don't exist anymore (`span_lint_note` and `span_lint_help`), though there was one that that lint had but wasn't disallowed in clippy.toml (`LintContext::lint`)

changelog: none
2024-07-08 23:10:11 +00:00
bors d4a620058b Auto merge of #127328 - Oneirical:yield-to-petestrians, r=jieyouxu
Migrate `pass-linker-flags-flavor`, `pass-linker-flags-from-dep` and `pass-linker-flags` `run-make` tests to rmake

Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

Please test on i686-msvc. Expected to fail.

try-job: aarch64-apple
2024-07-08 23:07:51 +00:00
bors e64236ca3a Auto merge of #13044 - Jarcho:bool_int, r=Manishearth
Refactor `bool_to_int_with_if`

Rearranges things to check the HIR tree first and simplifies how the literals are read.

changelog: None
2024-07-08 22:58:50 +00:00
Trevor Gross 96a791662a Update a f16/f128 FIXME to be more accurate 2024-07-08 18:55:26 -04:00
bors 058e6eaa3a Auto merge of #13043 - Jarcho:assign_clone, r=Manishearth
Refactor `assigning_clones`

Short list of changes:
* Inline and simplify `extract_call`
* Inline `is_ok_to_suggest`
* Inline `skip_drop_block`
* Check the HIR tree before the macro check
* Don't call `outer_expn_data`
* Use `find` instead of a loop in `clone_source_borrows_from_dest`

changelog: none
2024-07-08 22:48:19 +00:00
bors f6020fbd44 Auto merge of #13042 - Jarcho:almost_range, r=Manishearth
`almost_complete_range`: Delay suggestion creation.

Does less work when the lint doesn't trigger.

changelog: none
2024-07-08 22:39:01 +00:00
Lieselotte ec662e7606
`#[doc(alias)]`'s doc: say that ASCII spaces are allowed 2024-07-09 00:16:06 +02:00
Trevor Gross 321eba5e8f Update f16/f128 FIXMEs that needed (NEG_)INFINITY 2024-07-08 18:02:14 -04:00
bors 35b658fb10 Auto merge of #127489 - GuillaumeGomez:rollup-rhqfeom, r=GuillaumeGomez
Rollup of 4 pull requests

Successful merges:

 - #126427 (Rewrite `intrinsic-unreachable`, `sepcomp-cci-copies`, `sepcomp-inlining` and `sepcomp-separate` `run-make` tests to rmake.rs)
 - #127237 (Improve code of `run-make/llvm-ident`)
 - #127325 (Migrate `target-cpu-native`,  `target-specs` and `target-without-atomic-cas` `run-make` tests to rmake)
 - #127482 (Infer async closure signature from (old-style) two-part `Fn` + `Future` bounds)

Failed merges:

 - #127357 (Remove `StructuredDiag`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-07-08 20:38:48 +00:00
Michael Goulet 920cbcdd45 Move trait selection error reporting to its own top-level module 2024-07-08 16:04:47 -04:00