Commit Graph

263062 Commits

Author SHA1 Message Date
Esteban Küber
860c8cdeaf Differentiate between methods and associated functions
Accurately refer to assoc fn without receiver as assoc fn instead of methods.
Add `AssocItem::descr` method to centralize where we call methods and associated functions.
2024-08-10 00:54:16 +00:00
bors
899eb03926 Auto merge of #128703 - compiler-errors:normalizing-tails, r=lcnr
Miscellaneous improvements to struct tail normalization

1. Make checks for foreign tails more accurate by normalizing the struct tail. I didn't write a test for this one.
2. Normalize when computing struct tail for `offset_of` for slice/str. This fixes the new solver only.
3. Normalizing when computing tails for disaligned reference check. This fixes both solvers.

r? lcnr
2024-08-09 11:36:01 +00:00
bors
97e72524a3 Auto merge of #128863 - matthiaskrgr:rollup-wmp8znk, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #128616 (Don't inline tainted MIR bodies)
 - #128804 (run-make: enable msvc for redundant-libs)
 - #128823 (run-make: enable msvc for staticlib-dylib-linkage)
 - #128824 (Update compiler-builtins version to 0.1.118)

Failed merges:

 - #128410 (Migrate `remap-path-prefix-dwarf` `run-make` test to rmake)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-08-09 04:16:29 +00:00
Matthias Krüger
e88067927a
Rollup merge of #128824 - GuillaumeGomez:update-compiler-builtins, r=Amanieu
Update compiler-builtins version to 0.1.118

r? `@Amanieu`
2024-08-09 05:52:16 +02:00
Matthias Krüger
521e75412f
Rollup merge of #128823 - ChrisDenton:staticlib, r=jieyouxu
run-make: enable msvc for staticlib-dylib-linkage

`-Zstaticlib-allow-rdylib-deps` on MSVC returns things like `/LIBPATH:R:\rust\build\x86_64-pc-windows-msvc\test\run-make\staticlib-dylib-linkage\rmake_out`. That is a linker argument rather than a `cc` argument. Which makes sense because rustc interacts directly with the linker on MSVC targets. So we need to tell the C compiler to pass on the arguments to the linker.

try-job: x86_64-msvc
try-job: i686-msvc
2024-08-09 05:52:16 +02:00
Matthias Krüger
408baccd0d
Rollup merge of #128804 - ChrisDenton:redudant, r=jieyouxu
run-make: enable msvc for redundant-libs

The issue here was that `foo` was not exporting any functions therefore creating an import library was unnecessary and elided by the linker.

I fixed it by exporting the functions.

try-job: x86_64-msvc
try-job: i686-msvc
2024-08-09 05:52:15 +02:00
Matthias Krüger
7485f8b9ab
Rollup merge of #128616 - compiler-errors:mir-inline-tainted, r=cjgillot
Don't inline tainted MIR bodies

Don't inline MIR bodies that are tainted, since they're not necessarily well-formed.

Fixes #128601 (I didn't add a new test, just copied one from the crashes, since they're the same root cause).
Fixes #122909.
2024-08-09 05:52:14 +02:00
Michael Goulet
65b029b468 Don't inline tainted MIR bodies 2024-08-08 20:53:25 -04:00
bors
fac7753802 Auto merge of #128853 - matthiaskrgr:rollup-pr222x1, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #128640 (rwlock: disable 'frob' test in Miri on macOS)
 - #128791 (Don't implement `AsyncFn` for `FnDef`/`FnPtr` that wouldnt implement `Fn`)
 - #128806 (Split `ColorConfig` off of `HumanReadableErrorType`)
 - #128818 (std float tests: special-case Miri in feature detection)
 - #128834 (rustdoc: strip unreachable modules)
 - #128836 (rustdoc-json: add a test for impls on private & hidden types)
 - #128837 (Clippy subtree update)
 - #128851 (Add comment that bors did not see pushed before it merged)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-08-09 00:17:32 +00:00
Matthias Krüger
9243aeecda
Rollup merge of #128851 - compiler-errors:validate-mir-opt-mir, r=matthiaskrgr
Add comment that bors did not see pushed before it merged

