1
Fork 0
Commit graph

273325 commits

Author SHA1 Message Date
Michael Goulet
5a1a5e8bb7 Reword prelude for AsyncFn stabilization 2024-12-13 00:04:57 +00:00
Michael Goulet
c605c84be8 Stabilize async closures 2024-12-13 00:04:56 +00:00
Esteban Küber
49a22a4245 Filter empty lines, comments and delimiters from previous to last multiline span rendering 2024-12-12 23:36:27 +00:00
Esteban Küber
65a54a7f27 Tweak multispan rendering
Consider comments and bare delimiters the same as an "empty line" for purposes of hiding rendered code output of long multispans. This results in more aggressive shortening of rendered output without losing too much context, specially in `*.stderr` tests that have "hidden" comments.
2024-12-12 23:36:27 +00:00
Matthias Krüger
7880abac44 crashes: more tests v2 2024-12-12 22:55:31 +01:00
bors
915e7eb9b9 Auto merge of #132961 - adetaylor:arbitrary-self-types-the-big-bit, r=compiler-errors,wesleywiser
Arbitrary self types v2: main compiler changes

This is the main PR in a series of PRs related to Arbitrary Self Types v2, tracked in #44874. Specifically this is step 7 of the plan [described here](https://github.com/rust-lang/rust/issues/44874#issuecomment-2122179688), for [RFC 3519](https://github.com/rust-lang/rfcs/pull/3519).

