Commit Graph

270255 Commits

Author SHA1 Message Date
Matthias Krüger
957f6c3973
Rollup merge of #129329 - eduardosm:rc-from-mut-slice, r=dtolnay
Implement `From<&mut {slice}>` for `Box/Rc/Arc<{slice}>`

ACP: https://github.com/rust-lang/libs-team/issues/424

New API:

```rust
impl<T: Clone> From<&mut [T]> for Box<[T]>
impl From<&mut str> for Box<str>
impl From<&mut CStr> for Box<CStr>
impl From<&mut OsStr> for Box<OsStr>
impl From<&mut Path> for Box<Path>

impl<T: Clone> From<&mut [T]> for Rc<[T]>
impl From<&mut str> for Rc<str>
impl From<&mut CStr> for Rc<CStr>
impl From<&mut OsStr> for Rc<OsStr>
impl From<&mut Path> for Rc<Path>

impl<T: Clone> From<&mut [T]> for Arc<[T]>
impl From<&mut str> for Arc<str>
impl From<&mut CStr> for Arc<CStr>
impl From<&mut OsStr> for Arc<OsStr>
impl From<&mut Path> for Arc<Path>
```

Since they are trait implementations, I think these are insta-stable.

As mentioned in https://github.com/rust-lang/libs-team/issues/424#issuecomment-2299415749, a crater run might be needed.
2024-11-03 12:08:49 +01:00
Nilstrieb
f42fb43517 Call the target libdir target libdir
Because it's the target libdir.

`--print` uses the same terminology, and it's a simple way to make it
obviously different from `$sysroot/lib`.
2024-11-03 11:49:43 +01:00
Taiki Endo
b07232d95d Move tests/ui/abi/riscv32e-registers.rs to tests/ui/asm/riscv
This also adds comments explaining the difference to bad-reg.rs.
2024-11-03 18:32:04 +09:00
Taiki Endo
a7520adc29
Fix typo in tests/auxiliary/minicore.rs
Co-authored-by: Jubilee <workingjubilee@gmail.com>
2024-11-03 17:32:33 +09:00
bors
db034cee00 Auto merge of #132419 - durin42:llvm-20-type-test-thing, r=cuviper
PassWrapper: adapt for llvm/llvm-project@b01e2a8b56

A boolean turned into an enum. None matches the old behavior of false, so we pass that.

`@rustbot` label: +llvm-main
2024-11-03 08:08:00 +00:00
Ralf Jung
bc757f9034 add const_panic macro to make it easier to fall back to non-formatting panic in const 2024-11-03 08:58:43 +01:00
Ralf Jung
234d3de8b4 stabilize const_arguments_as_str 2024-11-03 07:49:24 +01:00
bors
89ab6559cc Auto merge of #132526 - bjorn3:sync_cg_clif-2024-11-02, r=bjorn3
Subtree sync for rustc_codegen_cranelift

The highlight this time is an update to Cranelift 0.113,

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
2024-11-03 05:03:52 +00:00
Jubilee Young
ab6994f880 compiler: Add rustc_abi to _sanitizers 2024-11-02 20:31:47 -07:00
Jubilee Young
31cbde037b compiler: Add rustc_abi to _monomorphize 2024-11-02 20:31:47 -07:00
Jubilee Young
4046e3610c compiler: Replace rustc_target with _abi in _trait_selection 2024-11-02 20:31:47 -07:00
Jubilee Young
bb0cd5606a compiler: Replace rustc_target with _abi in _hir 2024-11-02 20:31:47 -07:00
Jubilee Young
586766e790 compiler: Replace rustc_target with _abi in _borrowck 2024-11-02 20:31:47 -07:00
bors
67395551d0 Auto merge of #132458 - RalfJung:rustc-const-unstable, r=Amanieu
get rid of a whole bunch of unnecessary rustc_const_unstable attributes

In general, when a `const fn` is still unstable, it doesn't need a `#[rustc_const_unstable]` attribute. The only exception is functions that internally use things that can't be used in stable const fn yet.

So this gets rid of a whole bunch of `#[rustc_const_unstable]` in libcore.
2024-11-03 02:32:48 +00:00
bors
8ccb78e0d5 Auto merge of #125579 - Noratrieb:print-host, r=davidtwco
Add `--print host-tuple` to print host target tuple

