Commit Graph

280338 Commits

Author SHA1 Message Date
许杰友 Jieyou Xu (Joe)
4f35eb305b tests: add a missing needs-symlink 2025-02-07 01:41:54 +08:00
bors
2f92f050e8 Auto merge of - safinaskar:parallel, r=SparrowLii
tree-wide: parallel: Fully removed all `Lrc`, replaced with `Arc`

tree-wide: parallel: Fully removed all `Lrc`, replaced with `Arc`

This is continuation of https://github.com/rust-lang/rust/pull/132282 .

I'm pretty sure I did everything right. In particular, I searched all occurrences of `Lrc` in submodules and made sure that they don't need replacement.

There are other possibilities, through.

We can define `enum Lrc<T> { Rc(Rc<T>), Arc(Arc<T>) }`. Or we can make `Lrc` a union and on every clone we can read from special thread-local variable. Or we can add a generic parameter to `Lrc` and, yes, this parameter will be everywhere across all codebase.

So, if you think we should take some alternative approach, then don't merge this PR. But if it is decided to stick with `Arc`, then, please, merge.

cc "Parallel Rustc Front-end" ( https://github.com/rust-lang/rust/issues/113349 )

r? SparrowLii

`@rustbot` label WG-compiler-parallel
2025-02-06 10:50:05 +00:00
bors
59588250ad Auto merge of - workingjubilee:rollup-ry6rw0m, r=workingjubilee
Rollup of 13 pull requests

Successful merges:

 -  (Avoid using make_direct_deprecated() in extern "ptx-kernel")
 -  (Pass spans around new solver)
 -  (Fix `rustc_hidden_type_of_opaques` for RPITITs with no default body)
 -  (Document minimum supported host tooling on macOS)
 -  (Clean up `Trivial*Impls` macros)
 -  (Fix link in from_fn.rs)
 -  (Document why some "type mismatches" exist)
 -  (Only highlight unmatchable parameters at the definition site)
 -  (Update browser-ui-test version to `0.20.2`)
 -  (Implement RustcInternal for RawPtrKind)
 -  (Add `rustc_hir_pretty::expr_to_string` function)
 -  (Fix `unreachable_pub` lint for hermit target)
 -  (cg_llvm: Remove the `mod llvm_` hack, which should no longer be necessary)

Failed merges:

 -  (compiler: Clean up weird `rustc_abi` reexports)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-02-06 06:45:07 +00:00
Jubilee
c549268a4a
Rollup merge of - Zalathar:llvm-underscore, r=workingjubilee
cg_llvm: Remove the `mod llvm_` hack, which should no longer be necessary

This re-export was introduced in c76fc3d804, as a workaround for .

In short, there was/is an assumption in some LLVM LTO code that symbol names would not contain `.llvm.`, but legacy symbol mangling would naturally produce that sequence for symbols in a module named `llvm`.

This was later “fixed” by adding a special case to the legacy symbol mangler in , which detects the sequence `llvm` and emits the `m` in an escaped form. As a result, there should no longer be any need to avoid the module name `llvm` in the compiler itself.

(Symbol mangling v0 avoids this problem by not using `.` in the first place, outside of the “vendor-specific suffix”.)
2025-02-05 19:53:54 -08:00
Jubilee
a21c31beca
Rollup merge of - thaliaarchi:hermit-unreachable-pub, r=Noratrieb
Fix `unreachable_pub` lint for hermit target

The build for the hermit target (`#[cfg(target_os = "hermit")]`) fails on master as of [8df89d1cb0](8df89d1cb0) (2025-02-05), due to introducing `#[warn(unreachable_pub)]` at the root in https://github.com/rust-lang/rust/pull/134286 (Enable unreachable_pub lint in core, merged 2025-01-20).

Make the relevant visibility modifiers more specific to resolve the warning.

```
$ ./x build --target x86_64-unknown-hermit
Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.34s
Building stage0 library artifacts (x86_64-apple-darwin)
    Finished `release` profile [optimized] target(s) in 0.15s
Building compiler artifacts (stage0 -> stage1, x86_64-apple-darwin)
    Finished `release` profile [optimized] target(s) in 1.67s
Creating a sysroot for stage1 compiler (use `rustup toolchain link 'name' build/host/stage1`)
Building stage1 library artifacts {alloc, core, panic_abort, panic_unwind, proc_macro, std, sysroot, test, unwind} (x86_64-apple-darwin -> x86_64-unknown-hermit)
   Compiling panic_unwind v0.0.0 (library/panic_unwind)
error: unreachable `pub` item
  --> library/panic_unwind/src/hermit.rs:10:9
   |
10 |         pub fn __rust_abort() -> !;
   |         ---^^^^^^^^^^^^^^^^^^^^^^^^
   |         |
   |         help: consider restricting its visibility: `pub(crate)`
   |
   = help: or consider exporting it for use by other crates
   = note: `-D unreachable-pub` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(unreachable_pub)]`

error: unreachable `pub` item
  --> library/panic_unwind/src/hermit.rs:17:9
   |
17 |         pub fn __rust_abort() -> !;
   |         ---^^^^^^^^^^^^^^^^^^^^^^^^
   |         |
   |         help: consider restricting its visibility: `pub(crate)`
   |
   = help: or consider exporting it for use by other crates

error: could not compile `panic_unwind` (lib) due to 2 previous errors
Build completed unsuccessfully in 0:00:39
```
2025-02-05 19:53:54 -08:00
Jubilee
d116ac4b0e
Rollup merge of - GuillaumeGomez:expr-to-string, r=Urgau
Add `rustc_hir_pretty::expr_to_string` function

It'll allow me to work on a new rustdoc feature. :)

r? `@Urgau`
2025-02-05 19:53:53 -08:00
Jubilee
a9d4b013a2
Rollup merge of - carolynzech:raw-ptr-kind-internal, r=compiler-errors
Implement RustcInternal for RawPtrKind

Implement `RustcInternal` for `RawPtrKind`. https://github.com/rust-lang/rust/pull/135748 introduced a `Stable` implementation [here](https://github.com/rust-lang/rust/pull/135748/files#diff-60f5e8edf69e04e89ef0c7f576363a91fa141e1db969484cef00063ed39c62e4R235).
2025-02-05 19:53:52 -08:00
Jubilee
393f2cd419
Rollup merge of - GuillaumeGomez:update-gui-tests, r=notriddle
Update browser-ui-test version to `0.20.2`

r? `@notriddle`
2025-02-05 19:53:51 -08:00
Jubilee
736f902581
Rollup merge of - Jarcho:fn_ctxt2, r=compiler-errors
Only highlight unmatchable parameters at the definition site

Followup to 

This generally results more focused messages in the same vein as  (see `test/ui/argument-suggestions/complex.rs`). There are still some cases (e.g. `test/ui/argument-suggestions/permuted_arguments.rs`) where it might be worth highlighting the arguments. This is mitigated by the fact that a suggestion with a suggested rearrangement is given.

r? `@compiler-errors`
2025-02-05 19:53:51 -08:00
Jubilee
ffa67f9c44
Rollup merge of - oli-obk:document-literal-at-wrong-type-reason, r=compiler-errors
Document why some "type mismatches" exist

Just something I stumbled over and thought to save myself (and maybe others) the research time when encountering it again.
2025-02-05 19:53:50 -08:00
Jubilee
8964e70051
Rollup merge of - hkBst:patch-1, r=scottmcm
Fix link in from_fn.rs
2025-02-05 19:53:49 -08:00
Jubilee
854a710fca
Rollup merge of - nnethercote:clean-up-Trivials, r=lcnr
Clean up `Trivial*Impls` macros

They're currently quite messy. Details in the individual commit logs.

r? `@lcnr`
2025-02-05 19:53:48 -08:00
Jubilee
45398fc04a
Rollup merge of - madsmtm:apple-host-tooling, r=jieyouxu
Document minimum supported host tooling on macOS

In particular we support macOS 10.12 (same as for binaries produced by `rustc`) and Xcode 9.2 (the highest Xcode version that runs on macOS 10.12.6). I have this installed on a MacBook Pro from 2013 that sits below my desk, and am occasionally testing it.

I am documenting this now because it was unclear in https://github.com/rust-lang/rust/issues/136523.

(I'm not inherently against bumping these one day, but that's a separate discussion, let's at least document what we support right now).

`@rustbot` label O-macos
2025-02-05 19:53:47 -08:00
Jubilee
1361ef37ff
Rollup merge of - compiler-errors:rpitit-empty-body, r=oli-obk
Fix `rustc_hidden_type_of_opaques` for RPITITs with no default body

Needed this when debugging something
2025-02-05 19:53:47 -08:00
Jubilee
b9bacc4da5
Rollup merge of - compiler-errors:spanned, r=lcnr
Pass spans around new solver

...so that when we instantiate canonical responses, we can actually have region obligations with the right span.

Within the solver itself, we still use dummy spans everywhere.
2025-02-05 19:53:46 -08:00
Jubilee
cc0f3efe7b
Rollup merge of - bjorn3:fix_ptx_kernel_abi, r=wesleywiser
Avoid using make_direct_deprecated() in extern "ptx-kernel"

This method will be removed in the future as it produces a broken ABI that depends on cg_llvm implementation details. After this PR wasm32-unknown-unknown is the only remaining user of make_direct_deprecated().

Fixes https://github.com/rust-lang/rust/issues/117271
Blocks https://github.com/rust-lang/rust/issues/38788
2025-02-05 19:53:45 -08:00
bors
c753cb9b42 Auto merge of - TDecking:mul_hi, r=Mark-Simulacrum
Use `widening_mul` instead of a separate function

A helper function became obsolete after `widening_mul` became available for `u128` values.
2025-02-06 03:43:58 +00:00
Nicholas Nethercote
d282a67d58 Fix whitespace in lift macros.
This has been bugging me for some time.
2025-02-06 13:35:01 +11:00
Nicholas Nethercote
d28678e621 Clean up trivial traversal/lift impl generator macro calls.
We have four macros for generating trivial traversal (fold/visit) and
lift impls.
- `rustc_ir::TrivialTypeTraversalImpls`
- `rustc_middle::TrivialTypeTraversalImpls`
- `rustc_middle::TrivialLiftImpls`
- `rustc_middle::TrivialTypeTraversalAndLiftImpls`

The first two are very similar. The last one just combines the second
and third one.

The macros themselves are ok, but their use is a mess. This commit does
the following.
- Removes types that no longer need a lift and/or traversal impl from
  the macro calls.
- Consolidates the macro calls into the smallest number of calls
  possible, with each one mentioning as many types as possible.
- Orders the types within those macro calls alphabetically, and makes
  the module qualification more consistent.
- Eliminates `rustc_middle::mir::type_foldable`, because the macro calls
  were merged and the manual `TypeFoldable` impls are better placed in
  `structural_impls.rs`, alongside all the other ones.

This makes the code more concise. Moving forward, it also makes it more
obvious where new types should be added.
2025-02-06 13:31:43 +11:00
Zalathar
042fd8c24a Remove some unused glob re-exports
These were detected by temporarily making `mod llvm` non-public.
2025-02-06 12:10:45 +11:00
Zalathar
65d7e6937b Remove the mod llvm_ hack, which should no longer be necessary 2025-02-06 12:10:42 +11:00
bors
30865107cb Auto merge of - notriddle:notriddle/clean-up, r=fmease
rustdoc: use ThinVec for generic arg parts

This reduces the size of both these args, and of path segments, so should measurably help with memory use.
2025-02-06 00:53:53 +00:00
bors
6741521dc4 Auto merge of - jieyouxu:rollup-mtyaisw, r=jieyouxu
Rollup of 12 pull requests

Successful merges:

 -  (cg_gcc: Directly use rustc_abi instead of reexports)
 -  (tests: Port `split-debuginfo` to rmake.rs)
 -  (Make cenum_impl_drop_cast a hard error)
 -  (Use +secure-plt for powerpc-unknown-linux-gnu{,spe})
 -  (Reject negative literals for unsigned or char types in pattern ranges and literals)
 -  (uefi: process: Add support for command environment variables)
 -  (std: move network code into `sys`)
 -  (implement inherent str constructors)
 -  (Rename and Move some UI tests to more suitable subdirs)
 -  (Update `compiler-builtins` to 0.1.145)
 -  (Rename `slice::take...` methods to `split_off...`)
 -  (Arbitrary self types v2: recursion test)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-02-05 21:17:26 +00:00
Michael Goulet
4e763c2297 Pass spans around new solver 2025-02-05 18:32:06 +00:00
bors
a9730c3b5f Auto merge of - notriddle:notriddle/aot-minify, r=GuillaumeGomez
rustdoc: run css and html minifier at build instead of runtime

This way, adding a bunch of comments to the JS files won't make rustdoc slower.

Meant to address https://github.com/rust-lang/rust/pull/136161#issuecomment-2622069453
2025-02-05 18:28:16 +00:00
Michael Goulet
fd1110ce6a Remove span from delegate 2025-02-05 18:18:11 +00:00
Guillaume Gomez
504ea670ae Add rustc_hir_pretty::expr_to_string function 2025-02-05 18:25:33 +01:00
Carolyn Zech
3b54faba15 Implement RustcInternal for RawPtrKind 2025-02-05 11:32:19 -05:00
Guillaume Gomez
d92d9f837b Update browser-ui-test version to 0.20.2 2025-02-05 17:06:38 +01:00
Jason Newcomb
4718cb40ec When displaying a parameter mismatch error, only highlight the mismatched parameters when showing the definition. 2025-02-05 10:36:32 -05:00
bors
d4bdd1ed55 Auto merge of - oli-obk:push-vvqmwzunxsrk, r=compiler-errors
Avoid calling the layout_of query in lit_to_const

We got all the information available locally
2025-02-05 15:10:28 +00:00
许杰友 Jieyou Xu (Joe)
eeef079a30
Rollup merge of - adetaylor:test-for-recursion, r=oli-obk
Arbitrary self types v2: recursion test

Add a test for infinite recursion of an arbitrary self type.

These diagnostics aren't perfect (especially the repetition of the statement that there's too much recursion) but for now at least let's add a test to confirm that such diagnostics are emitted.

As suggested by ```@oli-obk```

Relates to 

r? ```@wesleywiser```
2025-02-05 19:09:39 +08:00
许杰友 Jieyou Xu (Joe)
fd4623bdcc
Rollup merge of - cramertj:split_off, r=dtolnay
Rename `slice::take...` methods to `split_off...`

This rename was discussed and recommended in a recent t-libs meeting.

cc https://github.com/rust-lang/rust/issues/62280

There's an additional commit here which modifies internals of unstable `OneSidedRange` APIs in order to implement `split_off` methods in a panic-free way (remove `unreachable!()`) as recommended in https://github.com/rust-lang/rust/pull/88502/files#r760177240. I can split this out into a separate PR if needed.
2025-02-05 19:09:38 +08:00
许杰友 Jieyou Xu (Joe)
f30ce21602
Rollup merge of - tgross35:update-builtins, r=tgross35
Update `compiler-builtins` to 0.1.145

This includes https://github.com/rust-lang/compiler-builtins/pull/752 which is required for LLVM 20.
2025-02-05 19:09:37 +08:00
许杰友 Jieyou Xu (Joe)
41e93ab8e6
Rollup merge of - DuskyElf:master, r=jieyouxu
Rename and Move some UI tests to more suitable subdirs

## Affected Tests
- tests/ui/issues/issue-48838.rs -> tests/ui/enum/closure-in-enum-issue-48838.rs https://github.com/rust-lang/rust/issues/48838
- tests/ui/issues/issue-40350.rs -> tests/ui/enum/enum-inside-enum-issue-40350.rs https://github.com/rust-lang/rust/issues/40350
- tests/ui/issues/issue-41272.rs -> tests/ui/expr/if/if-let-no-match-guards-issue-41272.rs https://github.com/rust-lang/rust/issues/41272
- tests/ui/issues/issue-40408.rs -> tests/ui/lexer/floating-point-0e10-issue-40408.rs https://github.com/rust-lang/rust/issues/40408
- tests/ui/issues/issue-40136.rs -> tests/ui/macros/const-expr-invocations-issue-40136.rs https://github.com/rust-lang/rust/issues/40136
- tests/ui/issues/issue-40845.rs -> tests/ui/macros/macros-in-trait-positions-issue-40845.rs https://github.com/rust-lang/rust/issues/40845
- tests/ui/issues/issue-41213.rs -> tests/ui/match/enum-and-break-in-match-issue-41213.rs https://github.com/rust-lang/rust/issues/41213
- tests/ui/issues/issue-40782.rs -> tests/ui/suggestions/for-loop-missing-in.rs https://github.com/rust-lang/rust/issues/40782
- tests/ui/issues/issue-40827.rs -> tests/ui/trait-bounds/deep-level-Send-bound-check-issue-40827.rs https://github.com/rust-lang/rust/issues/40827
- tests/ui/issues/issue-40610.rs -> tests/ui/typeck/coercion-check-for-addition-issue-40610.rs https://github.com/rust-lang/rust/issues/40610
- tests/ui/issues/issue-40883.rs -> tests/ui/codegen/StackColoring-not-blowup-stack-issue-40883.rs https://github.com/rust-lang/rust/issues/40883
- tests/ui/issues/issue-40861.rs -> tests/ui/typeck/coercion-check-for-indexing-expression-issue-40861.rs https://github.com/rust-lang/rust/issues/40861
- tests/ui/issues/issue-41139.rs -> tests/ui/typeck/unsized-rvalue-issue-41139.rs https://github.com/rust-lang/rust/issues/41139
- tests/ui/issues/issue-40749.rs -> tests/ui/wf/range-expr-root-of-constant-issue-40749.rs https://github.com/rust-lang/rust/issues/40749
- tests/ui/issues/issue-40235.rs -> tests/ui/while/while-let-scope-issue-40235.rs https://github.com/rust-lang/rust/issues/40235
2025-02-05 19:09:37 +08:00
许杰友 Jieyou Xu (Joe)
7ad1a3b8d8
Rollup merge of - m4rch3n1ng:inherent-str-constructors, r=jhpratt
implement inherent str constructors

implement 

this implements
- str::from_utf8
- str::from_utf8_mut
- str::from_utf8_unchecked
- str::from_utf8_unchecked_mut

i left `std::str::from_raw_parts` and `std::str::from_raw_parts_mut` out of this as those are unstable and were not mentioned by the tracking issue or the original pull request, but i can  add those here as well.

i was also unsure of what to do with the `rustc_const_(un)stable` attributes: i removed the `#[rustc_const_stable]` attribute from `str::from_utf8`, `str::from_utf8_unchecked` and `str::from_utf8_unchecked_mut`, and left the`#[rust_const_unstable]` in `str::from_utf8_mut` (btw why is that one not const stable yet with  merged?).

is there a way to redirect users to the stable `std::str::from_utf8` instead of only saying "hey this is unstable"?

for now i just removed the check for `str::from_utf8` in the test in `tests/ui/suggestions/suggest-std-when-using-type.rs`.
2025-02-05 19:09:36 +08:00
许杰友 Jieyou Xu (Joe)
ff339fbbf4
Rollup merge of - joboet:move_pal_net, r=ChrisDenton
std: move network code into `sys`

As per , this PR moves `sys_common::net` and the `sys::pal::net` into the newly created `sys::net` module. In order to support , I've moved all the current network code into a separate `connection` module, future functions like `hostname` can live in separate modules.

I'll probably do a follow-up PR and clean up some of the actual code, this is mostly just a reorganization.
2025-02-05 19:09:35 +08:00
许杰友 Jieyou Xu (Joe)
cc58e8b7ec
Rollup merge of - Ayush1325:command-env, r=jhpratt
uefi: process: Add support for command environment variables

Set environment variables before launching the process and restore the prior variables after the program exists.

This is the same implementation as the one used by UEFI Shell Execute [0].

[0]: 2d2642f483/ShellPkg/Application/Shell/ShellProtocol.c (L1700)
2025-02-05 19:09:35 +08:00
许杰友 Jieyou Xu (Joe)
f9f667f8b9
Rollup merge of - oli-obk:push-ymxoklvzrpvx, r=Nadrieril
Reject negative literals for unsigned or char types in pattern ranges and literals

It sucks a bit that we have to duplicate the work here (normal expressions just get this for free from the `ExprKind::UnOp(UnOp::Neg, ...)` typeck logic.

In https://github.com/rust-lang/rust/pull/134228 I caused

```rust
fn main() {
    match 42_u8 {
        -10..255 => {},
        _ => {}
    }
}
```

to just compile without even a lint.

I can't believe we didn't have tests for this

Amusingly https://github.com/rust-lang/rust/pull/136302 will also register a delayed bug in `lit_to_const` for this, so we'll have a redundancy if something like this fails again.
2025-02-05 19:09:34 +08:00
许杰友 Jieyou Xu (Joe)
25f7db31af
Rollup merge of - taiki-e:ppc-secure-plt, r=nikic
Use +secure-plt for powerpc-unknown-linux-gnu{,spe}

Fixes 
See that issue for details.

I'm not sure about the policy about baseline on these platforms (there is no [platform support doc](https://doc.rust-lang.org/nightly/rustc/platform-support.html) for them), but it seems that the Debian/Ubuntu's cross-compiler (powerpc-linux-gnu-gcc) already uses --enable-secureplt at least as of Debian 9 (stretch) and Ubuntu 14.04.

```
$ cat /etc/os-release | grep VERSION_ID
VERSION_ID="9"
$ powerpc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=powerpc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/powerpc-linux-gnu/6/lto-wrapper
Target: powerpc-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 6.3.0-18' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-powerpc-cross/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-powerpc-cross --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-powerpc-cross --with-arch-directory=ppc --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libgcj --enable-objc-gc=auto --enable-secureplt --disable-softfloat --with-cpu=default32 --disable-softfloat --enable-targets=powerpc-linux,powerpc64-linux --enable-multiarch --with-long-double-128 --enable-multilib --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=powerpc-linux-gnu --program-prefix=powerpc-linux-gnu- --includedir=/usr/powerpc-linux-gnu/include
Thread model: posix
gcc version 6.3.0 20170516 (Debian 6.3.0-18)
```

```
$ cat /etc/os-release | grep VERSION_ID
VERSION_ID="14.04"
$ cat /etc/debian_version
jessie/sid
$ powerpc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=powerpc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/powerpc-linux-gnu/4.8/lto-wrapper
Target: powerpc-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/powerpc-linux-gnu/include/c++/4.8.4 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --disable-libitm --disable-libsanitizer --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-powerpc-cross/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-powerpc-cross --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-powerpc-cross --with-arch-directory=ppc --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libgcj --enable-objc-gc --enable-secureplt --disable-softfloat --with-cpu=default32 --disable-softfloat --enable-targets=powerpc-linux,powerpc64-linux --enable-multiarch --disable-werror --with-long-double-128 --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=powerpc-linux-gnu --program-prefix=powerpc-linux-gnu- --includedir=/usr/powerpc-linux-gnu/include
Thread model: posix
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.1)
```

cc ```@glaubitz``` (who added powerpc-unknown-linux-gnuspe in https://github.com/rust-lang/rust/pull/48484)

r? tgross35

```@rustbot``` label +O-PowerPC +O-linux-gnu

try-job: dist-powerpc-linux
try-job: dist-powerpc64-linux
try-job: dist-powerpc64le-linux
try-job: dist-various-1
try-job: dist-various-2
try-job: aarch64-gnu
2025-02-05 19:09:34 +08:00
许杰友 Jieyou Xu (Joe)
def44600d1
Rollup merge of - ehuss:cenum_impl_drop_cast, r=Nadrieril
Make cenum_impl_drop_cast a hard error

This changes the `cenum_impl_drop_cast` lint to be a hard error. This lint has been deny-by-default and warning in dependencies since https://github.com/rust-lang/rust/pull/97652 about 2.5 years ago.

Closes https://github.com/rust-lang/rust/issues/73333
2025-02-05 19:09:33 +08:00
许杰友 Jieyou Xu (Joe)
f75146fc16
Rollup merge of - jieyouxu:migrate-split-debuginfo, r=davidtwco
tests: Port `split-debuginfo` to rmake.rs

Part of .

This PR supersedes  and is co-authored with `@Oneirical.`

## Known limitations

- In general, like the `Makefile` version, this test in its present form is also somewhat funny because for the most part it merely checks for existence/absence of output artifacts but makes no attempt to actually check if the debuginfo is at all usable.

## Changes

This PR ports `tests/run-make/split-debuginfo` to rmake.rs. This is an **initial** port, and certainly could be cleaned up and/or enhanced.

The original Makefile version had several functional problems. I fixed some of them, but also left some existing issues as-is.

1. The linux/non-linux final branch had a conditional interpolation of `UNSTABLE_OPTIONS := -Zunstable-options`. However, one of the use sites was `-C $(UNSTABLE_OPTIONS) split-debuginfo`. This indicates to me that this run-make test is not run in CI under a non-linux + non-windows + non-darwin environment, because that would've failed as this would expand to `-C -Zunstable-options split-debuginfo`. I fixed this in the rmake.rs version, but I'm not sure if this distinction is worth keeping at all if it's not tested in CI.
2. There are several comments that were discovered to be wrong. I tried to fix them in the rmake.rs version as well.
3. The check for path remapping / lack of path remapping through

    ```make
    objdump -Wi $(TMPDIR)/foo | grep DW_AT_GNU_dwo_name | (! grep $(TMPDIR)) || exit 1
    ```

    is incorrect, because that looks at the single line of that contains `DW_AT_GNU_dwo_name`. This is unfortunately wrong because empirical evidence shows that with `objdump`[^objdump], the check actually needs to look at the attribute value of `DW_AT_comp_dir` on the previous line not `DW_AT_GNU_dwo_name`[^gnu-ext]. Example output of `objdump`:

	```text
    <10>   DW_AT_comp_dir    : (indirect string, offset: 0xafb48): /home/joe/repos/rust
    <14>   DW_AT_GNU_dwo_name: (indirect string, offset: 0x5d1b0): foo.foo.fc848df41df7a00d-cgu.0.rcgu.dwo
	```

	In the rmake.rs version I used a 2-line sliding window to check for `DW_AT_comp_dir` and `DW_AT_GNU_dwo_name`, but to look at `DW_AT_comp_dir` specifically.
4. I included a bunch of FIXMEs and ENHANCEMENTs I noticed regarding the test because I didn't want to fix them in this initial port[^enhancement].
5. The Makefile version didn't test *anything* on Windows (both windows-msvc and windows-gnu). I added some *very* basic and *very* sparse checks for windows-msvc, but I am not willing to spend the effort to expand test coverage to windows-gnu in this initial port.
6. This run-make test is way too big. But I didn't want to expend the effort of breaking this up in this initial port.

[^objdump]: the output format differs between `objdump` and `llvm-objdump`, but the same is true for `llvm-objdump` that this is looking at the wrong line.
[^gnu-ext]: AFAICT that is a GNU DWARF attribute extension, since it isn't mentioned in DWARFv5 spec
[^enhancement]: For instance, the previous path remapping check could in theory be precisely inspected by inspecting `.debug_info` section to look for attribute value of `DW_AT_comp_dir`. But that involves resolving the value of the indirect string, which means you have to: (1) look for offset into string offset table and (2) use *that* offset to find the string itself in the string table. The split part of "split-debuginfo" makes this murky for me, so I wasn't able to replace `llvm-objdump` textual output substring matches with more precise `object` + `gimli` inspections.

## Review advice

- I'm sorry for how long the rmake.rs test ended up, but a lot of it is comments and just vertical space due to formatting. If there's any ways to make this test less long / convoluted, advice would be appreciated.
- This PR *intentionally* introduces several intermediate commits for the `Makefile`, mostly to illustrate the problems I discovered when looking at the original `Makefile` version. This is intended to highlight the existing problems in the `Makefile` version for the reviewer[^squash].
    - There are several intentional non-functional commits:
        1. Reindent the `Makefile` to make the platform conditional gating more obvious.
        2. Collapse nested if-else branches into an else if construct, which is not supported by GNU Make 3.80.
        3. Remove all redundant `-C debuginfo=2` when `-g` is already specified.
- This PR is best reviewed commit-by-commit.

[^squash]: I intend to squash these intermediate commits away after the reviewer concludes that the current form of the rmake.rs test is acceptable for merge. Before then, I'll keep them to help with review.

---

try-job: x86_64-msvc
try-job: i686-msvc
try-job: i686-mingw
try-job: x86_64-mingw-1
try-job: x86_64-apple-1
try-job: aarch64-apple
try-job: test-various
2025-02-05 19:09:32 +08:00
许杰友 Jieyou Xu (Joe)
963eec0468
Rollup merge of - workingjubilee:rustc-abi-in-cg-gcc, r=GuillaumeGomez
cg_gcc: Directly use rustc_abi instead of reexports

These reexports will be going away soonish.
2025-02-05 19:09:31 +08:00
Oli Scherer
476074888f Document why some "type mismatches" exist 2025-02-05 11:02:49 +00:00
bors
820bfffc25 Auto merge of - davidv1992:upgrade-elsa, r=oli-obk
Upgrade elsa to the newest version.

This was locked to 1.7.1 because of an error in the elsa release process that has since been fixed. Upgrading has the advantage that the elsa code runs properly in miri, at least with tree borrows.

This was spawned from https://github.com/rust-lang/rust/issues/135870#issuecomment-2612470540
2025-02-05 10:15:02 +00:00
Oli Scherer
f44794f455 Only allow negation on literals in patterns if it's on integers or floats 2025-02-05 09:49:36 +00:00
Oli Scherer
24d94b2db9 Add regression test for negative unsigned literals in patterns 2025-02-05 09:43:09 +00:00
Adrian Taylor
0772400dbf Arbitrary self types v2: recursion test
Add a test for infinite recursion of an arbitrary self type.

These diagnostics aren't perfect (especially the repetition of the
statement that there's too much recursion) but for now at least
let's add a test to confirm that such diagnostics are emitted.
2025-02-05 08:18:38 +00:00
Marijn Schouten
6770d3ddf4
Fix link in from_fn.rs 2025-02-05 08:52:13 +01:00
Thalia Archibald
5794952156 Fix unreachable_pub lint for hermit target 2025-02-04 23:38:17 -08:00