Commit Graph

268134 Commits

Author SHA1 Message Date
许杰友 Jieyou Xu (Joe)
db6e31bba7 Remove myself from vacation 2024-10-07 23:40:17 +00:00
许杰友 Jieyou Xu (Joe)
03abf6756d Use untracked env var to pass -Zon-broken-pipe=kill for tools
- Don't touch rustc's `-Zon-broken-pipe=kill` env var in `compile.rs`.
- Use an untracked env var to pass `-Zon-broken-pipe=kill` for tools but
  skip cargo still, because cargo wants `-Zon-broken-pipe=kill` unset.
2024-10-07 23:38:08 +00:00
AngelicosPhosphoros
cb267b4c56 Add docs about slicing slices at the ends
Closes https://github.com/rust-lang/rust/issues/60783
2024-10-08 00:23:53 +02:00
Eric Huss
89b0f8a689 Fix utf8-bom test
The BOM was accidentally removed in https://github.com/rust-lang/rust/pull/57108
2024-10-07 14:45:49 -07:00
Miguel Ojeda
5fb71c677f CI: rfl: move job forward to Linux v6.12-rc2
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2024-10-07 23:32:48 +02:00
bors
3ae715c8c6 Auto merge of #131343 - compiler-errors:remove-combine-fields, r=lcnr
Remove `CombineFields`

This conflicts with #131263, but if this one lands first then perhaps #131263 could then go ahead and remove all the branching on solver in `TypeRelating`. We could perhaps then rename `TypeRelating` to `OldSolverRelating` or something, idk.

r? lcnr
2024-10-07 21:23:06 +00:00
Michael Howell
f7eced3a21 Add comment to describe camelcase line break 2024-10-07 13:27:50 -07:00
bors
baaf3e65ab Auto merge of #131372 - workingjubilee:rollup-4tyqgx2, r=workingjubilee
Rollup of 7 pull requests

Successful merges:

 - #128721 (Don't allow the `#[pointee]` attribute where it doesn't belong)
 - #130479 (skip in-tree compiler build for llvm-bitcode-linker if ci-rustc is on)
 - #130899 (Couple of changes to make it easier to compile rustc for wasm)
 - #131225 (`rustc_borrowck` memory management tweaks)
 - #131351 (Remove valgrind test suite and support from compiletest, bootstrap and opt-dist)
 - #131359 (Fix used_underscore_binding in rustc_serialize)
 - #131367 (Mark Boxy as on vacation)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-10-07 18:12:27 +00:00
Jubilee
ee6663e24c
Rollup merge of #131367 - compiler-errors:unboxy, r=lqd
Mark Boxy as on vacation

Boxy asked me to do this since she's busy :D

cc `@BoxyUwU`
2024-10-07 11:10:55 -07:00
Jubilee
3f88d6a83a
Rollup merge of #131359 - practicalrs:fix_used_underscore_binding, r=jieyouxu
Fix used_underscore_binding in rustc_serialize

Hi,

This PR fixes the following clippy warnings in rustc_serialize

```
warning: used underscore-prefixed binding
   --> compiler/rustc_serialize/src/opaque.rs:443:27
    |
443 |         debug_assert_eq!((_end_pos - _start_pos), IntEncodedWithFixedSize::ENCODED_SIZE);
    |                           ^^^^^^^^
    |
note: binding is defined here
   --> compiler/rustc_serialize/src/opaque.rs:442:13
    |
442 |         let _end_pos = e.position();
    |             ^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding
    = note: requested on the command line with `-W clippy::used-underscore-binding`

warning: used underscore-prefixed binding
   --> compiler/rustc_serialize/src/opaque.rs:443:38
    |
443 |         debug_assert_eq!((_end_pos - _start_pos), IntEncodedWithFixedSize::ENCODED_SIZE);
    |                                      ^^^^^^^^^^
    |
note: binding is defined here
   --> compiler/rustc_serialize/src/opaque.rs:440:13
    |
440 |         let _start_pos = e.position();
    |             ^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding
```

Best regards,
Michal
2024-10-07 11:10:55 -07:00
Jubilee
f88bfa34e1
Rollup merge of #131351 - jieyouxu:yeet-the-valgrind, r=Kobzol
Remove valgrind test suite and support from compiletest, bootstrap and opt-dist

The `run-pass-valgrind` test suite is not exercised in CI, and as far as I'm aware nobody runs it (asked in https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Are.20the.20valgrind.20tests.20even.20used.20by.20anyone.3F). What's remaining of valgrind support in compiletest isn't even properly hooked up with bootstrap.

The existing valgrind logic in compiletest is also straight up questionable, i.e.

1b3b8e7b02/src/tools/compiletest/src/runtest/valgrind.rs (L7-L12)

It just runs valgrind tests as `rpass` if no valgrind path is provided to compiletest from bootstrap -- but bootstrap doesn't even pass a valgrind path to compiletest in the first place, so this always ran as `rpass` tests. So what is this even testing?

So if it's not testing anything, let's delete it.

Closes #44816 by deleting the test suite :3

