Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ rust-analyzer #109069

Merged
merged 169 commits into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
169 commits
Select commit Hold shift + click to select a range
ed1f467
add openDocs to context menu. add further restrictions to context men…
jmviz Feb 17, 2023
4438017
Refactor
lowr Feb 19, 2023
83e24fe
Fix associated item visibility in block-local impls
lowr Feb 19, 2023
2351875
change titles of commands in context menu to title case. shorten open…
jmviz Feb 19, 2023
d416623
Adjust block-local impl item visibility rendering
lowr Feb 19, 2023
7e711da
:arrow_up: rust-analyzer
lnicola Feb 20, 2023
dd92e4a
add to manual
jmviz Feb 20, 2023
7b5cfdd
Add v7 support to rust-analyzer
CraftSpider Feb 13, 2023
549b53b
Merge branch 'master' into sync-from-rust
lnicola Feb 21, 2023
dad6b14
Auto merge of #14181 - lnicola:sync-from-rust, r=lnicola
bors Feb 21, 2023
f40526b
Remove file added by mistake
lnicola Feb 21, 2023
e59ada9
Auto merge of #14182 - lnicola:rm-profdata, r=lnicola
bors Feb 21, 2023
563bd9c
Try to improve the rustfmt.overrideCommand docs
lnicola Feb 21, 2023
27239fb
Auto merge of #14183 - lnicola:rustfmt-command-docs, r=lowr
bors Feb 21, 2023
888c18d
Rename many interner functions.
nnethercote Feb 17, 2023
f5401f6
Auto merge of #14175 - jmviz:openDocs-context-menu, r=lnicola
bors Feb 24, 2023
cf0c8fe
minor: import `Either` from `either`
lowr Feb 25, 2023
9a4efb4
Auto merge of #14202 - lowr:minor/use-either-either, r=lnicola
bors Feb 25, 2023
44e47fe
Add check for extra path segments after an angled one
shilangyu Feb 25, 2023
289208b
Auto merge of #14203 - shilangyu:fix/angled-path-segments, r=lnicola
bors Feb 25, 2023
e4b184a
Respect $CARGO_HOME when looking up toolchains.
tomokinat Feb 24, 2023
aa87764
Fix resolving types when resolving HIR and add a related test
Kohei316 Feb 26, 2023
4e29820
Auto merge of #14207 - tomokinat:master, r=lnicola
bors Feb 26, 2023
9a481d1
add: clean api to get `raw_ptr` type
swarnimarun Feb 27, 2023
2e47915
Auto merge of #14208 - Kohei316:master, r=Veykril
bors Feb 27, 2023
832f8bf
rename: `as_raw_ptr_ty` to `remove_raw_ptr`
swarnimarun Feb 27, 2023
b38fcde
Auto merge of #14213 - swarnimarun:raw-ptr-ty, r=Veykril
bors Feb 27, 2023
9e5fa74
Simplify
Veykril Feb 27, 2023
29a4453
Merge the two autoref vecs into one in autoderef_method_receiver
Veykril Feb 27, 2023
c867cbf
Auto merge of #14216 - Veykril:simplify, r=Veykril
bors Feb 27, 2023
9942cc4
Fix 14142: Annotate lifetime paramaters in doctest runnables
anergictcell Feb 19, 2023
8bc75c4
return Iterator instead of Vec for combined lifetime and argument par…
anergictcell Feb 21, 2023
9957bb3
Add const generics to doctest names for structt
anergictcell Feb 24, 2023
4ee2e46
Rename the method that returns struct paramaters
anergictcell Feb 24, 2023
7abcc7d
Add const to doctest runnable definition
anergictcell Feb 27, 2023
f494d11
Remove empty line
anergictcell Feb 27, 2023
cd67589
beginning of MIR
HKalbasi Feb 3, 2023
a0be16b
Auto merge of #14040 - HKalbasi:mir, r=HKalbasi
bors Feb 28, 2023
af79491
Rename method to generic_parameters
anergictcell Feb 28, 2023
c386316
Auto merge of #14185 - anergictcell:fix_14142, r=HKalbasi
bors Feb 28, 2023
47a567b
Deduplicate source roots that have overlapping include paths
Veykril Feb 28, 2023
1d07c5b
Auto merge of #14218 - Veykril:root-dedup, r=Veykril
bors Feb 28, 2023
b5a1ddf
Don't use unstable `pointer` link
lowr Feb 28, 2023
7f01ae8
Auto merge of #14220 - lowr:fix/ci-pointer-offset-is-unstable, r=lnicola
bors Feb 28, 2023
f64fe66
Add tuple to render_const_scalar
HKalbasi Feb 28, 2023
de4a896
Support removing nested `dbg!()`s in `remove_dbg`
lowr Mar 1, 2023
d1fd635
Auto merge of #14225 - lowr:patch/remove-nested-dbg, r=Veykril
bors Mar 1, 2023
ef9d5db
Auto merge of #14223 - HKalbasi:mir, r=HKalbasi
bors Mar 1, 2023
32424d0
Auto merge of #14176 - lowr:fix/assoc-func-vis-in-local-impl, r=Veykril
bors Mar 1, 2023
88f2abb
Don't drop rustc crates in the rustc workspace
Veykril Mar 2, 2023
9b441b9
Auto merge of #14234 - Veykril:rustc-crate-check, r=Veykril
bors Mar 2, 2023
943de55
Fix typo
lowr Mar 1, 2023
bda2af7
feat: allow `generate_function` to generate in different local crate
lowr Mar 2, 2023
fc2b395
Show pattern mismatch diagnostics
Veykril Feb 28, 2023
ec273c3
Split pattern inference into more functions
Veykril Mar 3, 2023
44e2c6e
Don't emit two type mismatches for literal pattern mismatches
Veykril Mar 3, 2023
522823f
Fix text fixtures of missing_match_arms diagnostics
Veykril Mar 3, 2023
3b857e1
Auto merge of #14238 - lowr:feat/allow-generate-fn-across-local-crate…
bors Mar 3, 2023
80ddfb8
fix: Load the sysroot in all CLI commands
Veykril Mar 3, 2023
c229a83
Auto merge of #14222 - Veykril:pat-mismatch-diags, r=Veykril
bors Mar 3, 2023
a8d3c46
Auto merge of #14239 - Veykril:sysroot-cli, r=Veykril
bors Mar 3, 2023
2e7d2c2
Parse trait alias as a distinct AST type
lowr Mar 3, 2023
356d12e
refactor: leverage `HasAttrs` for code brevity
lowr Mar 3, 2023
e2ec3a6
Refactor generic parameter lowering
lowr Mar 3, 2023
29c957f
Lower and handle trait aliases in HIR
lowr Mar 3, 2023
f8eac19
Support trait aliases in IDE where type support isn't needed
lowr Mar 3, 2023
6756294
Auto merge of #14184 - lowr:feat/trait-alias-def, r=Veykril
bors Mar 3, 2023
02eb2d7
Distinguish between expected and final type in CoerceMany
Veykril Mar 3, 2023
41f234d
Diagnose value breaks in incorrect breakables
Veykril Mar 3, 2023
3ba876a
Auto merge of #14240 - Veykril:coerce-many, r=Veykril
bors Mar 3, 2023
3c7a0aa
Diagnose call expression on non-callable things
Veykril Mar 3, 2023
78b2dd8
Diagnose unresolved field accesses
Veykril Mar 3, 2023
e7485a0
Diagnose unresolved method calls
Veykril Mar 3, 2023
7c092a1
Auto merge of #14243 - Veykril:inference-diags, r=Veykril
bors Mar 3, 2023
c12fac6
Report type metrics for patterns
Veykril Mar 3, 2023
29150c2
Disable pattern type mismatches again
Veykril Mar 3, 2023
73e2505
Auto merge of #14245 - Veykril:pat-diags, r=Veykril
bors Mar 3, 2023
2e465d1
generate correct completion edits for missing macro arguments
pascalkuthe Mar 4, 2023
4b330f5
Auto merge of #14247 - pascalkuthe:master, r=Veykril
bors Mar 4, 2023
800ab65
split expression and pattern metrics
Veykril Mar 4, 2023
5efcfe5
Auto merge of #14244 - Veykril:metrics, r=lnicola
bors Mar 4, 2023
24ba1be
Set expectation for no-semi expression statements to unit
Veykril Mar 4, 2023
1b5bc83
Remove weird nesting of effect blocks in hir
Veykril Mar 4, 2023
b827648
Fix extract_variable test
Veykril Mar 4, 2023
95c4cb9
Handle new hir block kinds in scope calculations
Veykril Mar 4, 2023
b85e2af
Correctly handle non-semi statement expressions for never coercions
Veykril Mar 4, 2023
94dc7a3
Auto merge of #14251 - Veykril:ty-expr-stmt, r=Veykril
bors Mar 4, 2023
5a91f01
internal: Handle fields called as method calls as the fields they res…
Veykril Mar 4, 2023
e6ba791
Auto merge of #14252 - Veykril:field-mcall-fallback, r=Veykril
bors Mar 4, 2023
15b867b
Auto merge of #101550 - CraftSpider:link-dead-windows, r=wesleywiser
bors Mar 5, 2023
ae8ce99
Bring back the hex in const hover
HKalbasi Mar 5, 2023
a8606e5
Re-use the resolver in InferenceContext instead of rebuilding it on e…
Veykril Mar 5, 2023
a51267c
Allocate traits in scope upfront when type checking instead of recoll…
Veykril Mar 5, 2023
27fad2a
Lift segment check out of the loop in resolve_path_in_value_ns
Veykril Mar 5, 2023
d8b1ec6
Remove unnecessary option wrapping
Veykril Mar 5, 2023
7be48ac
Adjust replace_match_with_if_let applicability range
Veykril Mar 5, 2023
0a956ec
Auto merge of #14255 - HKalbasi:const-hex, r=HKalbasi
bors Mar 5, 2023
900efbe
Auto merge of #14260 - Veykril:if-let-match-adjust, r=Veykril
bors Mar 6, 2023
a360fab
Auto merge of #14261 - Veykril:ty-perf, r=Veykril
bors Mar 6, 2023
61ad6a9
Add BindingId
HKalbasi Feb 18, 2023
c0a0664
Support "or patterns" MIR lowering
HKalbasi Feb 18, 2023
a25710b
Add `need-mut` and `unused-mut` diagnostics
HKalbasi Feb 21, 2023
ac04bfd
Add `View Mir` command and fix some bugs
HKalbasi Feb 26, 2023
6377d50
Support "for loop" MIR lowering
HKalbasi Mar 2, 2023
bf0f99f
Fix overloaded deref unused mut false positive
HKalbasi Mar 2, 2023
af90ec8
Partially support "overloaded deref" MIR lowering
HKalbasi Mar 4, 2023
2cce9dc
Make `unused_mut` diagnostic experimental
HKalbasi Mar 6, 2023
199bc82
feature: Make replace_or_with_or_else assists more generally applicable
Veykril Mar 6, 2023
34a3187
internal: Mark unresolved field, unresolved method and expected funct…
Veykril Mar 6, 2023
1bfe96e
Auto merge of #14267 - Veykril:experimental-diagnostics, r=Veykril
bors Mar 6, 2023
0ce0608
Fix inlay-hint tests
Veykril Mar 6, 2023
31c12ec
Auto merge of #14266 - Veykril:generalize-eager-lazy, r=Veykril
bors Mar 6, 2023
995aacf
show diagnostic for } token followed by else in let else statement
xffxff Mar 4, 2023
98990af
add more tests
xffxff Mar 4, 2023
bcd7ecb
Add profiling to mir lower and borrowck query
HKalbasi Mar 7, 2023
6e97527
add is_blocklike func on BlockLike
xffxff Mar 7, 2023
44ff3c4
Auto merge of #14232 - HKalbasi:mir, r=Veykril
bors Mar 7, 2023
d45708f
Don't trigger unresolved method/field diagnostics on types containing…
Veykril Mar 7, 2023
ecc32c2
Auto merge of #14271 - Veykril:ty-diag-err, r=Veykril
bors Mar 7, 2023
c978648
Load proc-macros for rustc_private crates
Veykril Mar 8, 2023
a9d97b6
Auto merge of #14248 - XFFXFF:let_else_right_curly_brace, r=Veykril
bors Mar 8, 2023
aff6cb0
Auto merge of #14282 - Veykril:rustc_private-proc-macro, r=Veykril
bors Mar 8, 2023
b4bd27b
Don't send error notifications for workspace failures if server statu…
Veykril Mar 8, 2023
6ebbd48
Auto merge of #14283 - Veykril:error-notifs, r=Veykril
bors Mar 8, 2023
b6e7cf3
Highlight unresolved derives as being unresolved
Veykril Mar 8, 2023
c951093
Auto merge of #14284 - Veykril:sem-derive-unresolved, r=Veykril
bors Mar 8, 2023
cf47c15
Evaluate consts in `path_to_const`
HKalbasi Mar 8, 2023
db64f3a
Auto merge of #14285 - HKalbasi:mir, r=Veykril
bors Mar 8, 2023
d038892
fix: Fix block defmap not looking into tail expressions for macro calls
Veykril Mar 8, 2023
3d904e0
Auto merge of #14286 - Veykril:block-def-tail-mac, r=Veykril
bors Mar 8, 2023
4ee2aba
minor: Fixup dylib extensions for rustc_private proc-macro loading
Veykril Mar 8, 2023
38e9a11
Auto merge of #14287 - Veykril:rustc_private-proc-macro, r=Veykril
bors Mar 8, 2023
811190b
fix multiple definition binding in match to let-else
HKalbasi Mar 8, 2023
8e404f4
Auto merge of #14291 - HKalbasi:master, r=HKalbasi
bors Mar 9, 2023
d8c80e7
Add core lib to proc_macro dependencies
Veykril Mar 9, 2023
a738737
Auto merge of #14297 - Veykril:proc-macro-deps, r=Veykril
bors Mar 9, 2023
e158dc7
Remove unnecessary special local handling in search
Veykril Mar 9, 2023
3427d36
fix: Fix search not searching bodies of attributed items
Veykril Mar 9, 2023
de3b12d
Auto merge of #14299 - Veykril:local-search, r=Veykril
bors Mar 9, 2023
879cac4
minor: Remove dead code
Veykril Mar 9, 2023
209cf7d
Watch both stdout and stderr in flycheck
lnicola Mar 3, 2023
10a652a
Auto merge of #14300 - lnicola:rustc-flycheck, r=lnicola
bors Mar 9, 2023
c49f753
Add missing queries to per_query_memory_usage
Veykril Mar 9, 2023
8ce5a53
Auto merge of #14302 - Veykril:db-memory-usage, r=Veykril
bors Mar 9, 2023
8593132
fix block with no termination in or patterns
HKalbasi Mar 9, 2023
14b9d18
Auto merge of #14306 - HKalbasi:master, r=HKalbasi
bors Mar 9, 2023
116775b
Don't attempt to calculate diagnostics in library crates
Veykril Mar 10, 2023
552aea5
Auto merge of #14311 - Veykril:lib-diags, r=Veykril
bors Mar 10, 2023
71e1c02
Revert #14285
HKalbasi Mar 10, 2023
1b5bba4
Auto merge of #14312 - HKalbasi:master, r=lnicola
bors Mar 10, 2023
0d19ccb
Make project loading errors less intrusive
Veykril Mar 10, 2023
2cb6034
Add fancy buttons to the vscode status message
Veykril Mar 10, 2023
c03775e
Fix is_quiescent reporting
Veykril Mar 10, 2023
070f8f8
Auto merge of #14313 - Veykril:notifs, r=Veykril
bors Mar 10, 2023
a980b56
Fix stack overflow when derefrencing `&!`
HKalbasi Mar 10, 2023
9fca0a4
Auto merge of #14316 - HKalbasi:master, r=HKalbasi
bors Mar 10, 2023
c38aa5f
Use anonymous lifetimes
iDawer Mar 10, 2023
8f189f6
Remove unnecessary argument
iDawer Mar 10, 2023
5e8c586
Refactor hir::diagnostics::MissingMatchArms fields, better naming
iDawer Mar 10, 2023
17b9d35
Refactor: Distinguish scrutinee expression from match expression
iDawer Mar 10, 2023
2691143
Fix overlap deduping infinite loop
ComputerDruid Mar 11, 2023
6d42e75
Auto merge of #14323 - ComputerDruid:fix_overlap_indexes, r=Veykril
bors Mar 11, 2023
70e10de
Auto merge of #14326 - iDawer:refactor, r=Veykril
bors Mar 11, 2023
cfc9d5c
Pass flycheck extra args when running build scripts
lnicola Mar 11, 2023
c3864eb
Add and use rust-analyzer.cargo.extraArgs setting
lnicola Mar 12, 2023
f1e51af
Auto merge of #14328 - lnicola:build-scripts-extra-args, r=Veykril
bors Mar 12, 2023
bdbd2a5
Merge branch 'master' into sync-from-rust
lnicola Mar 13, 2023
9549753
Auto merge of #14333 - lnicola:sync-from-rust, r=lnicola
bors Mar 13, 2023
e862901
:arrow_up: rust-analyzer
lnicola Mar 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Don't trigger unresolved method/field diagnostics on types containing…
… errors
  • Loading branch information
