Commit Graph

265007 Commits

Author SHA1 Message Date
Oneirical
65cb5deedb Use path instead of Path in some run-make tests 2024-08-29 10:15:17 -04:00
Oneirical
da43f95dd3 Add needs-unwind compiletest directive to libtest-thread-limit 2024-08-29 10:13:48 -04:00
Krasimir Georgiev
9c910e81a4 llvm-wrapper: adapt for LLVM API changes
Updates the wrapper for 21eddfac3d.
2024-08-29 14:08:58 +00:00
Ralf Jung
05ffd446a9 Box validity: update for new zero-sized rules 2024-08-29 16:06:20 +02:00
Ding Xiang Fei
9c29b33c7e
riscv64imac: allow shadow call stack sanitizer 2024-08-29 21:48:48 +08:00
Nicholas Nethercote
7a71a914f6 Add warn(unreachable_pub) to rustc_resolve. 2024-08-29 20:18:44 +10:00
Nicholas Nethercote
afc58beebe Add warn(unreachable_pub) to rustc_query_system. 2024-08-29 20:18:44 +10:00
Nicholas Nethercote
2eea2d2cf1 Add warn(unreachable_pub) to rustc_query_impl. 2024-08-29 20:18:44 +10:00
Nicholas Nethercote
71bffef4f9 Add warn(unreachable_pub) to rustc_privacy. 2024-08-29 20:18:44 +10:00
Nicholas Nethercote
653ee7bc3a Add warn(unreachable_pub) to rustc_pattern_analysis. 2024-08-29 20:18:44 +10:00
Nicholas Nethercote
f77821203f Add warn(unreachable_pub) to rustc_passes. 2024-08-29 20:18:40 +10:00
Guillaume Gomez
8683439a20 Fix clippy lints 2024-08-29 12:14:41 +02:00
Nicholas Nethercote
76bd802403 Add warn(unreachable_pub) to rustc_parse_format. 2024-08-29 20:13:06 +10:00
Nicholas Nethercote
cac04a1cb9 Add warn(unreachable_pub) to rustc_parser. 2024-08-29 20:13:06 +10:00
Nicholas Nethercote
46ea798a94 Add warn(unreachable_pub) to rustc_next_trait_solver. 2024-08-29 20:13:06 +10:00
Nicholas Nethercote
e3062147de Add warn(unreachable_pub) to rustc_monomorphize. 2024-08-29 20:13:06 +10:00
Nicholas Nethercote
8a8dd3f33e Add warn(unreachable_pub) to rustc_mir_dataflow. 2024-08-29 20:13:06 +10:00
Nicholas Nethercote
c16e2899dc Add warn(unreachable_pub) to rustc_mir_build. 2024-08-29 20:13:06 +10:00
Nicholas Nethercote
938daf6033 Add warn(unreachable_pub) to rustc_middle.
I am surprised the diff is so small for this enormous crate.
2024-08-29 20:13:06 +10:00
Nicholas Nethercote
05e07381d0 Add warn(unreachable_pub) to rustc_metadata. 2024-08-29 20:13:06 +10:00
Nicholas Nethercote
4b92682530 Add warn(unreachable_pub) to rustc_macros. 2024-08-29 20:13:06 +10:00
DianQK
9589eb95d2
Add -Zlint-llvm-ir 2024-08-29 18:12:31 +08:00
bors
34e7e7954c Auto merge of #17993 - ChayimFriedman2:convert-to-tuple-attrs, r=Veykril
Consider field attributes when converting from tuple to named struct and the opposite

Fixes #17983.

I tried to use the `SourceChangeBuilder::make_mut()` API, but it duplicated the attribute...
2024-08-29 08:28:46 +00:00
bors
cd377d90db Auto merge of #17991 - ChayimFriedman2:extract-variable-ref, r=Veykril
fix: Don't add reference when it isn't needed for the "Extract variable" assist

I.e. don't generate `let var_name = &foo()`. Because it always irritates me when I need to fix that.

Anything that creates a new value don't need a reference. That excludes mostly field accesses and indexing.

I had a thought that we can also not generate a reference for fields and indexing as long as the type is `Copy`, but sometimes people impl `Copy` even when they don't want to copy the values (e.g. a large type), so I didn't do that.
2024-08-29 08:14:04 +00:00
bors
b6d0fd03e1 Auto merge of #17987 - ChayimFriedman2:column-macro, r=Veykril
fix: Fix name resolution of shadowed builtin macro

