Skip to content

Rollup of 6 pull requests #100626

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

Merged
merged 78 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
61d1c3e
add debug impl for AnyDiagnostic
HKalbasi Jul 28, 2022
c1a175f
Generate rust type from json
HKalbasi Jul 28, 2022
5cb3e7a
Added fixup for match statements w/ missing parts
fprasx Aug 3, 2022
d513b4c
Added fixup for for loops w/ missing parts
fprasx Aug 3, 2022
ef2eabb
Tidy formatted
fprasx Aug 3, 2022
d6d8a1c
Shortened fixup for match, added cases for for
fprasx Aug 4, 2022
ab44a81
Fixed up for loops, added fixme with problem
fprasx Aug 4, 2022
859d467
fix: make `concat!` work with char
lowr Aug 4, 2022
4d5873e
minor: align with rustc on escaping characters in macro expansion
lowr Aug 5, 2022
fd00bd4
Document CLI flag stability
Aug 5, 2022
851f6db
Import serde derives on converting json to struct
HKalbasi Aug 6, 2022
a81c7a2
Parse range patterns in struct and slice without trailing comma
lowr Aug 5, 2022
4b648d8
[code] make toggleInlayHints understand {off,on}UntilPressed
jhgg Aug 8, 2022
b569bbb
Auto merge of #12942 - lowr:fix/concat-with-char, r=Veykril
bors Aug 8, 2022
b481b59
Auto merge of #12937 - fprasx:master, r=Veykril
bors Aug 8, 2022
3805067
Auto merge of #12905 - HKalbasi:master, r=Veykril
bors Aug 8, 2022
20d6441
Auto merge of #12951 - jonas-schievink:doc-cli-stability, r=Veykril
bors Aug 8, 2022
49700e4
Auto merge of #12967 - jhgg:code/fix-toggle-hints, r=Veykril
bors Aug 8, 2022
b14062a
Parse range patterns in let statement with type annotation
lowr Aug 8, 2022
79c22d5
Auto merge of #12962 - lowr:patch/parse-last-range-pattern, r=Veykril
bors Aug 8, 2022
e39918f
Corrected order of printing op and `=`
fprasx Aug 8, 2022
554f7f8
Auto merge of #12974 - fprasx:master, r=lnicola
bors Aug 8, 2022
232176b
remove imports that are also in edition 2021's prelude
kadiwa4 Aug 8, 2022
e1e93c4
Auto merge of #12981 - kadiwa4:remove_some_imports, r=Veykril
bors Aug 9, 2022
950de7c
Use `--keep-going` cargo flag when building build scripts
Veykril Aug 9, 2022
8c9359b
Fix pattern field completions not working for unions
Veykril Aug 9, 2022
b3ac58d
Add some more `cov_mark`s
Veykril Aug 9, 2022
49d24f6
Recover from missing ellipsis in record literals for path expressions
Veykril Aug 9, 2022
d186986
Auto merge of #12986 - Veykril:completions, r=Veykril
bors Aug 9, 2022
5366009
Auto merge of #12987 - Veykril:ellipsis-recov, r=Veykril
bors Aug 9, 2022
f4f70c0
Remove incomplete 1.64 ABI
lnicola Aug 10, 2022
25d4fbe
Re-try build script building with --keep-going
Veykril Aug 10, 2022
23e17cd
Improve insert whitespace in mbe
edwin0cheng Aug 10, 2022
c47914c
Fixes tests
edwin0cheng Aug 10, 2022
d79d9e1
Auto merge of #12990 - edwin0cheng:improve-ws, r=Veykril
bors Aug 10, 2022
ffc6b42
fix: infer byte string pattern as `&[u8]` when matched against slices
lowr Aug 10, 2022
e70681f
Auto merge of #12992 - lowr:fix/type-inference-for-byte-string-pat, r…
bors Aug 10, 2022
b1e9bcd
Auto merge of #12984 - Veykril:keep-going, r=Veykril
bors Aug 10, 2022
3eb340f
Auto merge of #12989 - lnicola:rm-1-64-abi, r=Veykril
bors Aug 10, 2022
53ec791
Add `UnescapedName` and make `Name` hold escaped name
lowr Aug 1, 2022
4322cf7
Remove `EscapedName`
lowr Aug 1, 2022
8fe73a2
Make tests pass
lowr Aug 1, 2022
018266a
Make `ModPath` display escaped path
lowr Aug 10, 2022
ba6db3e
Add test for runnables with raw identifiers
lowr Jul 30, 2022
1bb5820
Fix panic in no_such_field when using tuple fields on record structs
Veykril Aug 11, 2022
696bee3
Auto merge of #12997 - Veykril:no-such-field, r=Veykril
bors Aug 11, 2022
cee1e15
Auto merge of #12993 - lowr:patch/swap-name-and-escaped-name, r=Veykril
bors Aug 12, 2022
1ce9783
Use Node 16 in CI workflows
lnicola Aug 12, 2022
19da032
Upgrade npm lockfile
lnicola Aug 12, 2022
f982c76
Auto merge of #13007 - lnicola:node-16, r=lnicola
bors Aug 12, 2022
fd58459
Take into account renamed extension id when launching
shoffmeister Aug 11, 2022
72ae308
Do not unconditionally succeed RUSTC_WRAPPER checks when run by build…
Veykril Aug 13, 2022
5941dec
Auto merge of #13010 - Veykril:build-script-probes, r=Veykril
bors Aug 13, 2022
038c36a
Simplify `GlobalState::handle_event`
Veykril Aug 13, 2022
306687b
Auto merge of #13014 - Veykril:simplify, r=Veykril
bors Aug 13, 2022
ec8256d
Move VSCode diagnostics workaroudn into client code
Veykril Aug 13, 2022
bbe5637
Auto merge of #13016 - Veykril:vscode-diag-workaround, r=Veykril
bors Aug 13, 2022
614969b
Pad empty diagnostic messages in relatedInformation as well
Veykril Aug 13, 2022
010f68c
Auto merge of #13017 - Veykril:vscode-diag-workaround, r=Veykril
bors Aug 13, 2022
ebc140e
Auto merge of #13000 - shoffmeister:patch-1, r=lnicola
bors Aug 14, 2022
c61237b
Remove redundant --pre-release flag from publish
lnicola Aug 14, 2022
b6d59f2
Auto merge of #13020 - lnicola:no-pre-release-flag, r=lnicola
bors Aug 14, 2022
8b64988
Fix error message with non-tupled bare fn trait
compiler-errors Jul 30, 2022
1c084f1
Correct meaning of two UI tests
compiler-errors Jul 30, 2022
3e04fed
Remove `{ast,hir}::WhereEqPredicate::id`.
nnethercote Jul 29, 2022
9619a2e
Avoid unnecessary cloning in `Parser::get_ident_from_generic_arg`.
nnethercote Aug 16, 2022
84629a5
Extend invalid floating point literal suffix suggestion
chenyukang Aug 16, 2022
3308627
Add some more AST node size assertions.
nnethercote Aug 16, 2022
96c91af
compiletest: fix typo in runtest.rs
eltociear Aug 16, 2022
a06da98
:arrow_up: rust-analyzer
lnicola Aug 16, 2022
5bb04f3
Support 128-bit atomics on all aarch64 targets
taiki-e Aug 16, 2022
89a51a1
use proper words in help message for floating point
chenyukang Aug 16, 2022
070de4b
Rollup merge of #99942 - compiler-errors:nonsense-un-tupled-fn-trait-…
Dylan-DPC Aug 16, 2022
cf5c764
Rollup merge of #100609 - chenyukang:fix-100527, r=davidtwco
Dylan-DPC Aug 16, 2022
2e78db3
Rollup merge of #100610 - nnethercote:ast-and-parser-tweaks, r=spasto…
Dylan-DPC Aug 16, 2022
04dd369
Rollup merge of #100613 - eltociear:patch-15, r=Mark-Simulacrum
Dylan-DPC Aug 16, 2022
1d23d3a
Rollup merge of #100616 - lnicola:rust-analyzer-2022-08-16, r=lnicola
Dylan-DPC Aug 16, 2022
35bd1d6
Rollup merge of #100622 - taiki-e:aarch64-atomic-128, r=Amanieu
Dylan-DPC Aug 16, 2022
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
Fix panic in no_such_field when using tuple fields on record structs
  • Loading branch information
