about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2024-05-10Use fewer origins when creating type variables.Nicholas Nethercote-6/+1
`InferCtxt::next_{ty,const}_var*` all take an origin, but the `param_def_id` is almost always `None`. This commit changes them to just take a `Span` and build the origin within the method, and adds new methods for the rare cases where `param_def_id` might not be `None`. This avoids a lot of tedious origin building. Specifically: - next_ty_var{,_id_in_universe,_in_universe}: now take `Span` instead of `TypeVariableOrigin` - next_ty_var_with_origin: added - next_const_var{,_in_universe}: takes Span instead of ConstVariableOrigin - next_const_var_with_origin: added - next_region_var, next_region_var_in_universe: these are unchanged, still take RegionVariableOrigin The API inconsistency (ty/const vs region) seems worth it for the large conciseness improvements.
2024-05-09always use `GenericArgsRef`lcnr-6/+10
2024-05-09Rollup merge of #124923 - RalfJung:offset-from-errors, r=compiler-errorsMatthias Krüger-0/+36
interpret/miri: better errors on failing offset_from Fixes https://github.com/rust-lang/miri/issues/3104
2024-05-09opt-dist: use xz2 instead of xz crateklensy-1/+1
xz crate consist of simple reexport of xz2 crate. Why? Idk.
2024-05-09Auto merge of #124706 - Zalathar:revision-checker, r=jieyouxubors-5/+124
Tidy check for test revisions that are mentioned but not declared If a `[revision]` name appears in a test header directive or error annotation, but isn't declared in the `//@ revisions:` header, that is almost always a mistake. In cases where a revision needs to be temporarily disabled, adding it to an `//@ unused-revision-names:` header will suppress these checks for that name. Adding the wildcard name `*` to the unused list will suppress these checks for the entire file. (None of the tests actually use `*`; it's just there because it was easy to add and could be handy as an escape hatch when dealing with other problems.) --- Most of the existing problems discovered by this check were fairly straightforward to fix (or ignore); the trickiest cases are in `borrowck` tests.
2024-05-09Auto merge of #17208 - Wilfred:log_error_from_threads, r=Veykrilbors-2/+8
fix: Report both IO errors and main_loop errors If rust-analyzer receives a malformed LSP request, the IO thread terminates with a meaningful error, but then closes the channel. Once the channel has closed, the main_loop also terminates, but it only has RecvError and can't show a meaningful error. As a result, rust-analyzer would incorrectly claim that the client forgot to shutdown. ``` $ buggy_lsp_client | rust-analyzer Error: client exited without proper shutdown sequence ``` Instead, include both error messages when the server shuts down.
2024-05-09interpret/miri: better errors on failing offset_fromRalf Jung-0/+36
2024-05-09Auto merge of #3591 - RalfJung:win-symlink-trouble, r=RalfJungbors-150/+151
do not run symlink tests on Windows hosts Fixes https://github.com/rust-lang/miri/issues/3587
2024-05-09do not run symlink tests on Windows hostsRalf Jung-150/+151
2024-05-09make RUSTC_BLESS entirely an internal thingRalf Jung-3/+4
2024-05-09make MIRI_TEST_TARGET entirely an internal thingRalf Jung-143/+175
2024-05-09Auto merge of #3588 - RossSmyth:CliTarget, r=RalfJungbors-30/+80
Allow test targets to be set via CLI args Fixes #3584 I'm not a pro shell script reader as I am a Windows user, but we shall see if the CI script broke.
2024-05-09minor tweaksRalf Jung-6/+5
2024-05-09Tidy check for test revisions that are mentioned but not declaredZalathar-0/+118
If a `[revision]` name appears in a test header directive or error annotation, but isn't declared in the `//@ revisions:` header, that is almost always a mistake. In cases where a revision needs to be temporarily disabled, adding it to an `//@ unused-revision-names:` header will suppress these checks for that name. Adding the wildcard name `*` to the unused list will suppress these checks for the entire file.
2024-05-09Include the line number in tidy's `iter_header`Zalathar-5/+6
2024-05-09Rollup merge of #124837 - GuillaumeGomez:migrate-rustdoc-map-file, r=jieyouxuMatthias Krüger-1/+0
Migrate `run-make/rustdoc-map-file` to rmake Part of https://github.com/rust-lang/rust/issues/121876. r? `@jieyouxu`
2024-05-08fix: Report both IO errors and main_loop errorsWilfred Hughes-2/+8
If rust-analyzer receives a malformed LSP request, the IO thread terminates with a meaningful error, but then closes the channel. Once the channel has closed, the main_loop also terminates, but it only has RecvError and can't show a meaningful error. As a result, rust-analyzer would incorrectly claim that the client forgot to shutdown. ``` $ buggy_lsp_client | rust-analyzer Error: client exited without proper shutdown sequence ``` Instead, include both error messages when the server shuts down.
2024-05-08fix: Report all LSP protocol errors with invalid_dataWilfred Hughes-10/+18
Previously we did not use invalid_data for serde errors, making it harder to understand errors when the client sends malformed data to the server.
2024-05-08Update documentation for miri-script test changesRoss Smyth-6/+5
2024-05-08Update CI script for the miri-script test changesRoss Smyth-2/+2
2024-05-08Allow test targets to be set via CLI argsRoss Smyth-23/+75
2024-05-08Rollup merge of #124876 - nnethercote:rm-use-crate-rustc_foo, r=compiler-errorsMatthias Krüger-8/+5
Simplify `use crate::rustc_foo::bar` occurrences. They can just be written as `use rustc_foo::bar`, which is far more standard. (I didn't even know that a `crate::` prefix was valid.) r? ``@eholk``
2024-05-08Rollup merge of #124587 - reitermarkus:use-generic-nonzero, r=dtolnayMatthias Krüger-201/+178
Generic `NonZero` post-stabilization changes. Tracking issue: https://github.com/rust-lang/rust/issues/120257 r? ``@dtolnay``
2024-05-08Rollup merge of #123344 - pietroalbini:pa-unused-imports, r=NilstriebMatthias Krüger-10/+12
Remove braces when fixing a nested use tree into a single item [Back in 2019](https://github.com/rust-lang/rust/pull/56645) I added rustfix support for the `unused_imports` lint, to automatically remove them when running `cargo fix`. For the most part this worked great, but when removing all but one childs of a nested use tree it turned `use foo::{Unused, Used}` into `use foo::{Used}`. This is slightly annoying, because it then requires you to run `rustfmt` to get `use foo::Used`. This PR automatically removes braces and the surrouding whitespace when all but one child of a nested use tree are unused. To get it done I had to add the span of the nested use tree to the AST, and refactor a bit the code I wrote back then. A thing I noticed is, there doesn't seem to be any `//@ run-rustfix` test for fixing the `unused_imports` lint. I created a test in `tests/suggestions` (is that the right directory?) that for now tests just what I added in the PR. I can followup in a separate PR to add more tests for fixing `unused_lints`. This PR is best reviewed commit-by-commit.
2024-05-08Auto merge of #3580 - tiif:feat/malloc0-non-null-pointer, r=RalfJungbors-19/+74
Implement non-null pointer for malloc(0) Use non-null pointer for malloc(0) as mentioned in #3576 to detect leaks and double free of ``malloc(0)`` addresses.
2024-05-09Implement non-null pointer for malloc(0)tiif-19/+74
2024-05-08Use generic `NonZero`.Markus Reiter-65/+65
2024-05-08Simplify `clippy` lint.Markus Reiter-136/+113
2024-05-08Make term search fuel configurableTavo Annus-9/+56
2024-05-08Auto merge of #3589 - RalfJung:io-error, r=RalfJungbors-34/+31
io::Error handling: keep around the full io::Error for longer so we can give better errors This should help with the error message in https://github.com/rust-lang/miri/issues/3587.
2024-05-08io::Error handling: keep around the full io::Error for longer so we can give ↵Ralf Jung-34/+31
better errors
2024-05-08miri: rename intrinsic_fallback_checks_ub to intrinsic_fallback_is_specRalf Jung-18/+18
2024-05-08Migrate `run-make/rustdoc-map-file` to rmakeGuillaume Gomez-1/+0
2024-05-08use key-value format in stage0 fileonur-ozkan-43/+105
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. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-05-08Simplify `use crate::rustc_foo::bar` occurrences.Nicholas Nethercote-8/+5
They can just be written as `use rustc_foo::bar`, which is far more standard. (I didn't even know that a `crate::` prefix was valid.)
2024-05-07Update cargoWeihang Lo-0/+0
2024-05-07remove problems that I do not think we have seen in a whileRalf Jung-13/+0
2024-05-07README: update introductionRalf Jung-39/+31
2024-05-07Use unit of work as fuel instead of timeTavo Annus-42/+48
2024-05-07Rollup merge of #124738 - notriddle:notriddle/search-form-js, r=GuillaumeGomezMatthias Krüger-0/+2
rustdoc: dedup search form HTML This change constructs the search form HTML using JavaScript, instead of plain HTML. It uses a custom element because - the [parser]'s insert algorithm runs the connected callback synchronously, so we won't get layout jank - it requires very little HTML, so it's a real win in size [parser]: https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token This shrinks the standard library by about 60MiB, by my test. There should be no visible changes. Just use less disk space.
2024-05-07Auto merge of #17192 - roife:fix-issue-17179, r=lnicolabors-1/+46
Fix source_range for INT_NUMBER in completion fix #17179. Previously r-a use `TextRange::empty(self.position.offset)` as `source_range` for `INT_NUMBER`, so the `text_edit` would always be an insertion, which results in #17179. This PR changed it by using `text_range` of `original_token` (same as `IDENT`).
2024-05-06rustdoc: allow custom element rustdoc-searchMichael Howell-0/+2
2024-05-06Add time based fuel to term searchTavo Annus-8/+36
2024-05-06Collapse term search exprs before Cartesian product to avoid OOMTavo Annus-20/+43
2024-05-06Refactor float `Primitive`s to a separate `Float` typebeetrees-6/+6
2024-05-06Auto merge of #124753 - GuillaumeGomez:migrate-rustdoc-determinism, r=jieyouxubors-12/+31
Migrate `run-make/rustdoc-error-lines` to new `rmake.rs` Part of https://github.com/rust-lang/rust/issues/121876. There was a weird naming inconsistency with `input`/`output`. A few tests write `.arg("-o").arg(path)` and the `output` method was actually the command output. So instead, I renamed the original `output` into `command_output` so that I could create the `output` method with the expected effect (and updated the tests to use it too). EDIT: The first two commits come from https://github.com/rust-lang/rust/pull/124711. Some weird things happened recently pparently. ^^' r? `@jieyouxu`
2024-05-06Implement unsafe attribute parsingLukas Wirth-11/+534
2024-05-06Auto merge of #124497 - rytheo:move-std-tests-to-library, r=workingjubileebors-1/+0
Move some stdlib tests from `tests/ui` to `library/std/tests` Related to #99417
2024-05-06Auto merge of #3579 - RalfJung:libc, r=RalfJungbors-208/+211
organize libc tests into a proper folder, and run some of them on Windows
2024-05-06organize libc tests into a proper folder, and run some of them on WindowsRalf Jung-208/+211