Skip to content

Conversation

@cjhopman
Copy link
Contributor

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.

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.

fn check_todo(path: &Path, text: &str) {
if path.ends_with("tests/cli.rs") {
let whitelist = &[
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not particularly happy about this approach, but this isn't a particularly sophisticated check that would allow more fine grained configuration.

Might be reasonable to extend this to detect some marker in the file that allows more fine-grained ignoring, but idk.

Any suggestions?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think such whitelisting is the optimal solution, given the scale of the problem actually!

@cjhopman
Copy link
Contributor Author

I mentioned this preference (todo over unimplemented) in #3904 and figured it'd be rather trivial to change.

@matklad
Copy link
Contributor

matklad commented Apr 11, 2020

bors r+

Thanks!

@matklad matklad merged commit 997c959 into rust-lang:master Apr 11, 2020
bors bot added a commit that referenced this pull request Apr 15, 2020
3969: Change add_function assist to use todo!() instead of unimplemented!() r=matklad a=TimoFreiberg

In the spirit of #3935

Co-authored-by: Timo Freiberg <timo.freiberg@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants