Commit graph

1664 commits

Author SHA1 Message Date
Matthias Krüger
5fa914c13a
Rollup merge of #152134 - hoodmane:emscripten-crt-static-allow-dylibs, r=petrochenkov
Set crt_static_allow_dylibs to true for Emscripten target

And add a test. This is followup work to rust-lang/rust#151704. It introduced a regression where cargo is now unwilling to build cdylibs for Emscripten because `crt_static_default` is `true` but `crt_static_allows_dylibs` is `false`. Unfortunately the added test does not fail without the change because the validation logic is in Cargo, not in rustc. But it's good to have some coverage of this anyways.
2026-02-09 18:39:39 +01:00
Jonathan Brouwer
0ef518c946
Disable the run-make/translation test for now 2026-02-07 10:30:42 +01:00
bors
9f4b56a5ae Auto merge of #151739 - Zalathar:short-backtrace, r=fee1-dead
Use fewer intermediate functions for short backtraces in queries

If we make sure that `compute_fn` in the query's vtable is actually named `__rust_begin_short_backtrace`, we can avoid the need for some additional intermediate functions and stack frames.

This is similar to how the `get_query_incr` and `get_query_non_incr` functions are actually named `__rust_end_short_backtrace`.

---

Before/after comparison: https://github.com/rust-lang/rust/pull/151739#issuecomment-3815432527

---

- Earlier draft of this PR: https://github.com/rust-lang/rust/pull/151719
- Introduction of this backtrace-trimming: https://github.com/rust-lang/rust/pull/108938
2026-02-05 01:56:57 +00:00
Hood Chatham
bdf8d3b63f
Set crt_static_allow_dylibs to true for Emscripten target
And add a test. This is followup work to PR 151704. It introduced a regression where
cargo is now unwilling to build cdylibs for Emscripten because `crt_static_default` is
`true` but `crt_static_allows_dylibs` is `false`. Unfortunately the added test does not
fail without the change because the validation logic is in Cargo, not in rustc. But it's
good to have some coverage of this anyways.
2026-02-04 10:57:00 -08:00
Jonathan Brouwer
841c462eb0
Rollup merge of #151534 - davidtwco:destabilise-target-spec-json-again, r=chenyukang
target: fix destabilising target-spec-json

cc rust-lang/rust#151528

rust-lang/rust#150151 missed a case and didn't entirely destabilise target-spec-json - this patch corrects that.

Closes https://github.com/rust-lang/rust/issues/71009
2026-02-04 14:39:17 +01:00
Jonathan Brouwer
a1d588b35e
Rollup merge of #150992 - cezarbbb:cstyle-export-rules2, r=bjorn3,petrochenkov
link modifier `export-symbols`: export all global symbols from selected uptream c static libraries

In order to be able to export symbols from a specified upstream C static library, I redesigned a solution that, compared to a previous PR rust-lang/rust#150335 I submitted, will not have any extra symbols leaking out.

The following points should be noted:
 - This attribute will select and import the `Global` symbols of the first matching library it finds.
 - Developers should ensure that there are no libraries with the same name.
 - This modifier is only compatible with `static` linking kind
 - By default, upstream C static libraries will not export their `Global` symbols regardless of whether `LTO` optimization is enabled. However, after enabling this attribute, if the upstream C static library has `LTO` optimization enabled, the compiler will issue an error to inform the developer that the linked C library is invalid.

