1
Fork 0
Commit graph

278976 commits

Author SHA1 Message Date
bjorn3
056a9cebe9 Respect --target in get_backend_from_raw_matches 2025-01-20 15:47:26 +00:00
bjorn3
d740a3f06a Merge commit '728bc27f32' into sync_cg_clif-2025-01-20 2025-01-20 15:30:04 +00:00
Jiri Bobek
cb2efaf5bc 1. Removed 'rustc_nounwind' 2. Rewording of comments 2025-01-20 16:16:46 +01:00
bjorn3
728bc27f32 Rustup to rustc 1.86.0-nightly (9a1d156f3 2025-01-19) 2025-01-20 14:41:06 +00:00
bjorn3
496b073257 Sync from rust 9a1d156f38 2025-01-20 14:35:25 +00:00
bors
6a64e3b897 Auto merge of #135643 - khuey:135332, r=jieyouxu
When LLVM's location discriminator value limit is exceeded, emit locations with dummy spans instead of dropping them entirely

Dropping them fails `-Zverify-llvm-ir`.

Fixes #135332.

r? `@jieyouxu`
2025-01-20 14:16:22 +00:00
vayunbiyani
c79fc90e9a Updated several files to use rust intrinsic macros instead of the legacy extern "rust-intrinsic" blocks 2025-01-20 09:15:23 -05:00
许杰友 Jieyou Xu (Joe)
e749a38886 docs: update contributing docs for submodule/subtree changes 2025-01-20 21:53:59 +08:00
Lukas Wirth
1eb9d15e42
Merge pull request #18967 from Veykril/push-pwonkmwqmmol
Properly record meaningful imports as re-exports in symbol index
2025-01-20 13:46:52 +00:00
Lukas Wirth
fe034eddc2
Merge pull request #18934 from 1hakusai1/goto_definition_from_into
feat: Add the ability to jump from `into` to `from` definitions
2025-01-20 13:46:47 +00:00
Lukas Wirth
5770977d72
Merge pull request #18982 from Veykril/push-lstmvzsowxyt
Extract variable assist triggers less eagerly
2025-01-20 13:45:26 +00:00
许杰友 Jieyou Xu (Joe)
ecfb55762c
Rollup merge of #135762 - TomFryersMidsummer:patch-1, r=joboet
Correct counting to four in cell module docs

It could also be argued that `OnceCell<T>` and `LazyCell<T>` don't really provide safe interior mutability in different ways. But it's a vague enough claim that I'm not sure it's worth being pedantic about.
2025-01-20 21:45:06 +08:00
许杰友 Jieyou Xu (Joe)
3e26673b29
Rollup merge of #135676 - yotamofek:resolve-cleanups, r=BoxyUwU
rustc_resolve: use structured fields in traces

I think this crate was written before `tracing` was adopted, and was manually writing fields into trace logs instead of using structured fields.

I kept function names in the trace messages even though I added `#[instrument]` invocations so that the events will be in named spans, wasn't sure if spans are always printed.
2025-01-20 21:45:06 +08:00
许杰友 Jieyou Xu (Joe)
a41d652d10
Rollup merge of #135658 - Kobzol:src-tarball-remove-gcc, r=jieyouxu
Do not include GCC source code in source tarballs

The licensing story is unclear, it makes the archive much larger, and we should not need it for building anything in the tarballs (yet).

```
Before:
121s building the archive
1.3 GiB gzipped size
5.7 GiB extracted size
402519 extracted files

After:
64s building the archive
961 MiB gzipped size
4.5 GiB extracted size
257719 extracfed files
```

Fixes: https://github.com/rust-lang/rust/issues/135606

r? `@ehuss`
2025-01-20 21:45:05 +08:00
许杰友 Jieyou Xu (Joe)
e7f53663de
Rollup merge of #135626 - clubby789:env-note, r=ibraheemdev
doc: Point to methods on `Command` as alternatives to `set/remove_var`

Make these methods more discoverable, as configuring a child process is a common reason for manipulating the environment.
2025-01-20 21:45:04 +08:00
许杰友 Jieyou Xu (Joe)
bdd88ddd30
Rollup merge of #135433 - tanvincible:patch-1, r=onur-ozkan
Add Profile Override for Non-Git Sources

## PR description

- Fixes #135358

This PR introduces the following updates to

1. `bootstrap.py`:
    - If the `profile` is `None` and the source is non-git, the `profile` is automatically overridden to `"dist"`.
    - Ensures that options like `download-ci-llvm` and `download-rustc` are not used with non-git sources. An exception is raised if these options are present in the configuration when the source is non-git.

