Commit Graph

145 Commits

Author SHA1 Message Date
Florian Diebold
3484d727c3 Extend analysis-stats a bit
This adds some tools helpful when debugging nondeterminism in analysis-stats:
 - a `--randomize` option that analyses everything in random order
 - a `-vv` option that prints even more detail

Also add a debug log if Chalk fuel is exhausted (which would be a source of
nondeterminism, but didn't happen in my tests).

I found one source of nondeterminism (rust-lang/chalk#331), but there are still
other cases remaining.
2020-02-15 18:04:01 +01:00
bors[bot]
b2b94cbf71
Merge #3147
3147: Check that impl self type matches up with expected self type in path mode r=matklad a=flodiebold

Fixes #3144.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2020-02-14 20:32:55 +00:00
Florian Diebold
f47dc4de8d Check that impl self type matches up with expected self type in path mode
Fixes #3144.
2020-02-14 21:08:25 +01:00
Florian Diebold
001dd6a200 Make Self implement the trait inside trait default methods 2020-02-14 20:39:04 +01:00
Florian Diebold
5028b86cb8 Move hir_fmt code to display module 2020-02-14 15:01:42 +01:00
Florian Diebold
a324d066cb Rename Ty::Param => Ty::Placeholder
This aligns more with Chalk.
2020-02-14 14:44:00 +01:00
Florian Diebold
43df7c3d53 Don't let unknown match arms fall back to ! 2020-02-11 21:09:11 +01:00
Matthew Jasper
8c8d0bb34f Add or- and parenthesized-patterns 2020-02-09 22:06:15 +00:00
Florian Diebold
eefe02ce6e Add two more tests 2020-02-07 18:28:11 +01:00
Florian Diebold
9d6061f3bb Fix some TODOs 2020-02-07 18:28:11 +01:00
Florian Diebold
b0bb8622ee Don't print implicit type args from impl Trait 2020-02-07 18:28:11 +01:00
Florian Diebold
6c70619b01 Deal better with implicit type parameters and argument lists 2020-02-07 18:28:10 +01:00
Florian Diebold
dded90a748 Formatting 2020-02-07 18:28:10 +01:00
Florian Diebold
6787f124b5 Clean up RPIT a bit 2020-02-07 18:28:10 +01:00
Florian Diebold
0718682cff Fix compilation of other crates 2020-02-07 18:28:10 +01:00
Florian Diebold
a3d8cffde3 Use variables in predicates as well 2020-02-07 18:28:10 +01:00
Florian Diebold
86348f5994 Comment fixes / todos 2020-02-07 18:28:10 +01:00
Florian Diebold
3397ca679f Fix APIT some more 2020-02-07 18:28:10 +01:00
Florian Diebold
c6654fd4a7 Fix APIT 2020-02-07 18:28:10 +01:00
Florian Diebold
ed25cf70d5 Change Ty::Param to contain param ID 2020-02-07 18:28:10 +01:00
Florian Diebold
f8b7b64bce WIP use params for APIT 2020-02-07 18:28:10 +01:00
Florian Diebold
33aa2f8e4f Fix assoc type selection 2020-02-07 18:28:10 +01:00
Florian Diebold
4a8279a21a Fix another test 2020-02-07 18:28:10 +01:00
Florian Diebold
dbc14f9d57 First stab at desugaring bounds for APIT 2020-02-07 18:28:10 +01:00
Florian Diebold
a9430865b3 Fix crash 2020-02-07 18:28:10 +01:00
Florian Diebold
a5554dcb17 Fix enum constructors 2020-02-07 18:28:10 +01:00
Florian Diebold
4789a993eb Fix printing of function types 2020-02-07 18:28:10 +01:00
Florian Diebold
16c6937447 Lower impl trait to variables, move away from using placeholders where they don't belong 2020-02-07 18:28:10 +01:00
Florian Diebold
93aa166748 wip lower impl trait to type args 2020-02-07 18:28:10 +01:00
Florian Diebold
9dec65d3b1 wip implement lowering mode 2020-02-07 18:28:10 +01:00
Florian Diebold
7ea4bce1b2 Add impl trait lowering mode 2020-02-07 18:28:10 +01:00
Florian Diebold
22a65b11b3 Introduce TyLoweringContext 2020-02-07 18:28:10 +01:00
Aleksey Kladov
6ca19b2188 Standard formatting for array types 2020-01-28 15:32:20 +01:00
Florian Diebold
339a11c33c Tweak Chalk settings 2020-01-27 21:52:35 +01:00
Florian Diebold
d3a3e5abdf Ignore failing impl Trait tests 2020-01-27 21:38:10 +01:00
Florian Diebold
96ddf2962c Upgrade Chalk 2020-01-27 21:25:33 +01:00
Jeremy Kolb
b89991daed Update crates 2020-01-26 10:46:45 -05:00
Kirill Bulatov
4029e44102 Omit default parameters for reference types 2020-01-22 16:55:09 +02:00
Florian Diebold
33d637f2dd Fix inference for shift operators
Fixes #2602.
2020-01-17 16:59:51 +01:00
bors[bot]
767ff2c13c
Merge #2844
2844: Use dummy value for line! and column! macro r=matklad a=edwin0cheng

Use dummy value `0` for line! and column! macro. 

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-01-14 17:59:24 +00:00
Edwin Cheng
6ebb1edf21 Use dummy value for line! and column! macro 2020-01-15 01:47:01 +08:00
Aleksey Kladov
21c5fd8b1b Push resolver further up 2020-01-14 14:24:03 +01:00
Aleksey Kladov
7ec62ea5e6 Push resolver up 2020-01-14 14:11:07 +01:00
Aleksey Kladov
52e7f67128 Move impls_future to Type, where it belongs 2020-01-14 11:29:43 +01:00
Aleksey Kladov
5654387e77 Don't panic if chalk panics 2020-01-13 19:00:42 +01:00
Florian Diebold
9dc1826cfa Fix various names, e.g. Iterator not resolving in core prelude
Basically, `Iterator` is re-exported via several steps, which happened to not be
resolved yet when we got to the prelude import, but since the name resolved to
the reexport from `core::iter` (just to no actual items), we gave up trying to
resolve it further.

Maybe part of the problem is that we can have
`PartialResolvedImport::Unresolved` or `PartialResolvedImport::Indeterminate`
with `None` in all namespaces, and handle them differently.

Fixes #2683.
2020-01-11 23:37:58 +01:00
Florian Diebold
dd6ec81d65 Add test for macro expansion in various expressions 2020-01-10 22:08:02 +01:00
Edwin Cheng
ca62d98781 Expand PAREN_EXPR as expression 2020-01-11 00:29:00 +08:00
bors[bot]
cb160f2a34
Merge #2742
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 <michal.terepeta@gmail.com>

Co-authored-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-03 19:08:32 +00:00
Michal Terepeta
d6c2a59538 Split infer query into two for better profiling
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 <michal.terepeta@gmail.com>
2020-01-03 19:58:11 +01:00