The test code is the same as the PR rust-lang/rust#150335.
Here are the results:
1. `cargo +include-libs rustc --release -- -L. -lstatic:+export-symbols=c_add`
(or you can use `#[link(name = "c_add", kind= "static", modifier = "+export-symbols")]` in the file)
```bash
                 U abort@GLIBC_2.2.5
                 U bcmp@GLIBC_2.2.5
0000000000014f60 T c_add
                 U calloc@GLIBC_2.2.5
                 U close@GLIBC_2.2.5
0000000000014f70 T c_sub
                 w __cxa_finalize@GLIBC_2.2.5
                 w __cxa_thread_atexit_impl@GLIBC_2.18
                 U dl_iterate_phdr@GLIBC_2.2.5
0000000000014ee0 T downstream_add
                 U __errno_location@GLIBC_2.2.5
                 U free@GLIBC_2.2.5
                 U fstat64@GLIBC_2.33
                 U getcwd@GLIBC_2.2.5
                 U getenv@GLIBC_2.2.5
                 w __gmon_start__
                 w _ITM_deregisterTMCloneTable
                 w _ITM_registerTMCloneTable
                 U lseek64@GLIBC_2.2.5
                 U malloc@GLIBC_2.2.5
                 U memcpy@GLIBC_2.14
                 U memmove@GLIBC_2.2.5
                 U memset@GLIBC_2.2.5
                 U mmap64@GLIBC_2.2.5
                 U munmap@GLIBC_2.2.5
                 U open64@GLIBC_2.2.5
                 U posix_memalign@GLIBC_2.2.5
                 U pthread_key_create@GLIBC_2.34
                 U pthread_key_delete@GLIBC_2.34
                 U pthread_setspecific@GLIBC_2.34
                 U read@GLIBC_2.2.5
                 U readlink@GLIBC_2.2.5
                 U realloc@GLIBC_2.2.5
                 U realpath@GLIBC_2.3
                 U stat64@GLIBC_2.33
                 w statx@GLIBC_2.28
                 U strlen@GLIBC_2.2.5
                 U syscall@GLIBC_2.2.5
                 U __tls_get_addr@GLIBC_2.3
                 U _Unwind_Backtrace@GCC_3.3
                 U _Unwind_DeleteException@GCC_3.0
                 U _Unwind_GetDataRelBase@GCC_3.0
                 U _Unwind_GetIP@GCC_3.0
                 U _Unwind_GetIPInfo@GCC_4.2.0
                 U _Unwind_GetLanguageSpecificData@GCC_3.0
                 U _Unwind_GetRegionStart@GCC_3.0
                 U _Unwind_GetTextRelBase@GCC_3.0
                 U _Unwind_RaiseException@GCC_3.0
                 U _Unwind_Resume@GCC_3.0
                 U _Unwind_SetGR@GCC_3.0
                 U _Unwind_SetIP@GCC_3.0
                 U write@GLIBC_2.2.5
                 U writev@GLIBC_2.2.5
```
3. `cargo +nightly rustc --release -- -L ./`
```bash
                 U abort@GLIBC_2.2.5
                 U bcmp@GLIBC_2.2.5
                 U calloc@GLIBC_2.2.5
                 U close@GLIBC_2.2.5
                 w __cxa_finalize@GLIBC_2.2.5
                 w __cxa_thread_atexit_impl@GLIBC_2.18
                 U dl_iterate_phdr@GLIBC_2.2.5
0000000000011e10 T downstream_add
                 U __errno_location@GLIBC_2.2.5
                 U free@GLIBC_2.2.5
                 U fstat64@GLIBC_2.33
                 U getcwd@GLIBC_2.2.5
                 U getenv@GLIBC_2.2.5
                 w gettid@GLIBC_2.30
                 w __gmon_start__
                 w _ITM_deregisterTMCloneTable
                 w _ITM_registerTMCloneTable
                 U lseek64@GLIBC_2.2.5
                 U malloc@GLIBC_2.2.5
                 U memcpy@GLIBC_2.14
                 U memmove@GLIBC_2.2.5
                 U memset@GLIBC_2.2.5
                 U mmap64@GLIBC_2.2.5
                 U munmap@GLIBC_2.2.5
                 U open64@GLIBC_2.2.5
                 U posix_memalign@GLIBC_2.2.5
                 U pthread_key_create@GLIBC_2.34
                 U pthread_key_delete@GLIBC_2.34
                 U pthread_setspecific@GLIBC_2.34
                 U read@GLIBC_2.2.5
                 U readlink@GLIBC_2.2.5
                 U realloc@GLIBC_2.2.5
                 U realpath@GLIBC_2.3
                 U stat64@GLIBC_2.33
                 w statx@GLIBC_2.28
                 U strlen@GLIBC_2.2.5
                 U syscall@GLIBC_2.2.5
                 U __tls_get_addr@GLIBC_2.3
                 U _Unwind_Backtrace@GCC_3.3
                 U _Unwind_GetDataRelBase@GCC_3.0
                 U _Unwind_GetIP@GCC_3.0
                 U _Unwind_GetIPInfo@GCC_4.2.0
                 U _Unwind_GetLanguageSpecificData@GCC_3.0
                 U _Unwind_GetRegionStart@GCC_3.0
                 U _Unwind_GetTextRelBase@GCC_3.0
                 U _Unwind_RaiseException@GCC_3.0
                 U _Unwind_Resume@GCC_3.0
                 U _Unwind_SetGR@GCC_3.0
                 U _Unwind_SetIP@GCC_3.0
                 U write@GLIBC_2.2.5
                 U writev@GLIBC_2.2.5
```