People often parse `-vV` output to get to the host tuple, which is annoying to do. It's easier to just get it directly.

I called it "host-tuple" instead of "host" because it's clearer that it's just the target name. I'm open to different names, but I think this one is fine.

a quick GitHub search for `'^host` reveals many instances of people doing the parsing, for example:

68e0ca57cd/README.md (L369)
0e38473b0c/main.sh (L96)
8a3553b865/README.md (L625)
43f3ec3970/do.sh (L35)

needs a compiler FCP. I could also do an MCP but I think just an FCP here makes the most sense.
2024-11-02 23:04:42 +00:00
cyrgani
7745b065cc add and update some crashtests 2024-11-02 23:44:12 +01:00
uellenberg
67a85925b1 Suggest fixing typos and let bindings at the same time
Fixes #132483
2024-11-02 14:40:37 -07:00
Noratrieb
ba481518da Add --print host-triple
People often parse `-vV` output to get to the host triple, which is
annoying to do. It's easier to just get it directly.
2024-11-02 21:29:59 +01:00
Noratrieb
a26450cf81 Rename target triple to target tuple in many places in the compiler
This changes the naming to the new naming, used by `--print
target-tuple`.
It does not change all locations, but many.
2024-11-02 21:29:59 +01:00
Nilstrieb
77d0b4ddfb move deployment-target tests to print-request 2024-11-02 21:29:59 +01:00
Michael Goulet
16394e9776 Do not format generic consts 2024-11-02 20:25:06 +00:00
bors
b3f75cc872 Auto merge of #132147 - estebank:long-types-2, r=davidtwco
Tweak E0277 output when a candidate is available

*Follow up to #132086.*

Go from

```
error[E0277]: the trait bound `Then<Ignored<chumsky::combinator::Filter<chumsky::primitive::Any<&str, chumsky::extra::Full<EmptyErr, (), ()>>, {closure@src/main.rs:9:17: 9:27}>, char>, chumsky::combinator::Map<impl CSTParser<'a, O>, O, {closure@src/main.rs:11:24: 11:27}>, (), (), chumsky::extra::Full<EmptyErr, (), ()>>: CSTParser<'a>` is not satisfied
 --> src/main.rs:7:50
  |
7 | fn leaf<'a, O>(parser: impl CSTParser<'a, O>) -> impl CSTParser<'a, ()> {
  |                                                  ^^^^^^^^^^^^^^^^^^^^^^ the trait `chumsky::private::ParserSealed<'_, &str, (), chumsky::extra::Full<EmptyErr, (), ()>>` is not implemented for `Then<Ignored<Filter<Any<&str, ...>, ...>, ...>, ..., ..., ..., ...>`, which is required by `Then<Ignored<chumsky::combinator::Filter<chumsky::primitive::Any<&str, chumsky::extra::Full<EmptyErr, (), ()>>, {closure@src/main.rs:9:17: 9:27}>, char>, chumsky::combinator::Map<impl CSTParser<'a, O>, O, {closure@src/main.rs:11:24: 11:27}>, (), (), chumsky::extra::Full<EmptyErr, (), ()>>: CSTParser<'a>`
  |
  = help: the trait `chumsky::private::ParserSealed<'_, &'a str, ((), ()), chumsky::extra::Full<EmptyErr, (), ()>>` is implemented for `Then<Ignored<chumsky::combinator::Filter<chumsky::primitive::Any<&str, chumsky::extra::Full<EmptyErr, (), ()>>, {closure@src/main.rs:9:17: 9:27}>, char>, chumsky::combinator::Map<impl CSTParser<'a, O>, O, {closure@src/main.rs:11:24: 11:27}>, (), (), chumsky::extra::Full<EmptyErr, (), ()>>`
  = help: for that trait implementation, expected `((), ())`, found `()`
  = note: required for `Then<Ignored<Filter<Any<&str, ...>, ...>, ...>, ..., ..., ..., ...>` to implement `Parser<'_, &str, ()>`
note: required for `Then<Ignored<Filter<Any<&str, ...>, ...>, ...>, ..., ..., ..., ...>` to implement `CSTParser<'a>`
 --> src/main.rs:5:16
  |