<img src="https://github.com/user-attachments/assets/99525bf7-e85b-40ba-9281-e4e1e275c4e8" width=300 />
2024-10-07 11:10:54 -07:00
Jubilee
9c4732a77d
Rollup merge of #131225 - nnethercote:rustc_borrowck-mm, r=lqd
`rustc_borrowck` memory management tweaks

Minor cleanups in `rustc_borrowck` relating to memory management.

r? `@lqd`
2024-10-07 11:10:54 -07:00
Jubilee
31fbf67ce3
Rollup merge of #130899 - bjorn3:wasi_bootstrap_fixes, r=davidtwco
Couple of changes to make it easier to compile rustc for wasm

This is a subset of the patches I have on my rust fork to compile rustc for wasm32-wasip1.
2024-10-07 11:10:53 -07:00
Jubilee
8cd9d954c7
Rollup merge of #130479 - onur-ozkan:llvm-bitcode-linker-multiple-candidates, r=Kobzol
skip in-tree compiler build for llvm-bitcode-linker if ci-rustc is on

Similar to https://github.com/rust-lang/rust/issues/108767, resolves the `multiple candidates` problem for ci-rustc.

See https://github.com/rust-lang/rust/pull/122709#issuecomment-2355436227 for more context.

Blocker for #122709.
2024-10-07 11:10:52 -07:00
Jubilee
bd2e7ee976
Rollup merge of #128721 - Brezak:pointee-in-strange-places, r=pnkfelix
Don't allow the `#[pointee]` attribute where it doesn't belong

Error if the `#[pointee]` attribute is applied to anything but generic type parameters.

Closes #128485
Related to #123430
2024-10-07 11:10:52 -07:00
Michael Howell
e23419fc97 rustdoc: improve <wbr>-insertion for SCREAMING_CAMEL_CASE 2024-10-07 10:52:39 -07:00
rustbot
4d7c6ca1bb Update books 2024-10-07 13:01:01 -04:00
Guillaume Gomez
126cb9bb78 Remove dead code 2024-10-07 18:41:32 +02:00
clubby789
382365bfe3 Add test for issue 30867 2024-10-07 16:30:48 +00:00
clubby789
fa4f18be55 Add test for issue 30472 2024-10-07 16:30:48 +00:00
clubby789
b27c22d6b0 Add test for issue 28994 2024-10-07 16:30:47 +00:00
clubby789
3afb7d687c Migrate emit-to-stdout to new run-make
Co-authored-by: Oneirical <manchot@videotron.ca>
Co-authored-by: Chris Denton <chris@chrisdenton.dev>
2024-10-07 16:30:41 +00:00
clubby789
b577b26249 Add stdio configuring to run-make Rustc 2024-10-07 16:30:00 +00:00
clubby789
ad7d41ce90 Test for issue 23600 2024-10-07 16:29:52 +00:00
Ben Kimock
8d562f6cc5 Disable slice_iter mir-opt test in debug builds 2024-10-07 12:23:27 -04:00
Michael Goulet
65cff8a1ef Mark Boxy as on vacation 2024-10-07 12:17:55 -04:00
Ben Kimock
128ccc3c26 Bless mir-opt tests 2024-10-07 11:18:37 -04:00
Ben Kimock
9d5c961fa4 cfg out checks in add and sub but not offset
...because the checks in offset found bugs in a crater run.
2024-10-07 11:12:58 -04:00
Ben Kimock
6d246e47fb Add precondition checks to ptr::offset, ptr::add, ptr::sub 2024-10-07 11:12:58 -04:00
Michal Piotrowski
4085b48dfd
Fix used_underscore_binding in rustc_serialize 2024-10-07 15:02:45 +02:00
bors
7caad69253 Auto merge of #131354 - matthiaskrgr:rollup-hprnng2, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #131331 (Revert "warn_old_master_branch" check)
 - #131344 (Avoid `&Lrc<T>` in various places)
 - #131346 (Restrict `ignore-mode-*` directives)
 - #131353 (Add documentation for `runtest::check_rustdoc_test_option` method)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-10-07 11:30:33 +00:00
Matthias Krüger
fd2278d017
Rollup merge of #131353 - GuillaumeGomez:check_rustdoc_test_option, r=jieyouxu
Add documentation for `runtest::check_rustdoc_test_option` method

r? `@jieyouxu`
2024-10-07 12:23:56 +02:00
Matthias Krüger
7d7b43c39a
Rollup merge of #131346 - jieyouxu:prune-invalid-directives, r=Zalathar
Restrict `ignore-mode-*` directives

This is only used by coverage test suites where the same sources get run under different coverage modes. Restrict `ignore-mode-<coverage_mode>` to only coverage modes.
2024-10-07 12:23:55 +02:00
Matthias Krüger
df61a0b1b2
Rollup merge of #131344 - nnethercote:ref-Lrc, r=compiler-errors
Avoid `&Lrc<T>` in various places

Seeing `&Lrc<T>` is a bit suspicious, and `&T` or `Lrc<T>` is often better.