2. `bootstrap_test.py`
   - Added unit tests to verify both the profile override mechanism and the assertion for restricted options.
These tests ensure the correct behavior for non-git sources and the handling of `if-unchanged` options.

r? `@onur-ozkan`
`@rustbot` T-bootstrap
2025-01-20 21:45:04 +08:00
Lukas Wirth
2233c31531
Merge pull request #18972 from osiewicz/drop-outgoing-messages-on-background-thread
lsp-server: Drop outgoing messages on background thread
2025-01-20 13:39:29 +00:00
Lukas Wirth
64d4181a3c
Merge pull request #18976 from ChayimFriedman2/non-module-generic-args
fix: Fix a bug where enum variants were not considered properly in type ns resolution
2025-01-20 13:35:03 +00:00
Lukas Wirth
4193abc3fe Fix import search not discarding rawness 2025-01-20 14:29:11 +01:00
Lukas Wirth
7ddeabaa74 Less allocs 2025-01-20 14:29:11 +01:00
Lukas Wirth
dbf7ccc889 Preserve impl assoc names in ImplData 2025-01-20 14:29:11 +01:00
Lukas Wirth
70e93ed898 Vec -> Box<[_]> 2025-01-20 14:29:11 +01:00
Lukas Wirth
241fd2ff4d Properly record meaningful imports as re-exports in symbol index 2025-01-20 14:29:11 +01:00
1hakusai1
f7096db910 Add a test case 2025-01-20 21:22:58 +09:00
1hakusai1
55aee5470b Use Semantics::resolve_method_call_as_callable to find implementation 2025-01-20 21:17:48 +09:00
bors
b5741a36a8 Auto merge of #135754 - jieyouxu:rollup-j4q1hpr, r=jieyouxu
Rollup of 7 pull requests

Successful merges:

 - #135542 (Add the concrete syntax for precise capturing to 1.82 release notes.)
 - #135700 (Emit single privacy error for struct literal with multiple private fields and add test for `default_field_values` privacy)
 - #135722 (make it possible to use ci-rustc on tarball sources)
 - #135729 (Add debug assertions to compiler profile)
 - #135736 (rustdoc: Fix flaky doctest test)
 - #135738 (Replace usages of `map_or(bool, ...)` with `is_{some_and|none_or|ok_and}`)
 - #135747 (Rename FileName::QuoteExpansion to CfgSpec)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-20 10:35:43 +00:00
Tom Fryers
8ba0d2db18
Correct counting to four in cell module docs 2025-01-20 10:16:27 +00:00
Laurențiu Nicola
618b913663
Merge pull request #18981 from Fabian-Gruenbichler/proc-macro-srv-portability
proc-macro-srv: make usage of RTLD_DEEPBIND portable
2025-01-20 09:35:11 +00:00
Laurențiu Nicola
141e53b715
Merge pull request #18980 from lnicola/sync-from-rust
minor: Sync from downstream
2025-01-20 09:29:00 +00:00
Fabian Grünbichler
5f4f6fb961 proc-macro-srv: make usage of RTLD_DEEPBIND portable
the constant is wrong on some platforms (e.g., on mips64el it's 0x10, and 0x8
is RTLD_NOLOAD which makes all this functionality broken), the libc crate takes
care of those differences for us.

fallback to not setting the flag in non-glibc environments - some of them might
have support for it using a different value that we don't know about, and some
of them lack it entirely.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2025-01-20 10:19:24 +01:00
Laurențiu Nicola
3af5c080e6 Bump rustc crates 2025-01-20 11:12:56 +02:00
Laurențiu Nicola
4cf9f491aa Merge from rust-lang/rust 2025-01-20 11:09:36 +02:00
Laurențiu Nicola
b81474b722 Preparing for merge from rust-lang/rust 2025-01-20 11:09:18 +02:00
bors
ecda83b30f Auto merge of #135755 - jieyouxu:rollup-rdwbhod, r=jieyouxu
Rollup of 5 pull requests

Successful merges:

 - #134276 (fully de-stabilize all custom inner attributes)
 - #135237 (Match Ergonomics 2024: document and reorganize the currently-implemented feature gates)
 - #135310 (Always force non-trimming of path in `unreachable_patterns` lint)
 - #135446 (further improve panic_immediate_abort by removing rtprintpanic! messages)
 - #135491 (Remove dead rustc_allowed_through_unstable_modules for std::os::fd contents)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-20 07:51:13 +00:00
