Commit Graph

269109 Commits

Author SHA1 Message Date
Ralf Jung
eea74be5c1 interpret errors: add map_err_kind, rename InterpError -> InterpErrorKind 2024-10-19 09:22:38 +02:00
许杰友 Jieyou Xu (Joe)
65458aed68 bootstrap: allow setting --jobs in config.toml 2024-10-19 13:35:41 +08:00
bors
0c374048b6 Auto merge of #18336 - xuwaters:patch-1, r=lnicola
Fix: Increase TOKEN_LIMIT in hir-expand

Due to the `TOKEN_LIMIT`, rust-analyzer failed to expand macro for `web-sys::WebGl2RenderingContext` https://github.com/rustwasm/wasm-bindgen/blob/main/crates/web-sys/src/features/gen_WebGl2RenderingContext.rs

<img width="780" alt="image" src="https://github.com/user-attachments/assets/3a39f18e-656e-43df-9994-0a0179fa42ac">
<img width="403" alt="image" src="https://github.com/user-attachments/assets/7ae8dcf9-a40a-4070-8623-dd3a953bbf45">

After increasing the `TOKEN_LIMIT`, the `web-sys::WebGl2RenderingContext` can be expanded successfully:
<img width="459" alt="image" src="https://github.com/user-attachments/assets/76a71763-05a5-4f14-a5c9-61fc190c668f">
2024-10-19 05:11:52 +00:00
Jubilee Young
62aa8f0740 compiler: Embed consensus in lint::types::improper_ctypes
Extracting this logic into a module makes it easier to write down, and
more importantly, later find, the actual decisions we've made.
2024-10-18 21:59:29 -07:00
bors
f075375e65 Auto merge of #18335 - SomeoneToIgnore:editorconfig-glob, r=lnicola
internal: Fix editorconfig glob

Had been testing Zed's editorconfig branch on r-a and noticed that something was odd with yaml files.

https://spec.editorconfig.org/#glob-expressions

> {s1,s2,s3}

> any of the strings given (separated by commas, can be nested) (But {s1} only matches {s1} literally.)
2024-10-19 04:55:39 +00:00
bors
b27f33a4d9 Auto merge of #131910 - weihanglo:update-cargo, r=weihanglo
Update cargo

