aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src
Commit message (Collapse)AuthorAgeFilesLines
* Add test for macro expansion in various expressionsFlorian Diebold2020-01-101-0/+81
|
* Expand PAREN_EXPR as expressionEdwin Cheng2020-01-101-0/+17
|
* Merge #2742bors[bot]2020-01-033-4/+13
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2742: Split `infer` query into two for better profiling r=flodiebold a=michalt This is the same change as we did with `crate_def_map` and it does seem that we mostly spend time in salsa, without recomputing much on rust-analyzer side. Example output: ``` 233ms - handle_inlay_hints 163ms - get_inlay_hints 163ms - SourceAnalyzer::new 67ms - def_with_body_from_child_node 67ms - analyze_container 67ms - analyze_container 67ms - Module::from_definition 67ms - Module::from_file 67ms - crate_def_map 0ms - parse_macro_query (6 calls) 0ms - raw_items_query (1 calls) 66ms - ??? 0ms - crate_def_map (1 calls) 0ms - crate_def_map (1 calls) 96ms - infer 2ms - trait_solve_query (2 calls) 94ms - ??? 0ms - body_with_source_map_query (1 calls) 0ms - crate_def_map (1 calls) [...] ``` Signed-off-by: Michal Terepeta <[email protected]> Co-authored-by: Michal Terepeta <[email protected]>
| * Split `infer` query into two for better profilingMichal Terepeta2020-01-033-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the same change as we did with `crate_def_map` and it does seem that we mostly spend time in salsa, without recomputing much on rust-analyzer side. Example output: ``` 233ms - handle_inlay_hints 163ms - get_inlay_hints 163ms - SourceAnalyzer::new 67ms - def_with_body_from_child_node 67ms - analyze_container 67ms - analyze_container 67ms - Module::from_definition 67ms - Module::from_file 67ms - crate_def_map 0ms - parse_macro_query (6 calls) 0ms - raw_items_query (1 calls) 66ms - ??? 0ms - crate_def_map (1 calls) 0ms - crate_def_map (1 calls) 96ms - infer 2ms - trait_solve_query (2 calls) 94ms - ??? 0ms - body_with_source_map_query (1 calls) 0ms - crate_def_map (1 calls) [...] ``` Signed-off-by: Michal Terepeta <[email protected]>
* | Fix #2705Florian Diebold2020-01-032-1/+18
|/ | | | | | | | The `-` turned into a `+` during a refactoring. The original issue was caused by `Read` resolving wrongly to a trait without type parameters instead of a struct with one parameter; this only fixes the crash, not the wrong resolution.
* Resolve traits in infer using lang item infrastructureEmil Lauridsen2019-12-293-10/+19
|
* Don't add non-impl/trait containers to scopeAleksey Kladov2019-12-293-24/+95
|
* Merge #2657bors[bot]2019-12-272-17/+26
|\ | | | | | | | | | | | | | | | | | | 2657: Omit closure parameters in closure type display strings r=flodiebold a=SomeoneToIgnore Part of https://github.com/rust-analyzer/rust-analyzer/issues/1946 I wonder, should we display the the closure trait (Fn/FnMut/FnOnce) in inlay hints instead of `|...|` at all? Co-authored-by: Kirill Bulatov <[email protected]>
| * Omit closure parametersKirill Bulatov2019-12-232-17/+26
| |
* | Merge #2661bors[bot]2019-12-242-2/+78
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | 2661: Implement infer await from async function r=flodiebold a=edwin0cheng This PR is my attempt for trying to add support for infer `.await` expression from an `async` function, by desugaring its return type to `Impl Future<Output=RetType>`. Note that I don't know it is supposed to desugaring it in that phase, if it is not suitable in current design, just feel free to reject it :) r=@flodiebold Co-authored-by: Edwin Cheng <[email protected]>
| * Check if parameters is emptyEdwin Cheng2019-12-241-4/+6
| |
| * Add FIXMEEdwin Cheng2019-12-241-1/+5
| |
| * Implement infer await from async funcEdwin Cheng2019-12-242-2/+72
| |
* | Filter out error predicates in type bounds as wellFlorian Diebold2019-12-222-2/+29
| |
* | Introduce our own Chalk TypeFamily, instead of using ChalkIrFlorian Diebold2019-12-224-87/+126
| | | | | | | | | | | | It's not very different, except we can directly use Salsa IDs instead of casting them. This means we need to refactor the handling of errors to get rid of UNKNOWN_TRAIT though.
* | Refactor Chalk integration some moreFlorian Diebold2019-12-222-79/+83
| |
* | Update Chalk, clean up Chalk integration a bitFlorian Diebold2019-12-223-121/+100
|/
* Rudimentary name resolution for local itemsAleksey Kladov2019-12-221-6/+6
|
* Merge #2626bors[bot]2019-12-211-0/+23
|\ | | | | | | | | | | | | | | 2626: Recursive collect macros in impl items r=matklad a=edwin0cheng Co-authored-by: Edwin Cheng <[email protected]>
| * Recursive collect macros in impl itemsEdwin Cheng2019-12-201-0/+23
| |
* | Merge #2625bors[bot]2019-12-212-3/+3
|\ \ | |/ |/| | | | | | | | | | | 2625: Clippy lints r=matklad a=kjeremy Co-authored-by: kjeremy <[email protected]>
| * Clippy lintskjeremy2019-12-202-3/+3
| |
* | Merge #2624bors[bot]2019-12-203-3/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | 2624: Separate module item from module scope r=matklad a=matklad bors r+ Co-authored-by: Aleksey Kladov <[email protected]>
| * | Move impls to ItemScopeAleksey Kladov2019-12-203-3/+3
| | |
* | | Merge #2623bors[bot]2019-12-201-0/+19
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | 2623: Add support macros in impl blocks r=matklad a=edwin0cheng This PR add support for macros in impl blocks, which reuse `Expander` for macro expansion. see also: #2459 Co-authored-by: Edwin Cheng <[email protected]>
| * | Add support macros in impl blocksEdwin Cheng2019-12-201-0/+19
| |/
* | Coerce closures to fn pointersFlorian Diebold2019-12-203-5/+48
| | | | | | | | E.g. `let x: fn(A) -> B = |x| { y };`
* | Fix coercion of last expression in function bodyFlorian Diebold2019-12-203-2/+18
| |
* | Handle closure return typesFlorian Diebold2019-12-204-4/+106
|/ | | | Fixes #2547.
* Merge #2592bors[bot]2019-12-203-5/+59
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2592: Add std::ops::Index support for infering r=edwin0cheng a=edwin0cheng see also #2534 Seem like this can't fix #2534 for this case: ```rust fn foo3(bar: [usize; 2]) { let baz = bar[1]; // <--- baz is still unknown ? println!("{}", baz); } ``` Co-authored-by: Edwin Cheng <[email protected]>
| * Use fill instread of for loopEdwin Cheng2019-12-191-5/+3
| |
| * Use build_for_defEdwin Cheng2019-12-191-1/+1
| |
| * Add std::ops::Index support for inferingEdwin Cheng2019-12-193-5/+61
| |
* | Use generic ItemLoc for implsAleksey Kladov2019-12-202-2/+2
| |
* | Support for nested traitsAleksey Kladov2019-12-201-2/+4
| |
* | Support for nested ADTAleksey Kladov2019-12-201-2/+2
| |
* | Introduce `ContainerId`Aleksey Kladov2019-12-203-3/+3
| |
* | Rename ContainerId -> AssocContainerIdAleksey Kladov2019-12-206-22/+22
| |
* | Add body as a possible container for itemsAleksey Kladov2019-12-193-7/+7
| |
* | Remove TruncateOptions structKirill Bulatov2019-12-191-13/+10
| |
* | Omit default parameter typesKirill Bulatov2019-12-192-7/+47
| |
* | Forbid <T>::foo syntax in mod pathsAleksey Kladov2019-12-182-5/+5
|/
* Add test markFlorian Diebold2019-12-153-2/+9
|
* Handle impl Trait more correctlyFlorian Diebold2019-12-153-1/+56
| | | | | | | When calling a function, argument-position impl Trait is transparent; same for return-position impl Trait when inside the function. So in these cases, we need to represent that type not by `Ty::Opaque`, but by a type variable that can be unified with whatever flows into there.
* Add test for unifying impl TraitFlorian Diebold2019-12-151-1/+27
|
* Use different types for path with and without genericsAleksey Kladov2019-12-144-51/+51
|
* Use path macroFlorian Diebold2019-12-132-15/+15
|
* Rename N! to name!Florian Diebold2019-12-135-15/+15
|
* Add macros for known names and pathsFlorian Diebold2019-12-135-17/+15
|
* Correctly infer - and ! using std::ops::{Neg,Not}Emil Lauridsen2019-12-133-23/+104
|