Commit Graph

246639 Commits

Author SHA1 Message Date
bors cce6a6e22e Auto merge of #121087 - oli-obk:eager_const_failures, r=lcnr
Always evaluate free constants and statics, even if previous errors occurred

work towards https://github.com/rust-lang/rust/issues/79738

We will need to evaluate static items before the `definitions.freeze()` below, as we will start creating new `DefId`s (for nested allocations) within the `eval_static_initializer` query.

But even without that motivation, this is a good change. Hard errors should always be reported and not silenced if other errors happened earlier.
2024-02-20 09:02:34 +00:00
bors 5af2130440 Auto merge of #121327 - Nilstrieb:rollup-zxcwwwy, r=Nilstrieb
Rollup of 10 pull requests

Successful merges:

 - #120716 (Change leak check and suspicious auto trait lint warning messages)
 - #121195 (unstable-book: Separate testing and production sanitizers)
 - #121205 (Merge `CompilerError::CompilationFailed` and `CompilerError::ICE`.)
 - #121233 (Move the extra directives for `Mode::CoverageRun` into `iter_header`)
 - #121256 (Allow AST and HIR visitors to return `ControlFlow`)
 - #121307 (Drive-by `DUMMY_SP` -> `Span` and fmt changes)
 - #121308 (Add regression test for #103369)
 - #121310 (Remove an old hack for rustdoc)
 - #121311 (Make `is_nonoverlapping` `#[inline]`)
 - #121319 (return `ty::Error` when equating `ty::Error`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-02-20 06:56:41 +00:00
Nilstrieb 599768d930
Rollup merge of #121319 - compiler-errors:err, r=oli-obk
return `ty::Error` when equating `ty::Error`

This helps iron out a difference in diagnostics between `Sub` and `Equate` relations, which I'm currently trying to unify.

r? oli-obk
2024-02-20 07:35:49 +01:00
Nilstrieb 9788b192bb
Rollup merge of #121311 - Nilstrieb:is-it-overlapping, r=saethlin
Make `is_nonoverlapping` `#[inline]`

It showed up with 3% execution time in a compiler profile.

backlink to #120848

r? ``@saethlin``
2024-02-20 07:35:48 +01:00
Nilstrieb dcb7c6919f
Rollup merge of #121310 - GrigorenkoPV:doc-smallfix, r=Nilstrieb
Remove an old hack for rustdoc

Since #78696 has been resolved
2024-02-20 07:35:48 +01:00
Nilstrieb 930566fe1a
Rollup merge of #121308 - kadiwa4:test_103369, r=TaKO8Ki
Add regression test for #103369

The issue was fixed in 1.70.0.
Closes #103369.
2024-02-20 07:35:48 +01:00
Nilstrieb ac030bcf05
Rollup merge of #121307 - estebank:drive-by, r=compiler-errors
Drive-by `DUMMY_SP` -> `Span` and fmt changes

Noticed these while doing something else. There's no practical change, but it's preferable to use `DUMMY_SP` as little as possible, particularly when we have perfectlly useful `Span`s available.
2024-02-20 07:35:47 +01:00
Nilstrieb 46cab11ed1
Rollup merge of #121256 - Jarcho:visitor2, r=oli-obk
Allow AST and HIR visitors to return `ControlFlow`

Alternative to #108598.

Since rust-lang/libs-team#187 was rejected, this implements our own version of the `Try` trait (`VisitorResult`) and the `try` macro (`try_visit`). Since this change still allows visitors to return `()`, no changes have been made to the existing ones. They can be done in a separate PR.
2024-02-20 07:35:47 +01:00
Nilstrieb 4131f6e730
Rollup merge of #121233 - Zalathar:extra-directives, r=oli-obk
Move the extra directives for `Mode::CoverageRun` into `iter_header`

When these extra directives were ported over as part of #112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument.

But now that #120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
2024-02-20 07:35:46 +01:00
Nilstrieb 328a5b7719
Rollup merge of #121205 - nnethercote:fix-stable-mir-CompilerError, r=oli-obk
Merge `CompilerError::CompilationFailed` and `CompilerError::ICE`.

`CompilerError` has `CompilationFailed` and `ICE` variants, which seems reasonable at first. But the way it identifies them is flawed:
- If compilation errors out, i.e. `RunCompiler::run` returns an `Err`, it uses `CompilationFailed`, which is reasonable.
- If compilation panics with `FatalError`, it catches the panic and uses `ICE`. This is sometimes right, because ICEs do cause `FatalError` panics, but sometimes wrong, because certain compiler errors also cause `FatalError` panics. (The compiler/rustdoc/clippy/whatever just catches the `FatalError` with `catch_with_exit_code` in `main`.)

