Commit Graph

259469 Commits

Author SHA1 Message Date
Ralf Jung
6c803ffefb remove unnecessary ignore-endian-big from stack-overflow-trait-infer test 2024-07-02 16:31:40 +02:00
Ana Hobden
8c353cbc46
Disable rmake test inaccessible-temp-dir on riscv64 2024-07-02 06:50:02 -07:00
Nicholas Nethercote
edeebe675b Import std::{iter,mem}. 2024-07-02 20:29:01 +10:00
Trevor Gross
42ac903f4f Change to the NetBSD archive URL rather than the CDN
The CDN has been down for a few hours. Switch to an alternative for the
time being so we can unblock CI.

It appears that the CDN is quite a bit faster, so we will likely want to
switch back when available.
2024-07-02 04:56:09 -04:00
Vadim Petrochenkov
565ddfb48c linker: Link dylib crates by path 2024-07-02 11:43:17 +03:00
Nicholas Nethercote
6f6015679f Rename make_token_stream.
And update the comment. Clearly the return type of this function was
changed at some point in the past, but its name and comment weren't
updated to match.
2024-07-02 17:38:43 +10:00
Nicholas Nethercote
3d750e2702 Shrink parser positions from usize to u32.
The number of source code bytes can't exceed a `u32`'s range, so a token
position also can't. This reduces the size of `Parser` and
`LazyAttrTokenStreamImpl` by eight bytes each.
2024-07-02 17:03:53 +10:00
Chris Denton
b998cff558
Use cfg!(windows) 2024-07-02 06:04:23 +00:00
hattizai
ada9fda7c3 chore: remove duplicate words 2024-07-02 11:25:31 +08:00
Nicholas Nethercote
f5b28968db Move more things around in collect_tokens_trailing_token.
To make things a little clearer, and to avoid some `mut` variables.
2024-07-02 10:46:44 +10:00
Nicholas Nethercote
8b5a7eb7f4 Move things around in collect_tokens_trailing_token.
So that the `capturing` state is adjusted immediately before and after
the call to `f`.
2024-07-02 10:46:44 +10:00
Nicholas Nethercote
2342770f49 Flip an if/else in AttrTokenStream::to_attr_token_stream.
To put the simple case first.
2024-07-02 10:46:44 +10:00
Nicholas Nethercote
36c30a968b Fix comment.
Both the indenting, and the missing `)`.
2024-07-02 10:46:44 +10:00
Nicholas Nethercote
7416c20cfd Just push in AttrTokenStream::to_token_trees.
Currently it uses a mixture of functional style (`flat_map`) and
imperative style (`push`), which is a bit hard to read. This commit
converts it to fully imperative, which is more concise and avoids the
need for `smallvec`.
2024-07-02 10:46:44 +10:00
Nicholas Nethercote
0cfd2473be Rename TokenStream::new argument.
`tts` is a better name than `streams` for a `Vec<TokenTree>`.
2024-07-02 10:46:44 +10:00
Nicholas Nethercote
f852568fa6 Change AttrTokenStream::to_tokenstream to to_token_trees.
I.e. change the return type from `TokenStream` to `Vec<TokenTree>`.

Most of the callsites require a `TokenStream`, but the recursive call
used to create `target_tokens` requires a `Vec<TokenTree>`. It's easy
to convert a `Vec<TokenTree>` to a `TokenStream` (just call
`TokenStream::new`) but it's harder to convert a `TokenStream` to a
`Vec<TokenTree>` (either iterate/clone/collect, or use `Lrc::into_inner`
if appropriate).

So this commit changes the return value to simplify that `target_tokens`
call site.
2024-07-02 10:46:44 +10:00
Nicholas Nethercote
d6c0b8117e Fix a typo in a comment. 2024-07-02 10:46:43 +10:00
Nicholas Nethercote
1680b791d5 Simplify CfgEval.
It can contain an owned value instead of a reference.
2024-07-02 10:46:43 +10:00
David Tolnay
06982239a6
Parenthesize break values containing leading label 2024-07-01 17:19:58 -07:00
mat
16fc41cedc Optimize SipHash by reordering compress instructions 2024-07-01 22:36:40 +00:00
DianQK
2ef82805d5
Use the aligned size for alloca at ret when the pass mode is cast. 2024-07-02 06:33:40 +08:00
DianQK
c453dcd62a
Use the aligned size for alloca at args when the pass mode is cast.
The `load` and `store` instructions in LLVM access the aligned size.
2024-07-02 06:33:35 +08:00
DianQK
09e0abb0d1
Add the definition for extern "C" at cast-target-abi.rs. 2024-07-02 06:31:35 +08:00
Trevor Gross
bb4c427ce4 Make FloatTy checks exhaustive in pretty print
This should prevent the default fallback if we add more float types in the
future.
2024-07-01 18:18:10 -04:00
bors
7d97c59438 Auto merge of #126941 - GuillaumeGomez:migrate-run-make-llvm-ident, r=Kobzol
Migrate `run-make/llvm-ident` to `rmake.rs`