r? `@oli-obk`
2024-10-07 12:23:54 +02:00
Matthias Krüger
3a5a816190
Rollup merge of #131331 - onur-ozkan:131296, r=Kobzol
Revert "warn_old_master_branch" check

See https://github.com/rust-lang/rust/issues/131296#issuecomment-2395486918.

Reverts https://github.com/rust-lang/rust/pull/130121 and https://github.com/rust-lang/rust/pull/129584.

Fixes https://github.com/rust-lang/rust/issues/131296 and https://github.com/rust-lang/rust/issues/131324.
2024-10-07 12:23:54 +02:00
Guillaume Gomez
dde78bd946 Add documentation for runtest::check_rustdoc_test_option method 2024-10-07 12:09:28 +02:00
Michael Goulet
0c5d2f98d1 Remove At methods that are unused 2024-10-07 05:29:13 -04:00
Michael Goulet
5d62afd2ba Remove unnecessary DefineOpaqueTypes from lub 2024-10-07 05:29:13 -04:00
Michael Goulet
da71dfbc51 Inline CombineFields 2024-10-07 05:29:13 -04:00
bors
0b16baa570 Auto merge of #131235 - codemountains:rename-nestedmetaitem-to-metaitemlnner, r=nnethercote
Rename `NestedMetaItem` to `MetaItemInner`

Fixes #131087

r? `@nnethercote`
2024-10-07 08:59:55 +00:00
许杰友 Jieyou Xu (Joe)
fa3c25e112 Delete the run-pass-valgrind test suite 2024-10-07 08:02:30 +00:00
许杰友 Jieyou Xu (Joe)
f1e408a8de Remove valgrind test suite from opt-dist 2024-10-07 07:54:57 +00:00
许杰友 Jieyou Xu (Joe)
de588a6e60 Remove valgrind test suite support from bootstrap 2024-10-07 07:53:48 +00:00
许杰友 Jieyou Xu (Joe)
a961be9f13 Remove valgrind test suite and support from compiletest 2024-10-07 07:53:42 +00:00
codemountains
fc64ff7ec2 Rename nested_meta to meta_item_inner 2024-10-07 15:22:03 +09:00
bors
690332a251 Auto merge of #131345 - Zalathar:rollup-scdxuou, r=Zalathar
Rollup of 3 pull requests

Successful merges:

 - #128399 (liballoc: introduce String, Vec const-slicing)
 - #131308 (enable f16 and f128 on windows-gnullvm targets)
 - #131325 (coverage: Multiple small tweaks to counter creation)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-10-07 06:01:07 +00:00
许杰友 Jieyou Xu (Joe)
64efbe2b53 Prune invalid ignore-mode-* directives
These are only valid for coverage test modes.
2024-10-07 05:42:43 +00:00
Stuart Cook
99e12442da
Rollup merge of #131325 - Zalathar:tweak-counters, r=jieyouxu
coverage: Multiple small tweaks to counter creation

I've been experimenting with some larger changes to how coverage counters are assigned to parts of the control-flow graph, and while none of that is ready yet, along the way I've repeatedly found myself wanting these smaller tweaks as a base.

There are no changes to compiler output.
2024-10-07 15:37:07 +11:00
Stuart Cook
5c1c49a0c4
Rollup merge of #131308 - mati865:gnullvm-f16-f128, r=tgross35
enable f16 and f128 on windows-gnullvm targets

Continuation of https://github.com/rust-lang/rust/pull/130959
2024-10-07 15:37:07 +11:00
Stuart Cook
dd4f062b07
Rollup merge of #128399 - mammothbane:master, r=Amanieu,tgross35
liballoc: introduce String, Vec const-slicing

This change `const`-qualifies many methods on `Vec` and `String`, notably `as_slice`, `as_str`, `len`. These changes are made behind the unstable feature flag `const_vec_string_slice`.

## Motivation
This is to support simultaneous variance over ownership and constness. I have an enum type that may contain either `String` or `&str`, and I want to produce a `&str` from it in a possibly-`const` context.

```rust
enum StrOrString<'s> {
    Str(&'s str),
    String(String),
}

impl<'s> StrOrString<'s> {
    const fn as_str(&self) -> &str {
        match self {
             // In a const-context, I really only expect to see this variant, but I can't switch the implementation
             // in some mode like #[cfg(const)] -- there has to be a single body
             Self::Str(s) => s,

             // so this is a problem, since it's not `const`
             Self::String(s) => s.as_str(),
        }
    }
}
```

Currently `String` and `Vec` don't support this, but can without functional changes. Similar logic applies for `len`, `capacity`, `is_empty`.

## Changes

The essential thing enabling this change is that `Unique::as_ptr` is `const`. This lets us convert `RawVec::ptr` -> `Vec::as_ptr` -> `Vec::as_slice` -> `String::as_str`.

I had to move the `Deref` implementations into `as_{str,slice}` because `Deref` isn't `#[const_trait]`, but I would expect this change to be invisible up to inlining. I moved the `DerefMut` implementations as well for uniformity.
2024-10-07 15:37:06 +11:00