Yotam Ofek
539b4d8555 rustc_resolve: use structured fields in traces 2025-01-20 07:20:02 +00:00
Tanvi Pooranmal Meena
7d806171d0 Add logic to override profile for non git sources 2025-01-20 11:07:32 +05:30
许杰友 Jieyou Xu (Joe)
e1e26f339d
Rollup merge of #135491 - RalfJung:remove-dead-rustc_allowed_through_unstable_modules, r=Mark-Simulacrum
Remove dead rustc_allowed_through_unstable_modules for std::os::fd contents

As far as I was able to reconstruct, the history here is roughly as follows:
- https://github.com/rust-lang/rust/pull/99723 added some `rustc_allowed_through_unstable_modules` to the types in `std::os::fd::raw` since they were accessible on stable via the unstable `std::os::wasi::io::AsRawFd` path. (This was needed to fix https://github.com/rust-lang/rust/issues/99502.)
- Shortly thereafter, https://github.com/rust-lang/rust/pull/98368 re-organized things so that instead of re-exporting from an internal  `std::os::wasi::io::raw`,   `std::os::wasi::io::AsRawFd` is now directly re-exported from `std::os::fd`. This also made `library/std/src/os/wasi/io/raw.rs` entirely dead code as far as I can tell, it's not imported by anything any more.
- Shortly thereafter, https://github.com/rust-lang/rust/pull/103308 stabilizes `std::os::wasi::io`, so `rustc_allowed_through_unstable_modules` is not needed any more to access `std::os::wasi::io::AsRawFd`. There is even a comment in `library/std/src/os/wasi/io/raw.rs` saying the attribute can be removed now, but that file is dead code so it is not touched as part of the stabilization.

I did a grep for `pub use crate::os::fd` and all the re-exports I could find are in stable modules. So given all that, we can remove the  `rustc_allowed_through_unstable_modules` (hoping they are not also re-exported somewhere else, it's really hard to be sure about this).

I have checked that std still builds after this PR on the wasm32-wasip2 target.
2025-01-20 12:38:32 +08:00
许杰友 Jieyou Xu (Joe)
e5b85035fe
Rollup merge of #135446 - klensy:panic_immediate_abort_ext, r=Mark-Simulacrum
further improve panic_immediate_abort by removing rtprintpanic! messages

Reduces binary size using `panic_immediate_abort` by removing strings used by `rtprintpanic!`.

for `main.rs`
```rust
fn main() {
    println!("Hello, world!");
}
```
with `Cargo.toml`
```toml
[package]
name = "tst"
version = "0.1.0"
edition = "2024"

[dependencies]

[profile.release]
lto = true
codegen-units = 1
panic = "abort"

```

and build with `RUSTFLAGS="-Zlocation-detail=none -Zfmt-debug=none" cargo +stage-1 b -r -Z build-std=std,panic_abort -Z build-std-features=optimize_for_size,panic_immediate_abort` for `x86_64-unknown-linux-gnu`

This reduces size:
| before |  after | type |
| - | - | - |
| 25256 | 21880 | unstripped |
| 18072 | 15288 | stripped |
2025-01-20 12:38:32 +08:00
许杰友 Jieyou Xu (Joe)
3f2f695d68
Rollup merge of #135310 - estebank:issue-135289, r=Nadrieril
Always force non-trimming of path in `unreachable_patterns` lint

Creating a "trimmed DefID path" when no error is being emitted is an ICE (on purpose). If we create a trimmed path for a lint that is then silenced before being emitted causes a known ICE. This side-steps the issue by always using `with_no_trimmed_path!`.

This was verified to fix https://github.com/quinn-rs/quinn/, but couldn't write a repro case for the test suite.

Fix #135289.
2025-01-20 12:38:31 +08:00
许杰友 Jieyou Xu (Joe)
1419f79acf
Rollup merge of #135237 - dianne:match-2024-cleanup, r=Nadrieril
Match Ergonomics 2024: document and reorganize the currently-implemented feature gates

The hope here is to make it easier to adjust, understand, and test the experimental pattern typing rules implemented in the compiler. This PR doesn't (or at isn't intended to) change any behavior or add any new tests; I'll be handling that later. I've also included some reasoning/commentary on the more involved changes in the commit messages.

Relevant tracking issue: #123076

r? `@Nadrieril`
2025-01-20 12:38:31 +08:00
许杰友 Jieyou Xu (Joe)
be8f1f9949
Rollup merge of #134276 - RalfJung:destabilize-custom-inner-attr, r=SparrowLii
fully de-stabilize all custom inner attributes

