about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2022-04-01Merge #11867bors[bot]-19/+28
11867: create generate is, as, try_into group r=Veykril a=jakevossen5 Fixes #11636 In `generate_enum_projection_method.rs`, the changes to the function are from `cargo fmt`, I made the same change as I did in `generate_enum_is_method.rs`. Co-authored-by: Jake Vossen <jake@vossen.dev>
2022-03-31create generate is, as, try_into groupJake Vossen-19/+28
2022-03-31Add test against line number underflowFelix Maurer-0/+107
2022-03-31Prevent underflow when converting line numbersFelix Maurer-2/+8
Previously, when line numbers of Rust spans were converted to LSP ranges, they could underflow resulting in very large line numbers. As an underflow is always wrong, prevent it and use 0 instead.
2022-03-31Fix: Select correct insert position for disabled group importJonas Bushart-62/+98
The logic for importing with and without `group_imports` differed significantly when no previous group existed. This lead to the problem of using the wrong position when importing inside a module (#11585) or when inner attributes are involved. The existing code for grouped imports is better and takes these things into account. This PR changes the flow to use the pre-existing code for adding a new import group even for the non-grouped import settings. Some coverage markers are updated and the `group` is removed, since they are now invoked in both cases (grouping and no grouping). Tests are updated and two tests (empty module and inner attribute) are added. Fixes #11585
2022-03-31Merge #11863bors[bot]-28/+37
11863: fix: allow varargs in any param position r=jonas-schievink a=jonas-schievink Fixes https://github.com/rust-analyzer/rust-analyzer/issues/3578 and aligns us with the Rust reference. bors r+ Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2022-03-31Remove parser restriction on varargs positioningJonas Schievink-28/+37
2022-03-31Merge #11827bors[bot]-501/+504
11827: internal: Enforce Invariant that Resolver always contains a ModuleScope r=Veykril a=Veykril Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-31Merge #11861bors[bot]-1/+89
11861: internal: Add "view file text" command to debug sync issues r=jonas-schievink a=jonas-schievink I saw a file sync bug the other day but didn't know how to further debug it. This command might give a clue as to what's wrong and help debug issues like https://github.com/rust-analyzer/rust-analyzer/issues/4829. bors r+ Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2022-03-31Add "view file text" command to debug sync issuesJonas Schievink-1/+89
2022-03-31internal: Enforce Resolver to always have a module scopeLukas Wirth-398/+360
2022-03-31Fix formattingAleksei Trifonov-4/+1
2022-03-31Lower postfix suggestions in completions listAleksei Trifonov-7/+20
2022-03-30internal: Refactor FamousDefs builtin crate searchLukas Wirth-105/+146
2022-03-30Merge #11852bors[bot]-1/+1
11852: Type mismatch when last expression is noreturn asm r=lnicola a=weirdsmiley When last expression in a function body is noreturn asm, then analyzer complains about the type mismatch by highlighting entire body. This fixes it by introducing loop {} in the expanded code. Fixes: [#11820](https://github.com/rust-analyzer/rust-analyzer/issues/11820) Co-authored-by: Manas <manas18244@iiitd.ac.in>
2022-03-30Type mismatch when last expression is noreturn asmManas-1/+1
When last expression in a function body is noreturn asm, then analyzer complains about the type mismatch by highlighting entire body. This fixes it by introducing loop {} in the expanded code.
2022-03-30Merge #11849bors[bot]-3/+3
11849: docs(auto_import): change by_self -> self and by_crate -> crate r=Veykril a=gibfahn --- #### Commits _(oldest to newest)_ 6b38c2d75 docs(auto_import): change by_self -> self and by_crate -> crate Keep things consistent with the package.json , which uses `self` and `crate` instead of `by_self` and `by_crate`. Both names are in fact allowed as aliases, but we should be consistent so that people reading the docs and using a schema do not see red squiggles. <br/> Co-authored-by: Gibson Fahnestock <gibfahn@gmail.com>
2022-03-30docs(auto_import): change by_self -> self and by_crate -> crateGibson Fahnestock-3/+3
Keep things consistent with the package.json , which uses `self` and `crate` instead of `by_self` and `by_crate`. Both names are in fact allowed as aliases, but we should be consistent so that people reading the docs and using a schema do not see red squiggles.
2022-03-29Merge #11844bors[bot]-5/+47
11844: Fix divergence detection for bare match arms r=flodiebold a=flodiebold Fixes #11814 and #11837. Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2022-03-29Fix divergence detection for bare match armsFlorian Diebold-5/+47
Fixes #11814 and #11837.
2022-03-29Merge #11842bors[bot]-83/+212
11842: Fix duplicate type mismatches with blocks r=flodiebold a=flodiebold E.g. when there's a type mismatch on the return value of a function. To fix this, we have to return the expected type as the type of the block when there's a mismatch. That meant some IDE code that expected otherwise had to be adapted, in particular the "add return type" assist. For the "wrap in Ok/Some" quickfix, this sadly means it usually can't be applied in all branches of an if expression at the same time anymore, because there's a type mismatch for each branch that has the wrong type. Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2022-03-29Fix duplicate type mismatches with blocksFlorian Diebold-83/+212
E.g. when there's a type mismatch on the return value of a function. To fix this, we have to return the expected type as the type of the block when there's a mismatch. That meant some IDE code that expected otherwise had to be adapted, in particular the "add return type" assist. For the "wrap in Ok/Some" quickfix, this sadly means it usually can't be applied in all branches of an if expression at the same time anymore, because there's a type mismatch for each branch that has the wrong type.
2022-03-29Merge #11840bors[bot]-2/+22
11840: Fix another const generic panic r=flodiebold a=HKalbasi fix #11835 If I change `dyn` to `impl` in the test, it will infer the type as `IntoIterator::Item<impl Iterator<Item = [Ar<u8, 7>; 9]> + ?Sized>` instead of `[Ar<u8, 7>; 9]`. Maybe it needs some action? Co-authored-by: hkalbasi <hamidrezakalbasi@protonmail.com>
2022-03-29fix regression_11688_3hkalbasi-2/+22
2022-03-27Merge #11833bors[bot]-103/+70
11833: internal: Move mismatched arg count diagnostic to inference r=flodiebold a=flodiebold This means we only need to handle legacy const generics in one place, and it fits there especially since there will be more diagnostics coming. Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2022-03-27Remove legacy_const_generics_indices from CallableSigFlorian Diebold-20/+3
I want to remove CallableSig anyway, and it's not needed anymore.
2022-03-27Move mismatched-arg-count diagnostic to inferenceFlorian Diebold-83/+67
2022-03-27Merge #11832bors[bot]-1/+1
11832: Fix typo in the style documentation r=lnicola a=Therzok Was going through the documentation itself and found this typo just waiting to be fixed Co-authored-by: Marius Ungureanu <therzok@gmail.com>
2022-03-27Fix typo in the style documentationMarius Ungureanu-1/+1
Was going through the documentation itself and found this typo just waiting to be fixed
2022-03-27Merge #11831bors[bot]-4/+41
11831: fix: Disable ref_match for qualified paths as well r=flodiebold a=flodiebold I.e. don't suggest `Foo::&foo()`. CC #8058. Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2022-03-27fix: Disable ref_match for qualified paths as wellFlorian Diebold-4/+41
I.e. don't suggest `Foo::&foo()`. CC #8058.
2022-03-27Merge #11829bors[bot]-11/+11
11829: minor: Bump chalk r=lnicola a=lnicola Pulls in https://github.com/rust-lang/chalk/pull/759. bors r+ Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2022-03-27Bump chalkLaurențiu Nicola-11/+11
2022-03-26Merge #11825bors[bot]-178/+196
11825: fix: Don't complete `Drop::drop` for qualified paths r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-26Merge #11826bors[bot]-21/+1
11826: Revert "Emit #[must_use] in Generate new assist" r=lnicola a=lnicola CC https://github.com/rust-analyzer/rust-analyzer/pull/11737#issuecomment-1079740305 Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2022-03-26Revert "Emit #[must_use] in Generate new assist"Laurențiu Nicola-21/+1
This reverts commit 7e05e10495cd0f83cbcba2e7d881b616998cf7dc.
2022-03-26Sort runnable test results to make them deterministicLukas Wirth-127/+128
2022-03-26fix: Don't complete Drop::drop for qualified pathsLukas Wirth-5/+28
2022-03-26SimplifyLukas Wirth-46/+40
2022-03-25Merge #11793bors[bot]-13/+23
11793: LSIF: consolidate references into a single edge where possible. r=Veykril a=khuey Co-authored-by: Kyle Huey <khuey@kylehuey.com>
2022-03-25Bump npm depsLaurențiu Nicola-512/+760
2022-03-25Merge #11817bors[bot]-1/+1
11817: minor: fix comment r=jonas-schievink a=jonas-schievink bors r+ Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2022-03-25Bump minimist from 1.2.5 to 1.2.6 in /editors/codedependabot[bot]-6/+6
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6. - [Release notes](https://github.com/substack/minimist/releases) - [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6) --- updated-dependencies: - dependency-name: minimist dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
2022-03-25Merge #11809bors[bot]-3/+3
11809: feat: disable experimental diagnostics by default r=jonas-schievink a=jonas-schievink Now that we diagnose type mismatches, we have another diagnostic that can potentially produce false positives, so let's disable experimental diagnostics by default. Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2022-03-25fix commentJonas Schievink-1/+1
2022-03-24Merge #11810bors[bot]-10/+10
11810: internal: rename the 1.47 proc macro ABI to 1.48 r=jonas-schievink a=jonas-schievink Closes https://github.com/rust-analyzer/rust-analyzer/issues/9898. We don't support 1.47, so rename it to reflect that. bors r+ Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2022-03-24Rename the 1.47 ABI to 1.48Jonas Schievink-10/+10
2022-03-24Disable experimental diagnostics by defaultJonas Schievink-3/+3
2022-03-24Merge #11772bors[bot]-141/+298
11772: Support constants in const eval r=HKalbasi a=HKalbasi This PR enables evaluating things like this: ```rust const X: usize = 2; const Y: usize = 3 + X; // = 5 ``` My target was nalgebra's `U5`, `U22`, ... which are defined as `type U5 = Const<{ SomeType5::SOME_ASSOC_CONST }>` but I didn't find out how to find the `ConstId` of the implementation of the trait, not the trait itself (possibly related to #4558 ? We can find associated type alias, so maybe this is doable already) So it doesn't help for nalgebra currently, but it is useful anyway. Co-authored-by: hkalbasi <hamidrezakalbasi@protonmail.com>
2022-03-24use pat_id instead of name in const eval stackhkalbasi-16/+13