about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-07-04also remove redundant requirements from offset()Ralf Jung-196/+100
2024-07-04offset_from: "the difference must fit in an isize" is a corollaryRalf Jung-77/+40
also, isize::MIN is an impossible distance
2024-07-01Auto merge of #126941 - GuillaumeGomez:migrate-run-make-llvm-ident, r=Kobzolbors-20/+48
Migrate `run-make/llvm-ident` to `rmake.rs` Part of https://github.com/rust-lang/rust/issues/121876. r? `@Kobzol` try-job: armhf-gnu
2024-07-01Auto merge of #127216 - GuillaumeGomez:rollup-iw9f2ed, r=GuillaumeGomezbors-521/+528
Rollup of 8 pull requests Successful merges: - #126732 (Stabilize `PanicInfo::message()` and `PanicMessage`) - #126753 (Add nightly style guide section for `precise_capturing` `use<>` syntax) - #126832 (linker: Refactor interface for passing arguments to linker) - #126880 (Migrate `volatile-intrinsics`, `weird-output-filenames`, `wasm-override-linker`, `wasm-exceptions-nostd` to `rmake`) - #127128 (Stabilize `duration_abs_diff`) - #127129 (Use full expr span for return suggestion on type error/ambiguity) - #127188 ( improve the way bootstrap handles rustlib components) - #127201 (Improve run-make-support API) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-01Rollup merge of #127201 - GuillaumeGomez:improve-run-make-support, r=KobzolGuillaume Gomez-14/+22
Improve run-make-support API I think I'll slowly continue this work. Makes things a bit nicer for contributors, so why not. :D r? ``@Kobzol``
2024-07-01Rollup merge of #127188 - onur-ozkan:rustc-src-fix, r=KobzolGuillaume Gomez-28/+31
improve the way bootstrap handles rustlib components When CI rustc is enabled, bootstrap tries to symlink the rust source (project root) into target sysroot right before copying it from the CI rustc's sysroot. This becomes a problem in CI builders (which we currently don't see because they don't use CI rustc) because the copying part will fail as [they run on read-only mode](https://github.com/rust-lang/rust/blob/ef3d6fd7002500af0a985f70d3ac5152623c1396/src/ci/docker/run.sh#L233). This change fixes the problem by copying `rustc-src` from the CI rustc sysroot and only symlinking `rustc-src` from the rust source when download-rustc is not enabled. r? ``@Kobzol`` (we talked about this already on Zulip, he knows the context) Blocker for https://github.com/rust-lang/rust/pull/122709
2024-07-01Rollup merge of #127129 - compiler-errors:full-expr-span, r=jieyouxuGuillaume Gomez-16/+56
Use full expr span for return suggestion on type error/ambiguity We sometimes use parts of an expression rather than the whole thing for an obligation span. For example, a method obligation will just point to the path segment corresponding to the `method` in `rcvr.method(args)`. So let's not use that assuming it'll point to the *whole* expression span, which we can access from the expr hir id we store in `ObligationCauseCode::WhereClauseInExpr`. Fixes #127109
2024-07-01Rollup merge of #127128 - elomatreb:elomatreb/stabilize-duration_abs_diff, ↵Guillaume Gomez-3/+3
r=joboet Stabilize `duration_abs_diff` Stabilize `duration_abs_diff` following FCP in #117618. Closes #117618.
2024-07-01Rollup merge of #126880 - Rejyr:migrate-rmake-vw, r=KobzolGuillaume Gomez-69/+80
Migrate `volatile-intrinsics`, `weird-output-filenames`, `wasm-override-linker`, `wasm-exceptions-nostd` to `rmake` Also refactors `wasm-abi` and `compressed-debuginfo`. Part of #121876. r? ``@jieyouxu`` try-job: x86_64-gnu-debug try-job: dist-various-2
2024-07-01Rollup merge of #126832 - petrochenkov:linkarg, r=jieyouxuGuillaume Gomez-383/+318
linker: Refactor interface for passing arguments to linker Separate arguments into passed to the underlying linker, to cc wrapper, or supported by both. Also avoid allocations in all the argument passing functions. The interfaces would look nicer if not the limitations on returning `&mut Self` in `dyn`-compatible traits, and unnecessary conflicts between `Trait` and `dyn Trait` methods. try-job: armhf-gnu try-job: aarch64-gnu try-job: dist-x86_64-linux try-job: x86_64-msvc try-job: i686-msvc try-job: dist-x86_64-apple try-job: test-various
2024-07-01Rollup merge of #126753 - compiler-errors:use-style-guide, ↵Guillaume Gomez-0/+12
r=joshtriplett,calebcartwright Add nightly style guide section for `precise_capturing` `use<>` syntax r? style Tracking: - https://github.com/rust-lang/rust/issues/123432
2024-07-01Rollup merge of #126732 - StackOverflowExcept1on:master, r=m-ou-seGuillaume Gomez-8/+6
Stabilize `PanicInfo::message()` and `PanicMessage` Resolves #66745 This stabilizes the [`PanicInfo::message()`](https://doc.rust-lang.org/nightly/core/panic/struct.PanicInfo.html#method.message) and [`PanicMessage`](https://doc.rust-lang.org/nightly/core/panic/struct.PanicMessage.html). Demonstration of [custom panic handler](https://github.com/StackOverflowExcept1on/panicker): ```rust #![no_std] #![no_main] extern crate libc; #[no_mangle] extern "C" fn main() -> libc::c_int { panic!("I just panic every time"); } #[panic_handler] fn my_panic(panic_info: &core::panic::PanicInfo) -> ! { use arrayvec::ArrayString; use core::fmt::Write; let message = panic_info.message(); let location = panic_info.location().unwrap(); let mut debug_msg = ArrayString::<1024>::new(); let _ = write!(&mut debug_msg, "panicked with '{message}' at '{location}'"); if debug_msg.try_push_str("\0").is_ok() { unsafe { libc::puts(debug_msg.as_ptr() as *const _); } } unsafe { libc::exit(libc::EXIT_FAILURE) } } ``` ``` $ cargo +stage1 run --release panicked with 'I just panic every time' at 'src/main.rs:8:5' ``` - [x] FCP: https://github.com/rust-lang/rust/issues/66745#issuecomment-2198143725 r? libs-api
2024-07-01Auto merge of #127113 - scottmcm:retune-inlining-again, r=oli-obkbors-845/+385
Avoid MIR bloat in inlining In #126578 we ended up with more binary size increases than expected. This change attempts to avoid inlining large things into small things, to avoid that kind of increase, in cases when top-down inlining will still be able to do that inlining later. r? ghost
2024-07-01Migrate `run-make/llvm-ident` to `rmake.rs`Guillaume Gomez-20/+41
2024-07-01Add `input_file` method on `LlvmFileCheck`Guillaume Gomez-0/+7
2024-07-01Avoid MIR bloat in inliningScott McMurray-845/+385
In 126578 we ended up with more binary size increases than expected. This change attempts to avoid inlining large things into small things, to avoid that kind of increase, in cases when top-down inlining will still be able to do that inlining later.
2024-07-01linker: Bail out of rpath logic early if the target doesn't support rpathVadim Petrochenkov-10/+4
2024-07-01linker: Refactor interface for passing arguments to linkerVadim Petrochenkov-373/+314
2024-07-01fail on component linking errorsonur-ozkan-3/+6
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-01improve the way bootstrap handles rustlib componentsonur-ozkan-26/+26
When CI rustc is enabled, bootstrap tries to symlink the rust source (project root) into target sysroot right before copying it from the CI rustc's sysroot. This becomes a problem in CI builders (which we currently don't see because they don't use CI rustc) because the copying part will fail as they run on read-only mode. This change fixes the problem by copying `rustc-src` from the CI rustc sysroot and only symlinking `rustc-src` from the rust source when download-rustc is not enabled. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-01Improve `target` method API in `run-make-support`Guillaume Gomez-5/+7
2024-07-01Improve `run-make-support` API for `assert*` functionsGuillaume Gomez-9/+15
2024-07-01Auto merge of #127197 - matthiaskrgr:rollup-aqpvn5q, r=matthiaskrgrbors-18/+436
Rollup of 7 pull requests Successful merges: - #126923 (test: dont optimize to invalid bitcasts) - #127090 (Reduce merge conflicts from rustfmt's wrapping) - #127105 (Only update `Eq` operands in GVN if it can update both sides) - #127150 (Fix x86_64 code being produced for bare-metal LoongArch targets' `compiler_builtins`) - #127181 (Introduce a `rustc_` attribute to dump all the `DefId` parents of a `DefId`) - #127182 (Fix error in documentation for IpAddr::to_canonical and Ipv6Addr::to_canonical) - #127191 (Ensure `out_of_scope_macro_calls` lint is registered) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-01Rollup merge of #127191 - beetrees:register-out-of-scope-macro-calls, ↵Matthias Krüger-0/+7
r=compiler-errors Ensure `out_of_scope_macro_calls` lint is registered Fixes part of https://github.com/rust-lang/rust/issues/126984#issuecomment-2198792687.
2024-07-01Rollup merge of #127182 - danielhuang:patch-4, r=NilstriebMatthias Krüger-2/+2
Fix error in documentation for IpAddr::to_canonical and Ipv6Addr::to_canonical
2024-07-01Rollup merge of #127181 - BoxyUwU:dump_def_parents, r=compiler-errorsMatthias Krüger-1/+217
Introduce a `rustc_` attribute to dump all the `DefId` parents of a `DefId` We've run into a bunch of issues with anon consts having the wrong generics and it would have been incredibly helpful to be able to quickly slap a `rustc_` attribute to check what `tcx.parent(` will return on the relevant DefIds. I wasn't sure of a better way to make this work for anon consts than requiring the attribute to be on the enclosing item and then walking the inside of it to look for any anon consts. This particular method will honestly break at some point when we stop having a `DefId` available for anon consts in hir but that's for another day... r? ``@compiler-errors``
2024-07-01Rollup merge of #127150 - xen0n:issue125908, r=KobzolMatthias Krüger-3/+19
Fix x86_64 code being produced for bare-metal LoongArch targets' `compiler_builtins` Formerly the `loongarch*-*-none*` targets were added to the `dist-various-2` CI job, but no corresponding toolchain was added along with them. This meant the `compiler_builtins` for the targets were built with the host toolchain. As the other `dist-various` toolchains are mostly pre-built so far, to avoid burdening them with crosstool-ng builds, simply move the two bare-metal LoongArch targets to the `dist-loongarch64-linux` job which has a ready-to-use LoongArch toolchain. With the proper CFLAGS applied it is possible to build artifacts suitable for bare-metal. I verified that the `compiler_builtins` objects are now correctly produced regarding architecture and ABI, with the changes here applied. Fixes #125908. cc ``@heiher`` try-job: dist-loongarch64-linux try-job: dist-various-2
2024-07-01Rollup merge of #127105 - scottmcm:issue-127089, r=cjgillotMatthias Krüger-5/+132
Only update `Eq` operands in GVN if it can update both sides Otherwise the types might not match Fixes #127089 r? mir-opt
2024-07-01Rollup merge of #127090 - kornelski:wrap-conflicts, r=fee1-deadMatthias Krüger-7/+15
Reduce merge conflicts from rustfmt's wrapping Imports in this file are changed by many different features. Rustfmt insists on reformatting and rewrapping the imports every time they change, which causes chronic merge conflicts. I've split the big import into multiple smaller ones, so that different features will conflict less often.
2024-07-01Rollup merge of #126923 - ↵Matthias Krüger-0/+44
workingjubilee:regression-tests-for-simd-invalid-bitcast, r=calebzulawski test: dont optimize to invalid bitcasts Regression tests to prevent regressing.
2024-07-01Auto merge of #126996 - oli-obk:do_not_count_errors, r=nnethercotebors-816/+886
Automatically taint InferCtxt when errors are emitted r? `@nnethercote` Basically `InferCtxt::dcx` now returns a `DiagCtxt` that refers back to the `Cell<Option<ErrorGuaranteed>>` of the `InferCtxt` and thus when invoking `Diag::emit`, and the diagnostic is an error, we taint the `InferCtxt` directly. That change on its own has no effect at all, because `InferCtxt` already tracks whether errors have been emitted by recording the global error count when it gets opened, and checking at the end whether the count changed. So I removed that error count check, which had a bit of fallout that I immediately fixed by invoking `InferCtxt::dcx` instead of `TyCtxt::dcx` in a bunch of places. The remaining new errors are because an error was reported in another query, and never bubbled up. I think they are minor enough for this to be ok, and sometimes it actually improves diagnostics, by not silencing useful diagnostics anymore. fixes #126485 (cc `@olafes)` There are more improvements we can do (like tainting in hir ty lowering), but I would rather do that in follow up PRs, because it requires some refactorings.
2024-07-01Auto merge of #127176 - fee1-dead-contrib:fx-requires-next-solver, ↵bors-428/+543
r=compiler-errors Make `feature(effects)` require `-Znext-solver` Per https://github.com/rust-lang/rust/pull/120639#pullrequestreview-2144804638 I made this a hard error because otherwise it should be a lint and that seemed more complicated. Not sure if this is the best place to put the error though. r? project-const-traits
2024-06-30Use full expr span for return suggestion on type error/ambiguityMichael Goulet-16/+56
2024-07-01Auto merge of #127082 - GuillaumeGomez:help-gui-test, r=notriddlebors-0/+70
Add back `help-page.goml` rustdoc GUI test Since https://github.com/rust-lang/rust/pull/127010 was merged, let's see if we can revert https://github.com/rust-lang/rust/pull/126445... r? `@notriddle`
2024-07-01Ensure `out_of_scope_macro_calls` lint is registeredbeetrees-0/+7
2024-06-30Auto merge of #127026 - Urgau:cleanup-bootstrap-check-cfg, r=Kobzolbors-39/+4
Cleanup bootstrap check-cfg This PR cleanup many custom `check-cfg` in bootstrap that have been accumulated over the years. As well as updating some outdated comments.
2024-06-30Auto merge of #127174 - matthiaskrgr:rollup-q87j6cn, r=matthiaskrgrbors-346/+427
Rollup of 9 pull requests Successful merges: - #126018 (Remove the `box_pointers` lint.) - #126895 (Fix simd_gather documentation) - #126981 (Replace some magic booleans in match-lowering with enums) - #127038 (Update test comment) - #127053 (Update the LoongArch target documentation) - #127069 (small correction to fmt::Pointer impl) - #127157 (coverage: Avoid getting extra unexpansion info when we don't need it) - #127160 (Add a regression test for #123630) - #127161 (Improve `run-make-support` library `args` API) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-30Update ip_addr.rsDaniel Huang-2/+2
2024-06-30add `rustc_dump_def_parents` attributeBoxy-1/+217
2024-06-30Add a GVN test for 127089 that doesn't optimize to a constantScott McMurray-0/+52
2024-06-30Migrate tests to use `-Znext-solver`Deadbeef-428/+503
2024-06-30Make `feature(effects)` require `-Znext-solver`Deadbeef-0/+40
2024-06-30Rollup merge of #127161 - GuillaumeGomez:improve-run-make-args, r=KobzolMatthias Krüger-18/+15
Improve `run-make-support` library `args` API It allows to pass both `Vec` and slices, which makes it much better (for me at least :wink:). r? ``@Kobzol``
2024-06-30Rollup merge of #127160 - pacak:123630-test, r=NadrierilMatthias Krüger-0/+43
Add a regression test for #123630 Fixes #123630 compiler should not suggest nonsensical signatures, original suggestion was ``` error[E0308]: mismatched types --> src/lib.rs:3:31 | 3 | fn select<F, I>(filter: F) -> Select<F, I> { | ------ ^^^^^^^^^^^^ expected `Select<F, I>`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression | = note: expected struct `Select<F, I>` found unit type `()` error[E0282]: type annotations needed for `Select<{closure@src/lib.rs:8:22: 8:25}, I>` --> src/lib.rs:8:9 | 8 | let lit = select(|x| match x { | ^^^ | help: consider giving `lit` an explicit type, where the type for type parameter `I` is specified | 8 | let lit: Select<{closure@src/lib.rs:8:22: 8:25}, I> = select(|x| match x { | ++++++++++++++++++++++++++++++++++++++++++++ Some errors have detailed explanations: E0282, E0308. For more information about an error, try `rustc --explain E0282`. ```
2024-06-30Rollup merge of #127157 - Zalathar:unexpand, r=cjgillotMatthias Krüger-66/+68
coverage: Avoid getting extra unexpansion info when we don't need it Several callers of `unexpand_into_body_span_with_visible_macro` would immediately discard the additional macro-related information, which is wasteful. We can avoid this by having them instead call a simpler method that just returns the span they care about. This PR also moves the relevant functions out of `coverage::spans::from_mir` and into a new submodule `coverage::unexpand`, so that calling them from `coverage::mappings` is less awkward. There should be no actual changes to coverage-instrumentation output, as demonstrated by the absence of test updates.
2024-06-30Rollup merge of #127069 - Sky9x:fmt-pointer-use-addr, r=NilstriebMatthias Krüger-2/+1
small correction to fmt::Pointer impl ~~The `addr` method does not require `T: Sized`, and is preferred for use over `expose_provenance`.~~ `expose_provenance` does not require `T: Sized`.
2024-06-30Rollup merge of #127053 - xen0n:update-loong-docs, r=Nilstrieb,heiherMatthias Krüger-70/+125
Update the LoongArch target documentation The docs for the LoongArch targets are a bit dated since their introduction, and the prose has some room for improvement as well. Streamline a bit, referring to the neighboring targets' docs, and provide up-to-date information as much as I can come up with. cc fellow target maintainer `@heiher` for review of target-specific bits
2024-06-30Rollup merge of #127038 - BoxyUwU:reword_comment, r=camelidMatthias Krüger-10/+14
Update test comment r? `@camelid` Rewrote this comment since it mixed up a/b in one place and was generally a bit confusing
2024-06-30Rollup merge of #126981 - Zalathar:enums, r=NadrierilMatthias Krüger-52/+150
Replace some magic booleans in match-lowering with enums This PR takes some boolean arguments used by the match-lowering code, and replaces them with dedicated enums that more clearly express their effect, while also making it much easier to find how each value is ultimately used.
2024-06-30Rollup merge of #126895 - betelgeuse:improve_simd_gather_documentation, ↵Matthias Krüger-3/+0
r=Amanieu Fix simd_gather documentation There is no idx in the function signature.