In #128612, bors merged 470ada2de0 instead of 1e07c19.

This means it dropped a useful comment I added, and a stage rename that is more descriptive.
2024-08-09 00:03:39 +02:00
Matthias Krüger
58c6497e4c
Rollup merge of #128837 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? ``@Manishearth``

Updates Cargo.lock due to uitest bump
2024-08-09 00:03:38 +02:00
Matthias Krüger
8789b95b67
Rollup merge of #128836 - its-the-shrimp:add_test_for_107278, r=aDotInTheVoid
rustdoc-json: add a test for impls on private & hidden types

Fixes #107278 (or rather just ensures it won't resurface)
r? ``@aDotInTheVoid``
2024-08-09 00:03:38 +02:00
Matthias Krüger
5e388ea48e
Rollup merge of #128834 - its-the-shrimp:fix_101105, r=aDotInTheVoid
rustdoc: strip unreachable modules

Modules are now stripped based on the same logic that's used to strip other item kinds
Fixes #101105
2024-08-09 00:03:37 +02:00
Matthias Krüger
5f0461707a
Rollup merge of #128818 - RalfJung:std-miri-floats, r=tgross35
std float tests: special-case Miri in feature detection

Quick work-around to fix miri-test-libstd failures.

r? ``@tgross35``
2024-08-09 00:03:37 +02:00
Matthias Krüger
f106496b82
Rollup merge of #128806 - estebank:color-config, r=jieyouxu
Split `ColorConfig` off of `HumanReadableErrorType`

The previous setup tied two unrelated things together. Splitting these two is a better model.

Identified by https://github.com/rust-lang/rust/pull/126597/files#r1667800754
2024-08-09 00:03:36 +02:00
Matthias Krüger
bcf6f9fa76
Rollup merge of #128791 - compiler-errors:async-fn-unsafe, r=lcnr
Don't implement `AsyncFn` for `FnDef`/`FnPtr` that wouldnt implement `Fn`

Due to unsafety, ABI, or the presence of target features, some `FnDef`/`FnPtr` types don't implement `Fn*`. Do the same for `AsyncFn*`.

Noticed this due to #128764, but this isn't really related to that ICE, which is fixed in #128792.
2024-08-09 00:03:36 +02:00
Matthias Krüger
95b40727bd
Rollup merge of #128640 - RalfJung:rwlock-macos-miri, r=joboet
rwlock: disable 'frob' test in Miri on macOS

Due to https://github.com/rust-lang/rust/issues/121950, Miri will sometimes complain about this test on macOS. Better disable the test, as otherwise it can fail for unrelated PRs.

r? ``@joboet``
2024-08-09 00:03:35 +02:00
Michael Goulet
524e7689a9 Add comment that bors did not see pushed before it merged 2024-08-08 17:57:31 -04:00
bors
c7b0d4e81f Auto merge of #128827 - weihanglo:update-cargo, r=weihanglo
Update cargo

