From af04d45d32b5d9bdf949beb17152ef78dd4a0523 Mon Sep 17 00:00:00 2001 From: Chris Hopman Date: Fri, 10 Apr 2020 13:41:11 -0700 Subject: Change missing impl assist to use todo!() instead of unimplemented() todo!() "Indicates unfinished code" (https://doc.rust-lang.org/std/macro.todo.html) Rust documentation provides further clarification: > The difference between unimplemented! and todo! is that while todo! > conveys an intent of implementing the functionality later and the > message is "not yet implemented", unimplemented! makes no such claims. todo!() seems more appropriate for assists that insert missing impls. --- xtask/tests/tidy-tests/main.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'xtask/tests/tidy-tests') diff --git a/xtask/tests/tidy-tests/main.rs b/xtask/tests/tidy-tests/main.rs index 80911a68e..4f525fcd0 100644 --- a/xtask/tests/tidy-tests/main.rs +++ b/xtask/tests/tidy-tests/main.rs @@ -20,7 +20,16 @@ fn rust_files_are_tidy() { } fn check_todo(path: &Path, text: &str) { - if path.ends_with("tests/cli.rs") { + let whitelist = &[ + // This file itself is whitelisted since this test itself contains matches. + "tests/cli.rs", + // Some of our assists generate `todo!()` so those files are whitelisted. + "doc_tests/generated.rs", + "handlers/add_missing_impl_members.rs", + // To support generating `todo!()` in assists, we have `expr_todo()` in ast::make. + "ast/make.rs", + ]; + if whitelist.iter().any(|p| path.ends_with(p)) { return; } if text.contains("TODO") || text.contains("TOOD") || text.contains("todo!") { -- cgit v1.2.3