Commit Graph

40291 Commits

Author SHA1 Message Date
Matthias Krüger
b9e083f86b
Rollup merge of #131567 - CastilloDel:reject-unstable-with-accepted-features, r=jieyouxu
Emit an error for unstable attributes that reference already stable features

Closes https://github.com/rust-lang/rust/issues/129814
2024-10-12 23:00:58 +02:00
Matthias Krüger
d547f2c7eb
Rollup merge of #131277 - ismailarilik:handle-potential-query-instability-lint-for-clippy, r=xFrednet
Handle `clippy` cases of `rustc::potential_query_instability` lint

This PR removes `#![allow(rustc::potential_query_instability)]` line from [`src/tools/clippy/clippy_lints/src/lib.rs`](https://github.com/rust-lang/rust/blob/master/src/tools/clippy/clippy_lints/src/lib.rs#L30) and converts `FxHash{Map,Set}` types into `FxIndex{Map,Set}` to suppress lint errors.

A somewhat tracking issue: https://github.com/rust-lang/rust/issues/84447
2024-10-12 23:00:57 +02:00
Matthias Krüger
663da00876
Rollup merge of #131239 - VulnBandit:trait-vulnerability, r=lcnr
Don't assume traits used as type are trait objs in 2021 edition

Fixes #127548

When you use a trait as a type, the compiler automatically assumes you meant to use a trait object, which is not always the case.
This PR fixes the bug where you don't need a trait object, so the error message was changed to:
```
error[E0782]: expected a type, found a trait
```
Also fixes some ICEs:
Fixes https://github.com/rust-lang/rust/issues/120241
Fixes https://github.com/rust-lang/rust/issues/120482
Fixes https://github.com/rust-lang/rust/issues/125512
2024-10-12 23:00:56 +02:00
Matthias Krüger
57be141f8a
Rollup merge of #128784 - tdittr:check-abi-on-fn-ptr, r=compiler-errors
Check ABI target compatibility for function pointers

Tracking issue: https://github.com/rust-lang/rust/issues/130260
Related tracking issue: #87678

Compatibility of an ABI for a target was previously only performed on function definitions and `extern` blocks. This PR adds it also to function pointers to be consistent.

This might have broken some of the `tests/ui/` depending on the platform, so a try run seems like a good idea.

Also this might break existing code, because we now emit extra errors. Does this require a crater run?

# Example
```rust
// build with: --target=x86_64-unknown-linux-gnu

// These raise E0570
extern "thiscall" fn foo() {}
extern "thiscall" { fn bar() }

// This did not raise any error
fn baz(f: extern "thiscall" fn()) { f() }
```

# Open Questions
* [x] Should this report a future incompatibility warning like #87678 ?
* [ ] Is this the best place to perform the check?
2024-10-12 23:00:55 +02:00
Matthias Krüger
4bc21e318c remove a couple of redundant String to String conversion 2024-10-12 22:07:46 +02:00
Trevor Gross
1b98ae02d8
Rollup merge of #131605 - DianQK:llvm-const-int, r=the8472
`LLVMConstInt` only allows integer types

See https://github.com/llvm/llvm-project/blob/llvmorg-19.1.1/llvm/lib/IR/Core.cpp#L1535-L1546.

r? the8472
2024-10-12 11:08:45 -05:00
Trevor Gross
421abc81cd
Rollup merge of #131596 - RalfJung:interp-result-must-use, r=jieyouxu
mark InterpResult as must_use

This was forgotten in https://github.com/rust-lang/rust/pull/130885
2024-10-12 11:08:44 -05:00
Trevor Gross
1fb64355c8
Rollup merge of #131590 - matthiaskrgr:clones3, r=compiler-errors
yeet some clones
2024-10-12 11:08:43 -05:00
Trevor Gross
63a91db022
Rollup merge of #130870 - surechen:fix_130791, r=compiler-errors
Add suggestion for removing invalid path sep `::` in fn def

Add suggestion for removing invalid path separator `::` in function definition.

for example: `fn invalid_path_separator::<T>() {}`

fixes #130791
2024-10-12 11:08:42 -05:00
DianQK
1efffe720d
LLVMConstInt only allows integer types 2024-10-12 23:02:15 +08:00
Michael Goulet
470e9fa1af Shallowly match opaque key in storage 2024-10-12 09:10:07 -04:00
Ralf Jung
89623439f7 mark InterpResult as must_use 2024-10-12 13:13:50 +02:00
Ralf Jung
bc4366b099 miri: avoid cloning AllocExtra 2024-10-12 12:14:28 +02:00
Matthias Krüger
e5906e1591 yeet some clones 2024-10-12 10:59:12 +02:00
CastilloDel
497100a13c Emit an error for unstable attributes that reference already stable features
Add missing error annotations and .stderr file

Acknowledge comments
2024-10-12 10:19:24 +02:00
Trevor Gross
1f31925345
Rollup merge of #131565 - Urgau:non_local_def-rm-deprecate, r=compiler-errors
Remove deprecation note in the `non_local_definitions` lint

This PR removes the edition deprecation note emitted by the `non_local_definitions` lint.

Specifically this part:

```
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
```

because it [didn't make the cut](https://github.com/rust-lang/rust/issues/120363#issuecomment-2407833300) for the 2024 edition.

`@rustbot` label +L-non_local_definitions
2024-10-11 23:57:47 -04:00
Trevor Gross
fcbf4ac6f9
Rollup merge of #131546 - surechen:fix_129833, r=jieyouxu
Make unused_parens's suggestion considering expr's attributes.

For the expr with attributes,
like `let _ = (#[inline] || println!("Hello!"));`,
the suggestion's span should contains the attributes, or the suggestion will remove them.

fixes #129833
2024-10-11 23:57:46 -04:00
Trevor Gross
9e72070f77
Rollup merge of #131310 - taiki-e:msp430-clobber-abi, r=Amanieu
Support clobber_abi in MSP430 inline assembly

This supports `clobber_abi` which is one of the requirements of stabilization mentioned in #93335.

Refs: Section 3.2 "Register Conventions" in [MSP430 Embedded Application Binary Interface](https://www.ti.com/lit/an/slaa534a/slaa534a.pdf)

cc ``@cr1901``

r? ``@Amanieu``

``@rustbot`` label +O-msp430
2024-10-11 23:57:46 -04:00
Trevor Gross
3f9aa50b70
Rollup merge of #124874 - jedbrown:float-mul-add-fast, r=saethlin
intrinsics fmuladdf{32,64}: expose llvm.fmuladd.* semantics

Add intrinsics `fmuladd{f32,f64}`. This computes `(a * b) + c`, to be fused if the code generator determines that (i) the target instruction set has support for a fused operation, and (ii) that the fused operation is more efficient than the equivalent, separate pair of `mul` and `add` instructions.

https://llvm.org/docs/LangRef.html#llvm-fmuladd-intrinsic

The codegen_cranelift uses the `fma` function from libc, which is a correct implementation, but without the desired performance semantic. I think this requires an update to cranelift to expose a suitable instruction in its IR.

I have not tested with codegen_gcc, but it should behave the same way (using `fma` from libc).

---
This topic has been discussed a few times on Zulip and was suggested, for example, by `@workingjubilee` in [Effect of fma disabled](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/Effect.20of.20fma.20disabled/near/274179331).
2024-10-11 23:57:44 -04:00
surechen
1e8d6d1ec3 Make unused_parens's suggestion considering expr's attributes
For the expr with attributes, like `let _ = (#[inline] || println!("Hello!"));`, the suggestion's span should contains the attributes, or the suggestion will remove them.

fixes #129833
2024-10-12 09:32:25 +08:00
Jubilee Young
10721909f2 compiler: Wire {TyAnd,}Layout into rustc_abi
This finally unites TyAndLayout, Layout, and LayoutS into the same crate,
as one might imagine they would be placed. No functional changes.
2024-10-11 17:41:52 -07:00
Jubilee Young
255bdd2f24 compiler: Empty out rustc_target::abi 2024-10-11 17:41:52 -07:00
Jubilee Young
559de74562 compiler: Move impl of ToJson for abi::Endian 2024-10-11 17:41:52 -07:00
Trevor Gross
6f76d6e1a3
Rollup merge of #131552 - durin42:llvm-20-getOrInsertDeclaration, r=cuviper
RustWrapper: adapt for rename of Intrinsic::getDeclaration

llvm/llvm-project@fa789dffb1 renamed getDeclaration to getOrInsertDeclaration.

`@rustbot` label: +llvm-main
2024-10-11 16:53:50 -05:00
Trevor Gross
2c385ba329
Rollup merge of #131543 - Zalathar:goodbye-llvm-17, r=petrochenkov
coverage: Remove code related to LLVM 17

In-tree LLVM is 19, and the minimum external LLVM was increased to 18 in #130487.
2024-10-11 16:53:49 -05:00
Jed Brown
0d8a978e8a intrinsics.fmuladdf{16,32,64,128}: expose llvm.fmuladd.* semantics
Add intrinsics `fmuladd{f16,f32,f64,f128}`. This computes `(a * b) +
c`, to be fused if the code generator determines that (i) the target
instruction set has support for a fused operation, and (ii) that the
fused operation is more efficient than the equivalent, separate pair
of `mul` and `add` instructions.

https://llvm.org/docs/LangRef.html#llvm-fmuladd-intrinsic

MIRI support is included for f32 and f64.

The codegen_cranelift uses the `fma` function from libc, which is a
correct implementation, but without the desired performance semantic. I
think this requires an update to cranelift to expose a suitable
instruction in its IR.

I have not tested with codegen_gcc, but it should behave the same
way (using `fma` from libc).
2024-10-11 15:32:56 -06:00
Urgau
77b3065ed2 Remove deprecation note in the non_local_definitions warning 2024-10-11 21:21:32 +02:00
Manuel Drehwald
624c071b99 Single commit implementing the enzyme/autodiff frontend
Co-authored-by: Lorenz Schmidt <bytesnake@mailbox.org>
2024-10-11 19:13:31 +02:00
Augie Fackler
19345d5c6e RustWrapper: adapt for rename of Intrinsic::getDeclaration
llvm/llvm-project@fa789dffb1 renamed
getDeclaration to getOrInsertDeclaration.

@rustbot label: +llvm-main
2024-10-11 12:29:49 -04:00
bors
01e2fff90c Auto merge of #131547 - matthiaskrgr:rollup-ui4p744, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #129079 (Create `_imp__` symbols also when doing ThinLTO)
 - #131208 (ABI: Pass aggregates by value on AIX)
 - #131394 (fix(rustdoc): add space between struct fields and their descriptions)
 - #131519 (Use Default visibility for rustc-generated C symbol declarations)
 - #131541 (compiletest: Extract auxiliary-crate properties to their own module/struct)
 - #131542 (next-solver: remove outdated FIXMEs)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-10-11 16:27:23 +00:00
VulnBandit
9a2772e1c2 Don't assume traits used as type are trait objs 2024-10-11 17:36:04 +02:00
Michael Goulet
d6391d5d4d Note what qualifier 2024-10-11 11:30:08 -04:00
Michael Goulet
c085071631 Remove unadorned 2024-10-11 11:30:08 -04:00
Matthias Krüger
b18e1aa612
Rollup merge of #131542 - lcnr:new-solver-fixmes, r=compiler-errors
next-solver: remove outdated FIXMEs

r? `@compiler-errors`
2024-10-11 15:36:53 +02:00
Matthias Krüger
33b1264540
Rollup merge of #131519 - davidlattimore:intrinsics-default-vis, r=Urgau
Use Default visibility for rustc-generated C symbol declarations

Non-default visibilities should only be used for definitions, not declarations, otherwise linking can fail.

This is based on https://github.com/rust-lang/rust/pull/123994.

Issue https://github.com/rust-lang/rust/issues/123427

When I changed `default-hidden-visibility` to `default-visibility` in https://github.com/rust-lang/rust/pull/130005, I updated all places in the code that used `default-hidden-visibility`, replicating the hidden-visibility bug to also happen for protected visibility.

Without this change, trying to build rustc with `-Z default-visibility=protected` fails with a link error.
2024-10-11 15:36:52 +02:00
Matthias Krüger
fc81a7c1d5
Rollup merge of #131208 - mustartt:aix-call-abi, r=davidtwco
ABI: Pass aggregates by value on AIX

On AIX we pass aggregates byval. Adds new ABI for AIX for powerpc64.

313ad85dfa/clang/lib/CodeGen/Targets/PPC.cpp (L216)

Fixes the following 2 testcases on AIX:
```
tests/ui/abi/extern/extern-pass-TwoU16s.rs
tests/ui/abi/extern/extern-pass-TwoU8s.rs
```
2024-10-11 15:36:51 +02:00
Matthias Krüger
7c79621462
Rollup merge of #129079 - Zoxc:thinlto_imp_symbols, r=wesleywiser
Create `_imp__` symbols also when doing ThinLTO

When generating a rlib crate on Windows we create `dllimport` / `_imp__` symbols for each global. This effectively makes the rlib contain an import library for itself and allows them to both be dynamically and statically linked. However when doing ThinLTO we do not generate these and thus we end up with missing symbols. Microsoft's `link` can fix these up (and emits warnings), but `lld` seems to currently be unable to.

This PR also does this generation for ThinLTO avoiding those issues with `lld` and also avoids the warnings on `link`.

This is an workaround for https://github.com/rust-lang/rust/issues/81408.

cc `@lqd`
2024-10-11 15:36:51 +02:00
bors
f4966590d8 Auto merge of #131045 - compiler-errors:remove-unnamed_fields, r=wesleywiser
Retire the `unnamed_fields` feature for now

`#![feature(unnamed_fields)]` was implemented in part in #115131 and #115367, however work on that feature has (afaict) stalled and in the mean time there have been some concerns raised (e.g.[^1][^2]) about whether `unnamed_fields` is worthwhile to have in the language, especially in its current desugaring. Because it represents a compiler implementation burden including a new kind of anonymous ADT and additional complication to field selection, and is quite prone to bugs today, I'm choosing to remove the feature.

However, since I'm not one to really write a bunch of words, I'm specifically *not* going to de-RFC this feature. This PR essentially *rolls back* the state of this feature to "RFC accepted but not yet implemented"; however if anyone wants to formally unapprove the RFC from the t-lang side, then please be my guest. I'm just not totally willing to summarize the various language-facing reasons for why this feature is or is not worthwhile, since I'm coming from the compiler side mostly.

Fixes #117942
Fixes #121161
Fixes #121263
Fixes #121299
Fixes #121722
Fixes #121799
Fixes #126969
Fixes #131041

Tracking:
* https://github.com/rust-lang/rust/issues/49804

[^1]: https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Unnamed.20struct.2Funion.20fields
[^2]: https://github.com/rust-lang/rust/issues/49804#issuecomment-1972619108
2024-10-11 13:11:13 +00:00
Zalathar
9357277de7 coverage: Remove code related to LLVM 17 2024-10-11 21:44:36 +11:00
lcnr
5fd7be97e9 remove outdated FIXMEs 2024-10-11 10:41:10 +00:00
Matthias Krüger
e00f49db17
Rollup merge of #131498 - Urgau:transparent-const-anons, r=lcnr
Consider outermost const-anon in `non_local_def` lint

This PR change the logic for finding the parent of the `impl` definition in the `non_local_definitions` lint to consider multiple level of const-anon items, instead of only one currently.

I also took the opportunity to cleanup the related code.

cc ``@traviscross``
Fixes https://github.com/rust-lang/rust/issues/131474
2024-10-11 12:21:07 +02:00
Jonathan Dönszelmann
0a9c87b1f5
rename RcBox in other places too 2024-10-11 10:04:22 +02:00
Urgau
7e05da8d42 Consider outermost const-anon in non_local_def lint 2024-10-11 09:39:53 +02:00
bors
249df9e791 Auto merge of #131444 - onur-ozkan:hotfix-ci, r=Kobzol
stabilize `ci_rustc_if_unchanged_logic` test

Makes `ci_rustc_if_unchanged_logic` test more stable and re-enables it. Previously, it was expecting CI-rustc to be used all the time when there were no changes, which wasn’t always the case. Purpose of this test is making sure we don't use CI-rustc while there are changes in compiler and/or library, but we don't really need to cover cases where CI-rustc is not enabled.

Second commit was pushed for making a change in the compiler tree, so `ci_rustc_if_unchanged_logic` can be tested properly in merge CI.
2024-10-10 23:51:17 +00:00
David Lattimore
42c0494499 Use Default visibility for rustc-generated C symbol declarations
Non-default visibilities should only be used for definitions, not
declarations, otherwise linking can fail.

Co-authored-by: Collin Baker <collinbaker@chromium.org>
2024-10-11 08:43:27 +11:00
Matthias Krüger
e88cc517e8
Rollup merge of #131493 - madsmtm:avoid-redundant-linker-path, r=jieyouxu
Avoid redundant sysroot additions to `PATH` when linking

Currently, `rustc` prepends `$HOME/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/bin` to the `PATH` three times before invoking the linker, which is unnecessary, once should be enough.

Spotted this while trying to get `-Clinker-flavor=gcc` and `-Clinker-flavor=ld` closer together, not really important.

`````@rustbot````` A-linkage
2024-10-10 22:00:50 +02:00
Matthias Krüger
fa3dff3e24
Rollup merge of #131475 - fmease:compiler-mv-obj-safe-dyn-compat-2, r=jieyouxu
Compiler & its UI tests: Rename remaining occurrences of "object safe" to "dyn compatible"

Follow-up to #130826.
Part of #130852.

1. 1st commit: Fix stupid oversights. Should've been part of #130826.
2. 2nd commit: Rename the unstable feature `object_safe_for_dispatch` to `dyn_compatible_for_dispatch`. Might not be worth the churn, you decide.
3. 3rd commit: Apply the renaming to all UI tests (contents and paths).
2024-10-10 22:00:50 +02:00
Matthias Krüger
4f2af123eb
Rollup merge of #131033 - compiler-errors:precise-capturing-in-traits, r=spastorino
Precise capturing in traits

This PR begins to implement `feature(precise_capturing_in_traits)`, which enables using the `impl Trait + use<..>` syntax for RPITITs. It implements this by giving the desugared GATs variance, and representing the uncaptured lifetimes as bivariant, like how opaque captures work.

Right now, I've left out implementing a necessary extension to the `refining_impl_trait` lint, and also I've made it so that all RPITITs always capture the parameters that come from the trait, because I'm not totally yet convinced that it's sound to not capture these args. It's certainly required to capture the type and const parameters from the trait (e.g. Self), or else users could bivariantly relate two RPITIT args that come from different impls, but region parameters don't affect trait selection in the same way, so it *may* be possible to relax this in the future. Let's stay conservative for now, though.

I'm not totally sure what tests could be added on top of the ones I already added, since we really don't need to exercise the `precise_capturing` feature but simply what makes it special for RPITITs.

r? types

Tracking issue:
* #130044
2024-10-10 22:00:48 +02:00
Matthias Krüger
edb669350a
Rollup merge of #130741 - mrkajetanp:detect-b16b16, r=Amanieu
rustc_target: Add sme-b16b16 as an explicit aarch64 target feature

LLVM 20 split out what used to be called b16b16 and correspond to aarch64
FEAT_SVE_B16B16 into sve-b16b16 and sme-b16b16.
Add sme-b16b16 as an explicit feature and update the codegen accordingly.

Resolves https://github.com/rust-lang/rust/pull/129894.
2024-10-10 22:00:48 +02:00
Matthias Krüger
13976f1f25
Rollup merge of #130308 - davidtwco:tied-target-consolidation, r=wesleywiser
codegen_ssa: consolidate tied target checks

Fixes #105110.
Fixes #105111.

`rustc_codegen_llvm` and `rustc_codegen_gcc` duplicated logic for checking if tied target features were partially enabled. This PR consolidates these checks into `rustc_codegen_ssa` in the `codegen_fn_attrs` query, which also is run pre-monomorphisation for each function, which ensures that this check is run for unused functions, as would be expected.

Also adds a test confirming that enabling one tied feature doesn't imply another - the appropriate error for this was already being emitted. I did a bisect and narrowed it down to two patches it was likely to be - something in #128796, probably #128221 or #128679.
2024-10-10 22:00:45 +02:00
Michael Goulet
322c4bdac5 Don't fire refinement lint if there are errors 2024-10-10 11:46:51 -07:00
Michael Goulet
36076ecdc7 Clarify implicit captures for RPITIT 2024-10-10 11:46:51 -07:00
Michael Goulet
a7dc98733d Add variances to RPITITs 2024-10-10 11:46:48 -07:00
Michael Goulet
b7297ac440 Add gate for precise capturing in traits 2024-10-10 11:44:11 -07:00
bors
8d94e06ec9 Auto merge of #131263 - compiler-errors:solver-relating, r=lcnr
Introduce SolverRelating type relation to the new solver

Redux of #128744.

Splits out relate for the new solver so that implementors don't need to implement it themselves.

r? lcnr
2024-10-10 14:59:40 +00:00
Matthias Krüger
1c62cff897
Rollup merge of #131491 - lcnr:nalgebra-perrrrf, r=compiler-errors
impossible obligations fast path

fixes the remaining performance regression in nalgebra for #130654

r? `@compiler-errors`

Fixes #124894
2024-10-10 12:49:22 +02:00
Matthias Krüger
02930953d8
Rollup merge of #131482 - compiler-errors:struct-res, r=lcnr
structurally resolve adts and tuples expectations too

r? lcnr
2024-10-10 12:49:21 +02:00
Matthias Krüger
68313623fc
Rollup merge of #131480 - madsmtm:macos-fix-strip-binary, r=nnethercote
Fix hardcoded strip path when cross-compiling from Linux to Darwin

Fixes https://github.com/rust-lang/rust/issues/131206.

I fear that https://github.com/rust-lang/rust/pull/131405 might end up taking some time, so opening this PR to resolve the regression.

`@rustbot` label O-apple
2024-10-10 12:49:20 +02:00
Matthias Krüger
173c50fb0e
Rollup merge of #131479 - madsmtm:avoid-redundant-dylib, r=jieyouxu
Apple: Avoid redundant `-Wl,-dylib` flag when linking

Seems to have been introduced all the way back in e338a4154b, but should be redundant, `-dynamiclib` should already make `cc` set `-dylib` when linking.

Spotted this while trying to get `-Clinker-flavor=gcc` and `-Clinker-flavor=ld` closer together, not that important to fix.

`@rustbot` label O-apple
2024-10-10 12:49:19 +02:00
Matthias Krüger
a2c43eb806
Rollup merge of #131397 - RalfJung:const-escaping-ref-teach, r=chenyukang
fix/update teach_note from 'escaping mutable ref/ptr' const-check

The old note was quite confusing since it talked about statics, but the message is also shown for consts. So let's reword to something that is true for both of them.
2024-10-10 12:49:19 +02:00
Matthias Krüger
6d41be2700
Rollup merge of #130625 - heiseish:issue-124028-fix, r=jieyouxu
Fix a few relative paths in rustc doc

## Changes

- Don't inline the doc for re-exporting some structs that have relative paths in doc.

## Context

See #124028.

- Most of the relative links in rustdoc are there because of circular import (so syntax like `[MyType]: rustc_foo::bar` is difficult to achieve when we cannot import `rustc_xxx` due to circular import)
- Here, I disable new links for re-exports. I think it's fine for re-exported items in `hir::*`.
- There is a few more relative links in other `rustc` crates, however they are not addressed in this PR, as they are not re-exported and/so the relative paths are working.

Closes #124028.

r​? `@fmease`

Let me know if I miss anything or there's any other way to address this issue.
2024-10-10 12:49:18 +02:00
Kajetan Puchalski
335f67b652 rustc_target: Add sme-b16b16 as an explicit aarch64 target feature
LLVM 20 split out what used to be called b16b16 and correspond to aarch64
FEAT_SVE_B16B16 into sve-b16b16 and sme-b16b16.
Add sme-b16b16 as an explicit feature and update the codegen accordingly.
2024-10-10 10:24:57 +00:00
lcnr
d6fd45c2e3 impossible obligations check fast path 2024-10-10 06:09:50 -04:00
Michael Goulet
8715bfbf0e Make super combine into fns 2024-10-10 06:07:52 -04:00
Michael Goulet
a4cd2202ef Use SolverRelating in favor of TypeRelating in the old solver where possible 2024-10-10 06:07:52 -04:00
Michael Goulet
30a2ecddb4 Remove unnecessary StructurallyRelateAliases from CombineFields/TypeRelating 2024-10-10 06:07:52 -04:00
Michael Goulet
3da257a98d Use SolverRelating in new solver 2024-10-10 06:07:52 -04:00
Michael Goulet
efb1c23ff6 Introduce SolverRelating 2024-10-10 06:07:51 -04:00
Michael Goulet
ce7a61b9d0 Uplift super_combine 2024-10-10 06:07:51 -04:00
Michael Goulet
09da2ebd63 Move ty::Error branch into super_combine_tys 2024-10-10 06:07:51 -04:00
Mads Marquart
1edff466e1 Avoid redundant additions to PATH when linking 2024-10-10 11:46:11 +02:00
onur-ozkan
de744eafe1 update rustc_borrowck::places_conflict doc-comment
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-10 10:33:29 +03:00
Michael Goulet
2a8f08083f Structurallyresolve adts and tuples expectations too 2024-10-10 00:34:06 -04:00
Mads Marquart
09b634a4ba Fix hardcoded strip path when cross-compiling from Linux to Darwin 2024-10-10 04:03:48 +02:00
Mads Marquart
d6aaf7b036 Avoid redundant -Wl,-dylib flag when linking 2024-10-10 03:51:11 +02:00
bors
df1b5d3cc2 Auto merge of #131466 - matthiaskrgr:rollup-3qtz83x, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #123951 (Reserve guarded string literals (RFC 3593))
 - #130827 (Library: Rename "object safe" to "dyn compatible")
 - #131383 (Add docs about slicing slices at the ends)
 - #131403 (Fix needless_lifetimes in rustc_serialize)
 - #131417 (Fix methods alignment on mobile)
 - #131449 (Decouple WASIp2 sockets from WasiFd)
 - #131462 (Mention allocation errors for `open_buffered`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-10-10 01:12:11 +00:00
León Orell Valerian Liehr
2e7a52b22f
Rename feature object_safe_for_dispatch to dyn_compatible_for_dispatch 2024-10-10 00:57:59 +02:00
León Orell Valerian Liehr
62b24ea7c5
Compiler: Replace remaining occurrences of "object safe" with "dyn compatible" 2024-10-10 00:57:52 +02:00
Matthias Krüger
50f7e80423
Rollup merge of #131403 - practicalrs:fix_needless_lifetimes_p2, r=petrochenkov
Fix needless_lifetimes in rustc_serialize

Hi,

This PR fixes the following clipy warnings:

```
warning: the following explicit lifetimes could be elided: 'a
   --> compiler/rustc_serialize/src/serialize.rs:328:6
    |
328 | impl<'a, S: Encoder, T: Encodable<S>> Encodable<S> for Cow<'a, [T]>
    |      ^^                                                    ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    = note: `#[warn(clippy::needless_lifetimes)]` on by default
help: elide the lifetimes
    |
328 - impl<'a, S: Encoder, T: Encodable<S>> Encodable<S> for Cow<'a, [T]>
328 + impl<S: Encoder, T: Encodable<S>> Encodable<S> for Cow<'_, [T]>
    |

warning: the following explicit lifetimes could be elided: 'a
   --> compiler/rustc_serialize/src/serialize.rs:348:6
    |
348 | impl<'a, S: Encoder> Encodable<S> for Cow<'a, str> {
    |      ^^                                   ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
    |
348 - impl<'a, S: Encoder> Encodable<S> for Cow<'a, str> {
348 + impl<S: Encoder> Encodable<S> for Cow<'_, str> {
    |

warning: the following explicit lifetimes could be elided: 'a
   --> compiler/rustc_serialize/src/serialize.rs:355:6
    |
355 | impl<'a, D: Decoder> Decodable<D> for Cow<'a, str> {
    |      ^^                                   ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
    |
355 - impl<'a, D: Decoder> Decodable<D> for Cow<'a, str> {
355 + impl<D: Decoder> Decodable<D> for Cow<'_, str> {
```

Best regards,
Michal
2024-10-09 23:03:49 +02:00
Matthias Krüger
0fe2532a37
Rollup merge of #131456 - kupiakos:patch-3, r=compiler-errors
Fix typo in E0793

`s/references/reference/`
2024-10-09 20:27:26 +02:00
Matthias Krüger
e642442f12
Rollup merge of #131424 - workingjubilee:stem-the-tyde-of-glob-imports, r=jieyouxu
compiler: Stop reexporting enum-globs from `rustc_target::abi`

Three enums had **all** their variants glob-exported into a distressingly large amount of the tree. Cease to do that, and also cease to glob import the contents of the module that contained them. Redirect relevant imports to their actual source, the `rustc_abi` crate.

No functional changes.
2024-10-09 20:27:24 +02:00
Matthias Krüger
f144469bda
Rollup merge of #131420 - compiler-errors:post-mono-layout-cycle, r=wesleywiser
Dont ICE when encountering post-mono layout cycle error

It's possible to encounter post-mono layout cycle errors in `fn_abi_of_instance`. Don't ICE in those cases.

This was originally discovered in an async fn, but that's not the only way to encounter such an error (which the other test I added should demonstrate).

Error messsages suck, but this fix is purely about suppressing the ICE.

Fixes #131409
2024-10-09 20:27:24 +02:00
Alyssa Haroldsen
12ce6f6564
Fix typo in E0793 2024-10-09 10:28:16 -07:00
Jubilee Young
43e198a3ae compiler: Seal off the rustc_target::abi enum glob imports 2024-10-08 18:24:56 -07:00
Jubilee Young
d92aee556d cg_gcc: Factor out rustc_target::abi 2024-10-08 18:24:56 -07:00
Jubilee Young
b3beb4efc7 cg_clif: Factor out rustc_target::abi 2024-10-08 18:24:56 -07:00
Jubilee Young
1379ef592a compiler: Factor rustc_target::abi out of cg_llvm 2024-10-08 18:24:56 -07:00
Jubilee Young
839cf1c1a4 compiler: Factor rustc_target::abi out of cg_ssa 2024-10-08 18:24:56 -07:00
Jubilee Young
ff17ce2f6a compiler: Factor rustc_target::abi out of hir_typeck 2024-10-08 18:24:56 -07:00
Jubilee Young
9d95c8bd16 compiler: Factor rustc_target::abi out of const_eval 2024-10-08 18:24:56 -07:00
Jubilee Young
11c48bee11 compiler: Factor rustc_target::abi::* out of ty_utils 2024-10-08 18:24:38 -07:00
Jubilee Young
8da92b5ce2 compiler: Factor rustc_target::abi::* out of middle::ty::layout 2024-10-08 18:14:48 -07:00
Peter Jaszkowiak
321a5db7d4 Reserve guarded string literals (RFC 3593) 2024-10-08 18:21:16 -06:00
Michael Goulet
17eca60c24 Dont ICE when encountering post-mono layout cycle error 2024-10-08 16:46:16 -04:00
Matthias Krüger
7cb47b505c
Rollup merge of #131348 - nnethercote:rustc_infer-more-cleanups, r=lcnr
More `rustc_infer` cleanups

A sequel to #131226.

r? `@lcnr`
2024-10-08 16:05:36 +02:00
Michal Piotrowski
7ab466697f
Fix needless_lifetimes in rustc_serialize 2024-10-08 15:17:45 +02:00
Ralf Jung
287eb03838 fix/update teach_note from 'escaping mutable ref/ptr' const-check 2024-10-08 14:03:03 +02:00
bors
cf24c73141 Auto merge of #126733 - ZhuUx:llvm-19-adapt, r=Zalathar
[Coverage][MCDC] Adapt mcdc to llvm 19

Related issue: #126672

Also finish task 4 at #124144

[llvm #82448](https://github.com/llvm/llvm-project/pull/82448) has introduced some break changes into mcdc, causing incompatibility between llvm 18 and 19. This draft adapts to that change and gives up supporting for llvm-18.
2024-10-08 07:08:41 +00:00
Nicholas Nethercote
3b1eee7755 Remove unnecessary return keyword. 2024-10-08 16:28:58 +11:00
Nicholas Nethercote
1dac23f6fe Use Default more in InferCtxtInner. 2024-10-08 16:28:58 +11:00