Commit Graph

269222 Commits

Author SHA1 Message Date
Michael Goulet
21d95fb7b2 More compare_impl_item simplifications 2024-10-23 14:33:44 +00:00
July Tikhonov
b515bbfb85 fix a typo in documentation of pointer::sub_ptr() 2024-10-23 19:37:51 +06:00
July Tikhonov
f4c8ff33de fix documentation of ptr::dangling() function 2024-10-23 19:17:36 +06:00
bors
be01dabfef Auto merge of #132027 - RalfJung:lang-feature-bool-fields, r=nnethercote
nightly feature tracking: get rid of the per-feature bool fields

The `struct Features` that tracks which features are enabled has a ton of public `bool`-typed fields that are basically caching the result of looking up the corresponding feature in `enabled_lang_features`. Having public fields with an invariant is not great, so at least they should be made private. However, it turns out caching these lookups is actually [not worth it](https://github.com/rust-lang/rust/pull/131321#issuecomment-2402068336), so this PR just entirely gets rid of these fields. (The alternative would be to make them private and have a method for each of them to expose them in a read-only way. Most of the diff of this PR would be the same in that case.)

r? `@nnethercote`
2024-10-23 12:16:41 +00:00
DianQK
6570a6fe92
Add a test case for #131164 2024-10-23 19:01:38 +08:00
Josh Triplett
ecdc2441b6 "innermost", "outermost", "leftmost", and "rightmost" don't need hyphens
These are all standard dictionary words and don't require hyphenation.
2024-10-23 02:45:24 -07:00
Adrian Taylor
2eb7e0d370 CI: rfl: use rust-next temporary commit
Commit c95bbb59a9b22f9b838b15d28319185c1c884329 within rust-next
contains some changes required to be compatible with upcoming arbitraty
self types work. Roll RFL CI forward to the latest rust-next to include
that work.

Related:
https://github.com/rust-lang/rust/pull/130225
https://github.com/rust-lang/rust/issues/44874
2024-10-23 09:31:43 +00:00
guliwa
1b5921641a
Refactor change detection for rustdoc and download-rustc 2024-10-23 09:30:00 +00:00
bors
ffd978b7bf Auto merge of #132044 - lcnr:no-relate-abi, r=compiler-errors
do not implement `Relate`  for "boring" types

and update some macros while we're at it. This means we don't have to implement `TypeVisitable` for them.

r? `@compiler-errors`
2024-10-23 08:41:24 +00:00
Ralf Jung
44638853f5 rename lang feature lists to include LANG 2024-10-23 09:14:43 +01:00
Ralf Jung
e82bca6f32 remove no longer needd UnstableFeature type 2024-10-23 09:14:43 +01:00
Ralf Jung
6ad17bd30c get rid of feature list in target feature logic 2024-10-23 09:14:43 +01:00
Ralf Jung
7340b9c7c2 rustc_feature: remove no-longer-needed macro 2024-10-23 09:14:42 +01:00
Ralf Jung
ad3991d303 nightly feature tracking: get rid of the per-feature bool fields 2024-10-23 09:14:41 +01:00
Benoît du Garreau
77a7164ec9 Specialize read_exact and read_buf_exact for VecDeque 2024-10-23 10:09:24 +02:00
Graydon Hoare
b0f02823fa
More review comments on wasm32v1-none target 2024-10-22 23:04:45 -07:00
Graydon Hoare
3ba87498fa
Fix rustc_target test: wasmNN-none should support dynamic linking 2024-10-22 23:04:44 -07:00
Graydon Hoare
212d516ab0
Address review comments on wasm32v1-none target 2024-10-22 23:04:44 -07:00
Graydon Hoare
e14d6d8314
Add wasm32v1-none target (compiler-team/#791) 2024-10-22 23:04:44 -07:00
bors
9abfcb4900 Auto merge of #132053 - matthiaskrgr:rollup-u5ds6i3, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #131707 (Run most `core::num` tests in const context too)
 - #132002 (abi/compatibility: also test Option-like types)
 - #132026 (analyse: remove unused uncanonicalized field)
 - #132031 (Optimize `Rc<T>::default`)
 - #132040 (relnotes: fix stabilizations of `assume_init`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-10-23 05:57:00 +00:00
onur-ozkan
47d6667454 do not remove .cargo directroy
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-23 08:56:54 +03:00
Matthias Krüger
b44a0fa61c
Rollup merge of #132040 - cuviper:assume_init-1.82, r=dtolnay
relnotes: fix stabilizations of `assume_init`

Ref: https://github.com/rust-lang/blog.rust-lang.org/pull/1416
2024-10-23 06:51:25 +02:00
Matthias Krüger
af356d6d73
Rollup merge of #132031 - slanterns:rc_default, r=ibraheemdev
Optimize `Rc<T>::default`

The missing piece of https://github.com/rust-lang/rust/pull/131460.

Also refactored `Arc<T>::default` by using a safe `NonNull::from(Box::leak(_))` to replace the unnecessarily unsafe call to `NonNull::new_unchecked(Box::into_raw(_))`. The remaining unsafety is coming from `[Rc|Arc]::from_inner`, which is safe from the construction of `[Rc|Arc]Inner`.
2024-10-23 06:51:25 +02:00
Matthias Krüger
5b602201ed
Rollup merge of #132026 - lcnr:stabilize-coherence-again, r=compiler-errors
analyse: remove unused uncanonicalized field

This field is unused and was only relevant when actually printing proof trees. Right now this simply causes proof tree building to leak a bunch of inference vars 😁

r? ``@compiler-errors``
2024-10-23 06:51:24 +02:00
Matthias Krüger
7e1dbaec13
Rollup merge of #132002 - RalfJung:abi-compat-option-like, r=compiler-errors
abi/compatibility: also test Option-like types

Adds tests for the decision [here](https://github.com/rust-lang/rust/pull/130628#issuecomment-2402761599).

Cc ``@workingjubilee``
2024-10-23 06:51:24 +02:00
Matthias Krüger
38eaf608eb
Rollup merge of #131707 - clarfonthey:constify-core-tests, r=thomcc
Run most `core::num` tests in const context too

This adds some infrastructure for something I was going to use in #131566, but it felt worthwhile enough on its own to merge/discuss separately.

Essentially, right now we tend to rely on UI tests to ensure that things work in const context, rather than just using library tests. This uses a few simple macro tricks to make it *relatively* painless to execute tests in both runtime and compile-time context. And this only applies to the numeric tests, and not anything else.

Recommended to review without whitespace in the diff.

cc `@RalfJung`
2024-10-23 06:51:23 +02:00
bors
e1f3068995 Auto merge of #131982 - compiler-errors:split-trait-bound-modifiers, r=fmease
Represent `hir::TraitBoundModifiers` as distinct parts in HIR

Stop squashing distinct `polarity` and `constness` into a single `hir::TraitBoundModifier`.

This PR doesn't attempt to handle all the corner cases correctly, since the old code certainly did not either; but it should be much easier for, e.g., rustc devs working on diagnostics, or clippy devs, to actually handle constness and polarity correctly.

try-job: x86_64-gnu-stable
2024-10-23 03:31:17 +00:00
Asuna
57bffe1d59 Set signext or zeroext for integer arguments on LoongArch64 2024-10-23 04:42:21 +02:00
Asuna
6b65524620 Set signext or zeroext for integer arguments on RISC-V 2024-10-23 04:42:03 +02:00
Asuna
03df13b70d Introduce adjust_for_rust_abi in rustc_target 2024-10-23 03:21:59 +02:00
bors
b13176595d Auto merge of #131929 - LaihoE:replace_default_capacity, r=joboet
better default capacity for str::replace

Adds smarter capacity for str::replace in cases where we know that the output will be at least as long as the original string.
2024-10-23 01:03:48 +00:00
lcnr
00266eeaa5 remove PredicatePolarity and BoundConstness relate impls
Also removes `TypeError::ConstnessMismatch`. It is unused.
2024-10-23 00:52:37 +02:00
bors
8bf64f106a Auto merge of #131871 - RalfJung:x86-32-float, r=workingjubilee
x86-32 float return for 'Rust' ABI: treat all float types consistently

This helps with https://github.com/rust-lang/rust/issues/131819: for our own ABI on x86-32, we want to *never* use the float registers. The previous logic only considered F32 and F64, but skipped F16 and F128. So I made the logic just apply to all float types.

try-job: i686-gnu
try-job: i686-gnu-nopt
2024-10-22 22:36:59 +00:00
lcnr
196fdf144f do not relate Abi and Safety
and update some macros while we're at it
2024-10-22 23:13:04 +02:00
Michael Goulet
febb3f7c88 Represent TraitBoundModifiers as distinct parts in HIR 2024-10-22 19:48:44 +00:00
Josh Stone
1909668a88 relnotes: fix stabilizations of assume_init
Ref: https://github.com/rust-lang/blog.rust-lang.org/pull/1416
2024-10-22 10:47:42 -07:00
Orion Gonzalez
28095bc541 real default value 2024-10-22 19:11:46 +02:00
Orion Gonzalez
c8de61b50d s/display-diff-tool/compiletest-diff-tool/ 2024-10-22 19:11:44 +02:00
Orion Gonzalez
37ffb94093 update CONFIG_CHANGE_HISTORY 2024-10-22 19:11:05 +02:00
Orion Gonzalez
ef4325eb85 implemented custom differ 2024-10-22 19:10:35 +02:00
Orion Gonzalez
73238301f4 add an option for a custom differ 2024-10-22 19:08:55 +02:00
Laiho
c8391802af better default capacity for str::replace 2024-10-22 19:53:33 +03:00
bors
86d69c705a Auto merge of #132035 - matthiaskrgr:rollup-ty1e4q0, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #125205 (Fixup Windows verbatim paths when used with the `include!` macro)
 - #131049 (Validate args are correct for `UnevaluatedConst`, `ExistentialTraitRef`/`ExistentialProjection`)
 - #131549 (Add a note for `?` on a `impl Future<Output = Result<..>>` in sync function)
 - #131731 (add `TestFloatParse` to `tools.rs` for bootstrap)
 - #131732 (Add doc(plugins), doc(passes), etc. to INVALID_DOC_ATTRIBUTES)
 - #132006 (don't stage-off to previous compiler when CI rustc is available)
 - #132022 (Move `cmp_in_dominator_order` out of graph dominator computation)
 - #132033 (compiletest: Make `line_directive` return a `DirectiveLine`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-10-22 14:16:37 +00:00
Matthias Krüger
6db5f332af
Rollup merge of #132033 - Zalathar:directive-line, r=jieyouxu
compiletest: Make `line_directive` return a `DirectiveLine`

This reduces the need to juggle raw tuples, and opens up the possibility of moving more parts of directive parsing into `line_directive`.

In order to make the main change possible, this PR also (partly) separates the debugger-command parsing from the main directive parser. That cleanup removes support for `[rev]` in debugger commands, which is not used by any tests.
2024-10-22 15:28:52 +02:00
Matthias Krüger
f5aa456646
Rollup merge of #132022 - Zalathar:dominator-order, r=tmiasko
Move `cmp_in_dominator_order` out of graph dominator computation

Dominator-order information is only needed for coverage graphs, and is easy enough to collect by just traversing the graph again.

This avoids wasted work when computing graph dominators for any other purpose.
2024-10-22 15:28:50 +02:00
Matthias Krüger
56eae720bd
Rollup merge of #132006 - onur-ozkan:131947, r=jieyouxu
don't stage-off to previous compiler when CI rustc is available

Resolves the 4th item in [Tracking Issue for download-rustc improvements](https://github.com/rust-lang/rust/issues/131744).
2024-10-22 15:28:47 +02:00
Matthias Krüger
83085b99c2
Rollup merge of #131732 - m4tx:fix-82824, r=davidtwco
Add doc(plugins), doc(passes), etc. to INVALID_DOC_ATTRIBUTES

This fixes #82824.
2024-10-22 15:28:45 +02:00
Matthias Krüger
cbb85f1bd5
Rollup merge of #131731 - lucarlig:master, r=onur-ozkan
add `TestFloatParse` to `tools.rs` for bootstrap

add TestFloatParse to tools for bootstrap, I am not sure this is what the issue https://github.com/rust-lang/rust/issues/128012 discussion wants.

try-job: aarch64-apple
2024-10-22 15:28:43 +02:00
Matthias Krüger
457087ed29
Rollup merge of #131549 - compiler-errors:try-in-sync, r=spastorino
Add a note for `?` on a `impl Future<Output = Result<..>>` in sync function

It's confusing to `?` a future of a result in a sync function. We have a suggestion to `.await` it if we're in an async function, but not a sync function. Note that this is the case for sync functions, at least.

Let's be a bit more vague about a fix, since it's somewhat context dependent. For example, you could block on it, or you could make your function asynchronous. 🤷
2024-10-22 15:28:41 +02:00
Matthias Krüger
3f15d296f4
Rollup merge of #131049 - compiler-errors:more-validation, r=spastorino
Validate args are correct for `UnevaluatedConst`, `ExistentialTraitRef`/`ExistentialProjection`

For the `Existential*` ones, we have to do some adjustment to the args list to deal with the missing `Self` type, so we introduce a `debug_assert_existential_args_compatible` function to the interner as well.
2024-10-22 15:28:38 +02:00