Part of https://github.com/rust-lang/rust/issues/121876.

r? `@Kobzol`

try-job: armhf-gnu
2024-07-01 21:55:41 +00:00
bors
cf2df68d1f Auto merge of #127216 - GuillaumeGomez:rollup-iw9f2ed, r=GuillaumeGomez
Rollup of 8 pull requests

Successful merges:

 - #126732 (Stabilize `PanicInfo::message()` and `PanicMessage`)
 - #126753 (Add nightly style guide section for `precise_capturing` `use<>` syntax)
 - #126832 (linker: Refactor interface for passing arguments to linker)
 - #126880 (Migrate `volatile-intrinsics`, `weird-output-filenames`, `wasm-override-linker`, `wasm-exceptions-nostd` to `rmake`)
 - #127128 (Stabilize `duration_abs_diff`)
 - #127129 (Use full expr span for return suggestion on type error/ambiguity)
 - #127188 ( improve the way bootstrap handles rustlib components)
 - #127201 (Improve run-make-support API)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-07-01 19:33:14 +00:00
Guillaume Gomez
a509b5a0ba
Rollup merge of #127201 - GuillaumeGomez:improve-run-make-support, r=Kobzol
Improve run-make-support API

I think I'll slowly continue this work. Makes things a bit nicer for contributors, so why not. :D

r? ``@Kobzol``
2024-07-01 20:29:59 +02:00
Guillaume Gomez
cb81d0dd05
Rollup merge of #127188 - onur-ozkan:rustc-src-fix, r=Kobzol
improve the way bootstrap handles rustlib components

When CI rustc is enabled, bootstrap tries to symlink the rust source (project root) into target sysroot right before copying it from the CI rustc's sysroot. This becomes a problem in CI builders (which we currently don't see because they don't use CI rustc) because the copying part will fail as [they run on read-only mode](ef3d6fd700/src/ci/docker/run.sh (L233)).

This change fixes the problem by copying `rustc-src` from the CI rustc sysroot and only symlinking `rustc-src` from the rust source when download-rustc is not enabled.

r? ``@Kobzol`` (we talked about this already on Zulip, he knows the context)

Blocker for https://github.com/rust-lang/rust/pull/122709
2024-07-01 20:29:59 +02:00
Guillaume Gomez
61fe6b6c0c
Rollup merge of #127129 - compiler-errors:full-expr-span, r=jieyouxu
Use full expr span for return suggestion on type error/ambiguity

We sometimes use parts of an expression rather than the whole thing for an obligation span. For example, a method obligation will just point to the path segment corresponding to the `method` in `rcvr.method(args)`.

So let's not use that assuming it'll point to the *whole* expression span, which we can access from the expr hir id we store in `ObligationCauseCode::WhereClauseInExpr`.

Fixes #127109
2024-07-01 20:29:58 +02:00
Guillaume Gomez
f5810c4a51
Rollup merge of #127128 - elomatreb:elomatreb/stabilize-duration_abs_diff, r=joboet
Stabilize `duration_abs_diff`

Stabilize `duration_abs_diff` following FCP in #117618. Closes #117618.
2024-07-01 20:29:58 +02:00
Guillaume Gomez
61e7f05895
Rollup merge of #126880 - Rejyr:migrate-rmake-vw, r=Kobzol
Migrate `volatile-intrinsics`, `weird-output-filenames`, `wasm-override-linker`, `wasm-exceptions-nostd` to `rmake`

Also refactors `wasm-abi` and `compressed-debuginfo`.

Part of #121876.

r? ``@jieyouxu``

try-job: x86_64-gnu-debug
try-job: dist-various-2
2024-07-01 20:29:57 +02:00
Guillaume Gomez
6b2e644218
Rollup merge of #126832 - petrochenkov:linkarg, r=jieyouxu
linker: Refactor interface for passing arguments to linker

Separate arguments into passed to the underlying linker, to cc wrapper, or supported by both.
Also avoid allocations in all the argument passing functions.

The interfaces would look nicer if not the limitations on returning `&mut Self` in `dyn`-compatible traits, and unnecessary conflicts between `Trait` and `dyn Trait` methods.

