Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 10 additions & 10 deletions crates/ide_diagnostics/src/handlers/missing_fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ fn fixes(ctx: &DiagnosticsContext<'_>, d: &hir::MissingFields) -> Option<Vec<Ass
if ty.could_unify_with(ctx.sema.db, &candidate_ty) {
None
} else {
Some(make::expr_unit())
Some(make::ext::expr_todo())
}
} else {
Some(make::expr_unit())
Some(make::ext::expr_todo())
};
let field =
make::record_expr_field(make::name_ref(&f.name(ctx.sema.db).to_string()), field_expr)
Expand Down Expand Up @@ -167,7 +167,7 @@ fn main() {
pub struct Foo { pub a: i32, pub b: i32 }
"#,
r#"
fn some(, b: () ) {}
fn some(, b: todo!() ) {}
fn items() {}
fn here() {}

Expand Down Expand Up @@ -196,7 +196,7 @@ fn test_fn() {
struct TestStruct { one: i32, two: i64 }

fn test_fn() {
let s = TestStruct { one: (), two: () };
let s = TestStruct { one: todo!(), two: todo!() };
}
"#,
);
Expand All @@ -216,7 +216,7 @@ impl TestStruct {
struct TestStruct { one: i32 }

impl TestStruct {
fn test_fn() { let s = Self { one: () }; }
fn test_fn() { let s = Self { one: todo!() }; }
}
"#,
);
Expand Down Expand Up @@ -264,7 +264,7 @@ fn test_fn() {
struct TestStruct { one: i32, two: i64 }

fn test_fn() {
let s = TestStruct{ two: 2, one: () };
let s = TestStruct{ two: 2, one: todo!() };
}
",
);
Expand All @@ -284,7 +284,7 @@ fn test_fn() {
struct TestStruct { r#type: u8 }

fn test_fn() {
TestStruct { r#type: () };
TestStruct { r#type: todo!() };
}
",
);
Expand Down Expand Up @@ -335,8 +335,8 @@ struct S { a: (), b: () }

fn f() {
S {
a: (),
b: (),
a: todo!(),
b: todo!(),
};
}
"#,
Expand Down Expand Up @@ -395,7 +395,7 @@ fn f() {
let b = 1usize;
S {
a,
b: (),
b: todo!(),
};
}
"#,
Expand Down
2 changes: 2 additions & 0 deletions crates/rust-analyzer/tests/slow-tests/tidy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ fn check_todo(path: &Path, text: &str) {
"ide_db/src/helpers/generated_lints.rs",
"ide_assists/src/utils/gen_trait_fn_body.rs",
"ide_assists/src/tests/generated.rs",
// The tests for missing fields
"ide_diagnostics/src/handlers/missing_fields.rs",
];
if need_todo.iter().any(|p| path.ends_with(p)) {
return;
Expand Down