r? @bjorn3
2026-02-04 14:39:17 +01:00
Zalathar
2c89741a35 Overhaul tests/run-make/short-ice to make it easier to read 2026-02-04 23:41:48 +11:00
cezarbbb
dcdffe8d80 link modifier export-symbols: export all global symbols from selected uptream c static libraries 2026-02-04 09:26:21 +08:00
sgasho
6c4abb7fab Fix some autodiff tests require Clto=fat 2026-02-04 00:58:34 +09:00
yukang
dc48704f98 Fix ICE when parsing frontmatter without newline 2026-01-31 08:51:40 +00:00
theiz
a1893d3187 Add support for trait object types in type_info reflection 2026-01-27 19:49:09 -04:00
Stuart Cook
933e686e91
Rollup merge of #151137 - osiewicz:151090-checksum-freshness-binary-files, r=jdonszelmann
checksum-freshness: Fix invalid checksum calculation for binary files

Admittedly this is not the cleanest way to achieve this, but SourceMap is quite intertwined with source files being represented as Strings.
Tracking issue: https://github.com/rust-lang/cargo/issues/14136
Closes: rust-lang/rust#151090
2026-01-27 12:50:50 +11:00
David Wood
76b6623267
target: fix destabilising target-spec-json 2026-01-26 12:08:04 +00:00
Stuart Cook
e811f07736
Rollup merge of #151589 - Urgau:documentation-scope, r=GuillaumeGomez
Add a `documentation` remapping path scope for rustdoc usage

This PR adds a new remapping path scope for rustdoc usage: `documentation`, instead of rustdoc abusing the other scopes for it's usage.

