about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-05-11Rollup merge of #124991 - Infinixius:patch-1, r=NilstriebMatthias Krüger-1/+1
Fix typo in ManuallyDrop's documentation ```diff - /// A wrapper to inhibit compiler from automatically calling `T`’s destructor. + /// A wrapper to inhibit the compiler from automatically calling `T`’s destructor. ```
2024-05-11Rollup merge of #124818 - compiler-errors:ena, r=Mark-SimulacrumMatthias Krüger-3/+3
Update ena to 0.14.3 Includes https://github.com/rust-lang/ena/pull/53, which removes a trivial `Self: Sized` bound that prevents `ena` from building on the new solver.
2024-05-11Rollup merge of #124766 - devnexen:getrandom_solarish, r=Mark-SimulacrumMatthias Krüger-1/+12
std::rand: adding solaris/illumos for getrandom support. To help solarish support for miri https://https://github.com/rust-lang/miri/issues/3567
2024-05-11Auto merge of #124996 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 7 commits in 0ca60e940821c311c9b25a6423b59ccdbcea218f..4de0094ac78743d2c8ff682489e35c8a7cafe8e4 2024-05-08 01:54:25 +0000 to 2024-05-09 16:09:22 +0000 - Fix docs for unstable script feature (rust-lang/cargo#13893) - Refactor cargo lint tests (rust-lang/cargo#13880) - test(rustfix): run some tests only on nightly (rust-lang/cargo#13890) - Old syntax suggestion (rust-lang/cargo#13874) - docs: clarify dash replacement rule in target name (rust-lang/cargo#13887) - Add local-only build scripts example in check-cfg docs (rust-lang/cargo#13884) - docs(changelog): also mention `--message-format=json` (rust-lang/cargo#13882) r? ghost
2024-05-10Update cargoWeihang Lo-0/+0
2024-05-11Auto merge of #124993 - jieyouxu:rollup-u02aso7, r=jieyouxubors-59/+125
Rollup of 5 pull requests Successful merges: - #124233 (Add `-lmingwex` second time in `mingw_libs`) - #124318 (ignore generics args in attribute paths) - #124899 (bootstrap: add comments for the automatic dry run) - #124904 (reachable computation: extend explanation of what this does, and why) - #124930 (Make sure we consume a generic arg when checking mistyped turbofish) r? `@ghost` `@rustbot` modify labels: rollup
2024-05-11Rollup merge of #124930 - compiler-errors:consume-arg, r=petrochenkov许杰友 Jieyou Xu (Joe)-1/+25
Make sure we consume a generic arg when checking mistyped turbofish When recovering un-turbofish-ed args in expr position (e.g. `let x = a<T, U>();` in `check_mistyped_turbofish_with_multiple_type_params`, we used `parse_seq_to_before_end` to parse the fake generic args; however, it used `parse_generic_arg` which *optionally* parses a generic arg. If it doesn't end up parsing an arg, it returns `Ok(None)` and consumes no tokens. If we don't find a delimiter after this (`,`), we try parsing *another* element. In this case, we just infinitely loop looking for a subsequent element. We can fix this by making sure that we either parse a generic arg or error in `parse_seq_to_before_end`'s callback. Fixes #124897
2024-05-11Rollup merge of #124904 - RalfJung:reachable, r=tmiasko许杰友 Jieyou Xu (Joe)-10/+22
reachable computation: extend explanation of what this does, and why Follow-up to https://github.com/rust-lang/rust/pull/122769. I had the time to think about this some more, in particular in the context of https://github.com/rust-lang/rust/issues/119214, so I felt it was worth extending these comments some more. I also gave up on the context of "externally reachable" as it is not called that way anywhere else in the compiler. Cc `@tmiasko` `@saethlin`
2024-05-11Rollup merge of #124899 - RalfJung:bootstrap-dry, r=onur-ozkan许杰友 Jieyou Xu (Joe)-0/+5
bootstrap: add comments for the automatic dry run
2024-05-11Rollup merge of #124318 - bvanjoi:fix-123911, r=petrochenkov许杰友 Jieyou Xu (Joe)-48/+70
ignore generics args in attribute paths Fixes #97006 Fixes #123911 Fixes #123912 This patch ensures that we no longer have to handle invalid generic arguments in attribute paths. r? `@petrochenkov`
2024-05-11Rollup merge of #124233 - mati865:fix-support-for-upcoming-mingw-w64, ↵许杰友 Jieyou Xu (Joe)-0/+3
r=petrochenkov Add `-lmingwex` second time in `mingw_libs` Upcoming mingw-w64 releases will contain small math functions refactor which moved implementation around. As a result functions like `lgamma` now depend on libraries in this order: `libmingwex.a` -> `libmsvcrt.a` -> `libmingwex.a`. Fixes #124221
2024-05-10Fix typo in ManuallyDrop's documentationInfinixius-1/+1
2024-05-10Auto merge of #124982 - compiler-errors:uplift-trait-ref, r=lcnrbors-313/+492
Uplift `TraitRef` into `rustc_type_ir` Emotional rollercoaster r? lcnr
2024-05-10Auto merge of #123886 - scottmcm:more-rvalue-operands, r=matthewjasperbors-14/+231
Avoid `alloca`s in codegen for simple `mir::Aggregate` statements The core idea here is to remove the abstraction penalty of simple newtypes in codegen. Even something simple like constructing a ```rust #[repr(transparent)] struct Foo(u32); ``` forces an `alloca` to be generated in nightly right now. Certainly LLVM can optimize that away, but it would be nice if it didn't have to. Quick example: ```rust #[repr(transparent)] pub struct Transparent32(u32); #[no_mangle] pub fn make_transparent(x: u32) -> Transparent32 { let a = Transparent32(x); a } ``` on nightly we produce <https://rust.godbolt.org/z/zcvoM79ae> ```llvm define noundef i32 `@make_transparent(i32` noundef %x) unnamed_addr #0 { %a = alloca i32, align 4 store i32 %x, ptr %a, align 4 %0 = load i32, ptr %a, align 4, !noundef !3 ret i32 %0 } ``` but after this PR we produce ```llvm define noundef i32 `@make_transparent(i32` noundef %x) unnamed_addr #0 { start: ret i32 %x } ``` (even before the optimizer runs).
2024-05-10Apply nits, make some bounds into supertraits on inherent traitsMichael Goulet-56/+57
2024-05-10Also debugMichael Goulet-21/+11
2024-05-10Lift `TraitRef` into `rustc_type_ir`Michael Goulet-241/+445
2024-05-10Lift `Lift`Michael Goulet-33/+17
2024-05-10Auto merge of #124952 - compiler-errors:no-error, r=lcnrbors-393/+432
Rename some `FulfillmentErrorCode`/`ObligationCauseCode` variants to be less redundant 1. Rename some `FulfillmentErrorCode` variants. 2. Always use `ObligationCauseCode::` to prefix a code, rather than using a glob import and naming them through `traits::`. 3. Rename some `ObligationCauseCode` variants -- I wasn't particularly thorough with thinking of a new names for these, so could workshop them if necessary. 4. Misc stuff from renaming. r? lcnr
2024-05-11ignore generics args in attribute pathsbohan-48/+70
2024-05-10Auto merge of #124972 - matthiaskrgr:rollup-3fablim, r=matthiaskrgrbors-401/+467
Rollup of 5 pull requests Successful merges: - #124615 (coverage: Further simplify extraction of mapping info from MIR) - #124778 (Fix parse error message for meta items) - #124797 (Refactor float `Primitive`s to a separate `Float` type) - #124888 (Migrate `run-make/rustdoc-output-path` to rmake) - #124957 (Make `Ty::builtin_deref` just return a `Ty`) r? `@ghost` `@rustbot` modify labels: rollup
2024-05-10Name tweaksMichael Goulet-75/+87
2024-05-10More rename falloutMichael Goulet-91/+93
2024-05-10Rename some ObligationCauseCode variantsMichael Goulet-247/+187
2024-05-10Remove glob imports for ObligationCauseCodeMichael Goulet-178/+279
2024-05-10rename some variants in FulfillmentErrorCodeMichael Goulet-62/+46
2024-05-10Rollup merge of #124957 - compiler-errors:builtin-deref, r=michaelwoeristerMatthias Krüger-116/+92
Make `Ty::builtin_deref` just return a `Ty` Nowhere in the compiler are we using the mutability part of the `TyAndMut` that we used to return.
2024-05-10Rollup merge of #124888 - GuillaumeGomez:migrate-rustdoc-output-path, r=jieyouxuMatthias Krüger-5/+9
Migrate `run-make/rustdoc-output-path` to rmake Part of https://github.com/rust-lang/rust/issues/121876. r? ``@jieyouxu``
2024-05-10Rollup merge of #124797 - beetrees:primitive-float, r=davidtwcoMatthias Krüger-95/+155
Refactor float `Primitive`s to a separate `Float` type Now there are 4 of them, it makes sense to refactor `F16`, `F32`, `F64` and `F128` out of `Primitive` and into a separate `Float` type (like integers already are). This allows patterns like `F16 | F32 | F64 | F128` to be simplified into `Float(_)`, and is consistent with `ty::FloatTy`. As a side effect, this PR also makes the `Ty::primitive_size` method work with `f16` and `f128`. Tracking issue: #116909 `@rustbot` label +F-f16_and_f128
2024-05-10Rollup merge of #124778 - fmease:fix-diag-msg-parse-meta-item, r=nnethercoteMatthias Krüger-78/+93
Fix parse error message for meta items Addresses https://github.com/rust-lang/rust/issues/122796#issuecomment-2010803906, cc [``@]Thomasdezeeuw.`` For attrs inside of a macro like `#[doc(alias = $ident)]` or `#[cfg(feature = $ident)]` where `$ident` is a macro metavariable of fragment kind `ident`, we used to say the following when expanded (with `$ident` ⟼ `ident`): ``` error: expected unsuffixed literal or identifier, found `ident` --> weird.rs:6:19 | 6 | #[cfg(feature = $ident)] | ^^^^^^ ... 11 | m!(id); | ------ in this macro invocation | = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) ``` This was incorrect and caused confusion, justifiably so (see #122796). In this position, we only accept/expect *unsuffixed literals* which consist of numeric & string literals as well as the boolean literals / the keywords / the reserved identifiers `false` & `true` **but not** arbitrary identifiers. Furthermore, we used to suggest garbage when encountering unexpected non-identifier tokens: ``` error: expected unsuffixed literal, found `-` --> weird.rs:16:17 | 16 | #[cfg(feature = -1)] | ^ | help: surround the identifier with quotation marks to parse it as a string | 16 | #[cfg(feature =" "-1)] | + + ``` Now we no longer do.
2024-05-10Rollup merge of #124615 - Zalathar:extracted-mappings, r=davidtwcoMatthias Krüger-107/+118
coverage: Further simplify extraction of mapping info from MIR This is another round of rearrangement and simplification that builds on top of the changes made to mapping-extraction by #124603. The overall theme is to take the computation of `bcb_has_mappings` and `test_vector_bitmap_bytes` out of the main body of `generate_coverage_spans`, which then lets us perform a few other small changes that had previously been held up by the need to work around those computations.
2024-05-10Auto merge of #124932 - RalfJung:temporal, r=compiler-errorsbors-9/+5
codegen: memmove/memset cannot be non-temporal non-temporal memset is not a thing. And for memmove, since the LLVM backend doesn't support this, surely we don't need it in the GCC backend.
2024-05-10Auto merge of #124863 - DaniPopes:from-str-radix-panic, r=Amanieubors-6/+6
from_str_radix: outline only the panic function In the `{integer}::from_str_radix` function, the radix check is labeled as `cold` and `inline(never)`, along with its corresponding panic. It probably was intended to apply these attributes only to the panic function.
2024-05-10Auto merge of #124774 - the8472:subnanosecond-benches, r=jhprattbors-17/+20
Display walltime benchmarks with subnanosecond precision With modern CPUs running at more than one cycle per nanosecond the current precision is insufficient to resolve differences worth several cycles per iteration. Granted, walltime benchmarks often are noisy but occasionally, especially when no allocations are involved, the difference really is just a few cycles. example results when benchmarking 1-4 serialized ADD instructions and an empty bench body ``` running 4 tests test add ... bench: 0.24 ns/iter (+/- 0.00) test add2 ... bench: 0.48 ns/iter (+/- 0.01) test add3 ... bench: 0.72 ns/iter (+/- 0.01) test add4 ... bench: 0.96 ns/iter (+/- 0.01) test empty ... bench: 0.24 ns/iter (+/- 0.00) ```
2024-05-10Migrate `run-make/rustdoc-output-path` to rmakeGuillaume Gomez-5/+9
2024-05-10Fix parse error message for meta itemsLeón Orell Valerian Liehr-78/+93
2024-05-10Auto merge of #124961 - matthiaskrgr:rollup-1jj65p6, r=matthiaskrgrbors-460/+359
Rollup of 7 pull requests Successful merges: - #124551 (Add benchmarks for `impl Debug for str`) - #124915 (`rustc_target` cleanups) - #124918 (Eliminate some `FIXME(lcnr)` comments) - #124927 (opt-dist: use xz2 instead of xz crate) - #124936 (analyse visitor: build proof tree in probe) - #124943 (always use `GenericArgsRef`) - #124955 (Use fewer origins when creating type variables.) r? `@ghost` `@rustbot` modify labels: rollup
2024-05-10fix typoRalf Jung-1/+1
Co-authored-by: jyn <github@jyn.dev>
2024-05-10Rollup merge of #124955 - nnethercote:next_ty_var, r=lcnrMatthias Krüger-332/+128
Use fewer origins when creating type variables. To reduce lots of repetitive boilerplate code. Details in the individual commit messages. r? ``@lcnr``
2024-05-10Rollup merge of #124943 - lcnr:generic-args-ref, r=compiler-errorsMatthias Krüger-15/+19
always use `GenericArgsRef` r? ```@compiler-errors```
2024-05-10Rollup merge of #124936 - lcnr:cool-beans, r=compiler-errorsMatthias Krüger-34/+113
analyse visitor: build proof tree in probe see inline comments fixes #124791 fixes #124702 r? ```@compiler-errors```
2024-05-10Rollup merge of #124927 - klensy:xz3, r=KobzolMatthias Krüger-11/+2
opt-dist: use xz2 instead of xz crate xz crate consist of simple reexport of xz2 crate. Why? Idk. Totally not a backdoor.
2024-05-10Rollup merge of #124918 - nnethercote:FIXME-lcnr, r=lcnrMatthias Krüger-51/+12
Eliminate some `FIXME(lcnr)` comments In some cases this involved changing code. In some cases the comment was able to removed or replaced. r? ``@lcnr``
2024-05-10Rollup merge of #124915 - nnethercote:rustc_target-cleanups, r=bjorn3Matthias Krüger-17/+5
`rustc_target` cleanups Minor improvement I found while looking at this code. r? ```@lqd```
2024-05-10Rollup merge of #124551 - Swatinem:debug-str-bench, r=cuviperMatthias Krüger-0/+80
Add benchmarks for `impl Debug for str` In order to inform future perf improvements and prevent regressions, lets add some benchmarks that stress `impl Debug for str`. --- As I am currently working on improving the perf in https://github.com/rust-lang/rust/pull/121150, its nice to have these benchmarks. Writing them, I also saw that escapes are written out one char at a time, even though other parts of the code are already optimizing that via `as_str`, which I intend to do as well as a followup improvement. r? ``@cuviper`` ☝🏻 as you were also assigned to https://github.com/rust-lang/rust/pull/121150, CC ``@the8472`` if you want to steal the review :-)
2024-05-10Auto merge of #124953 - compiler-errors:own-params, r=lcnrbors-171/+179
Rename `Generics::params` to `Generics::own_params` I hope this makes it slightly more obvious that `generics.own_params` is insufficient when considering nested items. I didn't actually audit any of the usages, for the record. r? lcnr
2024-05-09Make builtin_deref just return a TyMichael Goulet-116/+92
2024-05-09Rename Generics::params to Generics::own_paramsMichael Goulet-171/+179
2024-05-10Auto merge of #124850 - dpaoliello:clang2022, r=Kobzolbors-21/+25
Upgrade pre-built Clang used in MSVC and MacOS builds, move MSVC builds to Server 2022 Fixes #92948 Example working MacOS and Windows builds: <https://github.com/rust-lang/rust/actions/runs/8989360201> There is a [bug in Clang 18](https://github.com/llvm/llvm-project/pull/81849) that causes issues when building for Arm64 in later parts of the build (specifically `libgit2`). As a workaround, we will still use the pre-built Clang to build LLVM but will use MSVC for the rest of the Arm64 build.
2024-05-10De-tuple two `vtable_trait_first_method_offset` args.Nicholas Nethercote-8/+4
Thus eliminating a `FIXME` comment.