aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty
Commit message (Collapse)AuthorAgeFilesLines
*-. Merge #4220 #4240bors[bot]2020-05-012-1/+41
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4220: Introduce LowerCtx r=matklad a=edwin0cheng This PR introduces `LowerCtx` for path lowering. After this PR, there are only 2 places remains for using deprecated `Path::from_ast`, which is related to `AstTransform` I am not familiar. I would like to change these in another PR by others ;) related disscusiion: https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Path.3A.3Afrom_src And also fixed part of https://github.com/rust-analyzer/rust-analyzer/issues/4176#issuecomment-620672930 4240: Bump deps r=matklad a=lnicola Co-authored-by: Edwin Cheng <[email protected]> Co-authored-by: Laurențiu Nicola <[email protected]>
| | * Bump depsLaurențiu Nicola2020-05-011-1/+1
| |/ |/|
| * Add testEdwin Cheng2020-05-011-0/+40
|/
* Kill more zombiesAleksey Kladov2020-04-301-5/+0
|
* Rename to associated_type_shorthand_candidatesJonas Schievink2020-04-292-27/+28
|
* Complete assoc. items on type parametersJonas Schievink2020-04-292-57/+90
|
* Merge #4173bors[bot]2020-04-271-4/+29
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4173: Use core instead of std for builtin derive macros r=edwin0cheng a=edwin0cheng Fixed #4087. We can't use `$crate` here right now because : 1. We have to able to detect `macro` 2.0 in collecting phase for finding `rustc_builtin_macro` attrs. 2. And we have to make hygiene works for builtin derive macro. r= @flodiebold Co-authored-by: Edwin Cheng <[email protected]>
| * Use empty-deps tricks to detect it is coreEdwin Cheng2020-04-271-6/+5
| |
| * Add testEdwin Cheng2020-04-271-0/+26
| |
| * Use core instead of std for builtin derive macrosEdwin Cheng2020-04-271-4/+4
| |
* | For associated type shorthand (T::Item), use the substs from the where clauseFlorian Diebold2020-04-264-13/+119
|/ | | | | So e.g. if we have `fn foo<T: SomeTrait<u32>>() -> T::Item`, we want to lower that to `<T as SomeTrait<u32>>::Item` and not `<T as SomeTrait<_>>::Item`.
* Merge #4145bors[bot]2020-04-251-3/+2
|\ | | | | | | | | | | | | | | | | | | | | 4145: Remove dead code r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * Fix panic in NoSuchField diagnosticAleksey Kladov2020-04-251-3/+2
| |
* | add support for cfg feature attributes on expression #4063Benjamin Coenen2020-04-251-0/+32
|/ | | | Signed-off-by: Benjamin Coenen <[email protected]>
* Rename StructField -> FieldAleksey Kladov2020-04-256-27/+25
|
* Convert tests to text-sizeAleksey Kladov2020-04-257-2192/+2192
|
* Convert code to text-sizeAleksey Kladov2020-04-251-2/+2
|
* Merge #4106bors[bot]2020-04-232-1/+42
|\ | | | | | | | | | | | | | | | | | | 4106: Fix wrong substitution code r=matklad a=flodiebold We need to shift in when we're substituting inside a binder. This should fix #4053 (it doesn't fix the occasional overflow that also occurs on the Diesel codebase though). Co-authored-by: Florian Diebold <[email protected]>
| * Fix wrong substitution codeFlorian Diebold2020-04-232-1/+42
| | | | | | | | | | | | | | We need to shift in when we're substituting inside a binder. This should fix #4053 (it doesn't fix the occasional overflow that also occurs on the Diesel codebase though).
* | Fully get rid of SyntaxNodePtr::rangeAleksey Kladov2020-04-231-20/+32
|/
* Update Chalk, and cache Chalk env elaboration through a queryFlorian Diebold2020-04-205-29/+164
| | | | This should fix some of the worst performance problems.
* Correctly infer types in guard expressionsAleksey Kladov2020-04-181-0/+26
| | | | | | | The root cause was that we forgot to add bindings from the arm to the guard expression closes #3980
* Fix goto definition for record patternsAleksey Kladov2020-04-182-0/+10
|
* missing match arm diagnostic support enum record typeJosh Mcguigan2020-04-182-41/+331
|
* Merge #4023bors[bot]2020-04-184-27/+92
|\ | | | | | | | | | | | | | | 4023: Fix another crash from wrong binders r=matklad a=flodiebold Basically, if we had something like `dyn Trait<T>` (where `T` is a type parameter) in an impl we lowered that to `dyn Trait<^0.0>`, when it should be `dyn Trait<^1.0>` because the `dyn` introduces a new binder. With one type parameter, that's just wrong, with two, it'll lead to crashes. Co-authored-by: Florian Diebold <[email protected]>
| * Fix another crash from wrong bindersFlorian Diebold2020-04-174-27/+92
| | | | | | | | | | | | | | Basically, if we had something like `dyn Trait<T>` (where `T` is a type parameter) in an impl we lowered that to `dyn Trait<^0.0>`, when it should be `dyn Trait<^1.0>` because the `dyn` introduces a new binder. With one type parameter, that's just wrong, with two, it'll lead to crashes.
* | Fix type equality for dyn TraitFlorian Diebold2020-04-173-5/+65
| | | | | | | | | | | | | | Fixes a lot of false type mismatches. (And as always when touching the unification code, I have to say I'm looking forward to replacing it by Chalk's...)
* | Add two more tests for associated typesFlorian Diebold2020-04-171-0/+174
| |
* | Merge #4012bors[bot]2020-04-171-0/+49
|\ \ | | | | | | | | | | | | | | | | | | | | | 4012: fix panic on ellipsis in pattern r=flodiebold a=JoshMcguigan fixes #3999 Co-authored-by: Josh Mcguigan <[email protected]>
| * | fix panic on ellipsis in patternJosh Mcguigan2020-04-171-0/+49
| |/
* | Simplify Diagnostic structureAleksey Kladov2020-04-173-42/+5
| | | | | | | | | | | | It's not entirely clear what subnode ranges should mean in the presence of macros, so let's leave them out for now. We are not using them heavily anyway.
* | Correctly highlight ranges of diagnostics from macrosAleksey Kladov2020-04-171-11/+11
| | | | | | | | closes #2799
* | Don't expose impl details of SyntaxPtrAleksey Kladov2020-04-173-6/+43
|/
* Merge #3979bors[bot]2020-04-163-3/+51
|\ | | | | | | | | | | | | | | 3979: fix missing match arm false positive for enum with no variants r=flodiebold a=JoshMcguigan fixes #3974 Co-authored-by: Josh Mcguigan <[email protected]>
| * fix false positive for enum with no variantsJosh Mcguigan2020-04-163-3/+51
| |
* | Test for non-working proc macro server assoc typesFlorian Diebold2020-04-161-0/+68
| |
* | Switch Chalk to recursive solverFlorian Diebold2020-04-165-40/+53
| | | | | | | | + various fixes related to that.
* | Update ChalkFlorian Diebold2020-04-162-5/+6
| |
| |
| \
*-. \ Merge #3966 #3968bors[bot]2020-04-153-7/+99
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3966: Add support for bounds on associated types in trait definitions r=matklad a=flodiebold E.g. ```rust trait Trait { type Item: SomeOtherTrait; } ``` Note that these don't simply desugar to where clauses; as I understand it, where clauses have to be proved by the *user* of the trait, but these bounds are proved by the *implementor*. (Also, where clauses on associated types are unstable.) (Another one from my recursive solver branch...) 3968: Remove format from syntax_bridge hot path r=matklad a=edwin0cheng Although only around 1% speed up by running: ``` Measure-Command {start-process .\target\release\rust-analyzer "analysis-stats -q ." -NoNewWindow -wait} ``` Co-authored-by: Florian Diebold <[email protected]> Co-authored-by: Edwin Cheng <[email protected]>
| * | | Add support for bounds on associated types in trait definitionsFlorian Diebold2020-04-133-7/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | E.g. ``` trait Trait { type Item: SomeOtherTrait; } ``` Note that these don't simply desugar to where clauses; as I understand it, where clauses have to be proved by the *user* of the trait, but these bounds are proved by the *implementor*. (Also, where clauses on associated types are unstable.)
| | | |
| \ \ \
| \ \ \
| \ \ \
*---. \ \ \ Merge #3964 #3965 #3967bors[bot]2020-04-155-21/+140
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3964: Nicer Chalk debug logs r=matklad a=flodiebold I'm looking at a lot of Chalk debug logs at the moment, so here's a few changes to make them slightly nicer... 3965: Implement inline associated type bounds r=matklad a=flodiebold Like `Iterator<Item: SomeTrait>`. This is an unstable feature, but it's used in the standard library e.g. in the definition of Flatten, so we can't get away with not implementing it :) (This is cherry-picked from my recursive solver branch, where it works better, but I did manage to write a test that works with the current Chalk solver as well...) 3967: Handle `Self::Type` in trait definitions when referring to own associated type r=matklad a=flodiebold It was implemented for other generic parameters for the trait, but not for `Self`. (Last one off my recursive solver branch :smile: ) Co-authored-by: Florian Diebold <[email protected]>
| | | * | | | Handle `Self::Type` in trait definitions when referring to own associated typeFlorian Diebold2020-04-133-5/+38
| | | |/ / / | | | | | | | | | | | | | | | | | | It was implemented for other generic parameters for the trait, but not for `Self`.
| | * / / / Implement inline associated type boundsFlorian Diebold2020-04-132-6/+69
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like `Iterator<Item: SomeTrait>`. This is an unstable feature, but it's used in the standard library e.g. in the definition of Flatten, so we can't get away with not implementing it :)
| * | | | Nicer display of projections in Chalk logsFlorian Diebold2020-04-132-8/+11
| | | | |
| * | | | Nicer display of closures in Chalk logsFlorian Diebold2020-04-131-2/+22
| |/ / /
* | | | Merge #3963bors[bot]2020-04-152-16/+69
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3963: Upgrade Chalk r=matklad a=flodiebold Co-authored-by: Florian Diebold <[email protected]>
| * | | | Upgrade ChalkFlorian Diebold2020-04-132-16/+69
| |/ / /
* | | / insta 0.16kjeremy2020-04-141-1/+1
| |_|/ |/| |
* | | handle tuple patterns with ellipsisJosh Mcguigan2020-04-132-50/+116
|/ /
* | Merge #3938bors[bot]2020-04-122-12/+253
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 3938: fix missing match arm false positive r=flodiebold a=JoshMcguigan This fixes #3932 by skipping the missing match arm diagnostic in the case any of the match arms don't type check properly against the match expression. I think this is the appropriate behavior for this diagnostic, since `is_useful` relies on all match arms being well formed, and the case of a malformed match arm should probably be handled by a different diagnostic. Co-authored-by: Josh Mcguigan <[email protected]>