Overall this PR:
* Switches from the `Deref` trait to the new `Receiver` trait when the unstable `arbitrary_self_types` feature is enabled (the simple bit)
* Introduces new algorithms to spot "shadowing"; that is, the case where a newly-added method in an outer smart pointer might end up overriding a pre-existing method in the pointee (the complex bit). Most of this bit was explored in [this earlier perf-testing PR](https://github.com/rust-lang/rust/pull/127812#issuecomment-2236911900).
* Lots of tests

This should not break compatibility for:
* Stable users, where it should have no effect
* Users of the existing `arbitrary_self_types` feature (because we implement `Receiver` for `T: Deref`) _unless_ those folks have added methods which may shadow methods in inner types, which we no longer want to allow

Subsequent PRs will add better diagnostics.

It's probably easiest to review this commit-by-commit.

r? `@wesleywiser`
2024-12-12 21:40:39 +00:00
Matthias Krüger
33e6be0c10 crashes: more tests 2024-12-12 22:09:39 +01:00
Will Crichton
4d5d4700f3 Make BorrowSet/BorrowData fields accessible via public getters 2024-12-12 12:34:43 -08:00
Michael Howell
8200c1e52e rustdoc-search: fix mismatched path when parent re-exported twice 2024-12-12 13:29:18 -07:00
Nicholas Nethercote
2e412fef75 Remove Lexer's dependency on Parser.
Lexing precedes parsing, as you'd expect: `Lexer` creates a
`TokenStream` and `Parser` then parses that `TokenStream`.

But, in a horrendous violation of layering abstractions and common
sense, `Lexer` depends on `Parser`! The `Lexer::unclosed_delim_err`
method does some error recovery that relies on creating a `Parser` to do
some post-processing of the `TokenStream` that the `Lexer` just created.

This commit just removes `unclosed_delim_err`. This change removes
`Lexer`'s dependency on `Parser`, and also means that `lex_token_tree`'s
return value can have a more typical form.

The cost is slightly worse error messages in two obscure cases, as shown
in these tests:
- tests/ui/parser/brace-in-let-chain.rs: there is slightly less
  explanation in this case involving an extra `{`.
- tests/ui/parser/diff-markers/unclosed-delims{,-in-macro}.rs: the diff
  marker detection is no longer supported (because that detection is
  implemented in the parser).

In my opinion this cost is outweighed by the magnitude of the code
cleanup.
2024-12-13 07:10:20 +11:00
Oli Scherer
2ffe3b1e70 Move impl constness into impl trait header 2024-12-12 20:06:03 +00:00
Alisa Sireneva
6ce7ba4300 Fix typos in docs on provenance 2024-12-12 22:52:12 +03:00
Alex Crichton
6b93fac9ff Update wasi-sdk used to build WASI targets
Bump to the latest wasi-sdk-25 release which brings in various wasi-libc
updates as well as LLVM 19 as the version used to compile wasi-libc.
2024-12-12 11:00:02 -08:00
BD103
7fb2fc01a5 feat: clarify how to use black_box()
Co-authored-by: Ben Kimock <kimockb@gmail.com>
2024-12-12 13:54:17 -05:00
bors
d4025ee454 Auto merge of #134223 - matthiaskrgr:rollup-qy69vqb, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #133122 (Add unpolished, experimental support for AFIDT (async fn in dyn trait))
 - #133249 (ABI checks: add support for loongarch)
 - #134089 (Use newly added exceptions to non default branch warning)
 - #134188 (Bump Fuchsia)
 - #134204 (Fix our `llvm::Bool` typedef to be signed, to match `LLVMBool`)
 - #134207 (Revert "bootstrap: print{ln}! -> eprint{ln}! (take 2) #134040")
 - #134214 (rustdoc: fix self cmp)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-12 18:53:32 +00:00
MarcoIeni
ac078a4ccc
fix path 2024-12-12 19:34:45 +01:00
MarcoIeni
4fa9078b17
fix path 2024-12-12 19:19:04 +01:00
Matthias Krüger
357d03d0a6
Rollup merge of #134214 - klensy:rd-shadow, r=notriddle
rustdoc: fix self cmp

Looks like condition in `filter` currently always `true`, but intended to compare with `fqp` from `if let Some(&(ref fqp, item_type))`?
2024-12-12 19:00:45 +01:00
Matthias Krüger
8d2759b2ee
Rollup merge of #134207 - jieyouxu:revert-134040, r=lqd
Revert "bootstrap: print{ln}! -> eprint{ln}! (take 2) #134040"

Unfortunately, #134040 is proving to have caused more output interleaving problems that are tricky to diagnose and fix, and I think we probably should leave these untouched as bootstrap and compiletest has a bunch of interconnecting parts, and the commands and tools that they exercise do not consistently use stderr/stdout either. This causes hard-to-diagnose output interleaving bugs, which unfortunately degrades contributor experience.

This PR reverts two PRs in order to cleanly revert #134040:

1. Revert #134123 which is a fix-forward after #134040.
2. Revert #134040 itself.

I don't regret the initial effort `@clubby789,` and thank you for making the attempts, but I think we need to refrain from touching too many of these at once because some of the interleaving are very non-obvious and we don't have test coverage for.

r? `@clubby789`
cc `@Zalathar`
2024-12-12 19:00:44 +01:00
Matthias Krüger
6d79df6867
Rollup merge of #134204 - Zalathar:llvm-bool, r=SparrowLii
Fix our `llvm::Bool` typedef to be signed, to match `LLVMBool`

In the LLVM-C API, boolean values are passed as `typedef int LLVMBool`, but our Rust-side typedef was using `c_uint` instead.

Signed and unsigned integers have the same ABI on most platforms, but that isn't universally true, so we should prefer to be consistent with LLVM.

1268e87/llvm/include/llvm-c/Types.h (L28)
2024-12-12 19:00:44 +01:00
Matthias Krüger
f620e4616e
Rollup merge of #134188 - steven807:master, r=lqd
Bump Fuchsia

try-job: x86_64-fuchsia
2024-12-12 19:00:43 +01:00
Matthias Krüger
a998c915ea
Rollup merge of #134089 - Urgau:triagebot-exceptions, r=ehuss
Use newly added exceptions to non default branch warning

cc https://github.com/rust-lang/triagebot/pull/1860
cc `@cuviper`
r? `@ehuss`
2024-12-12 19:00:42 +01:00
Matthias Krüger
6475fde16b
Rollup merge of #133249 - heiher:loong-abi-check, r=workingjubilee
ABI checks: add support for loongarch

LoongArch psABI[^1] specifies that LSX vector types are passed via general-purpose registers, while LASX vector types are passed indirectly through the stack.

This patch addresses the following warnings:

```
warning: this function call uses a SIMD vector type that is not currently supported with the chosen ABI
    --> .../library/core/src/../../stdarch/crates/core_arch/src/loongarch64/lsx/generated.rs:3695:5
     |
3695 |     __lsx_vreplgr2vr_b(a)
     |     ^^^^^^^^^^^^^^^^^^^^^ function called here
     |
     = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
     = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
     = note: `#[warn(abi_unsupported_vector_types)]` on by default
```

[^1]: https://github.com/loongson/la-abi-specs/blob/release/lapcs.adoc

r? `@workingjubilee`
2024-12-12 19:00:42 +01:00
Matthias Krüger
2e8807d87c
Rollup merge of #133122 - compiler-errors:afidt, r=oli-obk
Add unpolished, experimental support for AFIDT (async fn in dyn trait)

This allows us to begin messing around `async fn` in `dyn Trait`. Calling an async fn from a trait object always returns a `dyn* Future<Output = ...>`.

To make it work, Implementations are currently required to return something that can be coerced to a `dyn* Future` (see the example in `tests/ui/async-await/dyn/works.rs`). If it's not the right size, then it'll raise an error at the coercion site (see the example in `tests/ui/async-await/dyn/wrong-size.rs`). Currently the only practical way of doing this is wrapping the body in `Box::pin(async move { .. })`.

This PR does not implement a helper type like a "`Boxing`"[^boxing] adapter, and I'll probably follow-up with another PR to improve the error message for the `PointerLike` trait (something that explains in just normal prose what is happening here, rather than a trait error).
[^boxing]: https://rust-lang.github.io/async-fundamentals-initiative/explainer/user_guide_future.html#the-boxing-adapter

This PR also does not implement new trait solver support for AFIDT; I'll need to think how best to integrate it into candidate assembly, and that's a bit of a matter of taste, but I don't think it will be difficult to do.

This could also be generalized:
* To work on functions that are `-> impl Future` (soon).
* To work on functions that are `-> impl Iterator` and other "dyn rpitit safe" traits. We still need to nail down exactly what is needed for this to be okay (not soon).

Tracking:
* https://github.com/rust-lang/rust/issues/133119
2024-12-12 19:00:41 +01:00
MarcoIeni
a67a71da18
add files 2024-12-12 18:34:20 +01:00
MarcoIeni
c2f45505f5
remove echo 2024-12-12 18:18:23 +01:00
MarcoIeni
2bf1cec41b
refactor 2024-12-12 18:07:47 +01:00
MarcoIeni
a1abbaab0d
remove echo logs 2024-12-12 18:02:19 +01:00
Lukas Wirth
c57aec8d58
Merge pull request #18677 from Veykril/push-uumpxklsqpzk
internal: Implement `naked_asm!` builtin
2024-12-12 16:58:26 +00:00
Taiki Endo
3a90c4751b Fix powerpc64 big-endian FreeBSD ABI 2024-12-13 01:53:26 +09:00
Michael Goulet
b8c5a0f0eb Fix tools 2024-12-12 16:43:36 +00:00
Lukas Wirth
88457c0684 internal: Implement naked_asm! builtin 2024-12-12 17:43:27 +01:00
Lukas Wirth
42aefa76a3
Merge pull request #18675 from ShoyuVanilla/issue-18664
fix: Panic when displaying generic params with defaults, again
2024-12-12 16:37:10 +00:00
Michael Goulet
c5d02237d3 Add tests 2024-12-12 16:29:40 +00:00
Michael Goulet
3f97c6be8d Add unwrap_unsafe_binder and wrap_unsafe_binder macro operators 2024-12-12 16:29:40 +00:00
Michael Goulet
2a9e358c72 Lower AST and resolve lifetimes for unsafe binder types 2024-12-12 16:29:40 +00:00
Michael Goulet
3b1adfa94b Parsing unsafe binders 2024-12-12 16:29:39 +00:00
Shoyu Vanilla
8f004a2047 fix: Panic when displaying generic params with defaults, again 2024-12-13 01:15:41 +09:00
bors
a94fce97e3 Auto merge of #132789 - matthiaskrgr:debug_tests, r=jieyouxu
add some debug-assertion crash tests

r? ghost

try-job: x86_64-gnu
2024-12-12 16:08:06 +00:00
klensy
86a4a2786f fix self shadowed self compare 2024-12-12 19:01:28 +03:00
Lukas Wirth
3e6145999c
Merge pull request #18671 from p-hofer/master
Fix typo in error message for invalid casting
2024-12-12 14:58:26 +00:00
Philipp Hofer
ec6e0983b8 Fix typo in error message for invalid casting
Corrected the spelling of "defererence" to "dereference" in the error message that informs users about invalid casting requirements.
2024-12-12 15:42:21 +01:00
Lukas Wirth
648a00936b
Merge pull request #18670 from Veykril/push-ylomnylswnxm
internal: Drop proc-macro server support for ~1.66.0 and older toolchains
2024-12-12 14:19:07 +00:00
Lukas Wirth
1ae8416798 internal: Drop proc-macro server support for ~1.66.0 and older toolchains 2024-12-12 15:06:14 +01:00
MarcoIeni
aa0fd4621e
copy script 2024-12-12 14:49:59 +01:00
Florian Bartels
37bb774219 Reduce the need to set archiver via environment variables 2024-12-12 14:39:01 +01:00
Lukas Wirth
05f9d44656
Merge pull request #18652 from Giga-Bowser/extract-constant
feat: Add an assist to extract an expression into a constant
2024-12-12 13:22:05 +00:00
Lukas Wirth
508ce7cfc8
Merge pull request #18669 from Veykril/push-qqkuxtvsmsut
internal: Only parse the object file once in proc-macro-srv
2024-12-12 12:46:29 +00:00
Lukas Wirth
b6b7c57305 Fix clippy lints in proc-macro-srv 2024-12-12 13:30:42 +01:00
Lukas Wirth
1428cf6032 Only parse the object file once 2024-12-12 13:23:25 +01:00