In other words, certain non-ICE compilation failures get miscategorized as ICEs. It's not possible to reliably distinguish the two cases, so this commit merges them. It also renames the combined variant as just `Failed`, to better match the existing `Interrupted` and `Skipped` variants.

Here is an example of a non-ICE failure that causes a `FatalError` panic, from `tests/ui/recursion_limit/issue-105700.rs`:
```
 #![recursion_limit="4"]
 #![invalid_attribute]
 #![invalid_attribute]
 #![invalid_attribute]
 #![invalid_attribute]
 #![invalid_attribute]
 //~^ERROR recursion limit reached while expanding

 fn main() {{}}
```

r? ``@spastorino``
2024-02-20 07:35:46 +01:00
Nilstrieb 4c2af78778
Rollup merge of #121195 - D0liphin:master, r=ehuss
unstable-book: Separate testing and production sanitizers

This is a redo of [this PR](https://github.com/rust-lang/rust/pull/108942). Left the commit as before (except for reflowing to 80-width), since it already got approved.
2024-02-20 07:35:45 +01:00
Nilstrieb 5b8b435d5d
Rollup merge of #120716 - spastorino:change-some-lint-msgs, r=lcnr
Change leak check and suspicious auto trait lint warning messages

The leak check lint message "this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!" is misleading as some cases may not be phased out and could end being accepted. This is under discussion still.

The suspicious auto trait lint the change in behavior already happened, so the new message is probably more accurate.

r? `@lcnr`

Closes #93367
2024-02-20 07:35:45 +01:00
bors bcea3cb748 Auto merge of #120692 - Nadrieril:move-column-analysis-to-placeinfo, r=compiler-errors
pattern_analysis: Move constructor selection logic to `PlaceInfo`

This is a small refactor PR. There was a dense bit of constructor-related logic in `compute_exhaustiveness_and_usefulness`. I'm moving it out into a `PlaceInfo` method to make it easier to follow both separately. I also have plans that will complicate it further so it's good that it's somewhat encapsulated.

r? `@compiler-errors`
2024-02-20 04:57:15 +00:00
bors 0b9f6ad994 Auto merge of #120628 - workingjubilee:reimpl-meaningful-test-name-lint, r=compiler-errors
Reimpl meaningful test name lint MCP658

This reintroduces the tidy rule originally proposed in https://github.com/rust-lang/rust/pull/113583 that then became an MCP in https://github.com/rust-lang/compiler-team/issues/658 which eventually surfaced a quite-reasonable request for a diagnostic enhancement. I have added that to the rule. It produces output like this:
```
tidy error: file `ui/unsized/issue-115809.rs` must begin with a descriptive name, try `{reason}-issue-115809.rs`
tidy error: file `ui/unsized/issue-115203.rs` must begin with a descriptive name, try `{reason}-issue-115203.rs`
tidy error: file `ui/privacy/issue-113860-2.rs` must begin with a descriptive name, try `{reason}-issue-113860.rs`
tidy error: file `ui/privacy/issue-117997.rs` must begin with a descriptive name, try `{reason}-issue-117997.rs`
tidy error: file `ui/privacy/issue-119463.rs` must begin with a descriptive name, try `{reason}-issue-119463.rs`
tidy error: file `ui/privacy/auxiliary/issue-117997.rs` must begin with a descriptive name, try `{reason}-issue-117997.rs`
tidy error: file `ui/privacy/auxiliary/issue-119463-extern.rs` must begin with a descriptive name, try `{reason}-issue-119463.rs`
tidy error: file `ui/privacy/issue-113860-1.rs` must begin with a descriptive name, try `{reason}-issue-113860.rs`
tidy error: file `ui/privacy/issue-113860.rs` must begin with a descriptive name, try `{reason}-issue-113860.rs`
tidy error: file `ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.rs` must begin with a descriptive name, try `{reason}-issue-114151.rs`
tidy error: file `ui/did_you_mean/issue-114112.rs` must begin with a descriptive name, try `{reason}-issue-114112.rs`
tidy error: file `ui/did_you_mean/issue-105225.rs` must begin with a descriptive name, try `{reason}-issue-105225.rs`
tidy error: file `ui/did_you_mean/issue-105225-named-args.rs` must begin with a descriptive name, try `{reason}-issue-105225.rs`
```

You get the idea.

There are some tests which merely would require reordering of the name according to the rule. I could modify the diagnostic further to identify those, but doing such would make it prone to bad suggestions. I have opted to trust contributors to recognize the diagnostic is robotic, as the pattern we are linting on is easier to match if we do not speculate on what parts of the name are meaningful: sometimes a word is a reason, but sometimes it is a mere "tag", such as with a pair like:
- issue-314159265-blue.rs
- issue-314159265-red.rs

Starting them with `red-` and `blue-` means they do not sort together, despite being related, and the color names are still not very descriptive. Recognizing a good name is an open-ended task, though this pair might be:
- colored-circle-gen-blue.rs
- colored-circle-gen-red.rs

Deciding exactly *how* to solve this is not the business of tidy, only recognizing a what.

r? `@compiler-errors`
2024-02-20 02:31:17 +00:00
bors 7d61394948 Auto merge of #121296 - madsmtm:fix-mac-catalyst-deployment-target, r=shepmaster
Fix `IPHONEOS_DEPLOYMENT_TARGET` on Mac Catalyst

Some of the target code invalidly assumed that the deployment target variable on Mac Catalyst is `MACOSX_DEPLOYMENT_TARGET`, which is wrong, Mac Catalyst uses the same environment variable as iOS.

Additionally, the deployment target was hardcoded to `14.0`, I've lowered this to `13.1` ([same default as Clang](d022f32c73/clang/lib/Driver/ToolChains/Darwin.cpp (L2038))), and made it properly load from the environment.

This shouldn't require any changes to the `cc` crate, as that uses `rustc --print=deployment-target` to get this information automatically.

CC `@BlackHoleFox`
r? `@rust-lang/macos`
2024-02-20 00:04:03 +00:00
Michael Goulet 84baf2f6f8 return ty::Error when equating ty::Error
This helps iron out a difference between Sub and Equate
2024-02-19 23:54:49 +00:00
Oli Scherer 9062697917 Always evaluate free constants and statics, even if previous errors occurred 2024-02-19 22:11:13 +00:00
bors 0395fa387a Auto merge of #121211 - lcnr:nll-relate-handle-infer, r=BoxyUwU
deduplicate infer var instantiation

Having 3 separate implementations of one of the most subtle parts of our type system is not a good strategy if we want to maintain a sound type system  while working on this I already found some subtle bugs in the existing code, so that's awesome 🎉 cc #121159

This was necessary as I am not confident in my nll changes in #119106, so I am first cleaning this up in a separate PR.

r? `@BoxyUwU`
2024-02-19 22:04:58 +00:00
Santiago Pastorino 4803f173be
Inline do_orphan_check_impl 2024-02-19 17:41:51 -03:00
Santiago Pastorino 086463b227
Remove suspicious auto trait lint 2024-02-19 17:41:48 -03:00
bors 3246e79513 Auto merge of #121185 - GuillaumeGomez:update-stdarch, r=Amanieu
Update stdarch submodule

I'm syncing the rustc_codegen_gcc backend currently and it seems that the new rustc version we use is not happy with the current stdarch submodule version: https://github.com/rust-lang/rustc_codegen_gcc/actions/runs/7930753019/job/21653642490?pr=439

r? `@Amanieu`
2024-02-19 20:04:07 +00:00
Oli Iliffe 3e5ad4285c Separate testing and production sanitizers 2024-02-19 10:40:43 -08:00
Nilstrieb 0b59748807 Make `is_nonoverlapping` `#[inline]`
It showed up with 3% execution time in a compiler profile.
2024-02-19 19:28:04 +01:00
Pavel Grigorenko ac1754beb8
Remove an old hack for rustdoc 2024-02-19 21:16:27 +03:00
bors ccb1415eac Auto merge of #121177 - joboet:move_pal_locks, r=ChrisDenton
Move locks to `sys`

Part of #117276.

r? `@ChrisDenton`
2024-02-19 18:04:28 +00:00
Kalle Wachsmuth 7fd7b47c1f
regression test for #103369 2024-02-19 18:16:11 +01:00
Esteban Küber b4a424feb8 Drive-by `DUMMY_SP` -> `Span` and fmt changes
Noticed these while doing something else. There's no practical change, but it's preferable to use `DUMMY_SP` as little as possible, particularly when we have perfectlly useful `Span`s available.
2024-02-19 17:04:23 +00:00
bors 02438348b9 Auto merge of #120463 - lcnr:eager-inference-replacement, r=compiler-errors
some trait system cleanups

Always eagerly replace projections with infer vars if normalization is ambig. Unsure why we previously didn't do so, wasn't able to find an explanation in #90887. This adds some complexity to the trait system and is afaict unnecessary.

The second commit simplifies `pred_known_to_hold_modulo_regions`, afaict the optional `fulfill` isn't necessary anymore.

r? types cc `@jackh726`
2024-02-19 15:48:21 +00:00
bors e29a1530f6 Auto merge of #121295 - matthiaskrgr:rollup-j2vffew, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #119808 (Store core::str::CharSearcher::utf8_size as u8)
 - #121032 (Continue reporting remaining errors instead of silently dropping them)
 - #121041 (Add `Future` and `IntoFuture` to the 2024 prelude)
 - #121230 (Extend Level API)
 - #121272 (Add diagnostic items for legacy numeric constants)
 - #121275 (add test for panicking attribute macros)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-02-19 13:41:13 +00:00
Mads Marquart a3cf493642 Lower default Mac Catalyst deployment target to 13.1
Same default as Clang:
d022f32c73/clang/lib/Driver/ToolChains/Darwin.cpp (L2038)
2024-02-19 13:30:53 +01:00
Mads Marquart cd530fccb3 Merge deployment target variable loading on iOS and Mac Catalyst 2024-02-19 13:23:02 +01:00
Mads Marquart 3cb4e34310 Fix ld platform_version argument on Mac Catalyst 2024-02-19 13:10:07 +01:00
Matthias Krüger 3fe809b38d
Rollup merge of #121275 - tshepang:test-panicking-proc-macros, r=nnethercote
add test for panicking attribute macros
2024-02-19 13:04:34 +01:00
Matthias Krüger c2cc066761
Rollup merge of #121272 - pitaj:diag_items-legacy_numeric_constants, r=Nilstrieb
Add diagnostic items for legacy numeric constants

For rust-lang/rust-clippy#12312
2024-02-19 13:04:34 +01:00
Matthias Krüger ec07410f05
Rollup merge of #121230 - GuillaumeGomez:extend-level-api, r=Nadrieril
Extend Level API

I need this API for https://github.com/rust-lang/rust-clippy/pull/12303: I have a nested `cfg` attribute (so a `MetaItem`) and I'd like to still be able to match against all possible kind of `Level`s.
2024-02-19 13:04:34 +01:00
Matthias Krüger cf0b36a1c5
Rollup merge of #121041 - Nilstrieb:into-the-future-of-2024, r=Mark-Simulacrum
Add `Future` and `IntoFuture` to the 2024 prelude

Implements rust-lang/rfcs#3509.
2024-02-19 13:04:33 +01:00
Matthias Krüger 25bba60e9d
Rollup merge of #121032 - oli-obk:cyclic_type_ice, r=cjgillot
Continue reporting remaining errors instead of silently dropping them

I was too eager to add assertions in https://github.com/rust-lang/rust/pull/120342/files#diff-593003090e0fb5c21f31413ce5feb506e235ec33c4775da88b853980429b9ff1R741

fixes #120864
2024-02-19 13:04:33 +01:00
Matthias Krüger c5da0382c8
Rollup merge of #119808 - GnomedDev:encode-charsearcher-size-in-type, r=Mark-Simulacrum
Store core::str::CharSearcher::utf8_size as u8

This is already relied on being smaller than u8 due to the `safety invariant: utf8_size must be less than 5`, so this helps LLVM optimize and maybe improve copies due to padding instead of unused bytes.
2024-02-19 13:04:32 +01:00
Mads Marquart 92d4b313eb Make LLVM target contain correct deployment target info on Mac Catalyst 2024-02-19 12:57:08 +01:00
Mads Marquart 94ddbb615d Remove MACOSX_DEPLOYMENT_TARGET env var when linking Mac Catalyst
Mac Catalyst uses IPHONEOS_DEPLOYMENT_TARGET to specify the deployment target, so it makes no sense to remove that variable.
2024-02-19 12:34:12 +01:00
bors 43d3470f11 Auto merge of #121079 - onur-ozkan:install-conflicts, r=albertlarsan68
distribute tool documentations and avoid file conflicts on `x install`

I suggest reading commits one-by-one with the descriptions for more context about the changes.

Fixes #115213
2024-02-19 11:28:34 +00:00
Guillaume Gomez 9f3f2cd90a Update stdarch submodule 2024-02-19 10:49:20 +01:00
onur-ozkan 435e1c6dc5 install rustc before the tools
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-02-19 12:40:26 +03:00
bors eb1f279477 Auto merge of #121203 - Nilstrieb:fp, r=Mark-Simulacrum
Add `rust.frame-pointers` config option

This is very helpful for profiling. I've hacked this in many times, so let's add it properly.
2024-02-19 09:25:17 +00:00
lcnr 0c7672a532 remove outdated comment 2024-02-19 09:17:01 +01:00
lcnr 9771fb08b6 split `project` into multiple files 2024-02-19 09:17:00 +01:00
lcnr df55f56283 `normalize_projection_ty` is not used with next-solver 2024-02-19 09:06:34 +01:00
lcnr 399a258f46 remove `pred_known_to_hold_modulo_regions` 2024-02-19 09:06:34 +01:00
lcnr 486c7b6a50 never normalize without eager inference replacement 2024-02-19 09:06:34 +01:00
bors bea5bebf3d Auto merge of #105917 - a1phyr:read_chain_more_impls, r=workingjubilee
Specialize some methods of `io::Chain`

This PR specializes the implementation of some methods of `io::Chain`, which could bring performance improvements when using it.
2024-02-19 04:43:54 +00:00