Commit Graph

285822 Commits

Author SHA1 Message Date
Manish Goregaokar
277d05e857 Rollup merge of #138318 - lolbinarycat:rustdoc-js-less-expect-error-part2, r=notriddle
Rustdoc: remove a bunch of @ts-expect-error from main.js

r? ```````@notriddle```````

Most remaining instances of ````````@ts-expect-error```````` in `search.js` and `main.js` are some sort of unchecked assertion, most of them involving nullibility, and we have yet to decide on how to handle these.
2025-03-12 10:19:29 -07:00
Manish Goregaokar
f5eb296c5a Rollup merge of #138280 - folkertdev:mir-dump-asm-const, r=compiler-errors
fix ICE in pretty-printing `global_asm!`

fixes https://github.com/rust-lang/rust/issues/138260

since https://github.com/rust-lang/rust/pull/137180, `global_asm!` gets a fake body, that the pretty printing logic did not know what to do with.

based on [#t-compiler/help > tests for MIR pretty printing](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/tests.20for.20MIR.20pretty.20printing) I created `tests/ui/unpretty/mir` which seemed as good a place as any for a test. If there is a better place, let me know.

try-job: test-various
try-job: x86_64-apple-2
2025-03-12 10:19:28 -07:00
Manish Goregaokar
2d7a592c62 Rollup merge of #138259 - compiler-errors:disentangle-ribs, r=BoxyUwU
Disentangle `ForwardGenericParamBan` and `ConstParamTy` ribs

In #137617, the `ConstParamTy` rib was adjusted to act kinda like the `ForwardGenericParamBan`. However, this means that it no longer served its purpose banning generics from *parent items*. Although we still are checking for param type validity using the `ConstParamTy_` trait, which means that we weren't accepting code we shouldn't, I think it's a bit strange for us not to be rejecting code like this during *resolution* and instead letting these malformed const generics leak into the type system:

```rust
trait Foo<T> {
  fn bar<const N: T>() {}
}
```

This PR does a few things:
1. Introduce a `ForwardGenericParamBanReason` enum, and start using the `ForwardGenericParamBan` rib to ban forward-declared params in const tys when `generic_const_parameter_types` is enabled.
2. Start using the `ConstParamTy` rib to ban *all* generics when `generic_const_parameter_types` is disabled.
3. Improve the diagnostics for both of the cases above, and for forward-declared params in parameter defaults too :3

r? `@BoxyUwU` or reassign
2025-03-12 10:19:28 -07:00
Manish Goregaokar
40c7a9014e Rollup merge of #138175 - sam-mccall:binobj, r=nnethercote
Support rmeta inputs for --crate-type=bin --emit=obj

This already works for --emit=metadata, but is possible anytime we're not linking.

Tests:
- `rmeta_bin` checks we're not changing --emit=link (already passes)
- `rmeta_bin-pass` tests the new behavior for --emit=obj (would fail today) and also --emit=metadata which isn't changing
2025-03-12 10:19:27 -07:00
Manish Goregaokar
f88f27aff0 Rollup merge of #137504 - nnethercote:remove-Map-4, r=Zalathar
Move methods from Map to TyCtxt, part 4.

A follow-up to https://github.com/rust-lang/rust/pull/137350.

r? ```@Zalathar```
2025-03-12 10:19:26 -07:00
Manish Goregaokar
185dd2d01b Rollup merge of #134076 - GrigorenkoPV:InvalidFilename, r=joboet
Stabilize `std::io::ErrorKind::InvalidFilename`

FCP complete: https://github.com/rust-lang/rust/issues/130192#issuecomment-2674989358

Tracking issues: #86442 & #130192

This PR:
- Stabilizes `InvalidFilename` without changing its name to `InvalidFileName`.
- Fixes the doc comment (https://github.com/rust-lang/rust/issues/130192#issuecomment-2429534640)
- Does not separate "the name is too long" case into a separate `ErrorKind`. That case is currently documented to be covered by `InvalidFilename` in the doc. I'm not sure if it would be possible to change this later or if that would be an unacceptable breaking change.
- Does not map more raw OS errors to this `ErrorKind` (as suggested in https://github.com/rust-lang/rust/issues/86442#issuecomment-1441709738). This can presumably be addressed later.
2025-03-12 10:19:25 -07:00
Matthias Krüger
579d0587a2 Rollup merge of #138390 - onur-ozkan:fix-invalid-tracing-log, r=jieyouxu
fix incorrect tracing log

Previous information is not correct.
2025-03-12 17:59:10 +01:00
Matthias Krüger
0c4415cdd6 Rollup merge of #138387 - RalfJung:intrinsic-arg-names, r=oli-obk
intrinsics: remove unnecessary leading underscore from argument names

This is unnecessary since https://github.com/rust-lang/rust/pull/135840.
2025-03-12 17:59:10 +01:00
Matthias Krüger
de7e5e96be Rollup merge of #138345 - oli-obk:autodiff-cleanup, r=compiler-errors
Some autodiff cleanups

cc ````@ZuseZ4````

just some things I noticed
2025-03-12 17:59:09 +01:00
Matthias Krüger
d93ef397ce Rollup merge of #138331 - nnethercote:use-RUSTC_LINT_FLAGS-more, r=onur-ozkan,jieyouxu
Use `RUSTC_LINT_FLAGS` more

An alternative to the failed #138084.

Fixes #138106.

r? ````@jieyouxu````
2025-03-12 17:59:08 +01:00
Matthias Krüger
a21d41a22d Rollup merge of #138269 - Ayush1325:uefi-fs-permission, r=joboet
uefi: fs: Implement FileType, FilePermissions and FileAttr

- In UEFI, both FileType and FilePermissions are represented by the attr bitfield.
- Using simple bools here since both are represented by a single bit.
- Add `FILE_PERMISSION` mask for constructing attribute while change permissions.

cc ````@nicholasbishop````
2025-03-12 17:59:07 +01:00
Matthias Krüger
4ffbc32f17 Rollup merge of #137701 - cuviper:sharded-hashtable, r=fmease
Convert `ShardedHashMap` to use `hashbrown::HashTable`

The `hash_raw_entry` feature (#56167) has finished fcp-close, so the compiler
should stop using it to allow its removal. Several `Sharded` maps were
using raw entries to avoid re-hashing between shard and map lookup, and
we can do that with `hashbrown::HashTable` instead.
2025-03-12 17:59:07 +01:00
Matthias Krüger
d55e2e4333 Rollup merge of #137314 - lcnr:cycles-with-unknown-kind, r=compiler-errors
change definitely unproductive cycles to error

builds on top of #136824 by adding a third variant to `PathKind` for paths which may change to be coinductive in the future but must not be so right now. Most notably, impl where-clauses of not yet coinductive traits.

With this, we can change cycles which are definitely unproductive to a proper error. This fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/114. This does not affect stable as we keep these cycles as ambiguous during coherence.

r? ````````@compiler-errors```````` ````````@nikomatsakis````````
2025-03-12 17:59:06 +01:00
Michael Goulet
42773bfcac Disentangle ForwardGenericParamBan and ConstParamTy ribs 2025-03-12 16:56:26 +00:00
Philipp Krones
72540726b1 needless_pass_by_value: reference the innermost Option content (#14392)
If types such as `Option<Option<String>>` are not used by value, then
`Option<Option<&String>>` will be suggested, instead of
`Option<&Option<String>>`.

changelog: [`needless_pass_by_value`]: suggest using a reference on the
innermost `Option` content

fix #14375
2025-03-12 16:07:47 +00:00
Josh Stone
d183da6331 Install licenses into share/doc/rust/licenses
This changes the path from "licences" to "licenses" for consistency
across the repo, including the usage directly around this line. This is
a US/UK spelling difference, but I believe the US spelling is also more
common in open source in general.
2025-03-12 08:43:21 -07:00
Mara Bos
ba2809e085 Update tests. 2025-03-12 16:32:11 +01:00
Mara Bos
90645c187c Reduce FormattingOptions to 64 bits. 2025-03-12 16:32:00 +01:00
Jakub Beránek
7d141dc12e Remove sccache-plus-cl MSVC hack 2025-03-12 16:13:13 +01:00
Jakub Beránek
36719a90f7 Update sccache to 0.10.0
This time, does it also for Windows and macOS.
2025-03-12 16:11:24 +01:00
bjorn3
1543256e6f Remove unused host_tlib_path field 2025-03-12 15:05:25 +00:00
bjorn3
f51d1d29f7 Rename user_provided_sysroot argument of fluent_bundle 2025-03-12 15:05:25 +00:00
bjorn3
926b5d2e4f Use materialize_sysroot in rustdoc 2025-03-12 15:05:25 +00:00
bjorn3
7e8494f0a5 Don't return an error from get_or_default_sysroot
All callers unwrap the result.
2025-03-12 15:05:25 +00:00
bjorn3
0a679514d4 Avoid unnecessary argument mutation in fluent_bundle 2025-03-12 15:05:24 +00:00
bjorn3
b54398e4ea Make opts.maybe_sysroot non-optional
build_session_options always uses materialize_sysroot anyway.
2025-03-12 15:05:24 +00:00
Xing Xue
17d1e050e6 Use sa_sigaction instead of sa_union.__su_sigaction for AIX. 2025-03-12 10:39:09 -04:00
bors
aaa2d47dae Auto merge of #138083 - nnethercote:rm-NtItem-NtStmt, r=petrochenkov
Remove `NtItem` and `NtStmt`

Another piece of #124141.

r? `@petrochenkov`
2025-03-12 14:18:36 +00:00
Bryanskiy
ccdba16f42 Delegation: reject C-variadics 2025-03-12 17:14:51 +03:00
bjorn3
eea0db2590 Fix rustc test suite 2025-03-12 13:18:52 +00:00
Eric Huss
8c0475e10b Update mdbook to 0.4.47 2025-03-12 06:11:38 -07:00
bjorn3
d2b328e6b3 Reduce verbosity of ./scripts/rustup.sh pull 2025-03-12 13:08:50 +00:00
bjorn3
4ca551cf41 Rustup to rustc 1.87.0-nightly (665025243 2025-03-11) 2025-03-12 13:08:42 +00:00
bjorn3
11565c3471 Sync from rust 6650252439 2025-03-12 13:02:12 +00:00
Bryanskiy
7bfe2136e4 Delegation: one more ICE fix for MethodCall generation 2025-03-12 15:59:37 +03:00
Samuel Tardieu
417d4e6210 needless_pass_by_value: make verbose suggestion
This reduces the number of snippet manipulations, and shows the new
reference in context.
2025-03-12 13:50:04 +01:00
Giang Dao
0fba203d9e added some new test to check for result and options opt 2025-03-12 20:15:14 +08:00
Jakub Beránek
d39a25837d Enable metrics and verbose tests in PR CI 2025-03-12 12:07:12 +01:00
bors
0998d4095b Auto merge of #137612 - Kobzol:bootstrap-2024, r=onur-ozkan
Update bootstrap to edition 2024

The stage0 compiler now supports edition 2024, so we can update bootstrap to it. I manually reviewed all the changes from `cargo fix --edition` and reverted most of them (`if let` -> `matches` changes and two unneeded usages of `use <>`).

r? `@onur-ozkan`

try-job: dist-x86_64-msvc
2025-03-12 11:05:40 +00:00
Philipp Krones
0730678e26 Make annotations mandatory for internal ui tests (#14393)
Last part of https://github.com/rust-lang/rust-clippy/pull/11421.

Now all ui tests require annotations.

The change in `ui_test` is to add `ICE:` errors.

changelog: Make internals ui tests annotations mandatory

r? @flip1995
2025-03-12 11:01:24 +00:00
Guillaume Gomez
092a20ec11 Update lint_message_convention test to allow clippy "help" message 2025-03-12 11:41:26 +01:00
Guillaume Gomez
ec8c0b3755 Make annotations mandatory for internal ui tests 2025-03-12 11:32:40 +01:00
Guillaume Gomez
e4d3b0a072 Update produce_ice so its error can be checked in ui tests 2025-03-12 11:32:27 +01:00
Guillaume Gomez
cfc743226e Update ui_test version to 0.29.2 2025-03-12 11:29:54 +01:00
lcnr
adbcb910f0 remove unnecessary variant 2025-03-12 10:12:53 +01:00
onur-ozkan
cb260791a4 fix incorrect tracing log
Previous information is not correct.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-03-12 08:10:51 +00:00
bors
57a4736e9f Auto merge of #138388 - matthiaskrgr:rollup-kbax8sz, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #138161 (Add PeekMut::refresh)
 - #138174 (Elaborate trait assumption in `receiver_is_dispatchable`)
 - #138313 (Update books)
 - #138347 (Reduce `kw::Empty` usage, part 2)
 - #138360 (Fix false-positive in `expr_or_init` and in the `invalid_from_utf8` lint)
 - #138372 (Refactor `pick2_mut` & `pick3_mut` to use `get_disjoint_mut`)
 - #138376 (Item-related cleanups)
 - #138377 (Remove unnecessary lifetime from `PatInfo`.)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-12 08:00:53 +00:00
Scott McMurray
143f39362a Don't alloca just to look at a discriminant
Today we're making LLVM do a bunch of extra work for every enum you match on, even trivial stuff like `Option<bool>`.  Let's not.
2025-03-12 00:56:43 -07:00
Berrysoft
bd385f3064 Fix panic handler for cygwin 2025-03-12 15:48:05 +08:00
Matthias Krüger
76f9cda260 Rollup merge of #138377 - nnethercote:rustc_hir_typeck, r=compiler-errors
Remove unnecessary lifetime from `PatInfo`.

r? ```@jackh726```
2025-03-12 08:06:51 +01:00