hkalbasi
b55fbd3ad7
Add moved-out-of-ref
diagnostic
2023-05-18 19:17:06 +03:30
bors
9ce95674e8
Auto merge of #14837 - Veykril:rustc-lexer, r=Veykril
...
Support c string literals
2023-05-18 11:55:38 +00:00
Lukas Wirth
3e528b85f9
Fix cstring literals construct &CStr not &str
2023-05-18 12:03:15 +02:00
bors
034d7c8537
Auto merge of #14787 - HKalbasi:mir2, r=HKalbasi
...
MIR episode 5
This PR inits drop support (it is very broken at this stage, some things are dropped multiple time, drop scopes are wrong, ...) and adds stdout support (`println!` doesn't work since its expansion is dummy, but `stdout().write(b"hello world\n")` works if you use `RA_SYSROOT_HACK`) for interpreting. There is no useful unit test that it can interpret yet, but it is a good sign that it didn't hit a major road block yet.
In MIR lowering, it adds support for slice pattern and anonymous const blocks, and some fixes so that we can evaluate `SmolStr::new_inline` in const eval. With these changes, 57 failed mir body remains.
2023-05-18 09:44:26 +00:00
Lukas Wirth
4b577e2bc8
Support c string literals
2023-05-18 11:06:05 +02:00
bors
a20a08f3e2
Auto merge of #14824 - Veykril:ty-diag-unit, r=Veykril
...
fix: Diagnose non-value return and break type mismatches
Could definitely deserve more polished diagnostics, but this at least brings the message across for now.
2023-05-18 05:03:42 +00:00
Lukas Wirth
478705baf5
fix: Diagnose non-value return and break type mismatches
2023-05-16 22:47:27 +02:00
Lukas Wirth
08dc0e21af
feat: Render hover actions for closure captures and sig
2023-05-15 19:35:27 +02:00
hkalbasi
cbcafd3539
MIR episode 5
2023-05-12 18:17:15 +03:30
bors
d3ce333ec8
Auto merge of #14742 - Veykril:closure-capture-inlays, r=Veykril
...
feat: Closure capture inlay hints
I opted for a fictional `move(foo, &bar, &mut qux)` syntax here, disabled by default as these are not correct rust syntax and hence could cause confusion.
![image](https://user-images.githubusercontent.com/3757771/236447484-649a4ea6-ad61-496e-bad8-765a5236150e.png )
2023-05-08 09:52:29 +00:00
Lukas Wirth
4c5fd19ee5
Render places in capture inlay hints
2023-05-08 09:50:58 +02:00
Lukas Wirth
8081a654da
feat: Closure capture inlay hints
2023-05-05 13:38:22 +02:00
hkalbasi
aafe9b1e06
Lazy evaluate consts in path_to_const
2023-05-05 01:17:11 +03:30
hkalbasi
36c9d5ce17
Fix pattern type mismatch in tuples
2023-05-04 16:03:36 +03:30
Laurențiu Nicola
7197a27028
Use triomphe Arc
2023-05-02 20:02:43 +03:00
Lukas Wirth
5a97a326a9
Simplify
2023-05-02 09:05:28 +02:00
Lukas Wirth
a64626d99e
Highlight closure captures when cursor is on pipe
2023-05-02 08:59:40 +02:00
hkalbasi
6312fbf521
MIR episode 4
2023-05-01 23:23:10 +03:30
hkalbasi
5df545b3f0
Add hover for closure
2023-04-30 14:31:43 +03:30
Ryo Yoshida
12ba5cab11
Register obligations during path inference
2023-04-24 12:39:48 +09:00
hkalbasi
0c621065fb
Fix need-mut large span in closures and a false positive
2023-04-21 02:15:19 +03:30
bors
2400b36a2e
Auto merge of #14577 - jsoref:spelling, r=lnicola
...
Spelling
This PR corrects misspellings identified by the [check-spelling action](https://github.com/marketplace/actions/check-spelling ).
The misspellings have been reported at https://github.com/jsoref/rust-analyzer/actions/runs/4699991040#summary-12751355796
The action reports that the changes in this PR would make it happy: https://github.com/jsoref/rust-analyzer/actions/runs/4699991284#summary-12751356293
closes #14567
2023-04-19 14:05:40 +00:00
Josh Soref
bc7d84c3ce
Spelling
...
* a rule
* access
* after
* amount
* annotations
* assignment
* assist
* associated
* attribute
* borrowed
* built-in type
* clarification
* command
* const
* constructor
* corresponding
* counterparts
* curlies
* dependencies
* deterministic
* diagnostic
* duplicates
* edge
* edited
* efficient
* elsewhere
* execution
* expression
* extensions
* extracted
* fill
* github
* helper
* heuristic
* incomplete
* indent end
* inlay
* invocation
* lifetime
* looking
* maybe
* move
* mutability
* mutable
* necessarily
* necessary
* negative
* nonexistent
* occurred
* offsets
* offsetted
* overridden
* parameters
* params
* params_and_where_preds_in_scope
* paredit
* parent
* parentheses
* prepended if
* punctuation
* receive
* receiver
* referring
* repeated
* representing
* semantically
* separately
* shouldnot
* siblings
* similar
* something's
* statement
* struct
* structure
* surprise
* the
* this
* transparent
* unimplemented
* unnamed
* unnecessary
* unneeded
* unreachable
* unterminated
* utilities
* variant
* variants
* visibility
* work around (v)
* workaround
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-19 09:45:55 -04:00
Laurențiu Nicola
160ab88bb9
Bump bitflags
2023-04-17 18:42:59 +03:00
hkalbasi
7cb4318331
Fix explicit deref problems in closure capture
2023-04-14 15:32:40 +03:30
hkalbasi
85f9235de8
fix inference in nested closure
2023-04-11 17:02:00 +03:30
hkalbasi
59b6f2d9f2
Compute closure captures
2023-04-10 23:04:34 +03:30
Ryo Yoshida
5ab4e64a4c
fix: unify types in infer_expr_coerce_never()
2023-04-07 05:46:30 +09:00
Lukas Wirth
99b69525f4
hir_def::expr -> hir_def::hir, hir_def::type_ref -> hir_def::hir::type_ref
2023-04-06 19:36:25 +02:00
Lukas Wirth
fbb1bd5880
Re-enable controlflow outside loop diagnostic
2023-04-06 15:37:53 +02:00
Lukas Wirth
0e7117900c
internal: Resolve labels in body lowering
2023-04-06 14:21:20 +02:00
bors
a1ca52e2a9
Auto merge of #14486 - HKalbasi:dev, r=Veykril
...
Desugar async fn completely
fix #14479
2023-04-05 13:58:38 +00:00
bors
af30656785
Auto merge of #14436 - lowr:patch/normalize-assoc-type-in-path-expr, r=HKalbasi
...
Normalize associated types in paths in expressions
Part of #14393
When we resolve paths in expressions (either path expressions or paths in struct expressions), there's a need of projection normalization, which `TyLoweringContext` cannot do on its own. We've been properly applying normalization for paths in struct expressions without type anchor, but not for others:
```rust
enum E {
S { v: i32 }
Empty,
}
impl Foo for Bar {
type Assoc = E;
fn foo() {
let _ = Self::Assoc::S { v: 42 }; // path in struct expr without type anchor; we already support this
let _ = <Self>::Assoc::S { v: 42 }; // path in struct expr with type anchor; resolves with this PR
let _ = Self::Assoc::Empty; // path expr; resolves with this PR
}
}
```
With this PR we correctly resolve the whole path, but we need some more tweaks in HIR and/or IDE layers to properly resolve a qualifier (prefix) of such paths and provide IDE features that are pointed out in #14393 to be currently broken.
2023-04-05 10:47:47 +00:00
hkalbasi
c26b12d01c
Desugar async fn completely
2023-04-04 23:07:38 +03:30
hkalbasi
8a6ca86247
Use async block in async fn type inference
2023-04-01 04:35:28 +03:30
Lukas Wirth
fc840dbb2d
internal: Don't expose InferenceTable outside of hir-ty
2023-03-30 13:27:10 +02:00
Lukas Wirth
251b3a47af
Simplify
2023-03-30 09:21:10 +02:00
Lukas Wirth
e797479651
fix: Handle box and raw pointers correctly in builtin_deref
2023-03-29 21:38:32 +02:00
Ryo Yoshida
6447d485e3
Normalize type anchor type before resolving the rest of value paths
2023-03-29 23:37:01 +09:00
Ryo Yoshida
8aef04f1a7
Resolve and normalize path segments one by one in variant resolution
2023-03-29 23:32:37 +09:00
Lukas Wirth
798990bf33
fix: Add missing autoborrow adjustment for index expressions
2023-03-29 16:11:48 +02:00
Lukas Wirth
bea1c71f83
Use struct_tail_without_normalization in Expectation::rvalue_hint
2023-03-29 14:49:06 +02:00
bors
7a98e24777
Auto merge of #14431 - Veykril:simplify, r=Veykril
...
minor: Simplify
2023-03-29 07:28:42 +00:00
Lukas Wirth
8ea1afce28
Simplify
2023-03-28 16:32:26 +02:00
Lukas Wirth
342fd2b9f3
fix: Properly handle local trait impls
2023-03-28 08:34:29 +02:00
hkalbasi
8a3ad7c3d5
Support evaluating inherent associated constants with generics
2023-03-21 02:20:30 +03:30
hkalbasi
3303a6eff5
Implement some intrinsics
2023-03-20 21:48:01 +03:30
hkalbasi
8e73ea5253
Desugar try blocks
2023-03-19 13:02:51 +03:30
hkalbasi
453ae2e00e
Support range MIR lowering
2023-03-18 02:06:36 +03:30
hkalbasi
9ad83deecc
Support overloaded index MIR lowering
2023-03-17 19:10:25 +03:30