1
Fork 0
Commit graph

278813 commits

Author SHA1 Message Date
dianne
586ff158a2 "structural" ruleset: match against the inherited ref when a reference pattern doesn't match the mutability of an inner reference
This is the `Deref(EatInner, FallbackToOuter)` rule in Typing Rust Patterns.
2025-01-20 16:03:37 -08:00
dianne
f8315ae3b5 "structural" ruleset: use the "classic" ruleset's diagnostic and fallback for inherited ref mutability mismatches
I think the diagnostic could use some work, but it's more helpful than
the alternative. The previous error was misleading, since it ignored the
inherited reference altogether.
2025-01-20 16:03:37 -08:00
dianne
c03769524b "structural" ruleset: account for dbm mutability cap in Deref(EatInner) rules 2025-01-20 16:03:37 -08:00
dianne
c57708a58d add more tests where the rulesets disagree
These come directly from the "Compare" tab of Typing Rust Patterns,
though they had to be split across multiple files. They're not
comprehensive, but they do provide some previously-missing coverage and
are easier to check against the spec. Possibly they should be split up
some more, since `pattern-errors.rs` is getting a bit unwieldy, but I'm
not sure how best to go about that.
2025-01-20 16:03:37 -08:00
dianne
a56f9ad574 remove Rule 3 from ref_pat_eat_one_layer_2024
The debug assertion ensuring that the pattern mutability cap holds
assumes the presence of Rule 3, so it now checks for that. I
considered going back to only tracking the mutability cap when Rule 3
is present, but since the mutability cap is used in Rule 5's
implementation too, the debug assertion would still need to check
which typing rules are present.

This also required some changes to tests:
- `ref_pat_eat_one_layer_2021.rs` had a test for Rule 3; I'll be
handling tests for earlier editions in a later commit, so as a stopgap
I've #[cfg]ed it out.
- One test case had to be moved from `well-typed-edition-2024.rs` to
`borrowck-errors.rs` in order to get borrowck to run on it and emit an
error.
2025-01-20 16:03:36 -08:00
bors
f3d1d47fd8 Auto merge of #135789 - matthiaskrgr:rollup-4cvw8s4, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #133695 (Reexport likely/unlikely in std::hint)
 - #135330 (Respect --sysroot for rustc -vV and -Cpasses=list)
 - #135333 (Partial progress on #132735: Replace extern "rust-intrinsic" with #[rustc_intrinsic] across the codebase)
 - #135741 (Recognise new IPv6 documentation range from IETF RFC 9637)
 - #135770 (Update contributing docs for submodule/subtree changes)
 - #135775 (Subtree update of `rust-analyzer`)
 - #135776 (Subtree sync for rustc_codegen_cranelift)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-20 20:41:33 +00:00
Matthias Krüger
67b609a919
Rollup merge of #135776 - bjorn3:sync_cg_clif-2025-01-20, r=bjorn3
Subtree sync for rustc_codegen_cranelift

Nothing too exciting this time, but this includes a fix for a linker hang on Windows: https://github.com/rust-lang/rustc_codegen_cranelift/pull/1554

r? ``@ghost``

``@rustbot`` label +A-codegen +A-cranelift +T-compiler
2025-01-20 20:58:38 +01:00
Matthias Krüger
b0eadb1a37
Rollup merge of #135775 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? ``@ghost``
2025-01-20 20:58:37 +01:00
Matthias Krüger
ab69a954d6
Rollup merge of #135770 - jieyouxu:subtree-submodule-contributing, r=Kobzol
Update contributing docs for submodule/subtree changes

Noticed in https://github.com/rust-lang/rust/pull/135337#issuecomment-2602434736.

r? ``@Kobzol`` (or anyone really)
2025-01-20 20:58:37 +01:00
Matthias Krüger
8a7db695a6
Rollup merge of #135741 - bardiharborow:std/net/rfc9637, r=Amanieu
Recognise new IPv6 documentation range from IETF RFC 9637

This PR adds the `3fff::/20` range defined by [IETF RFC 9637](https://datatracker.ietf.org/doc/rfc9637/) to those ranges which `Ipv6Addr::is_documentation` recognises as a documentation IP.

See also: https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml
Unstable tracking issue: #27709
2025-01-20 20:58:36 +01:00
Matthias Krüger
0d5b8138bb
Rollup merge of #135333 - vayunbiyani:test-environment, r=RalfJung
Partial progress on #132735: Replace extern "rust-intrinsic" with #[rustc_intrinsic] across the codebase

Part of #132735: Replace `extern "rust-intrinsic"` with `#[rustc_intrinsic]` macro

- Updated all instances of `extern "rust-intrinsic"` to use the `#[rustc_intrinsic]` macro.
- Skipped `.md` files and test files to avoid unnecessary changes.
2025-01-20 20:58:35 +01:00
Matthias Krüger
c8c5fa4893
Rollup merge of #135330 - bjorn3:respect_sysroot_in_version_printing, r=lqd
Respect --sysroot for rustc -vV and -Cpasses=list

This is necessary when the specified codegen backend is in a custom sysroot.

Fixes https://github.com/rust-lang/rust/issues/135165
2025-01-20 20:58:35 +01:00
Matthias Krüger
bbec1510bb
Rollup merge of #133695 - x17jiri:hint_likely, r=Amanieu
Reexport likely/unlikely in std::hint

Since `likely`/`unlikely` should be working now, we could reexport them in `std::hint`. I'm not sure if this is already approved or if it requires approval

Tracking issue: #26179
2025-01-20 20:58:34 +01:00
bors
9f4d9dc102 Auto merge of #135769 - jieyouxu:rollup-3h384pz, r=jieyouxu
Rollup of 5 pull requests

Successful merges:

 - #135433 (Add Profile Override for Non-Git Sources)
 - #135626 (doc: Point to methods on `Command` as alternatives to `set/remove_var`)
 - #135658 (Do not include GCC source code in source tarballs)
 - #135676 (rustc_resolve: use structured fields in traces)
 - #135762 (Correct counting to four in cell module docs)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-20 17:07:30 +00:00
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