Like remapping paths in rustdoc, this scope is unstable. (rustdoc doesn't even have yet an equivalent to [rustc `--remap-path-scope`](https://doc.rust-lang.org/nightly/rustc/remap-source-paths.html#--remap-path-scope)).

I also took the opportunity to add a bit of documentation in rustdoc book.
2026-01-26 14:36:22 +11:00
Urgau
91e3e2a37f Add the remapping path documentation scope for rustdoc usage 2026-01-24 15:33:21 +01:00
Jonathan Brouwer
db8b9ecb5c
Rollup merge of #151517 - paradoxicalguy:enable-debuginfo-tests-linux, r=Kobzol
Enable reproducible binary builds with debuginfo on Linux

Fixes rust-lang/rust#89911

This PR enables `-Cdebuginfo=2` for binary crate types in the `reproducible-build` run-make test on Linux platforms.

- Removed the `!matches!(crate_type, CrateType::Bin)` check in `diff_dir_test()`
- SHA256 hashes match: `932be0d950f4ffae62451f7b4c8391eb458a68583feb11193dd501551b6201d4`

This scenario was previously disabled due to rust-lang/rust#89911. I have verified locally on Linux (WSL) with LLVM 21 that the regression reported in that issue appears to be resolved, and the tests now pass with debug info enabled.
2026-01-24 08:18:06 +01:00
abhinav srivastav
1e8ffd9ce5
Removed comment on reproducibility issue #89911
Removed comment about reproducibility failures with crate type `bin` and `-Cdebuginfo=2` on non windows machines 
issue #89911
2026-01-23 13:10:21 +05:30
paradoxicalguy
ff9c5cfd28 Enable reproducible binary builds with debuginfo on Linux 2026-01-22 22:37:29 +00:00
bors
39052daf93 Auto merge of #149440 - chenyukang:yukang/issue-149402, r=fee1-dead
Remove suggestion from importing unstable items on stable channel

Fixes rust-lang/rust#149402
2026-01-22 18:09:51 +00:00
Guillaume Gomez
1832bdfe64
Rollup merge of #147611 - stablize-remap-path-scope, r=davidtwco
Stabilize `-Zremap-path-scope`

# Stabilization report of `--remap-path-scope`

## Summary

RFC 3127 trim-paths aims to improve the current status of sanitizing paths emitted by the compiler via the `--remap-path-prefix=FROM=TO` command line flag, by offering a profile setting named `trim-paths` in Cargo to sanitize absolute paths introduced during compilation that may be embedded in the compiled binary executable or library.

As part of that RFC the compiler was asked to add the `--remap-path-scope` command-line flag to control the scoping of how paths get remapped in the resulting binary.

Tracking:

- https://github.com/rust-lang/rust/issues/111540

### What is stabilized

The rustc `--remap-path-scope` flag is being stabilized by this PR. It defines which scopes of paths should be remapped by `--remap-path-prefix`.

This flag accepts a comma-separated list of values and may be specified multiple times, in which case the scopes are aggregated together.

The valid scopes are:

- `macro` - apply remappings to the expansion of `std::file!()` macro. This is where paths in embedded panic messages come from
- `diagnostics` - apply remappings to printed compiler diagnostics
- `debuginfo` - apply remappings to debug informations
- `coverage` - apply remappings to coverage informations
- `object` - apply remappings to all paths in compiled executables or libraries, but not elsewhere. Currently an alias for `macro,coverage,debuginfo`.
- `all` (default) - an alias for all of the above, also equivalent to supplying only `--remap-path-prefix` without `--remap-path-scope`.

#### Example

```sh
# With `object` scope only the build outputs will be remapped, the diagnostics won't be remapped.
rustc --remap-path-prefix=$(PWD)=/remapped --remap-path-scope=object main.rs
```

### What isn't stabilized

None of the Cargo facility is being stabilized in this stabilization PR, only the `--remap-path-scope` flag in `rustc` is being stabilized.

## Design

### RFC history

- [RFC3127 - trim-paths](https://rust-lang.github.io/rfcs/3127-trim-paths.html)

### Answers to unresolved questions

> What questions were left unresolved by the RFC? How have they been answered? Link to any relevant lang decisions.

There are no unresolved questions regarding `--remap-path-scope`.

(The tracking issue list a bunch of unresolved questions but they are for `--remap-path-prefix` or the bigger picture `trim-paths` in Cargo and are not related the functionality provided by `--remap-path-scope`.)

### Post-RFC changes

The RFC described more scopes, in particularly regarding split debuginfo. Those scopes where removed after analysis by `michaelwoerister` of all the possible combinations in https://github.com/rust-lang/rust/issues/111540#issuecomment-1994010274.

### Nightly extensions

There are no nightly extensions.

### Doors closed

We are committing to having to having a flag that control which paths are being remapped based on a "scope".

## Feedback

### Call for testing

> Has a "call for testing" been done? If so, what feedback was received?

No call for testing has been done per se but feedback has been received on both the rust-lang/rust and rust-lang/cargo tracking issue.

The feedback was mainly related to deficiencies in *our best-effort* `--remap-path-prefix` implementation, in particular regarding linkers added paths, which does not change anything for `--remap-path-scope`.

### Nightly use

> Do any known nightly users use this feature? Counting instances of `#![feature(FEATURE_NAME)]` on GitHub with grep might be informative.

Except for Cargo unstable `trim-paths` there doesn't appear any committed use [on GitHub](https://github.com/search?q=%22--remap-path-scope%22+NOT+path%3A%2F%5Esrc%5C%2Fcargo%5C%2Fcore%5C%2Fcompiler%5C%2F%2F+NOT+path%3A%2F%5Etext%5C%2F%2F+NOT+path%3A%2F%5Erust%5C%2Fsrc%5C%2Fdoc%5C%2Funstable-book%5C%2Fsrc%5C%2Fcompiler-flags%5C%2F%2F+NOT+path%3A%2F%5Esrc%5C%2Fdoc%5C%2Funstable-book%5C%2Fsrc%5C%2Fcompiler-flags%5C%2F%2F+NOT+path%3A%2F%5Ecollector%5C%2Fcompile-benchmarks%5C%2Fcargo-0%5C.87%5C.1%5C%2Fsrc%5C%2Fcargo%5C%2Fcore%5C%2Fcompiler%5C%2F%2F&type=code).

## Implementation

### Major parts

- b3f8586fb1/compiler/rustc_session/src/config.rs (L1373-L1384)
- b3f8586fb1/compiler/rustc_session/src/session.rs (L1526)
- b3f8586fb1/compiler/rustc_span/src/lib.rs (L352-L372)

### Coverage

- [`tests/run-make/split-debuginfo/rmake.rs`](9725c4baac/tests/run-make/split-debuginfo/rmake.rs (L7))
- [`tests/ui/errors/remap-path-prefix.rs`](9725c4baac/tests/ui/errors/remap-path-prefix.rs (L4))
- [`tests/ui/errors/remap-path-prefix-macro.rs`](9725c4baac/tests/ui/errors/remap-path-prefix-macro.rs (L1-L4))
- [`tests/run-make/remap-path-prefix-dwarf/rmake.rs
`](9725c4baac/tests/run-make/remap-path-prefix-dwarf/rmake.rs)
- [`tests/run-make/remap-path-prefix/rmake.rs`](9725c4baac/tests/run-make/remap-path-prefix/rmake.rs)
- [`tests/ui/errors/remap-path-prefix-diagnostics.rs`](9725c4baac/tests/ui/errors/remap-path-prefix-diagnostics.rs)

### Outstanding bugs

> What outstanding bugs involve this feature? List them. Should any block the stabilization? Discuss why or why not.

There are no outstanding bugs regarding `--remap-path-scope`.

### Outstanding FIXMEs

> What FIXMEs are still in the code for that feature and why is it OK to leave them there?

There are no FIXME regarding `--remap-path-scope` in it-self.

### Tool changes

> What changes must be made to our other tools to support this feature. Has this work been done? Link to any relevant PRs and issues.

- rustdoc (both JSON, HTML and doctest)
  - `rustdoc` has support for `--remap-path-prefix`, it should probably also get support for `--remap-path-scope`, although rustdoc maybe want to adapt the scopes for it's use (replace `debuginfo` with `documentation` for example).

## History

> List issues and PRs that are important for understanding how we got here.

- https://github.com/rust-lang/rust/pull/115214
- https://github.com/rust-lang/rust/pull/122450
- https://github.com/rust-lang/rust/pull/139550
- https://github.com/rust-lang/rust/pull/140716

## Acknowledgments

> Summarize contributors to the feature by name for recognition and so that those people are notified about the stabilization. Does anyone who worked on this *not* think it should be stabilized right now? We'd like to hear about that if so.

- @cbeuw
- @michaelwoerister
- @weihanglo
- @Urgau

@rustbot labels +T-compiler +needs-fcp +F-trim-paths
r? @davidtwco
2026-01-20 14:36:30 +01:00
Jonathan Brouwer
05d494faaf
Rollup merge of #150767 - all-help, r=jieyouxu
Allow invoking all help options at once

Implements rust-lang/rust#150442

Help messages are printed in the order they are invoked, but only once (e.g. `--help -C help --help` prints regular help then codegen help).

Lint groups (`-Whelp`) are always printed last due to necessarily coming later in the compiler pipeline.

Adds `help` flags to `-C` and `-Z` to avoid an error in `build_session_options`.

cc @bjorn3 [#t-compiler/major changes > Allow combining `--help -C help -Z help -… compiler-team#954 @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/233931-t-compiler.2Fmajor-changes/topic/Allow.20combining.20.60--help.20-C.20help.20-Z.20help.20-.E2.80.A6.20compiler-team.23954/near/564358190) - this currently maintains the behaviour of unrecognized options always failing-fast, as this happens within `getopt`s parsing, before we can even check if help options are present.
2026-01-18 18:26:03 +01:00
yukang
c578560177 Surpress suggestion from unstable items on stable channel 2026-01-18 20:01:50 +08:00
Jieyou Xu
8dfb888812
Disable dump-ice-to-disk on i686-pc-windows-msvc
Sometimes the middle frames of the ICE backtrace becomes `<unknown>` on
`i686-pc-windows-msvc` which then makes this test flaky.
2026-01-16 09:27:45 +08:00
Piotr Osiewicz
a1a944880f checksum-freshness: Add binary file inclusion to integration test 2026-01-14 21:16:54 +01:00
Jonathan Brouwer
cbcd1c3eef
Rollup merge of #151036 - issue-151026, r=mati865
Better handle when trying to iterate on a `Range` of a type that isn't `Step`

Mention when a trait bound corresponds to an unstable trait.

Mention `Range` when `Step` bound is unment, and explain that only some std types impl `Iterator` for `Range`.

CC rust-lang/rust#151026
2026-01-14 11:05:40 +01:00
Guillaume Gomez
080c7043c1
Rollup merge of #150840 - print-check-cfg-rework-output, r=nnethercote
Make `--print=check-cfg` output compatible `--check-cfg` arguments

This PR changes significantly the output of the unstable `--print=check-cfg` option.

Specifically it removes the ad-hoc resemblance with `--print=cfg` in order to output a simplified but still compatible `--check-cfg` arguments.

The goal is to future proof the output of `--print=check-cfg` like `--check-cfg` is, and the best way to do that is to use it's syntax.

This is particularly relevant for [RFC3905](https://github.com/rust-lang/rfcs/pull/3905) which wants to introduce a new predicate: `version(...)`.
2026-01-13 23:39:09 +01:00
Esteban Küber
1fe705ca70 Mention the type in the label, to avoid confusion at the cost of redundancy 2026-01-13 19:47:06 +00:00
bors
db1484bdee Auto merge of #151051 - JonathanBrouwer:rollup-SuaGLmP, r=JonathanBrouwer
Rollup of 14 pull requests

Successful merges:

 - rust-lang/rust#150151 (Destabilise `target-spec-json`)
 - rust-lang/rust#150826 (Add `f16` inline ASM support for s390x)
 - rust-lang/rust#150883 (Improve span for "unresolved intra doc link" on `deprecated` attribute)
 - rust-lang/rust#150934 (Move some checks from `check_doc_attrs` directly into `rustc_attr_parsing`)
 - rust-lang/rust#150943 (Port `#[must_not_suspend]` to attribute parser)
 - rust-lang/rust#150990 (std: sys: net: uefi: Make TcpStream Send)
 - rust-lang/rust#150995 (core: ptr: split_at_mut: fix typo in safety doc)
 - rust-lang/rust#150998 (Relax test expectation for @__llvm_profile_runtime_user)
 - rust-lang/rust#151002 (Remove a workaround for a bug (take 2))
 - rust-lang/rust#151005 (Fix typo in `MaybeUninit` docs)
 - rust-lang/rust#151011 (Update books)
 - rust-lang/rust#151029 (rustc-dev-guide subtree update)
 - rust-lang/rust#151032 (fix: added missing backtick in triagebot.toml)
 - rust-lang/rust#151035 (Don't suggest replacing closure parameter with type name)

r? @ghost
2026-01-13 10:47:20 +00:00
Jonathan Brouwer
a89683dd95
Rollup merge of #150151 - destabilise-target-spec-json, r=Kivooeo
Destabilise `target-spec-json`

Per rust-lang/compiler-team#944:

> Per https://github.com/rust-lang/rust/issues/71009, the ability to load target spec JSONs was stabilised accidentally. Within the team, we've always considered the format to be unstable and have changed it freely. This has been feasible as custom targets can only be used with core, like any other target, and so custom targets de-facto require nightly to be used (i.e. to build core manually or use Cargo's -Zbuild-std).
>
> Current build-std RFCs (https://github.com/rust-lang/rfcs/pull/3873, https://github.com/rust-lang/rfcs/pull/3874) propose a mechanism for building core on stable (at the request of Rust for Linux), which combined with a stable target-spec-json format, permit the current format to be used much more widely on stable toolchains. This would prevent us from improving the format - making it less tied to LLVM, switching to TOML, enabling keys in the spec to be stabilised individually, etc.
>
> De-stabilising the format gives us the opportunity to improve the format before it is too challenging to do so. Internal company toolchains and projects like Rust for Linux already use target-spec-json, but must use nightly at some point while doing so, so while it could be inconvenient for those users to destabilise this, it is hoped that an minimal alternative that we could choose to stabilise can be proposed relatively quickly.
2026-01-13 09:01:29 +01:00
Esteban Küber
9b7f612d44 Update main label 2026-01-13 02:57:40 +00:00
Esteban Küber
47089856ab Update run-make test output 2026-01-13 02:14:31 +00:00
Urgau
feb44c3f48 Make --print=check-cfg output compatible --check-cfg arguments 2026-01-12 23:46:22 +01:00
Akshit Gaur
e03cb1f0a6
run-make-support: resolve .rmeta companion for .rlib stubs
Add .rmeta resolution for run-make/sysroot-crates-are-unstable test
2026-01-12 10:52:14 +01:00
Jamie Hill-Daniel
e834e60987 Test behavior of --help --invalid-flag 2026-01-07 16:56:59 +00:00
Jamie Hill-Daniel
4909fd8c77 Add tests for invoking multiple help options at once 2026-01-07 16:56:54 +00:00
Jieyou Xu
dd948f96f3
Thread --jobs from bootstrap -> compiletest -> run-make-support 2026-01-06 14:51:51 +08:00
Matthias Krüger
78376fd39c
Rollup merge of #150558 - estebank:multiple-dep-versions, r=jieyouxu
Detect cases where `?` is applied on a type that could be coming from a different crate version than expected

```
error[E0277]: `?` couldn't convert the error to `dependency::Error`
  --> replaced
   |
LL | fn main() -> Result<(), Error> {
   |              ----------------- expected `dependency::Error` because of this
...
LL |     Err(Error2)?;
   |     -----------^ the trait `From<Error2>` is not implemented for `dependency::Error`
   |     |
   |     this can't be annotated with `?` because it has type `Result<_, Error2>`
   |
   = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
help: the trait `From<Error2>` is not implemented for `dependency::Error`
      but trait `From<()>` is implemented for it
  --> replaced
   |
LL | impl From<()> for Error {
   | ^^^^^^^^^^^^^^^^^^^^^^^
   = help: for that trait implementation, expected `()`, found `Error2`
   = note: there are multiple different versions of crate `dependency` in the dependency graph
   = help: you can use `cargo tree` to explore your dependency tree
```

The existing checks rely on having access to the actual types/traits that diverged to detect they are called the same, come from different crates with the same name. The new check is less specific, merely looking to see if the crate name the involved type belongs has multiple crates.

CC rust-lang/rust#78552.
2026-01-03 10:09:29 +01:00
Esteban Küber
22bb4fe147 Detect cases where ? is applied on a type that could be coming from a different crate version than expected
```
error[E0277]: `?` couldn't convert the error to `dependency::Error`
  --> replaced
   |
LL | fn main() -> Result<(), Error> {
   |              ----------------- expected `dependency::Error` because of this
...
LL |     Err(Error2)?;
   |     -----------^ the trait `From<Error2>` is not implemented for `dependency::Error`
   |     |
   |     this can't be annotated with `?` because it has type `Result<_, Error2>`
   |
   = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
help: the trait `From<Error2>` is not implemented for `dependency::Error`
      but trait `From<()>` is implemented for it
  --> replaced
   |
LL | impl From<()> for Error {
   | ^^^^^^^^^^^^^^^^^^^^^^^
   = help: for that trait implementation, expected `()`, found `Error2`
   = note: there are multiple different versions of crate `dependency` in the dependency graph
   = help: you can use `cargo tree` to explore your dependency tree
```

The existing checks rely on having access to the actual types/traits that diverged to detect they are called the same, come from different crates with the same name. The new check is less specific, merely looking to see if the crate name the involved type belongs has multiple crates.
2025-12-31 23:40:16 +00:00
bjorn3
1a4e7f9aa9 Use --print target-libdir in run-make tests
This makes the tests more robust against sysroot layout changes and
slightly simplifies them.
2025-12-31 15:15:28 +00:00
Jonathan Brouwer
77fe25a741
Rollup merge of #150311 - ChrisDenton:no-temp, r=Kivooeo
Avoid using env::temp when linking a binary

This keeps all build artefacts (even temporary ones) within the build directory.

Fixes rust-lang/rust#139963
2025-12-24 14:19:22 +01:00
Chris Denton
6e354544bf
Rename invalid-tmpdir-env-var
to invalid-tmpdir-no-ice
2025-12-24 06:41:44 +00:00
Chris Denton
b5c473e414
Avoid using env::temp when linking a binary
This keeps all build artefacts (even temporary ones) within the build directory.
2025-12-24 06:41:42 +00:00
bors
efa32de15b Auto merge of #150283 - Urgau:remap-debuginfo-absolute, r=jieyouxu
Remap both absolute and relative paths when building `rustc` and `std`

Turns out [#150110](https://github.com/rust-lang/rust/issues/150110) didn't work as expected, because when the standard library sources are present, we [helpfully un-remap the paths](e951f470d7/compiler/rustc_metadata/src/rmeta/decoder.rs (L1656-L1702)) to the local directory of the user, including when we are building the compiler and standard library it-self (duh!), and since those paths are absolute (not relative), our purely relative remapping didn't pick them up.

This behavior wasn't a issue before because the un-remap logic immediately tries to remap them again, and since we had the absolute remapping we would just remap them to the the same thing.

To fix that issue I've adjusted our remapping to remap both the absolute and relative paths when building `rustc` and `std`, as well as added a run-make to make sure we don't regress it again (with a new `needs-std-remap-debuginfo` directive).

r? `@jieyouxu`
2025-12-24 06:23:00 +00:00
Tshepang Mbambo
e7965821e8 use new term in description of --target 2025-12-23 23:35:58 +02:00
Urgau
4d839da22b Remap both absolute and relative paths when building rustc and std 2025-12-22 19:44:13 +01:00
bors
d3f16d2f35 Auto merge of #149437 - ilammy:patch-1, r=Mark-Simulacrum
Fix trailing newline in JUnit formatter

`write_message()` expects messages to contain no newlines.

Fixes https://github.com/rust-lang/rust/issues/149436
2025-12-21 10:37:51 +00:00
David Wood
6c4c4384e8
destabilise target-spec-json 2025-12-19 11:57:34 +00:00
Oleksii Lozovskyi
a8f4a6744c rustdoc: Test only in stage2
stage1's rustdoc is using stage0's libtest which does not have
a fix from 069cf9dfc9, making the test run fail. Ensure that
this test is executed with everything recompiled in stage2.
2025-12-16 21:10:29 +09:00
Matthias Krüger
3e412faa66
Rollup merge of #149994 - Flakebi:amdgpu-vectors, r=jieyouxu
Allow vector types for amdgpu

The amdgpu target uses vector types in various places. The vector types can be used on all architectures, there is no associated target feature that needs to be enabled.

The largest vector type found in LLVM intrinsics is `v32i32` (`[32 x i32]`) for mfma intrinsics. Note that while this intrinsic is only supported on some architectures, the vector type itself is supported on all architectures.

Tracking issue: rust-lang/rust#135024

(I used an empty string to say “does not need a target feature”. If you prefer an `Option` or something like that, I’ll change it.)
2025-12-15 08:08:04 +01:00
Matthias Krüger
98f87362d9
Rollup merge of #149969 - jyn514:ibt, r=jieyouxu
don't use no_main and no_core to test IBT

The previous test was quite fragile and depended on a bunch of internal features. Simplify it.

Split out of https://github.com/rust-lang/rust/pull/149937.

cc ```@jieyouxu``` ```@Oneirical```
2025-12-14 20:04:57 +01:00