Veykril committed Aug 11, 2022
commit 1bb58205f0b09ccdb1a8915cfdede35bd2c09da4
1 change: 1 addition & 0 deletions crates/hir/src/source_analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ impl SourceAnalyzer {
let local = if field.name_ref().is_some() {
None
} else {
// Shorthand syntax, resolve to the local
let path = ModPath::from_segments(PathKind::Plain, once(local_name.clone()));
match self.resolver.resolve_path_in_value_ns_fully(db.upcast(), &path) {
Some(ValueNs::LocalBinding(pat_id)) => {
Expand Down
18 changes: 16 additions & 2 deletions crates/ide-diagnostics/src/handlers/no_such_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ fn missing_record_expr_field_fixes(
}
let new_field = make::record_field(
None,
make::name(&record_expr_field.field_name()?.text()),
make::name(&record_expr_field.field_name()?.ident_token()?.text()),
make::ty(&new_field_type.display_source_code(sema.db, module.into()).ok()?),
);

Expand Down Expand Up @@ -109,7 +109,7 @@ fn missing_record_expr_field_fixes(

#[cfg(test)]
mod tests {
use crate::tests::{check_diagnostics, check_fix};
use crate::tests::{check_diagnostics, check_fix, check_no_fix};

#[test]
fn no_such_field_diagnostics() {
Expand Down Expand Up @@ -277,6 +277,20 @@ struct Foo {
bar: i32,
pub(crate) baz: bool
}
"#,
)
}

#[test]
fn test_tuple_field_on_record_struct() {
check_no_fix(
r#"
struct Struct {}
fn main() {
Struct {
0$0: 0
}
}
"#,
)
}
Expand Down