about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2024-12-11Merge pull request #18653 from SomeoneToIgnore/hash-completionsLukas Wirth-23/+134
Hash completion items to properly match them during /resolve
2024-12-11Merge pull request #18657 from Giga-Bowser/generate-enum-variantLukas Wirth-231/+522
minor: Migrate `generate_enum_variant` to `SyntaxEditor`
2024-12-11Merge pull request #18656 from roife/fix-issue-18639Lukas Wirth-15/+54
feat: preserve order of parameters in extract_functions
2024-12-11Merge pull request #4008 from JoJoDeveloping/tb-access-state-based-skippingRalf Jung-1/+88
[TB Optimization] Skip subtrees based on the subtree's root node's permissions
2024-12-10Remove more traces of anonymous ADTsMichael Goulet-4/+1
2024-12-10Rollup merge of #134113 - jyn514:run-make-contains, r=jieyouxuLeón Orell Valerian Liehr-1/+1
run-make: Fix `assert_stderr_not_contains_regex` It asserted on **stdout**, not stderr. r? ``@jieyouxu``
2024-12-11feat: preserve order of parameters in extract_functionsroife-15/+54
2024-12-10Keep track of parse errors in `mod`s and don't emit resolve errors for paths ↵Esteban Küber-9/+8
involving them When we expand a `mod foo;` and parse `foo.rs`, we now track whether that file had an unrecovered parse error that reached the end of the file. If so, we keep that information around. When resolving a path like `foo::bar`, we do not emit any errors for "`bar` not found in `foo`", as we know that the parse error might have caused `bar` to not be parsed and accounted for. When this happens in an existing project, every path referencing `foo` would be an irrelevant compile error. Instead, we now skip emitting anything until `foo.rs` is fixed. Tellingly enough, we didn't have any test for errors caused by `mod` expansion. Fix #97734.
2024-12-10minor: Migrate `generate_enum_variant` to `SyntaxEditor`Giga Bowser-229/+275
2024-12-10minor: Add `ty_infer` constructor to `SyntaxFactory`Giga Bowser-0/+8
2024-12-10minor: Add `whitespace` constructor to `SyntaxFactory`Giga Bowser-0/+4
2024-12-10minor: Add `item_enum` constructor to `SyntaxFactory`Giga Bowser-9/+242
I recursively added all constructors it depends on. I also changed the old `make::` constructors to support more of the grammar.
2024-12-10TB: optimize accesses on large trees by ignoring subtrees if the access ↵Johannes Hostert-7/+34
would mostly be a NOP
2024-12-10Auto merge of #134125 - fmease:rollup-u38o3ob, r=fmeasebors-262/+170
Rollup of 11 pull requests Successful merges: - #133478 (jsondocck: Parse, don't validate commands.) - #133967 ([AIX] Pass -bnoipath when adding rust upstream dynamic crates) - #133970 ([AIX] Replace sa_sigaction with sa_union.__su_sigaction for AIX) - #133980 ([AIX] Remove option "-n" from AIX "ln" command) - #134008 (Make `Copy` unsafe to implement for ADTs with `unsafe` fields) - #134017 (Don't use `AsyncFnOnce::CallOnceFuture` bounds for signature deduction) - #134023 (handle cygwin environment in `install::sanitize_sh`) - #134041 (Use SourceMap to load debugger visualizer files) - #134065 (Move `write_graphviz_results`) - #134106 (Add compiler-maintainers who requested to be on review rotation) - #134123 (bootstrap: Forward cargo JSON output to stdout, not stderr) Failed merges: - #134120 (Remove Felix from ping groups and review rotation) r? `@ghost` `@rustbot` modify labels: rollup
2024-12-10Rollup merge of #134008 - jswrenn:unsafe-fields-copy, r=compiler-errorsLeón Orell Valerian Liehr-0/+1
Make `Copy` unsafe to implement for ADTs with `unsafe` fields As a rule, the application of `unsafe` to a declaration requires that use-sites of that declaration also entail `unsafe`. For example, a field declared `unsafe` may only be read in the lexical context of an `unsafe` block. For nearly all safe traits, the safety obligations of fields are explicitly discharged when they are mentioned in method definitions. For example, idiomatically implementing `Clone` (a safe trait) for a type with unsafe fields will require `unsafe` to clone those fields. Prior to this commit, `Copy` violated this rule. The trait is marked safe, and although it has no explicit methods, its implementation permits reads of `Self`. This commit resolves this by making `Copy` conditionally safe to implement. It remains safe to implement for ADTs without unsafe fields, but unsafe to implement for ADTs with unsafe fields. Tracking: #132922 r? ```@compiler-errors```
2024-12-10Rollup merge of #133478 - aDotInTheVoid:finally, r=fmeaseLeón Orell Valerian Liehr-262/+169
jsondocck: Parse, don't validate commands. Centralizes knowledge of jsondocck syntax into the parser, so the checker doesn't need to know what the indexes are. [Vaguely related zulip discussion](https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/jsondocck.20rewrite) I'm very happy this is negative LoC, despite adding a big, documented enum! r? ``@fmease``
2024-12-10Address the feedback from pascalkutheKirill Bulatov-6/+21
* Use Base64 to minify the hash representation in the JSON data * Do hash checks only for items with similar labels
2024-12-10Address the feedback from VeykrilKirill Bulatov-10/+10
* Exclude documentation field from hashing * Do less cloning during initial completion list generation
2024-12-10run-make: Fix `assert_stderr_not_contains_regex`jyn-1/+1
It asserted on **stdout**, not stderr.
2024-12-10Rollup merge of #134102 - WaffleLapkin:nix-dev-shell-fixups-2024-12-10, ↵León Orell Valerian Liehr-8/+6
r=Noratrieb Miscellaneous fixes for nix-dev-shell this makes it so files in `src/nix-dev-shell` are *not* ignored, as they should not be. note that `flake.lock` is still ignored globally. r? `@Noratrieb` See individual commits for more info. cc #131176 (it added gitignore entries I'm changing).
2024-12-10Rollup merge of #134010 - RalfJung:promoted-type-error-ice, r=oli-obkLeón Orell Valerian Liehr-2/+5
fix ICE on type error in promoted Fixes https://github.com/rust-lang/rust/issues/133968 Ensure that when we turn a type error into a "this promoted failed to evaluate" error, we do record this as something that may happen even in "infallible" promoteds.
2024-12-10Rollup merge of #133456 - clubby789:cargo-update, r=ChrisDentonLeón Orell Valerian Liehr-105/+340
Add licenses + Run `cargo update` Replaces #131311 try-job: dist-x86_64-linux License changes: - `unicode_ident` 1.0.14 introduces `(MIT OR Apache-2.0) AND Unicode-3.0`, but `unicode_ident` 1.0.12 (`(MIT OR Apache-2.0) AND Unicode-DFS-2016`) is still in tree - `instant` and its license exception are no longer used ``` compiler & tools dependencies: Updating allocator-api2 v0.2.18 -> v0.2.20 Updating anyhow v1.0.92 -> v1.0.93 Removing bitflags v1.3.2 Updating blake3 v1.5.4 -> v1.5.5 Updating bstr v1.10.0 -> v1.11.0 Updating bytes v1.8.0 -> v1.9.0 Updating cargo-platform v0.1.8 -> v0.1.9 Updating cc v1.2.0 -> v1.2.2 Updating clap v4.5.20 -> v4.5.21 Updating clap_builder v4.5.20 -> v4.5.21 Updating clap_complete v4.5.36 -> v4.5.38 Updating clap_lex v0.7.2 -> v0.7.3 Updating color-print v0.3.6 -> v0.3.7 Updating color-print-proc-macro v0.3.6 -> v0.3.7 Updating cpufeatures v0.2.14 -> v0.2.16 Updating curl-sys v0.4.77+curl-8.10.1 -> v0.4.78+curl-8.11.0 Updating errno v0.3.9 -> v0.3.10 Updating fastrand v2.1.1 -> v2.2.0 Updating flate2 v1.0.34 -> v1.0.35 Updating handlebars v5.1.2 -> v6.2.0 Adding icu_collections v1.5.0 Adding icu_normalizer v1.5.0 Adding icu_normalizer_data v1.5.0 Adding icu_properties v1.5.1 Adding icu_properties_data v1.5.0 Updating idna v0.5.0 -> v1.0.3 Adding idna_adapter v1.2.0 Updating indexmap v2.6.0 -> v2.7.0 Updating indicatif v0.17.8 -> v0.17.9 Removing instant v0.1.13 Updating itoa v1.0.11 -> v1.0.14 Updating js-sys v0.3.72 -> v0.3.74 Updating libc v0.2.164 -> v0.2.167 Updating libloading v0.8.5 -> v0.8.6 Updating litemap v0.7.3 -> v0.7.4 Updating mdbook v0.4.40 -> v0.4.43 Adding num-modular v0.6.1 Adding num-order v1.2.0 Updating pathdiff v0.2.2 -> v0.2.3 Updating portable-atomic v1.9.0 -> v1.10.0 Updating proc-macro2 v1.0.89 -> v1.0.92 Updating regex-automata v0.4.8 -> v0.4.9 Updating rustc-hash v2.0.0 -> v2.1.0 Updating rustc_apfloat v0.2.1+llvm-462a31f5a5ab -> v0.2.2+llvm-462a31f5a5ab Updating rustix v0.38.38 -> v0.38.41 Updating schannel v0.1.26 -> v0.1.27 Updating serde v1.0.214 -> v1.0.215 Updating serde_derive v1.0.214 -> v1.0.215 Updating serde_json v1.0.132 -> v1.0.133 Updating socket2 v0.5.7 -> v0.5.8 Updating spdx v0.10.6 -> v0.10.7 Updating syn v2.0.87 -> v2.0.90 Updating tempfile v3.13.0 -> v3.14.0 Updating terminal_size v0.4.0 -> v0.4.1 Updating thiserror v1.0.66 -> v1.0.69 (available: v2.0.3) Updating thiserror-impl v1.0.66 -> v1.0.69 Updating tokio v1.41.0 -> v1.41.1 Updating tracing-attributes v0.1.27 -> v0.1.28 Updating tracing-error v0.2.0 -> v0.2.1 Removing unicode-bidi v0.3.17 Updating unicode-ident v1.0.13 -> v1.0.14 Updating url v2.5.2 -> v2.5.4 Adding utf16_iter v1.0.5 Adding utf8_iter v1.0.4 Updating wasm-bindgen v0.2.95 -> v0.2.97 Updating wasm-bindgen-backend v0.2.95 -> v0.2.97 Updating wasm-bindgen-macro v0.2.95 -> v0.2.97 Updating wasm-bindgen-macro-support v0.2.95 -> v0.2.97 Updating wasm-bindgen-shared v0.2.95 -> v0.2.97 Updating wasm-encoder v0.220.0 -> v0.221.0 Adding wasmparser v0.221.0 Updating wast v219.0.1 -> v221.0.0 Updating wat v1.219.1 -> v1.221.0 Adding web-time v1.1.0 Adding write16 v1.0.0 Updating yoke v0.7.4 -> v0.7.5 Updating yoke-derive v0.7.4 -> v0.7.5 Updating zerofrom v0.1.4 -> v0.1.5 Updating zerofrom-derive v0.1.4 -> v0.1.5 library dependencies: Updating allocator-api2 v0.2.18 -> v0.2.20 Updating cc v1.2.0 -> v1.2.2 Updating libc v0.2.162 -> v0.2.164 Updating unwinding v0.2.3 -> v0.2.4 rustbook dependencies: Updating anstream v0.6.17 -> v0.6.18 Updating anyhow v1.0.92 -> v1.0.93 Updating bstr v1.10.0 -> v1.11.0 Updating cc v1.2.0 -> v1.2.2 Updating clap v4.5.20 -> v4.5.21 Updating clap_builder v4.5.20 -> v4.5.21 Updating clap_complete v4.5.36 -> v4.5.38 Updating clap_lex v0.7.2 -> v0.7.3 Updating cpufeatures v0.2.14 -> v0.2.16 Adding displaydoc v0.2.5 Updating errno v0.3.9 -> v0.3.10 Updating fastrand v2.1.1 -> v2.2.0 Updating flate2 v1.0.34 -> v1.0.35 Updating hashbrown v0.15.0 -> v0.15.2 Adding icu_collections v1.5.0 Adding icu_locid v1.5.0 Adding icu_locid_transform v1.5.0 Adding icu_locid_transform_data v1.5.0 Adding icu_normalizer v1.5.0 Adding icu_normalizer_data v1.5.0 Adding icu_properties v1.5.1 Adding icu_properties_data v1.5.0 Adding icu_provider v1.5.0 Adding icu_provider_macros v1.5.0 Updating idna v0.5.0 -> v1.0.3 Adding idna_adapter v1.2.0 Updating indexmap v2.6.0 -> v2.7.0 Updating itoa v1.0.11 -> v1.0.14 Updating js-sys v0.3.72 -> v0.3.74 Updating libc v0.2.161 -> v0.2.167 Adding litemap v0.7.4 Updating mdbook v0.4.42 -> v0.4.43 Updating pathdiff v0.2.2 -> v0.2.3 Updating proc-macro2 v1.0.89 -> v1.0.92 Updating regex-automata v0.4.8 -> v0.4.9 Updating rustix v0.38.38 -> v0.38.41 Updating serde v1.0.214 -> v1.0.215 Updating serde_derive v1.0.214 -> v1.0.215 Updating serde_json v1.0.132 -> v1.0.133 Adding stable_deref_trait v1.2.0 Updating syn v2.0.87 -> v2.0.90 Adding synstructure v0.13.1 Updating tempfile v3.13.0 -> v3.14.0 Updating terminal_size v0.4.0 -> v0.4.1 Updating thiserror v1.0.66 -> v1.0.69 Updating thiserror-impl v1.0.66 -> v1.0.69 Adding tinystr v0.7.6 Removing tinyvec v1.8.0 Removing tinyvec_macros v0.1.1 Removing unicode-bidi v0.3.17 Updating unicode-ident v1.0.13 -> v1.0.14 Removing unicode-normalization v0.1.24 Updating url v2.5.2 -> v2.5.4 Adding utf16_iter v1.0.5 Adding utf8_iter v1.0.4 Updating wasm-bindgen v0.2.95 -> v0.2.97 Updating wasm-bindgen-backend v0.2.95 -> v0.2.97 Updating wasm-bindgen-macro v0.2.95 -> v0.2.97 Updating wasm-bindgen-macro-support v0.2.95 -> v0.2.97 Updating wasm-bindgen-shared v0.2.95 -> v0.2.97 Adding write16 v1.0.0 Adding writeable v0.5.5 Adding yoke v0.7.5 Adding yoke-derive v0.7.5 Adding zerofrom v0.1.5 Adding zerofrom-derive v0.1.5 Adding zerovec v0.10.4 Adding zerovec-derive v0.10.3 ```
2024-12-10Merge pull request #18649 from roife/fix-issue-18648Laurențiu Nicola-1/+27
minor: enhance name suggestion for `Arc<T>` and `Rc<T>`
2024-12-10Auto merge of #134096 - fmease:rollup-0asgoo8, r=fmeasebors-167/+66
Rollup of 9 pull requests Successful merges: - #133996 (Move most tests for `-l` and `#[link(..)]` into `tests/ui/link-native-libs`) - #134012 (Grammar fixes) - #134032 (docs: better examples for `std::ops::ControlFlow`) - #134040 (bootstrap: print{ln}! -> eprint{ln}! (take 2)) - #134043 (Add test to check unicode identifier version) - #134053 (rustdoc: rename `issue-\d+.rs` tests to have meaningful names (part 10)) - #134055 (interpret: clean up deduplicating allocation functions) - #134073 (dataflow_const_prop: do not eval a ptr address in SwitchInt) - #134084 (Fix typo in RFC mention 3598 -> 3593) r? `@ghost` `@rustbot` modify labels: rollup
2024-12-09minor: Migrate `remove_unnecessary_wrapper` to `SyntaxEditor`Giga Bowser-20/+63
2024-12-09fix: Handle the final statement in `SyntaxFactory::block_expr` properlyGiga Bowser-6/+15
This caused a bug that was rather tricky to hunt down!
2024-12-09Add diagnostic fix to remove unnecessary wrapper in type mismatchGiga Bowser-62/+375
I also reorganized the tests in a more logical order, and removed the redundant `test_` prefix from their names.
2024-12-10provide `libz.so.1` in the `nix-dev-shell`Waffle Lapkin-6/+4
`libz.so.1` is needed for some (?) things... i personally found myself in need of it when running `x t linkchecker`, which failed when running cargo build script or something. although there are also mentions of rustc itself needing it: <https://github.com/NixOS/nixpkgs/issues/92946>
2024-12-10remove instructions to git exclude files in `src/nix-dev-shell/envrc-*`Waffle Lapkin-2/+2
this is no longer needed as `.gitignore` contains both `/.envrc` and `flake.lock` (and also `/.direnv/`)
2024-12-10Clippy fixesKirill Bulatov-5/+5
2024-12-10Avoid hashing completion-related ranges as those may change during /resolve ↵Kirill Bulatov-15/+3
query
2024-12-09Rollup merge of #134055 - RalfJung:interpret-alloc-dedup, r=oli-obkLeón Orell Valerian Liehr-104/+3
interpret: clean up deduplicating allocation functions The "align" and "kind" arguments would be largely ignored in the "dedup" case, so let's move that to entirely separate function. Let's also remove support for old-style miri_resolve_frame while we are at it. The docs have already said for a while that this must be set to 1.
2024-12-09Rollup merge of #134040 - clubby789:bootstrap-eprintln, r=jieyouxuLeón Orell Valerian Liehr-57/+57
bootstrap: print{ln}! -> eprint{ln}! (take 2) r? `@jieyouxu` Reland of #133817 with the `print!`s changed as well.
2024-12-09Rollup merge of #133996 - Zalathar:ui-link-native-libs, r=jieyouxuLeón Orell Valerian Liehr-6/+6
Move most tests for `-l` and `#[link(..)]` into `tests/ui/link-native-libs` Tests for the closely-related `-l` flag and `#[link(..)]` attribute are spread across a few different directories, and in some cases have ended up in a test directory intended for other linker-related functionality. This PR moves most of them into a single `tests/ui/link-native-libs` directory. --- Part of #133895. try-job: i686-mingw r? jieyouxu
2024-12-09Introduce `default_field_values` featureEsteban Küber-29/+44
Initial implementation of `#[feature(default_field_values]`, proposed in https://github.com/rust-lang/rfcs/pull/3681. Support default fields in enum struct variant Allow default values in an enum struct variant definition: ```rust pub enum Bar { Foo { bar: S = S, baz: i32 = 42 + 3, } } ``` Allow using `..` without a base on an enum struct variant ```rust Bar::Foo { .. } ``` `#[derive(Default)]` doesn't account for these as it is still gating `#[default]` only being allowed on unit variants. Support `#[derive(Default)]` on enum struct variants with all defaulted fields ```rust pub enum Bar { #[default] Foo { bar: S = S, baz: i32 = 42 + 3, } } ``` Check for missing fields in typeck instead of mir_build. Expand test with `const` param case (needs `generic_const_exprs` enabled). Properly instantiate MIR const The following works: ```rust struct S<A> { a: Vec<A> = Vec::new(), } S::<i32> { .. } ``` Add lint for default fields that will always fail const-eval We *allow* this to happen for API writers that might want to rely on users' getting a compile error when using the default field, different to the error that they would get when the field isn't default. We could change this to *always* error instead of being a lint, if we wanted. This will *not* catch errors for partially evaluated consts, like when the expression relies on a const parameter. Suggestions when encountering `Foo { .. }` without `#[feature(default_field_values)]`: - Suggest adding a base expression if there are missing fields. - Suggest enabling the feature if all the missing fields have optional values. - Suggest removing `..` if there are no missing fields.
2024-12-09jsondocck: Parse, don't validate commands.Alona Enraght-Moony-262/+169
2024-12-10crates/r-a: Fix typo in debug messageYuki Sireneva-1/+1
2024-12-09Unite more bool hashingKirill Bulatov-15/+16
2024-12-09Stop excluding Helix from the general resolve pathKirill Bulatov-2/+2
2024-12-09Always compute the hash when r-a wants the imports to be resolvedKirill Bulatov-17/+6
2024-12-09Draft completion hashingKirill Bulatov-24/+142
2024-12-10minor: enhance name suggestion for `Arc<T>` and `Rc<T>`roife-1/+27
2024-12-09Merge pull request #18647 from Veykril/push-nsrrmmnzzoymLukas Wirth-3/+3
internal: Disable pipe on typing handler
2024-12-09Disable pipe on typing handlerLukas Wirth-3/+3
2024-12-09fix ICE on type error in promotedRalf Jung-2/+5
2024-12-09interpret: clean up deduplicating allocation functionsRalf Jung-104/+3
2024-12-09Merge pull request #18645 from Veykril/push-yruoyrvrsntwLukas Wirth-12/+21
fix: Non-exhaustive structs may be empty
2024-12-09fix: Non-exhaustive structs may be emptyLukas Wirth-12/+21
2024-12-09Enable `[bot-pull-requests]` triagebot featureJakub Beránek-0/+3
2024-12-09compiletest: `print{,ln}!` -> `eprint{,ln}!`clubby789-57/+57
Co-authored-by: Jieyou Xu <jieyouxu@outlook.com>