5 | impl<'a, O, T> CSTParser<'a, O> for T where T: Parser<'a, &'a str, O> {}
  |                ^^^^^^^^^^^^^^^^     ^          ---------------------- unsatisfied trait bound introduced here
  = note: the full name for the type has been written to '/home/gh-estebank/longlong/target/debug/deps/longlong-0008f9a4f2023b08.long-type-13239977239800463552.txt'
  = note: consider using `--verbose` to print the full type name to the console
  = note: the full name for the type has been written to '/home/gh-estebank/longlong/target/debug/deps/longlong-0008f9a4f2023b08.long-type-13239977239800463552.txt'
  = note: consider using `--verbose` to print the full type name to the console
```

to

```
error[E0277]: the trait bound `Then<Ignored<chumsky::combinator::Filter<chumsky::primitive::Any<&str, chumsky::extra::Full<EmptyErr, (), ()>>, {closure@src/main.rs:9:17: 9:27}>, char>, chumsky::combinator::Map<impl CSTParser<'a, O>, O, {closure@src/main.rs:11:24: 11:27}>, (), (), chumsky::extra::Full<EmptyErr, (), ()>>: CSTParser<'a>` is not satisfied
  --> src/main.rs:7:50
   |
7  | fn leaf<'a, O>(parser: impl CSTParser<'a, O>) -> impl CSTParser<'a, ()> {
   |                                                  ^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
...
11 |     ws.then(parser.map(|_| ()))
   |     --------------------------- return type was inferred to be `Then<Ignored<..., ...>, ..., ..., ..., ...>` here
   |
   = help: the trait `ParserSealed<'_, &_, (), Full<_, _, _>>` is not implemented for `Then<Ignored<..., ...>, ..., ..., ..., ...>`
           but trait `ParserSealed<'_, &'a _, ((), ()), Full<_, _, _>>` is implemented for it
   = help: for that trait implementation, expected `((), ())`, found `()`
   = note: required for `Then<Ignored<..., ...>, ..., ..., ..., ...>` to implement `Parser<'_, &str, ()>`
note: required for `Then<Ignored<..., ...>, ..., ..., ..., ...>` to implement `CSTParser<'a>`
  --> src/main.rs:5:16
   |
5  | impl<'a, O, T> CSTParser<'a, O> for T where T: Parser<'a, &'a str, O> {}
   |                ^^^^^^^^^^^^^^^^     ^          ---------------------- unsatisfied trait bound introduced here
   = note: the full name for the type has been written to '/home/gh-estebank/longlong/target/debug/deps/longlong-df9d52be87eada65.long-type-1337037744507305372.txt'
   = note: consider using `--verbose` to print the full type name to the console