Fixes #17969.
2024-08-29 07:59:12 +00:00
bors
e0625d5c08 Auto merge of #17988 - darichey:fix-scip-def, r=Veykril
Fix incorrect symbol definitions in SCIP output

The SCIP output incorrectly marks some symbols as definitions because it doesn't account for the file ID when comparing the token's range to its definition's range.

This means that if a symbol is referenced in a file at the same position at which it is defined in another file, that reference will be marked as a definition. I was quite surprised by how common this is. For example, `PartialEq` is defined [here](https://github.com/rust-lang/rust/blob/1.80.1/library/core/src/cmp.rs#L273) and `uuid` references it [here](https://github.com/uuid-rs/uuid/blob/1.8.0/src/lib.rs#L329). And what do you know, they're both at offset 10083! In our large monorepo, this happens for basically every common stdlib type!
2024-08-29 07:44:29 +00:00
Lukas Wirth
e20a888f8c Allow running ./x.py test compiler 2024-08-29 09:26:27 +02:00
bors
b195ff3ac0 Auto merge of #17940 - ChayimFriedman2:closure-to-fn, r=Veykril
feat: Create an assist to convert closure to freestanding fn

The assist converts all captures to parameters.

Closes #17920.

This was more work than I though, since it has to handle a bunch of edge cases...

Based on #17941. Needs to merge it first.
2024-08-29 07:21:46 +00:00
bors
f05888d2ae Auto merge of #17995 - lnicola:sync-from-rust, r=lnicola
minor: sync from downstream
2024-08-29 07:04:04 +00:00
Laurențiu Nicola
26888c31cf Merge from rust-lang/rust 2024-08-29 10:02:18 +03:00
Laurențiu Nicola
2ec71c8e85 Preparing for merge from rust-lang/rust 2024-08-29 10:02:05 +03:00
Ralf Jung
eb8e78f624 f32 docs: define 'arithmetic' operations 2024-08-29 08:55:37 +02:00
bors
266bb1fd96 Auto merge of #17994 - Veykril:proc-macro-srv-from-str-panic, r=Veykril
fix: Fix TokenStream::to_string implementation dropping quotation marks

Fixes https://github.com/rust-lang/rust-analyzer/issues/17986
We might wanna consider backporting this to beta if that's simple enough to do
2024-08-29 06:46:16 +00:00
Lukas Wirth
03d67458ee fix: Fix TokenStream::to_string implementation dropping quotation marks 2024-08-29 08:45:35 +02:00
Lukas Wirth
14ec1202e5 fix: Fix proc-macro server crashing when parsing a non-lexable string into a TokenStream 2024-08-29 08:45:19 +02:00
bors
ad7a1aa32a Auto merge of #3851 - rust-lang:rustup-2024-08-29, r=RalfJung
Automatic Rustup
2024-08-29 05:51:49 +00:00
Ralf Jung
b5be3ab38b fix wasm test 2024-08-29 07:50:18 +02:00
The Miri Cronjob Bot
a10633afe6 Merge from rustc 2024-08-29 05:07:14 +00:00
The Miri Cronjob Bot
b0c3324838 Preparing for merge from rustc 2024-08-29 04:59:24 +00:00
bors
3a14e301dd Auto merge of #17992 - Wilfred:newlines_in_logs, r=Veykril
internal: Avoid newlines in fetch errors

Most logs lines don't have newlines, ensure fetch errors follow this pattern. This makes it easier to see which log line is associated with the error.

Before:

    2024-08-28T21:11:58.431856Z ERROR FetchWorkspaceError:
    rust-analyzer failed to discover workspace

After:

    2024-08-28T21:11:58.431856Z ERROR FetchWorkspaceError: rust-analyzer failed to discover workspace
2024-08-29 04:52:11 +00:00
Michael Goulet
92004523db Stop using ty::GenericPredicates for non-predicates_of queries 2024-08-29 00:17:40 -04:00
Chai T. Rex
7af8e218da Speed up checked_isqrt and isqrt methods
* Use a lookup table for 8-bit integers and the Karatsuba square root
  algorithm for larger integers.
* Include optimization hints that give the compiler the exact numeric
  range of results.
2024-08-28 23:07:04 -04:00
Chai T. Rex
0cac915211 Improve isqrt tests and add benchmarks
* Choose test inputs more thoroughly and systematically.
* Check that `isqrt` and `checked_isqrt` have equivalent results for
  signed types, either equivalent numerically or equivalent as a panic
  and a `None`.
* Check that `isqrt` has numerically-equivalent results for unsigned
  types and their `NonZero` counterparts.
* Reuse `ilog10` benchmarks, plus benchmarks that use a uniform
  distribution.
2024-08-28 23:06:54 -04:00
bors
6cf068db56 Auto merge of #129721 - workingjubilee:rollup-y2o1mnp, r=workingjubilee
Rollup of 14 pull requests

Successful merges:

 - #128192 (rustc_target: Add various aarch64 features)
 - #129170 (Add an ability to convert between `Span` and `visit::Location`)
 - #129343 (Emit specific message for time<=0.3.35)
 - #129378 (Clean up cfg-gating of ProcessPrng extern)
 - #129401 (Partially stabilize `feature(new_uninit)`)
 - #129467 (derive(SmartPointer): assume pointee from the single generic and better error messages)
 - #129494 (format code in tests/ui/threads-sendsync)
 - #129617 (Update books)
 - #129673 (Add fmt::Debug to sync::Weak<T, A>)
 - #129683 (copysign with sign being a NaN can have non-portable results)
 - #129689 (Move `'tcx` lifetime off of impl and onto methods for `CrateMetadataRef`)
 - #129695 (Fix path to run clippy on rustdoc)
 - #129712 (Correct trusty targets to be tier 3)
 - #129715 (Update `compiler_builtins` to `0.1.123`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-08-29 02:38:32 +00:00
Jubilee
bd66fadd79
Rollup merge of #129715 - Amjad50:update-compiler-builtins, r=tgross35
Update `compiler_builtins` to `0.1.123`

Includes https://github.com/rust-lang/compiler-builtins/pull/680 and fixes https://github.com/rust-lang/rust/issues/128386.

Fixed by not including math symbols of `compiler_builtins` into any `unix` target or `wasi`, old behavior is restored

r? tgross35
2024-08-28 19:12:56 -07:00
Jubilee
2ac56db8a2
Rollup merge of #129712 - randomPoison:trusty-tier-3-fix, r=saethlin
Correct trusty targets to be tier 3

The Trusty targets were added in https://github.com/rust-lang/rust/pull/129490, but in that PR I accidentally marked them as tier 2. This PR corrects the target metadata to mark them as tier 3.
2024-08-28 19:12:55 -07:00
Jubilee
ac5be35d58
Rollup merge of #129695 - GuillaumeGomez:fix-clippy-rustdoc-path, r=onur-ozkan
Fix path to run clippy on rustdoc

Took me a while to find out that the path clippy expected was `src/tools/rustdoc` and not `src/librustdoc`. I think it makes more sense this way as most commands rely on source paths.

r? ```@Kobzol```
2024-08-28 19:12:55 -07:00
Jubilee
472d164a49
Rollup merge of #129689 - compiler-errors:impl-lifetime, r=michaelwoerister
Move `'tcx` lifetime off of impl and onto methods for `CrateMetadataRef`

Unconstrained type and const variables are not allowed, but unconstrained lifetimes are. This is not very good style, though, and it leads to unnecessary captures of a lifetime in edition 2024 (not that it matters, but it does trigger the edition migration lint).
2024-08-28 19:12:54 -07:00
Jubilee
dfe66cf529
Rollup merge of #129683 - RalfJung:copysign, r=thomcc
copysign with sign being a NaN can have non-portable results

Follow-up to https://github.com/rust-lang/rust/pull/129559.
Cc ```@tgross35``` ```@beetrees```

There's no portable variant we can recommend instead here, is there? Something with a semantics like "if `sign` is a NaN, then return `self` unaltered, otherwise return `self` with the sign changed to that of `sign`"?
2024-08-28 19:12:54 -07:00
Jubilee
9ddb45e81a
Rollup merge of #129673 - matthewpipie:arc-weak-debug-trait, r=dtolnay
Add fmt::Debug to sync::Weak<T, A>

Currently, `sync::Weak<T>` implements `Debug`, but `sync::Weak<T, A>` does not. This appears to be an oversight, as `rc::Weak<T, A>` implements `Debug`. (Note: `sync::Weak` is the weak for `Arc`, and `rc::Weak` is the weak for `Rc`.)

This PR adds the Debug trait for `sync::Weak<T, A>`. The issue was initially brought up here: https://github.com/rust-lang/wg-allocators/issues/131
2024-08-28 19:12:54 -07:00