| Age | Commit message (Collapse) | Author | Lines |
|
|
|
fix: Port a bunch of stuff from rustc and fix a bunch of type mismatches/diagnostics
|
|
Fix applicable on variant field for change_visibility
|
|
Enum variant fields do not allow visibility
Example
---
```rust
enum Foo {
Variant($0String),
}
```
**Before this PR**:
```rust
enum Foo {
Variant(pub(crate) String),
}
```
**After this PR**:
Assist not applicable
|
|
Add `rust-analyzer.semanticHighlighting.comments.enable`
|
|
|
|
Example
---
```rust
struct Foo { num: u32 }
struct Bar(Foo);
fn foo(Bar($0)) {}
```
**Before this PR**:
```rust
struct Foo { num: u32 }
struct Bar(Foo);
fn foo(Bar(Foo { num$1 }: Foo$0)) {}
```
**After this PR**:
```rust
struct Foo { num: u32 }
struct Bar(Foo);
fn foo(Bar(Foo { num$1 }$0)) {}
```
|
|
fix(hover): unify horizontal rule formatting to `---`
|
|
|
|
fix: Fix expand macro recursively not working correctly for nested macro calls
|
|
Add more workaround hacks for incorrect startup diagnostics
|
|
fix: Only compute unstable paths on nightly toolchains for IDE features
|
|
|
|
|
|
|
|
|
|
|
|
This started from porting coercion, but ended with porting much more.
|
|
internal: Add Regression Test For The One And The Only Issue #5514
|
|
|
|
internal: Improve `rust-analyzer diagnostics`
|
|
fix: Don't mark unknown type as implementing every notable trait
|
|
That were fixed by the migration.
|
|
Because the new solver, will return "yes" for them (which is a good thing).
|
|
In my experience the `processing <module>` messages make it harder to search for the actual diagnostics, so remove them and instead print the filename only if there is a diagnostic.
Also allow choosing the minimum severity.
|
|
fix: Infinite loop while elaborting predicates
|
|
|
|
fix: Don't trigger two flychecks when saving files that are part of targets
|
|
Example
---
```rust
fn main() {
let x = if true {
()
} $0 else {};
}
```
**Before this PR**:
```rust
fn main() {
let x = if true {
()
} else if $1 {
$0
}; else {};
}
```
**After this PR**:
```rust
fn main() {
let x = if true {
()
} else if $1 {
$0
} else {};
}
```
|
|
|
|
fix: Make `#[target_feature]` always safe on WASM
|
|
Fix empty generic param list for generate_function
|
|
Example
---
```rust
struct Foo<S>(S);
impl<S> Foo<S> {
fn foo(&self) {
self.bar()$0;
}
}
```
**Before this PR**:
```rust
struct Foo<S>(S);
impl<S> Foo<S> {
fn foo(&self) {
self.bar();
}
fn bar<>(&self) ${0:-> _} {
todo!()
}
}
```
**After this PR**:
```rust
struct Foo<S>(S);
impl<S> Foo<S> {
fn foo(&self) {
self.bar();
}
fn bar(&self) ${0:-> _} {
todo!()
}
}
```
|
|
fix: Always coerce in a cast, even when there are unknown types
|
|
This cause the relationships between inference vars to get recorded.
|
|
internal: Upgrade rustc crates
|
|
fix: Fix normalization in the new solver
|
|
Previously normalization was broken, which caused a lot of fake errors.
This fix most type mismatches of the new solver, and it also reverts many test regressions.
The downside is that now `chalk_ir::TyKind::AssociatedType`/`chalk_ir::TyKind::Alias` cannot be trusted anymore with their roles, namely: `AssociatedType` is always fully normalized and `Alias` only if it can possibly be normalized further. That seems okay as the new solver does not have this distinction at all (due to it being a lazy normalizer), so this will only hold for the migration time. This does mean we have to change some APIs, notably `hir::Type::walk()` and `TyFingerprint`, to treat `Alias` the same as `AssociatedType`.
Another small thing this commit does is to isolate processing of user-written types (currently involving replacing error types and normalizing, but in the future validation will also be needed) to separate functions.
|
|
More correctly, a `TyKind::AssociatedType` is not the same as `TyKind::Projection`.
We used to map next-solver `TyKind::Alias` to Chalk's `TyKind::AssociatedType`. This is very incorrect, as `AssociatedType` is assumed to be fully normalized, and caused a lot of type mismatches.
Unfortunately fixing this causes a lot of stack overflows, because the next solver doesn't have something akin to `AssociatedType` so we normalize again and again. The reason is that is the lazy-normalization nature of the next solver, which means we need to stop normalizing everything. This will be fixed in the next commit.
|
|
A lot of simplification and fun.
|
|
They have to do with diagnostics, we could probably not support them but we will also someday want good diagnostics.
The code is mostly copied from rustc.
|
|
Fix indent for unresolved_field fixes
|
|
fix: Resolve paths to snapshot test libraries absolutely
|
|
|
|
|
|
Even when the feature isn't enabled, as it's not UB to invoke an undefined feature in WASM (just a trap).
|
|
And make it easier to expand it more in the future, if needed.
|
|
That is, resolve them globally, not from the test's location.
This *should* result in more robust resolution; for example, previously the code failed to detect the presence of snapshot testing if the snapshot library was renamed in the dependency or was an indirect dependency.
|
|
Fix LifetimeParam::lifetime_bounds invalid implement
|
|
Lifetime node example:
```
LIFETIME_PARAM@15..21
LIFETIME@15..17
LIFETIME_IDENT@15..17 "'a"
COLON@17..18 ":"
WHITESPACE@18..19 " "
TYPE_BOUND_LIST@19..21
TYPE_BOUND@19..21
LIFETIME@19..21
LIFETIME_IDENT@19..21 "'b"
```
|