try-job: armhf-gnu
try-job: aarch64-gnu
try-job: dist-x86_64-linux
try-job: x86_64-msvc
try-job: i686-msvc
try-job: dist-x86_64-apple
try-job: test-various
2024-07-01 20:29:56 +02:00
Guillaume Gomez
c4baa3f2f4
Rollup merge of #126753 - compiler-errors:use-style-guide, r=joshtriplett,calebcartwright
Add nightly style guide section for `precise_capturing` `use<>` syntax

r? style

Tracking:

- https://github.com/rust-lang/rust/issues/123432
2024-07-01 20:29:56 +02:00
Guillaume Gomez
61db24d15d
Rollup merge of #126732 - StackOverflowExcept1on:master, r=m-ou-se
Stabilize `PanicInfo::message()` and `PanicMessage`

Resolves #66745

This stabilizes the [`PanicInfo::message()`](https://doc.rust-lang.org/nightly/core/panic/struct.PanicInfo.html#method.message) and [`PanicMessage`](https://doc.rust-lang.org/nightly/core/panic/struct.PanicMessage.html).

Demonstration of [custom panic handler](https://github.com/StackOverflowExcept1on/panicker):
```rust
#![no_std]
#![no_main]

extern crate libc;

#[no_mangle]
extern "C" fn main() -> libc::c_int {
    panic!("I just panic every time");
}

#[panic_handler]
fn my_panic(panic_info: &core::panic::PanicInfo) -> ! {
    use arrayvec::ArrayString;
    use core::fmt::Write;

    let message = panic_info.message();
    let location = panic_info.location().unwrap();

    let mut debug_msg = ArrayString::<1024>::new();
    let _ = write!(&mut debug_msg, "panicked with '{message}' at '{location}'");

    if debug_msg.try_push_str("\0").is_ok() {
        unsafe {
            libc::puts(debug_msg.as_ptr() as *const _);
        }
    }

    unsafe { libc::exit(libc::EXIT_FAILURE) }
}
```
```
$ cargo +stage1 run --release
panicked with 'I just panic every time' at 'src/main.rs:8:5'
```

- [x] FCP: https://github.com/rust-lang/rust/issues/66745#issuecomment-2198143725

r? libs-api
2024-07-01 20:29:55 +02:00
rustbot
8d1065c803 Update books 2024-07-01 13:00:43 -04:00
Camille GILLOT
76244d4dbc Make jump threading state sparse. 2024-07-01 15:41:21 +00:00
Camille GILLOT
1834f5a272 Swap encapsulation of DCP state. 2024-07-01 15:39:59 +00:00
Michael Howell
c8592da16a rustc_data_structures: fix wrong markdown syntax
This didn't produce working footnote links. The unportable markdown
lint warned about it.
2024-07-01 07:21:02 -07:00
Michael Howell
cc1b3ee7f1 clippy: update to pulldown-cmark 0.11 2024-07-01 07:21:02 -07:00
Michael Howell
294c3dda88 rustdoc: add usable lint for pulldown-cmark-0.11 parsing changes 2024-07-01 07:21:02 -07:00
bors
221e2741c3 Auto merge of #127113 - scottmcm:retune-inlining-again, r=oli-obk
Avoid MIR bloat in inlining

In #126578 we ended up with more binary size increases than expected.

This change attempts to avoid inlining large things into small things, to avoid that kind of increase, in cases when top-down inlining will still be able to do that inlining later.

r? ghost
2024-07-01 14:09:39 +00:00
Guillaume Gomez
7276499dc9 Migrate run-make/llvm-ident to rmake.rs 2024-07-01 15:12:13 +02:00
Guillaume Gomez
fc8b6c6657 Add input_file method on LlvmFileCheck 2024-07-01 15:10:13 +02:00
Scott McMurray
23c8ed14c9 Avoid MIR bloat in inlining
In 126578 we ended up with more binary size increases than expected.

This change attempts to avoid inlining large things into small things, to avoid that kind of increase, in cases when top-down inlining will still be able to do that inlining later.
2024-07-01 05:17:13 -07:00
dimi
860729ea39 Stabilize atomic_bool_fetch_not 2024-07-01 14:14:22 +02:00
yukang
8cc1ed81df Fix import suggestion error when failed not from starting 2024-07-01 20:07:29 +08:00
Vadim Petrochenkov
5f9a0d3844 linker: Bail out of rpath logic early if the target doesn't support rpath 2024-07-01 14:19:51 +03:00
Vadim Petrochenkov
af31c338fc linker: Refactor interface for passing arguments to linker 2024-07-01 14:19:51 +03:00
bjorn3
f27645927c Inline Query::default() 2024-07-01 11:00:49 +00:00
bjorn3
ec2d1b0ed2 Minor change 2024-07-01 11:00:49 +00:00