Commit graph

149311 commits

Author SHA1 Message Date
Luca Barbato
4db00fe229 Use an helper to move the files
In case the source is not in the same filesystem.
2024-05-13 19:16:20 +02:00
Michael Goulet
3bcdf3058e split out AliasTy -> AliasTerm 2024-05-13 11:59:42 -04:00
bors
d891ec697a Auto merge of #17221 - Veykril:lazier-validation, r=Veykril
internal: Lazier macro parse tree validation
2024-05-13 15:16:46 +00:00
Lukas Wirth
f1aa040ef6 parse_macro_expansion_error almost never contains values so Option it 2024-05-13 17:02:08 +02:00
Lukas Wirth
490994f9fb Push macro-parsing error calculation out of fundamental queries 2024-05-13 16:56:26 +02:00
Josh Triplett
163b1a6615 Reword formatting for where clauses
Suggested-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
2024-05-13 16:43:13 +02:00
Josh Triplett
9ff777bf50 style-guide: Also format where clauses on one line for short function decls 2024-05-13 16:43:13 +02:00
Josh Triplett
2af29af710 style-guide: Not all where clauses can be written as inline bounds 2024-05-13 16:43:13 +02:00
Josh Triplett
2f20bb4a97 style-guide: Give a second example for associated type formatting
Show an example that has bounds.
2024-05-13 16:43:13 +02:00
Josh Triplett
3742a4bd90 style-guide: Format single associated type where clauses on the same line
In particular, lifetime-generic associated types often have a
`where Self: 'a` bound, which we can format on the same line.
2024-05-13 16:42:47 +02:00
Guillaume Gomez
b515de83af Migrate run-make/rustdoc-target-spec-json-path to rmake 2024-05-13 15:21:13 +02:00
Guillaume Gomez
4057a7b1e3 Add library_search_path to Rustdoc 2024-05-13 15:21:12 +02:00
Guillaume Gomez
eea00ca354 Add target method to Rustdoc type 2024-05-13 15:04:10 +02:00
bors
abb95639ef Auto merge of #125024 - Oneirical:master, r=jieyouxu
Rewrite 3 very similar `run-make` alloc tests to rmake

Part of #121876

#121918 attempted to port these 3 tests 2 months ago. However, since then, the structure of `run-make-support` has changed a bit and new helper functions were added. Since there has been no activity on the PR, they are good low-hanging fruit to knock down, using the new functions of the current library.

There is also the removal of a useless import on a very similar test.
2024-05-13 11:20:00 +00:00
bors
6e0c33d1ba Auto merge of #17220 - Veykril:hov-lit, r=Veykril
fix: Improve confusing literal hovers
2024-05-13 10:58:29 +00:00
Lukas Wirth
3e510eb147 Don't render multi-line literal values 2024-05-13 12:56:02 +02:00
Lukas Wirth
60ed071ecc Render literal escaping errors in hovers 2024-05-13 12:51:57 +02:00
bors
197856dca5 Auto merge of #17203 - kilpkonn:collapse_terms, r=Veykril
Fix OOM caused by term search

The issue came from multi Cartesian product for exprs with many (25+) arguments, each having multiple options.
The solution is two fold:
### Avoid blowing up in Cartesian product
**Before the logic was:**
    1. Find expressions for each argument/param - there may be many
    2. Take the Cartesian product (which blows up in some cases)
    4. If there are more than 2 options throw them away by squashing them to `Many`
**Now the logic is:**
    1. Find expressions for each argument/param and squash them to `Many` if there are more than 2 as otherwise we are guaranteed to also have more than 2 after taking the product which means squashing them anyway.
    2. Take the Cartesian product on iterator
    3. Start consuming it one by one
    4. If there are more than 2 options throw them away by squashing them to `Many`  (same as before)

This is also why I had to update some tests as the expressions get squashed to many more eagerly.

### Use fuel to avoid long search times and high memory usage
Now all the tactics use `should_continue:  Fn() -> bool` to chech if they should keep iterating _(Similarly to chalk)_.
This reduces the search times by a magnitude, for example from ~139ms/hole to ~14ms/hole for `ripgrep` crate.
There are slightly less expressions found, but I think speed gain worth it for usability.
Also note that syntactic hits decreases more because of squashing so you simple need to run search multiple times to get full terms.
Also the worst case time (For example `nalgebra` crate cus it has tons of generics) has search times mostly under 200ms.