Veykril committed Mar 7, 2023
commit d45708fabe1f43b0c229b6b5222b7a2d5420d07e
7 changes: 6 additions & 1 deletion crates/hir-ty/src/chalk_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{
db::HirDatabase, from_assoc_type_id, from_chalk_trait_id, from_foreign_def_id,
from_placeholder_idx, to_chalk_trait_id, utils::generics, AdtId, AliasEq, AliasTy, Binders,
CallableDefId, CallableSig, FnPointer, ImplTraitId, Interner, Lifetime, ProjectionTy,
QuantifiedWhereClause, Substitution, TraitRef, Ty, TyBuilder, TyKind, WhereClause,
QuantifiedWhereClause, Substitution, TraitRef, Ty, TyBuilder, TyKind, TypeFlags, WhereClause,
};

pub trait TyExt {
Expand All @@ -22,6 +22,7 @@ pub trait TyExt {
fn is_floating_point(&self) -> bool;
fn is_never(&self) -> bool;
fn is_unknown(&self) -> bool;
fn contains_unknown(&self) -> bool;
fn is_ty_var(&self) -> bool;

fn as_adt(&self) -> Option<(hir_def::AdtId, &Substitution)>;
Expand Down Expand Up @@ -76,6 +77,10 @@ impl TyExt for Ty {
matches!(self.kind(Interner), TyKind::Error)
}

fn contains_unknown(&self) -> bool {
self.data(Interner).flags.contains(TypeFlags::HAS_ERROR)
}

fn is_ty_var(&self) -> bool {
matches!(self.kind(Interner), TyKind::InferenceVar(_, _))
}
Expand Down
4 changes: 2 additions & 2 deletions crates/hir-ty/src/infer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ impl<'a> InferenceContext<'a> {
{
*ty = table.resolve_completely(ty.clone());
// FIXME: Remove this when we are on par with rustc in terms of inference
if ty.is_unknown() {
if ty.contains_unknown() {
return false;
}

Expand All @@ -557,7 +557,7 @@ impl<'a> InferenceContext<'a> {
{
let clear = if let Some(ty) = field_with_same_name {
*ty = table.resolve_completely(ty.clone());
ty.is_unknown()
ty.contains_unknown()
} else {
false
};
Expand Down
13 changes: 13 additions & 0 deletions crates/ide-diagnostics/src/handlers/unresolved_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,19 @@ fn foo() {
Foo.bar;
// ^^^^^^^ 💡 error: no field `bar` on type `Foo`, but a method with a similar name exists
}
"#,
);
}

#[test]
fn no_diagnostic_on_unknown() {
check_diagnostics(
r#"
fn foo() {
x.foo;
(&x).foo;
(&((x,),),).foo;
}
"#,
);
}
Expand Down