`#![test]` and `#![rustfmt::skip]` were accidentally accepted in more places than they should. These have been marked as soft-unstable since forever (https://github.com/rust-lang/rust/pull/82399) and shown in future-compat reports since Rust 1.77 (https://github.com/rust-lang/rust/pull/116274).

Cc `@rust-lang/lang` `@petrochenkov`
2025-01-20 12:38:30 +08:00
许杰友 Jieyou Xu (Joe)
82a239c798
Rollup merge of #135747 - ehuss:filename-quote, r=SparrowLii
Rename FileName::QuoteExpansion to CfgSpec

I believe this variant name was used incorrectly. The timeline is roughly:

* `FileName::cfg_spec_source_code` was added in https://github.com/rust-lang/rust/pull/54517. However, it used `FileName::Quote` instead of `FileName::CfgSpec` which I believe was a mistake.
* Quote stuff was removed in https://github.com/rust-lang/rust/pull/51285, but did not remove `FileName::Quote`.
* `FileName::CfgSpec` was removed in https://github.com/rust-lang/rust/pull/116474 because it was unused.

This restores it so that the `--cfg` variant uses a name that makes more sense with how it is used, and restores what I think is the original intent.
2025-01-20 12:37:56 +08:00
许杰友 Jieyou Xu (Joe)
f3f21ae6a4
Rollup merge of #135738 - yotamofek:map_or_true-compiler, r=compiler-errors
Replace usages of `map_or(bool, ...)` with `is_{some_and|none_or|ok_and}`

Split out from #135732 according to https://github.com/rust-lang/rust/pull/135732?pullrequestreview-2561072330 ,
same thing but just for the compiler:

> The usage of `map_or(bool, ...)` is really hard to understand IMHO.
> This PR simply uses clippy (with `--fix`) to replace that with `is_{some_and|none_or|ok_and}`.
> (no manual modifications were made, just machine applicable clippy fixes and then fmt)

r? ``@compiler-errors``
2025-01-20 12:37:56 +08:00
许杰友 Jieyou Xu (Joe)
64768c5630
Rollup merge of #135736 - fmease:rustdoc-fix-flaky-test, r=GuillaumeGomez
rustdoc: Fix flaky doctest test

Fixes #135660.
2025-01-20 12:37:55 +08:00
许杰友 Jieyou Xu (Joe)
9cd0e8efdc
Rollup merge of #135729 - Noratrieb:compiler-profile-debug-assert, r=lqd
Add debug assertions to compiler profile

Working on the compiler without debug assertions is not a very productive way to work on the compiler.
2025-01-20 12:37:55 +08:00
许杰友 Jieyou Xu (Joe)
afdf3aa457
Rollup merge of #135722 - onur-ozkan:handle-tarball-ci-commit, r=jieyouxu
make it possible to use ci-rustc on tarball sources

Previously, bootstrap was using `Config::last_modified_commit` unconditionally to figure the commit to download precompiled rustc artifact from CI, which was leading builds to fail on tarball sources as `Config::last_modified_commit` requires `git` to be present in the project source. This change makes bootstrap to call `Config::last_modified_commit` only when it's running on git-managed source and read `git-commit-hash` file otherwise.
2025-01-20 12:37:54 +08:00
许杰友 Jieyou Xu (Joe)
6db2d1aae5
Rollup merge of #135700 - estebank:priv-field-dfv, r=wesleywiser
Emit single privacy error for struct literal with multiple private fields and add test for `default_field_values` privacy

Add test ensuring that struct with default field values is not constructable if the fields are not accessible.

Collect all unreachable fields in a single struct literal struct and emit a single error, instead of one error per private field.

```
error[E0451]: fields `beta` and `gamma` of struct `Alpha` are private
  --> $DIR/visibility.rs:18:13
   |
LL |     let _x = Alpha {
   |              ----- in this type
LL |         beta: 0,
   |         ^^^^^^^ private field
LL |         ..
   |         ^^ field `gamma` is private
```
2025-01-20 12:37:54 +08:00
许杰友 Jieyou Xu (Joe)
5740a552e3
Rollup merge of #135542 - kpreid:use-note, r=Mark-Simulacrum
Add the concrete syntax for precise capturing to 1.82 release notes.

This will make the note findable by searching for the “use” keyword, and skimming. Many other language additions mention their syntax in the release notes, but this one only used the name of the feature.

Inspired by https://users.rust-lang.org/t/what-is-use/124079/4
2025-01-20 12:37:53 +08:00
Scott McMurray
b2b12ae0cb Add an example of using carrying_mul_add to write wider multiplication
Just the basic quadratic version that you wouldn't actually want for a true bigint, but it's nice and short so is useful as an example :)
2025-01-19 16:15:00 -08:00
dianne
0263772bac elaborate/clarify the comments on InheritedRefMatchRule's variants 2025-01-19 16:03:15 -08:00