Commit Graph

285822 Commits

Author SHA1 Message Date
Matthias Krüger
a488cf8a70 Rollup merge of #136842 - randomPoison:trusty-libstd-v3, r=ChrisDenton
Add libstd support for Trusty targets

This PR adds support for `alloc` and `std` for the Trusty targets based on the internal patches used in Android. The original patches can be seen [here](https://android.googlesource.com/toolchain/android_rust/+/refs/heads/main/patches/development/rustc-0023-Add-Trusty-OS-support-to-Rust-std.patch) and [here](https://android.googlesource.com/toolchain/android_rust/+/refs/heads/main/patches/development/rustc-0054-Add-std-os-fd-support-for-Trusty.patch). Please let me know if there's any additional context I need to add.
2025-03-13 10:58:17 +01:00
Matthias Krüger
b3ab69504a Rollup merge of #133981 - aDotInTheVoid:document-docs-ids, r=fmease
rustdoc-json: Refractor and document Id's

Closes #133780

While working on documenting Id's, I realized alot of the way they were generated was weird and unnecessary. Eg:

1. The fully uninterned id type was `(FullItemId, Option<FullItemId>)`, meaning it wasn't actually full!
2. None of the extra fields in `Option<FullItemId>` would ever be used
3. `imported_item_id` was a `rustdoc_json_types::Id` instead of a simpler `DefId`.

I believe the new implementation still covers all the same cases, but in a more principled way (and explaining why each piece is needed).

This was written to be reviewed commit-by-commit, but it might be easier to review all at once if you're not interested in tracking how the original code became the final code.

cc ``@its-the-shrimp``

r? ``@fmease``
2025-03-13 10:58:15 +01:00
Matthias Krüger
3b1776dc29 Rollup merge of #126856 - onur-ozkan:remove-rls, r=clubby789
remove deprecated tool `rls`

This tool has been deprecated for two years and now it only gives warning without doing anything useful.

Zulip discussion: https://rust-lang.zulipchat.com/#narrow/stream/241545-t-release/topic/excluding.20rls.20from.20the.20release

try-job: x86_64-gnu-distcheck
2025-03-13 10:58:13 +01:00
Jakub Beránek
ed29ebb576 Merge pull request #2282 from jieyouxu/fetch-prunetags
Document `fetch.prunetags = true` gotcha during rustc-pull
2025-03-13 09:49:22 +01:00
dianne
36ff87e90e EUV: fix place of deref pattern's interior's scrutinee
The place previously used here was that of the temporary holding the
reference returned by `Deref::deref` or `DerefMut::deref_mut`. However,
since the inner pattern of `deref!(inner)` expects the deref-target type
itself, this would ICE when that type was inspected (e.g. by the EUV
case for slice patterns). This adds a deref projection to fix that.

Since current in-tree consumers of EUV (upvar inference and clippy)
don't care about Rvalues, the place could be simplified to
`self.cat_rvalue(pat.hir_id, self.pat_ty_adjusted(subpat)?)` to save
some cycles. I personally find EUV to be a bit fragile, so I've opted
for pedantic correctness. Maybe a `HACK` comment would suffice though?
2025-03-13 01:01:26 -07:00
许杰友 Jieyou Xu (Joe)
440d336b71 Document fetch.prunetags = true gotcha during rustc-pull 2025-03-13 15:44:23 +08:00
Scott McMurray
2b15dd1ddd Add more comments to discriminant calculations. 2025-03-13 00:39:18 -07:00
许杰友 Jieyou Xu (Joe)
7bde176305 Merge from rustc 2025-03-13 15:20:11 +08:00
许杰友 Jieyou Xu (Joe)
d4c5e752c5 Preparing for merge from rustc 2025-03-13 15:19:22 +08:00
Ralf Jung
025eecc3e7 atomic intrinsics: clarify which types are supported and (if applicable) what happens with provenance 2025-03-13 08:14:34 +01:00
Ralf Jung
88b206d582 atomic intrinsics: clarify which types are supported and (if applicable) what happens with provenance 2025-03-13 08:14:34 +01:00
Scott McMurray
91af4aa2e2 Allow more top-down inlining for single-BB callees
This means that things like `<usize as Step>::forward_unchecked` and `<PartialOrd for f32>::le` will inline even if we've already done a bunch of inlining to find the calls to them.
2025-03-12 22:39:43 -07:00
bors
961351c76c Auto merge of #138249 - compiler-errors:auto-self, r=lcnr
Do not register `Self: AutoTrait` when confirming auto trait (in old solver)

Every built-in auto impl for a trait goal like `Ty: Auto` immediately registers another obligation of `Ty: Auto` as one of its nested obligations, leading to us stressing the cycle detection machinery a lot more than we need to. This is because all traits have a `Self: Trait` predicate.

To fix this, remove the call to `impl_or_trait_obligations` in `vtable_auto_impl`, since auto traits do not have where clauses.

r? lcnr
2025-03-13 05:37:55 +00:00
Catherine Flores
18061e2c42 incompatible_msrv: lint function calls with any argument count (#14216)
The lint for function calls was previously restricted to functions
taking exactly one argument. This was not documented.

Generalizing the lint to an arbitrary number of arguments in the
function call requires special casing some macro expansions from the
standard library. Macros such as `panic!()` or `assert_eq!()` exist
since Rust 1.0.0, but modern stdlib expand those macros into calls to
functions introduced in later Rust versions. While it is desirable to
lint code inside macros, using MSRV-incompatible functions coming from
`core` in macro expansions has been special-cased to not trigger this
lint.

Also, code coming from compiler desugaring may contain function calls
(for example, `a..=b` is now desugared into `RangeInclusive::new(a, b)`.
Those should not be linted either as the compiler is allowed to use
unstable function calls.

Fix #14212

changelog: [`incompatible_msrv`]: lint function calls with any argument
count
2025-03-13 04:11:42 +00:00
ClearLove
2f824ea429 Update library/core/src/intrinsics/mod.rs
Co-authored-by: Thom Chiovoloni <thom@shift.click>
2025-03-13 11:34:18 +08:00
ClearLove
6a01990215 Update library/core/src/intrinsics/mod.rs
Co-authored-by: Thom Chiovoloni <thom@shift.click>
2025-03-13 11:34:06 +08:00
ClearLove
d2ff65807c Update library/core/src/intrinsics/mod.rs
Co-authored-by: Thom Chiovoloni <thom@shift.click>
2025-03-13 11:33:55 +08:00
Tshepang Mbambo
231627b138 update error message
[`compile-pass` has since been renamed to `build-pass`](https://github.com/rust-lang/rust/issues/62277)
2025-03-13 04:48:46 +02:00
Tshepang Mbambo
d0a3160374 Merge pull request #2281 from rust-lang/tshepang-patch-1
less text for same effect
2025-03-13 03:52:43 +02:00
Tshepang Mbambo
26176b017e less text for same effect 2025-03-13 03:51:51 +02:00
bors
8536f201ff Auto merge of #138416 - Manishearth:rollup-fejor9p, r=Manishearth
Rollup of 12 pull requests

Successful merges:

 - #134076 (Stabilize `std::io::ErrorKind::InvalidFilename`)
 - #137504 (Move methods from Map to TyCtxt, part 4.)
 - #138175 (Support rmeta inputs for --crate-type=bin --emit=obj)
 - #138259 (Disentangle `ForwardGenericParamBan` and `ConstParamTy` ribs)
 - #138280 (fix ICE in pretty-printing `global_asm!`)
 - #138318 (Rustdoc: remove a bunch of `@ts-expect-error` from main.js)
 - #138331 (Use `RUSTC_LINT_FLAGS` more)
 - #138357 (merge `TypeChecker` and `TypeVerifier`)
 - #138394 (remove unnecessary variant)
 - #138403 (Delegation: one more ICE fix for `MethodCall` generation)
 - #138407 (Delegation: reject C-variadics)
 - #138409 (Use sa_sigaction instead of sa_union.__su_sigaction for AIX)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-13 01:37:26 +00:00
Michael Goulet
8bf33c213f Visit PatField when collecting lint levels 2025-03-13 00:22:30 +00:00
Mads Marquart
eab700a0aa Fix uclibc LLVM target triples
`uclibc` is not an environment understood by LLVM, it is only a concept
in Clang that can be selected with `-muclibc` (it affects which dynamic
linker is passed to the static linker's `-dynamic-linker` flag).

In fact, using `uclibcgnueabi`/`uclibc` is actively harmful, as it
prevents LLVM from seeing that the target is gnu-like; we should use
`gnueabi`/`gnu` directly instead.
2025-03-12 23:40:25 +01:00
Weihang Lo
c8a6fcc3c8 fix: remove the check of lld not supporting @response-file
In LLVM v9, lld has supported @response-file
LLVM v9 was released on 2019-09-19.
And the check was added back to 2018-03-14 (1.26.0) via 04442af18b.
It has been more than five years, and we ship our own lld regardlessly.
This should be happily removed.

See also:

* <bb12396f91>
* <https://reviews.llvm.org/D63024>
2025-03-12 18:36:21 -04:00
bors
0e76f8b7e0 Auto merge of #138076 - tmiasko:pred-count, r=matthewjasper
Calculate predecessor count directly

Avoid allocating a vector of small vectors merely to determine how many
predecessors each basic block has.

Additionally use u8 and saturating operations. The pass only needs to
distinguish between [0..1] and [2..].
2025-03-12 22:33:54 +00:00
Alona Enraght-Moony
a05d6ab8b7 rustdoc-json: Clean up & Document id handling
Alot of the current id handling is weird and unnecessary. e.g:

1. The fully uninterned id type was (FullItemId, Option<FullItemId>)
   meaning it wasn't actually full!
2. None of the extra fields in Option<FullItemId> would ever be used
3. imported_item_id was a rustdoc_json_types::Id instead of a simpler
   DefId

This commit removes the unnessessary complexity, and documents where the
remaining complexity comes from.

Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
2025-03-12 22:10:27 +00:00
Mads Marquart
65bd61d2fb Fix armv7-sony-vita-newlibeabihf LLVM target triple
It was previously normalized by LLVM to `thumbv7a-vita-unknown-eabihf`,
which is probably wrong, as Vita is the OS.
2025-03-12 22:44:59 +01:00
Mads Marquart
0434013a6e Fix RISC-V VxWorks LLVM target triples
The targets used the plain `$ARCH` triple, which LLVM normalizes to
`$ARCH-unknown-unknown`, which is inconsistent with the the other
VxWorks targets which all use `$ARCH-unknown-linux-gnu$ABI`.
2025-03-12 22:42:17 +01:00
Alona Enraght-Moony
0a477921a8 rustdoc-json: Extract Id handling into its own module
I want to work on this in a followup commit, so in this commit I make it
self-contained. Contains no code changes, all functions are defined
exactly as they were in conversions.rs.
2025-03-12 21:35:00 +00:00
Alexey Semenyuk
559f23e1f2 Update copyright year 2025-03-13 02:01:16 +05:00
Josh Stone
2c0ad9d967 Remove feature = "hash_raw_entry" 2025-03-12 13:32:50 -07:00
Michael Goulet
7a08d0368f Add an opt-out in pretty printing for RTN rendering 2025-03-12 19:42:18 +00:00
Michael Goulet
5ec462e8e7 Don't emit error within cast function, propagate it as a CastError 2025-03-12 19:33:27 +00:00
Hans Wennborg
eb2e421e36 Adapt to LLVM dropping CfiFunctionIndex::begin()/end()
After https://github.com/llvm/llvm-project/pull/130382, RustWrapper
needs to call CfiFunctionIndex::symbols() instead.
2025-03-12 20:03:29 +01:00
Guillaume Gomez
0ffc6cf097 Add ui test for string_to_string in map calls 2025-03-12 19:59:27 +01:00
Guillaume Gomez
21601fd042 Improve string_to_string lint in case it is in a map call 2025-03-12 19:59:27 +01:00
Ralf Jung
3d01217ccd Merge pull request #4185 from geetanshjuneja/abi_check
FnAbi Compatability check
2025-03-12 18:09:17 +00:00
Ralf Jung
a004c12a7b Merge pull request #4225 from RalfJung/alloc_addresses
alloc_addresses: use MemoryKind instead of tcx query to determine global allocations
2025-03-12 18:06:50 +00:00
geetanshjuneja
82dfa03a71 added check_shim_abi
added input arg mismatch test

added detailed ub messages

added return type mismatch test
2025-03-12 23:14:14 +05:30
Ralf Jung
0346e926a8 alloc_addresses: use MemoryKind instead of tcx query to determine global allocations 2025-03-12 18:39:06 +01:00
Ralf Jung
03c1b43d9e minor interpret cleanups 2025-03-12 18:35:40 +01:00
bors
249cb84316 Auto merge of #138414 - matthiaskrgr:rollup-9ablqdb, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #137314 (change definitely unproductive cycles to error)
 - #137701 (Convert `ShardedHashMap` to use `hashbrown::HashTable`)
 - #138269 (uefi: fs: Implement FileType, FilePermissions and FileAttr)
 - #138331 (Use `RUSTC_LINT_FLAGS` more)
 - #138345 (Some autodiff cleanups)
 - #138387 (intrinsics: remove unnecessary leading underscore from argument names)
 - #138390 (fix incorrect tracing log)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-12 17:27:43 +00:00
onur-ozkan
675ae1afd0 use expect instead of allow
This is more useful than `allow` as compiler will force us to remove rules
that are no longer valid (we already got 2 of them in this change).

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-03-12 17:27:26 +00:00
y21
44094e5148 explain is_from_proc_macro in the book 2025-03-12 18:25:25 +01:00
Manish Goregaokar
c756251076 Rollup merge of #138409 - xingxue-ibm:use-sigaction, r=compiler-errors
Use sa_sigaction instead of sa_union.__su_sigaction for AIX

Revert test cases to use `sa_sigaction` instead of `sa_union.__su_sigaction`, now that the `libc` crate implementation for AIX defines `sa_sigaction` as a direct member of `struct sigaction`, aligning it with implementations on other similar platforms. ([[AIX] Use sa_sigaction instead of the union](https://github.com/rust-lang/libc/pull/4250)).
2025-03-12 10:19:35 -07:00
Manish Goregaokar
9d1b62c109 Rollup merge of #138407 - Bryanskiy:delegation-variadic, r=petrochenkov
Delegation: reject C-variadics

The explanation is contained in attached issues.

Fixes https://github.com/rust-lang/rust/issues/127443
Fixes https://github.com/rust-lang/rust/issues/127413

r? `@petrochenkov`
2025-03-12 10:19:34 -07:00
Manish Goregaokar
8d28328049 Rollup merge of #138403 - Bryanskiy:delegation-ice-2, r=petrochenkov
Delegation: one more ICE fix for `MethodCall` generation

self-explanatory

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

r? `@petrochenkov`
2025-03-12 10:19:33 -07:00
Manish Goregaokar
84a2b689ac Rollup merge of #138394 - lcnr:yeet-variant, r=compiler-errors
remove unnecessary variant
2025-03-12 10:19:32 -07:00
Manish Goregaokar
74c3794ece Rollup merge of #138357 - lcnr:goodbye-TypeVerifier-rarw, r=compiler-errors
merge `TypeChecker` and `TypeVerifier`

Stacked on top of #138354. Best reviewed commit by commit.

r? `@compiler-errors`
2025-03-12 10:19:31 -07:00
Manish Goregaokar
245d3a90ca 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 10:19:30 -07:00