7 commits in 8c30ce53688e25f7e9d860b33cc914fb2957ca9a..cf53cc54bb593b5ec3dc2be4b1702f50c36d24d5
2024-10-15 16:43:16 +0000 to 2024-10-18 13:56:15 +0000
- feat: Stabilize MSRV-aware resolver config (rust-lang/cargo#14639)
- Help with `[patch.crates.io]` (rust-lang/cargo#14700)
- test: Migrate publish snapshotting to snapbox (rust-lang/cargo#14642)
- Bump to 0.85.0; update changelog (rust-lang/cargo#14695)
- Fix typo in faq.md (rust-lang/cargo#14696)
- fix(registry): `HttpRegistry` `block_until_ready` returns early when work is still pending (rust-lang/cargo#14694)
- fix(resolver): avoid cloning when iterating using RcVecIter (rust-lang/cargo#14690)
2024-10-19 02:50:54 +00:00
Alona Enraght-Moony
3cf8a61a7a rustdoc: Switch from FxHash to sha256 for static file hashing. 2024-10-19 01:05:58 +00:00
Jubilee Young
888efe74a3 cg_llvm: Switch llvm::add_global to &CStr 2024-10-18 17:46:33 -07:00
Wei Xu
0590422812
Increase TOKEN_LIMIT for hir-expand 2024-10-18 17:36:24 -07:00
lcnr
d836d35739 refactor fudge_inference, handle effect vars 2024-10-19 00:41:56 +02:00
Kirill Bulatov
1a93651b8c Fix editorconfig glob 2024-10-19 01:10:31 +03:00
Weihang Lo
e541058b0e
Update cargo 2024-10-18 18:00:28 -04:00
printfn
be984c1889 Update use keyword docs to describe precise capturing 2024-10-18 21:17:08 +00:00
bors
e92993dbb4 Auto merge of #131892 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

One day late with the sync, as I was sick yesterday.

Cargo.lock update includes Clippy version bump and some deps cleanup we did in Clippy to match more versions used in the Rust repo.

r? `@Manishearth`
2024-10-18 20:06:31 +00:00
Jubilee Young
b9c96780b4 compiler: Revert -Zregparm handling for extern Rust 2024-10-18 11:59:20 -07:00
Jubilee Young
d6f5b437e5 compiler: Enable test for regparm on different hosts 2024-10-18 11:59:20 -07:00
Ayush Singh
753536aba8
std: uefi: Use common function for UEFI shell
- Since in almost all cases, there will only be 1 UEFI shell, share the
  shell handle between all functions that require it.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2024-10-18 22:56:15 +05:30
Ayush Singh
588bfb4d50
std: uefi: Add basic Env variables
- Implement environment variable functions
- Using EFI Shell protocol.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2024-10-18 22:56:08 +05:30
bors
f7b5e5471b Auto merge of #131895 - jieyouxu:rollup-jyt3pic, r=jieyouxu
Rollup of 3 pull requests

Successful merges:

 - #126207 (std::unix::stack_overflow::drop_handler addressing todo through libc …)
 - #131864 (Never emit `vptr` for empty/auto traits)
 - #131870 (compiletest: Store test collection context/state in two structs)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-10-18 17:23:35 +00:00
Michael Goulet
1617501eea Mark unexpected variant res suggestion as having placeholders 2024-10-18 12:30:27 -04:00
许杰友 Jieyou Xu (Joe)
1af9d11583 Expand test coverage for deny-inside-forbid interactions 2024-10-18 18:18:41 +02:00
Noratrieb
e78d78868a Allow #[deny(..)] inside #[forbid(..)] as a no-op with a warning
Forbid cannot be overriden. When someome tries to do this anyways,
it results in a hard error. That makes sense.

Except it doesn't, because macros. Macros may reasonably use `#[deny]`
in their expansion to assert
that their expanded code follows the lint. This is doesn't work when the
output gets expanded into a `forbid()` context. This is pretty silly,
since both the macros and the code agree on the lint!

Therefore, we allow `#[deny(..)]`ing a lint that's already forbidden,
keeping the level at forbid.
2024-10-18 18:18:41 +02:00
Falco Hirschenberger
8f2273e518 Fix #131471, range misleading field access
Fixes #131471 by checking if the range-start is a literal.
2024-10-18 17:27:28 +02:00
bors
0790356a0c Auto merge of #18300 - krobelus:clamp-position-character-2, r=Veykril
Clamp Position::character to line length 2/2

Completes https://github.com/rust-lang/rust-analyzer/pull/18243

I don't think I have permissions to target this on the other PR, so we'll need to rebase manually
2024-10-18 13:53:44 +00:00
许杰友 Jieyou Xu (Joe)
43e50932f2
Rollup merge of #131870 - Zalathar:test-collector, r=jieyouxu
compiletest: Store test collection context/state in two structs

This is another incremental cleanup that untangles some of the parameter passing during test collection, making it easier to see which pieces of context information are read-only, and making it easier to find where each field is used.
2024-10-18 14:52:26 +01:00
许杰友 Jieyou Xu (Joe)
765e8c75b0
Rollup merge of #131864 - lrh2000:upcast_reorder, r=WaffleLapkin
Never emit `vptr` for empty/auto traits

Emiting `vptr`s for empty/auto traits is unnecessary (#114942) and causes unsoundness in `trait_upcasting` (#131813). This PR should ensure that we never emit vtables for such traits. See the linked issues for more details.

I'm not sure if I can add tests for the vtable layout. So this PR only adds tests for the soundness hole (i.e., the segmentation fault will disappear after this PR).

Fixes #114942
Fixes #131813

Cc #65991 (tracking issue for `trait_upcasting`)

r? `@WaffleLapkin`  (per https://github.com/rust-lang/rust/issues/131813#issuecomment-2419969745)
2024-10-18 14:52:25 +01:00
许杰友 Jieyou Xu (Joe)
39af44dae9
Rollup merge of #126207 - devnexen:stack_overflow_libc_upd, r=joboet
std::unix::stack_overflow::drop_handler addressing todo through libc …

…update
2024-10-18 14:52:25 +01:00
bors
b0c2d2e5b0 Auto merge of #131841 - paulmenage:futex-abstraction, r=joboet
Abstract the state type for futexes

In the same way that we expose `SmallAtomic` and `SmallPrimitive` to allow Windows to use a value other than an `AtomicU32` for its futex state, switch the primary futex state type from `AtomicU32` to `futex::Futex`.  The `futex::Futex` type should be usable as an atomic value with underlying primitive type equal to `futex::Primitive`. (`SmallAtomic` is also renamed to `SmallFutex`).

This allows supporting the futex API on systems where the underlying kernel futex implementation requires more user state than simply an `AtomicU32`.

All in-tree futex implementations simply define {`Futex`,`Primitive`} directly as {`AtomicU32`,`u32`}.
2024-10-18 13:43:57 +00:00
Johannes Altmanninger
00318bacba Clamp Position::character to line length
LSP says about Position::character

> If the character value is greater than the line length it defaults back to the line length.

but from_proto::offset() doesn't implement this.

A client might for example request code actions for a whole line by sending
Position::character=99999.  I don't think there is ever a reason (besides laziness) why the
client can't specify the line length instead but I guess we should not crash but follow protocol.

Technically it should be a warning, not an error but warning is not shown by default so keep
it at error I guess.

Fixes #18240
2024-10-18 15:07:13 +02:00
Philipp Krones
cf918d5601
Hotfix TRAIT_METHODS static->const 2024-10-18 14:54:06 +02:00
bors
8305c1927a Auto merge of #18324 - davidbarsky:davidbarsky/fix-some-node-dependencies, r=lnicola
vscode: update some dependencies

I bumped Typescript and vsce; was a little tired of the warnings when running `vsce`.
2024-10-18 12:48:40 +00:00
David Barsky
f01ebd6d13 vscode: update some dependencies 2024-10-18 08:43:14 -04:00
David Barsky
db6824a447 internal: fix lldb-dap unconditionally calling rustc 2024-10-18 08:43:13 -04:00
Philipp Krones
375ca8d90f
Update Cargo.lock 2024-10-18 13:44:57 +02:00
Philipp Krones
849a19f242
Merge commit 'a109190d7060236e655fc75533373fa274ec5343' into clippy-subtree-update 2024-10-18 13:44:06 +02:00
bors
4fc517264e Auto merge of #18320 - davidbarsky:davidbarsky/fix-lldb-dap-calling-rustc, r=Veykril
internal: fix lldb-dap unconditionally calling rustc

Fixes https://github.com/rust-lang/rust-analyzer/issues/18318. I also took the opportunity to refactor how `discoverSourceFileMap` worked—it now returns a type instead of mutating a map in place.

I tested this change using the LLDB DAP extension. I needed to set `"lldb-dap.executable-path": "/Applications/Xcode.app/Contents/Developer/usr/bin/lldb-dap"` for everything to work, however, but once I did, was able to successfully debug a test.
2024-10-18 11:38:01 +00:00
bors
a109190d70 Auto merge of #13561 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

changelog: none
2024-10-18 11:31:05 +00:00
Philipp Krones
4b5d1894db
Bump nightly version -> 2024-10-18 2024-10-18 13:26:07 +02:00
Philipp Krones
4d5eaa0344
Bump Clippy version -> 0.1.84 2024-10-18 13:25:50 +02:00
Philipp Krones
224d1e323a
Merge remote-tracking branch 'upstream/master' into rustup 2024-10-18 13:25:37 +02:00
bors
03cfa8e234 Auto merge of #18243 - krobelus:clamp-position-character, r=Veykril
Clamp Position::character to line length

LSP says about Position::character

> If the character value is greater than the line length it defaults back to the line length.

but from_proto::offset() doesn't implement this.

A client might for example request code actions for a whole line by sending
Position::character=99999.  I don't think there is ever a reason (besides laziness) why the
client can't specify the line length instead but I guess we should not crash but follow protocol.

Not sure how to update Cargo.lock (lib/README.md doesn't say how).

Fixes #18240
2024-10-18 11:23:05 +00:00
bors
1350eead10 Auto merge of #131887 - jieyouxu:rollup-ftik4ni, r=jieyouxu
Rollup of 9 pull requests

Successful merges:

 - #130136 (Partially stabilize const_pin)
 - #131755 (Regression test for AVR `rjmp` offset)
 - #131774 (Add getentropy for RTEMS)
 - #131802 (Dont ICE when computing coverage of synthetic async closure body)
 - #131809 (Fix predicate signatures in retain_mut docs)
 - #131858 (Remove outdated documentation for `repeat_n`)
 - #131866 (Avoid use imports in `thread_local_inner!`)
 - #131874 (Default to the medium code model on OpenHarmony LoongArch target)
 - #131877 (checktools.sh: add link to issue for more context about disabled Miri tests)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-10-18 11:11:43 +00:00
许杰友 Jieyou Xu (Joe)
80a8f7b041
Rollup merge of #131877 - RalfJung:checktools-comment, r=ChrisDenton
checktools.sh: add link to issue for more context about disabled Miri tests

Adds some context for the changes made in https://github.com/rust-lang/rust/pull/130072.
2024-10-18 12:00:54 +01:00
许杰友 Jieyou Xu (Joe)
9a664a0a96
Rollup merge of #131874 - heiher:loong-ohos-medium, r=jieyouxu
Default to the medium code model on OpenHarmony LoongArch target

The context for this is #130266: setting the medium code model for the `loongarch64-linux-ohos` target.

r? ```@jieyouxu```
2024-10-18 12:00:54 +01:00
许杰友 Jieyou Xu (Joe)
af85d5280a
Rollup merge of #131866 - jieyouxu:thread_local, r=jhpratt
Avoid use imports in `thread_local_inner!`

Previously, the use imports in `thread_local_inner!` can shadow user-provided types or type aliases of the names `Storage`, `EagerStorage`, `LocalStorage` and `LocalKey`. This PR fixes that by dropping the use imports and instead refer to the std-internal types via fully qualified paths. A basic test is added to ensure `thread_local!`s with static decls with type names that match the aforementioned std-internal type names can successfully compile.

Fixes #131863.
2024-10-18 12:00:53 +01:00
许杰友 Jieyou Xu (Joe)
64bf99b476
Rollup merge of #131858 - AnthonyMikh:AnthonyMikh/repeat_n-is-not-that-special-anymore, r=jhpratt
Remove outdated documentation for `repeat_n`

After #106943, which made `Take<Repeat<I>>` implement `ExactSizeIterator`, part of documentation about difference from `repeat(x).take(n)` is no longer valid.

````@rustbot```` labels: +A-docs, +A-iterators
2024-10-18 12:00:52 +01:00
许杰友 Jieyou Xu (Joe)
759820e631
Rollup merge of #131809 - collinoc:fix-retain-mut-docs, r=jhpratt
Fix predicate signatures in retain_mut docs

This is my first PR here so let me know if I'm doing anything wrong.

The docs for `retain_mut` in `LinkedList` and `VecDeque` say the predicate takes `&e`, but it should be `&mut e` to match the actual signature. `Vec` [has it documented](https://doc.rust-lang.org/std/vec/struct.Vec.html#method.retain_mut) correctly already.
2024-10-18 12:00:52 +01:00
许杰友 Jieyou Xu (Joe)
aae4730c78
Rollup merge of #131802 - compiler-errors:fnonce-coverage, r=Zalathar
Dont ICE when computing coverage of synthetic async closure body

I'm not totally certain if this is *right*, but at least it doesn't ICE.

The issue is that we end up generating two MIR bodies for each async closure, since the `FnOnce` and `Fn`/`FnMut` implementations have different borrowing behavior of their captured variables. They should ideally both contribute to the coverage, since those MIR bodies are (*to the user*) the same code and should have no behavioral differences.

This PR at least suppresses the ICEs, and then I guess worst case we can fix this the right way later.

r? Zalathar or re-roll

Fixes #131190
2024-10-18 12:00:51 +01:00
许杰友 Jieyou Xu (Joe)
951c0cd6f3
Rollup merge of #131774 - thesummer:rtems-add-getentropy, r=joboet
Add getentropy for RTEMS

RTEMS provides the `getentropy` function.
Use this for providing random data.

This PR enables the `getentropy` function for the RTEMS operating system to get random data.
It is exposed via libc  (see https://github.com/rust-lang/libc/pull/3975).
2024-10-18 12:00:51 +01:00
许杰友 Jieyou Xu (Joe)
ebff167966
Rollup merge of #131755 - jfrimmel:avr-rjmp-offset-regression-test, r=jieyouxu
Regression test for AVR `rjmp` offset

This adds a regression test for #129301 by minimizing the code in the linked issue and putting it into a `#![no_core]`-compatible format, so that it can easily be used within an `rmake`-test. This needs to be a `rmake` test (opposed to a `tests/assembly` one), since the linked issue describes, that the problem only occurs if the code is directly compiled. Note, that `lld` is used instead of `avr-gcc`; see the [comments](https://github.com/rust-lang/rust/pull/131755#issuecomment-2416469675) [below](https://github.com/rust-lang/rust/pull/131755#issuecomment-2417160045).
Closes #129301.

To show, that the test actually catches the wrong behavior, this can be tested with a faulty rustc:
```bash
$ rustup install nightly-2024-08-19
$ rustc +nightly-2024-08-19 -C opt-level=s -C panic=abort --target avr-unknown-gnu-atmega328 -Clinker=build/x86_64-unknown-linux-gnu/ci-llvm/bin/lld -Clink-arg='--entry=main' -o compiled tests/run-make/avr-rjmp-offset/avr-rjmp-offsets.rs
$ llvm-objdump -d compiled | grep '<main>' -A 6
000110b4 <main>:
   110b4: 81 e0         ldi     r24, 0x1
   110b6: 92 e0         ldi     r25, 0x2
   110b8: 85 b9         out     0x5, r24
   110ba: 95 b9         out     0x5, r25
   110bc: fe cf         rjmp    .-4
```
One can see, that the wrong label offset (`4` instead of `6`) is produced, which would trigger an assertion in the test case.

This would be a good candidate for using the `minicore` proposed in #130693. Since this is not yet merged, there is a FIXME.

r? Patryk27
I think, you are the yet-to-be official target maintainer, hence I'll assign to you.

`@rustbot` label +O-AVR
2024-10-18 12:00:50 +01:00