3 commits in 94977cb1fab003d45eb5bb108cb5e2fa0149672a..0d8d22f83b066503f6b2b755925197e959e58b4f
2024-08-06 21:42:10 +0000 to 2024-08-08 12:54:24 +0000
- fix: std Cargo.lock moved to `library` dir (rust-lang/cargo#14370)
- fix(vendor): Strip excluded build targets (rust-lang/cargo#14367)
- Infer registry (rust-lang/cargo#14340)

r? ghost
2024-08-08 21:50:46 +00:00
bors
3e9bd8b566 Auto merge of #128835 - matthiaskrgr:rollup-apzlbxy, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #128306 (Update NonNull::align_offset quarantees)
 - #128612 (Make `validate_mir` ensure the final MIR for all bodies)
 - #128648 (Add regression test)
 - #128749 (Mark `{f32,f64}::{next_up,next_down,midpoint}` inline)
 - #128795 (Update E0517 message to reflect RFC 2195.)
 - #128825 (rm `declared_features` field in resolver)
 - #128826 (Only suggest `#[allow]` for `--warn` and `--deny` lint level flags)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-08-08 19:24:26 +00:00
Michael Goulet
ec1c424293 Don't implement AsyncFn for FnDef/FnPtr that wouldnt implement Fn 2024-08-08 14:07:31 -04:00
Philipp Krones
8be2688e45
Update Cargo.lock 2024-08-08 19:14:09 +02:00
Philipp Krones
b7f07ce57a
Merge commit 'cb806113e0f83a8f9b47d35b453b676543bcc40e' into clippy-subtree-update 2024-08-08 19:13:50 +02:00
bors
cb806113e0 Auto merge of #13236 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

changelog: ICE fix [`uninit_vec`] through https://github.com/rust-lang/rust/pull/128720
2024-08-08 17:00:00 +00:00
Matthias Krüger
70dccc2e9b
Rollup merge of #128826 - Alexendoo:lint-override-suggestions, r=compiler-errors
Only suggest `#[allow]` for `--warn` and `--deny` lint level flags

`--force-warn` and `--forbid` cannot be overridden
2024-08-08 18:57:04 +02:00
Matthias Krüger
f6e00f012d
Rollup merge of #128825 - bvanjoi:useless-resolver-field, r=petrochenkov
rm `declared_features` field in resolver

r? ``@petrochenkov``
2024-08-08 18:57:03 +02:00
Matthias Krüger
25fc71b7a1
Rollup merge of #128795 - zachs18:e0517-update-for-rfc-2195, r=jieyouxu
Update E0517 message to reflect RFC 2195.

E0517 occurs when a `#[repr(..)]` attribute is placed on an unsupported item. Currently, the explanation of the error implies that `#[repr(u*/i*)]` cannot be placed on fieldful enums, which is no longer the case since [RFC 2195](https://github.com/rust-lang/rfcs/pull/2195) was [stabilized](https://github.com/rust-lang/rust/issues/60553), which allows placing `#[repr(u*/i*)]` and/or `#[repr(C)]` on fieldful enums to produce a defined layout.

This PR doesn't (currently) add a description of the semantics of placing `#[repr(u*/i*)]` on a fieldful enum to the error explanation, it just removes the claims/implications that it is not allowed.
2024-08-08 18:57:02 +02:00
Matthias Krüger
127fbc8481
Rollup merge of #128749 - tgross35:float-inline, r=scottmcm
Mark `{f32,f64}::{next_up,next_down,midpoint}` inline

Most float functions are marked `#[inline]` so any float symbols used by these functions only need to be provided if the function itself is used. RFL recently noticed that `next_up`, `next_down`, and `midpoint` for `f32` and `f64` are not inline, which causes linker errors when building with certain configurations <https://lore.kernel.org/all/20240806150619.192882-1-ojeda@kernel.org/>.

Add the missing attributes so the symbols should no longer be required.
2024-08-08 18:57:02 +02:00
Matthias Krüger
53f2ac30e4
Rollup merge of #128648 - tiif:issue-125873, r=lcnr
Add regression test

Fixes #125873
2024-08-08 18:57:01 +02:00
Matthias Krüger
2d7075cf00
Rollup merge of #128612 - compiler-errors:validate-mir-opt-mir, r=davidtwco
Make `validate_mir` ensure the final MIR for all bodies

A lot of the crashes tests use `-Zpolymorphize` or `-Zdump-mir` for their side effect of computing the `optimized_mir` for all bodies, which will uncover bugs with late MIR passes like the inliner. I don't like having all these tests depend on `-Zpolymorphize` (or other hacky ways) for no reason, so this PR extends the `-Zvalidate-mir` flag to ensure `optimized_mir`/`mir_for_ctfe` for all body owners during the analysis phase.

Two thoughts:
1. This could be moved later in the compilation pipeline I guess? I don't really think it matters, though.
1. This could alternatively be expressed using a new flag, though I don't necessarily see much value in separating these.

For example, #128171 could have used this flag, in the `tests/ui/polymorphization/inline-incorrect-early-bound.rs`.

r? mir
2024-08-08 18:57:00 +02:00
Matthias Krüger
3a9dd829d0
Rollup merge of #128306 - WiktorPrzetacznik:WiktorPrzetacznik-nonnull-alignoffset-update, r=Amanieu
Update NonNull::align_offset quarantees

This PR proposes to update [`NonNull::align_offset`](https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.align_offset) guarantees, which should to be matched with [`ptr::align_offset`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.align_offset-1)
(as `NonNull::align_offset` delegates to `ptr::align_offset`).

[PR #121201](https://github.com/rust-lang/rust/pull/121201) updated only `ptr::align_offset` docs.
2024-08-08 18:57:00 +02:00
schvv31n
1bf30eb5aa rustdoc-json: added a test for #107278 2024-08-08 17:55:52 +01:00
Philipp Krones
e608b2fcf5
Bump nightly version -> 2024-08-08 2024-08-08 18:55:00 +02:00
Philipp Krones
7a73a101e9
Merge remote-tracking branch 'upstream/master' into rustup 2024-08-08 18:54:43 +02:00
bors
2048386fe2 Auto merge of #128639 - folkertdev:rmake-thumb-none-qemu, r=jieyouxu
migrate `thumb-none-qemu` to rmake

tracking issue: https://github.com/rust-lang/rust/issues/121876

I think this one is actually simpler than https://github.com/rust-lang/rust/pull/128636, we invoke `cargo run` with the right target and see if the expected result appears.

r? `@jieyouxu`

try-job: armhf-gnu
try-job: dist-various-1
try-job: test-various
2024-08-08 16:54:10 +00:00
Michael Goulet
b916431976 Rename struct_tail_erasing_lifetimes to struct_tail_for_codegen 2024-08-08 12:15:16 -04:00
schvv31n
c2a0d9ca6e rustdoc: fixed #101105
modules are now stripped based on the same logic that's used to strip other item kinds
2024-08-08 17:13:15 +01:00
Michael Goulet
f81549c9ca Normalize struct tail properly in disalignment check 2024-08-08 11:58:11 -04:00
Michael Goulet
d9dd5509dc Normalize when computing offset_of for slice tail 2024-08-08 11:58:11 -04:00
Michael Goulet
85b5e42d5e Do normalize when computing struct tails in codegen 2024-08-08 11:58:11 -04:00
Esteban Küber
95c1c34fff review comments 2024-08-08 14:58:52 +00:00
bors
b1e87922c1 Auto merge of #13200 - Jarcho:constant_no_typeck, r=Alexendoo
Don't use `LateContext` in the constant evaluator

This also changes the interface to require explicitly creating the context. `constant` could be added back in, but the others are probably not worth it.

A couple of bugs have been fixed. The wrong `TypeckResults` was used once when evaluating a constant, and the wrong `ParamEnv` was used by some callers (there wasn't a way to use the correct one).

changelog: none
2024-08-08 14:42:42 +00:00
Esteban Küber
ae696f847d Split ColorConfig off of HumanReadableErrorType
The previous setup tied two unrelated things together. Splitting these two is a better model.
2024-08-08 14:41:33 +00:00
Jason Newcomb
e4ad36d6a8 Require ConstEvalCtxt to be constructed. 2024-08-08 10:37:10 -04:00
Jason Newcomb
d2cb227eb4 Don't store LateContext in ConstEvalLateContext 2024-08-08 10:34:53 -04:00
Jason Newcomb
3779062955 Add HasSession trait 2024-08-08 10:31:45 -04:00
Weihang Lo
40a63d4f6e
Update cargo 2024-08-08 10:26:47 -04:00
bors
ffc391c766 Auto merge of #13231 - Jarcho:no_tree_walk_in_const, r=Alexendoo
Don't walk the HIR tree when checking for a const context

changelog: none
2024-08-08 13:47:18 +00:00
Alex Macleod
9289f5691b Only suggest #[allow] for --warn and --deny lint level flags 2024-08-08 13:09:58 +00:00
Guillaume Gomez
6d69b2e408 Update compiler-builtins version to 0.1.118 2024-08-08 14:47:49 +02:00