```

* Remove redundant wording
* Introduce trait diff highlighting logic and use it
* Fix incorrect "long type written to path" logic (can be split off)
* Point at tail expression in more cases in E0277
* Avoid long primary span labels in E0277 by moving them to a `help`

Fix #132013.

There are individual commits that can be their own PR. If the review load is too big, happy to split them off.
2024-11-02 20:22:49 +00:00
Augie Fackler
c61312268e PassWrapper: adapt for llvm/llvm-project@5445edb5d
As with ab5583ed1e, we had been explicitly
passing defaults whose type have changed. Rather than do an ifdef, we
simply rely on the defaults.

@rustbot label: +llvm-main
2024-11-02 15:50:44 -04:00
tuturuu
c7b07d58c3 Rustdoc: added brief colon explanation 2024-11-02 20:49:24 +01:00
Augie Fackler
ab5583ed1e PassWrapper: adapt for llvm/llvm-project@b01e2a8b56
We don't see a reason to explicitly pass the default here, so just use
the default instead of explicitly passing it and needing an ifdef.

@rustbot label: +llvm-main
2024-11-02 14:39:58 -04:00
Esteban Küber
7e0d3ed951 fix tests
Paths in CI can be longer than in devs' machines.
2024-11-02 16:58:50 +00:00
bors
00ed73cdc0 Auto merge of #132512 - workingjubilee:update-miri-for-rustc-abi, r=RalfJung
miri: Directly use rustc_abi

I tried to make this a PR to the miri repo for funsies. Ironically, the integration flow meant that it would use a too-old toolchain hash, and I didn't understand the build system there enough to want to manually fiddle with the hashes.
2024-11-02 16:46:08 +00:00
Michael Goulet
82f8b8f0e3 Use opt functions to not ICE in fallback suggestion 2024-11-02 15:25:12 +00:00
bjorn3
c959f6e5fd Update tidy license exceptions and allowed dependencies 2024-11-02 15:21:38 +00:00
bjorn3
60f0cd87e8 Merge commit '5b1246bb4bed72fd0bb8fa497d8e5ed2c7f3515c' into sync_cg_clif-2024-11-02 2024-11-02 14:53:30 +00:00
bjorn3
5b1246bb4b Rustup to rustc 1.84.0-nightly (705cfe0e9 2024-11-01) 2024-11-02 14:16:06 +00:00
bors
07cbbdd693 Auto merge of #132513 - matthiaskrgr:rollup-y98jvsl, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #132481 (rustdoc: skip stability inheritance for some item kinds)
 - #132482 (library: fix some stability annotations)
 - #132493 (Fix type reference in documents which was being confused with html tags.)
 - #132494 (make `download-rustc="if-unchanged"` default for library profile)
 - #132495 (Remove unintended link)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-11-02 14:12:12 +00:00
bjorn3
b856716b81 Sync from rust 705cfe0e96 2024-11-02 14:08:50 +00:00
Jieyou Xu
5596a592e3 Adjust tests to use minicore and rebless 2024-11-02 21:59:27 +08:00
Jieyou Xu
89a107740c Add more core stubs to minicore
`f32`, `f64` and `asm!` macro.
2024-11-02 21:59:27 +08:00
Laurențiu Nicola
db29fd3dfc
Merge pull request #18463 from benluiwj/fix/proc-macro-server-msg-improvement
Improve error message for too new proc-macro server
2024-11-02 13:58:33 +00:00
benluiwj
f5e1dce490 Improve error message for too new proc-macro server 2024-11-02 21:46:05 +08:00
ismailarilik
4e0d71f3f6 chore(style): sync submodule exclusion list between tidy and rustfmt
As asked in the FIXME comments
2024-11-02 16:43:10 +03:00
Taiki Endo
e97ba53879 Add bad-reg inline assembly ui test for RISC-V and s390x 2024-11-02 21:37:03 +08:00
ranger-ross
b9196757a0
Added regression test for 117446 2024-11-02 22:17:46 +09:00
Zalathar
90f2075b66 Port most of LLVMRustPrintTargetCPUs to Rust 2024-11-02 23:39:29 +11:00
Zalathar
0fa86f9660 Use a dedicated safe wrapper for LLVMRustGetHostCPUName 2024-11-02 23:39:29 +11:00
Zalathar
36040aacc2 Add a run-make test for same-arch --print=target-cpus 2024-11-02 23:39:29 +11:00
Matthias Krüger
f341a19366 NFC add known bug nr to test 2024-11-02 13:33:39 +01:00
Zalathar
afe190204b coverage: Regression test for inlining into an uninstrumented crate 2024-11-02 23:20:14 +11:00
Lukas Wirth
b4312375bd Allow static initializers to be const evaluated 2024-11-02 12:43:11 +01:00
Remo Senekowitsch
8837fc7542 make codegen help output more consistent
The output of `rustc -C help` generally has one option per line. There was one
exception because of a (presumably) forgotten line continuation escape.
2024-11-02 12:35:48 +01:00
Taiki Endo
d19517dcd0 Support clobber_abi and vector registers (clobber-only) in PowerPC inline assembly 2024-11-02 20:26:08 +09:00
Matthias Krüger
c4024585a4
Rollup merge of #132495 - Houtamelo:remove_unintended_link, r=jieyouxu
Remove unintended link

Since `#[link_section]` is enclosed in braces, it was being confused with a link during docs compilation.

This caused compilation to fail when running `x dist` since it emitted a warning regarding broken links.
2024-11-02 12:14:15 +01:00
Matthias Krüger
bfcd9ecea6
Rollup merge of #132494 - onur-ozkan:library-profile-default, r=jieyouxu
make `download-rustc="if-unchanged"` default for library profile

Since `download-rustc` is tested on CI and https://github.com/rust-lang/rust/pull/132267 makes it effective for library development, we can now make it default for the library profile.

Implements the 3rd item from [this tracking issue](https://github.com/rust-lang/rust/issues/131744).
2024-11-02 12:14:14 +01:00