Benchmarks on `ripgrep` crate
Before:
```
Tail Expr syntactic hits: 291/1692 (17%)
Tail Exprs found: 1253/1692 (74%)
Term search avg time: 139ms
````
After:
```
Tail Expr syntactic hits: 239/1692 (14%)
Tail Exprs found: 1226/1692 (72%)
Term search avg time: 14ms
```
2024-05-13 10:30:12 +00:00
Lukas Wirth
a73973934f Fix literal hovers being confusing and wrong for floats 2024-05-13 12:26:45 +02:00
bors
03f935d4c1 Auto merge of #17188 - szabgab:patch-1, r=Veykril
use the repository field to link to the repository
2024-05-13 10:16:45 +00:00
bors
9e20f4bf0e Auto merge of #17187 - roife:fix-issue-17185, r=Veykril
fix: keep parentheses when the precedence of inner expr is lower than the outer one

fix #17185

Additionally, this PR simplifies some code in `apply_demorgan`.
2024-05-13 10:03:40 +00:00
bors
6a3556b779 Auto merge of #17195 - Veykril:unsafe-attr, r=Veykril
Implement unsafe attribute parsing
2024-05-13 09:50:52 +00:00
Luv-Ray
99c6b2e604 Give FileDescription::{read, write} access to the InterpCx 2024-05-13 16:17:56 +08:00
bors
d0b2c6611b Auto merge of #3604 - RalfJung:intrinsics, r=RalfJung
intrinsics: just panic when they get used incorrectly

This is already what we do most of the time, so do it consistently.
2024-05-13 06:24:47 +00:00
Ralf Jung
c6a0e2ca4c intrinsics: just panic when they get used incorrectly 2024-05-13 08:21:05 +02:00
Ralf Jung
5c33a5690d offset, offset_from: allow zero-byte offset on arbitrary pointers 2024-05-13 07:59:16 +02:00
bors
d4937cb229 Auto merge of #3575 - devnexen:illumos_part3, r=RalfJung
Illumos part3

Fixes https://github.com/rust-lang/miri/issues/3567
2024-05-12 20:33:36 +00:00
David Carlier
10acfd9f77 further illumos/solaris support.
fixing part of `miri test alloc/hashmap`.
2024-05-12 19:59:09 +00:00
bors
e4f81d1bb2 Auto merge of #3599 - saethlin:quiet-when-no-change, r=RalfJung
Don't print unnecessary sysroot messages

Currently, when running `cargo miri setup`, we always print that a sysroot is being prepared, even if we just bail out of building after checking the hash. So that message is wrong; we didn't actually prepare a sysroot.

We also always print the preparing message for `cargo miri run`, even if no sysroot is prepared.

With this PR, `cargo miri run` prints no sysroot messages when an existing one is reused, and when a redundant `cargo miri setup` is requested, we print:
```
A sysroot for Miri is already available in `/home/ben/.cache/miri`.
```
2024-05-12 18:35:24 +00:00
Ben Kimock
cd7527aa35 Don't print unnecessary sysroot messages 2024-05-12 14:31:22 -04:00
Oneirical
f2de5fb2ae rewrite issue-14500 to rmake 2024-05-12 14:00:09 -04:00
bors
852a78ea8d Auto merge of #124902 - compiler-errors:mem-cat-but-better, r=lcnr
Fix MemCategorization and ExprUse visitors for new solver (this time it's better)

Best reviewed by each commit. Supersedes #124859.

r? lcnr
2024-05-12 17:48:33 +00:00
Federico Maria Morrone
a6f237ca85
docs: fix typo in platform-support docs 2024-05-12 19:07:11 +02:00
Michael Goulet
c697ec41f4 Propagate errors rather than using return_if_err 2024-05-12 12:50:18 -04:00
Michael Goulet
55cf09d761 Make LateCtxt be a type info delegate for EUV for clippy 2024-05-12 12:11:25 -04:00
Michael Goulet
d7595eb6df Inline MemCategorization into ExprUseVisitor 2024-05-12 11:52:13 -04:00
bors
d25cf6fc14 Auto merge of #125040 - ickk:patch-1, r=notriddle
Fix hidden title in rustdoc book

raw html is treated as actual html by markdown, so this title needs to use some form of escaping in order to display correctly
2024-05-12 15:40:49 +00:00
Ralf Jung
1e7fba9e06 Merge from rustc 2024-05-12 15:44:24 +02:00
Ralf Jung
7d565dfa0f Preparing for merge from rustc 2024-05-12 15:44:17 +02:00
Guillaume Gomez
1393a87e4f
Rollup merge of #125022 - GuillaumeGomez:migrate-rustdoc-scrape-examples-ordering, r=jieyouxu
Migrate rustdoc scrape examples ordering

Part of https://github.com/rust-lang/rust/issues/121876.

This one adds a lot of utility methods/functions. To prevent having too much changes at once, I didn't make the existing rmake tests use these yet but I'll send a follow-up so they all use it.

r? `@jieyouxu`
2024-05-12 13:41:57 +02:00
Guillaume Gomez
114e25761f Migrate rustdoc-scrape-examples-ordering to rmake 2024-05-12 11:30:52 +02:00
Ralf Jung
01b5430b28 merge two integer tests 2024-05-12 10:25:51 +02:00
Ralf Jung
5d76ec9cdd merge float tests into one 2024-05-12 10:21:00 +02:00
Ralf Jung
9fc569d67f organize float intrinsic implementations a bit 2024-05-12 10:12:33 +02:00
ickk
48506150f4
fix hidden title in command-line-arguments docs 2024-05-12 17:18:44 +10:00
tiif
bf5906fbb4 Add non-null pointer for posix_memalign 2024-05-12 15:01:18 +08:00
bors
645bc609d9 Auto merge of #124883 - onur-ozkan:change-stage0-file, r=Mark-Simulacrum
use key-value format in stage0 file

Currently, we are working on the python removal task on bootstrap. Which means we have to extract some data from the stage0 file using shell scripts. However, parsing values from the stage0.json file is painful because shell scripts don't have a built-in way to parse json files.

This change simplifies the stage0 file format to key-value pairs, which makes it easily readable from any environment.

See the zulip thread for more details: https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Using.20different.20format.20in.20the.20stage0.20file
2024-05-12 06:26:20 +00:00
Young-Flash
de58ddfd0f test: add test case extract_with_specified_path_attr 2024-05-12 11:48:17 +08:00
Young-Flash
fafcc77855 fix: extract mod to file should respect path attribute 2024-05-12 11:48:17 +08:00
Michael Goulet
848f3c2c6e Make crashes dump mir to build dir 2024-05-11 20:39:25 -04:00