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

Subtree update of rust-analyzer #120447

Merged
merged 38 commits into from
Feb 2, 2024
Merged
Changes from 2 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
6001c50
Detect `NulInCStr` error earlier.
nnethercote Dec 6, 2023
6231ca5
fix(rust-analyzer): use new pkgid spec to compare
weihanglo Jan 18, 2024
7d4980a
Rollup merge of #119172 - nnethercote:earlier-NulInCStr, r=petrochenkov
matthiaskrgr Jan 18, 2024
1a9ef23
Remove unused codes
mu001999 Jan 21, 2024
0661390
Rollup merge of #120084 - weihanglo:pkgid-spec, r=Mark-Simulacrum
Nadrieril Jan 21, 2024
e4866b6
Merge commit 'a9116523604c998e7781f60d3b5a6f586e0414a9' into sync-fro…
lnicola Jan 21, 2024
47b0f46
Auto merge of #16409 - mu001999:master, r=HKalbasi
bors Jan 21, 2024
8af2b4d
Merge remote-tracking branch 'upstream/master' into sync-from-rust
lnicola Jan 21, 2024
ef6e6df
Merge remote-tracking branch 'upstream/master' into sync-from-rust
lnicola Jan 21, 2024
0ea0565
Revert "Detect `NulInCStr` error earlier."
lnicola Jan 21, 2024
5607714
Format code
lnicola Jan 21, 2024
d410d4a
Auto merge of #16412 - lnicola:sync-from-rust, r=lnicola
bors Jan 21, 2024
231f730
internal: Make TryToNav trait public
Waqar144 Jan 22, 2024
2370b70
Replace local copy of exhaustiveness checking with upstream librarifi…
Nadrieril Jan 16, 2024
0d52934
Auto merge of #16420 - Nadrieril:use-upstream-pattern-analysis, r=Vey…
bors Jan 24, 2024
b1b6e0c
Reapply "Detect `NulInCStr` error earlier."
lnicola Jan 25, 2024
b1b99cb
Bump rustc_lexer and rustc_parse_format
lnicola Jan 25, 2024
ea94c10
Bump rustc_index and rustc_abi
lnicola Jan 25, 2024
38f7a34
Auto merge of #16426 - lnicola:bump-rustc, r=lnicola
bors Jan 25, 2024
4505f03
fix: filter out cfg disabled filed when lowering `RecordPat`
Young-Flash Jan 25, 2024
1374bc8
test: ensure `no_such_field` diagnostic don't work for field with dis…
Young-Flash Jan 25, 2024
8f05e7c
Replaced adjusted_display_range with it's new version in mismatched_a…
Ar4ys Jan 25, 2024
f090205
Auto merge of #16415 - Waqar144:work/make-try-to-nav-pub, r=Veykril
bors Jan 26, 2024
e320004
Remove tt -> ast -> tt round trips in attrs lowering
Veykril Jan 24, 2024
880baa9
Shuffle hir-expand things around
Veykril Jan 25, 2024
d8ef6c2
Cleanup `convert_path`
Veykril Jan 25, 2024
5a34341
Add some size assertions
Veykril Jan 26, 2024
596e5c7
Auto merge of #16431 - Ar4ys:fix-E0107-error-range-in-proc-macro, r=V…
bors Jan 26, 2024
6cf7b5f
Don't parse intra doc links as syntax trees
Veykril Jan 26, 2024
ad5e2cf
Do not return code lens data after resolving
SomeoneToIgnore Jan 27, 2024
4a23744
Auto merge of #16435 - SomeoneToIgnore:less_resolve_data, r=lnicola
bors Jan 27, 2024
8a5829c
Re-order mod declarations
Veykril Jan 26, 2024
27c3ed9
Auto merge of #16434 - Veykril:things, r=Veykril
bors Jan 27, 2024
7219414
Auto merge of #16427 - Young-Flash:fix_no_such_field_diagnostics, r=V…
bors Jan 27, 2024
e71b4c7
Merge commit '7219414e81810fd4d967136c4a0650523892c157' into sync-fro…
lnicola Jan 28, 2024
e7e81cf
Silence triagebot on subtree syncs
lnicola Jan 28, 2024
309d615
Add rustc_apfloat license exception for RA
lnicola Jan 28, 2024
7159d88
Revert "Silence triagebot on subtree syncs"
lnicola Jan 28, 2024
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
14 changes: 7 additions & 7 deletions crates/ide-diagnostics/src/handlers/mismatched_arg_count.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ use hir::InFile;
use ide_db::base_db::FileRange;
use syntax::{
ast::{self, HasArgList},
AstNode, SyntaxNodePtr,
AstNode, AstPtr,
};

use crate::{adjusted_display_range, Diagnostic, DiagnosticCode, DiagnosticsContext};
use crate::{adjusted_display_range_new, Diagnostic, DiagnosticCode, DiagnosticsContext};

// Diagnostic: mismatched-tuple-struct-pat-arg-count
//
Expand All @@ -24,7 +24,7 @@ pub(crate) fn mismatched_tuple_struct_pat_arg_count(
Diagnostic::new(
DiagnosticCode::RustcHardError("E0023"),
message,
invalid_args_range(ctx, d.expr_or_pat.map(Into::into), d.expected, d.found),
invalid_args_range(ctx, d.expr_or_pat, d.expected, d.found),
)
}

Expand All @@ -40,17 +40,17 @@ pub(crate) fn mismatched_arg_count(
Diagnostic::new(
DiagnosticCode::RustcHardError("E0107"),
message,
invalid_args_range(ctx, d.call_expr.map(Into::into), d.expected, d.found),
invalid_args_range(ctx, d.call_expr.map(AstPtr::wrap_left), d.expected, d.found),
)
}

fn invalid_args_range(
ctx: &DiagnosticsContext<'_>,
source: InFile<SyntaxNodePtr>,
source: InFile<AstPtr<Either<ast::Expr, ast::Pat>>>,
expected: usize,
found: usize,
) -> FileRange {
adjusted_display_range::<Either<ast::Expr, ast::TupleStructPat>>(ctx, source, &|expr| {
adjusted_display_range_new(ctx, source, &|expr| {
let (text_range, r_paren_token, expected_arg) = match expr {
Either::Left(ast::Expr::CallExpr(call)) => {
let arg_list = call.arg_list()?;
Expand All @@ -68,7 +68,7 @@ fn invalid_args_range(
arg_list.args().nth(expected).map(|it| it.syntax().text_range()),
)
}
Either::Right(pat) => {
Either::Right(ast::Pat::TupleStructPat(pat)) => {
let r_paren = pat.r_paren_token()?;
let l_paren = pat.l_paren_token()?;
(
Expand Down