Eliminate stub warnings#497
Merged
coriolinus merged 17 commits intoexercism:masterfrom Apr 8, 2018
Merged
Conversation
petertseng
approved these changes
Apr 8, 2018
petertseng
approved these changes
Apr 8, 2018
|
|
||
| pub fn sing(start: i32, end: i32) -> String { | ||
| unimplemented!() | ||
| unimplemented!("sing verses {} to {}", start, end) |
Member
There was a problem hiding this comment.
could specify whether end is inclusive
| @@ -1,3 +1,3 @@ | |||
| pub fn reply(message: &str) -> &str { | |||
| unimplemented!() | |||
| unimplemented!("have bob reply to the incoming message: {}", message) | |||
Two notes for this one:
1. We use PhantomData<T> instead of a bare reference to T so that
even if the student fails to remove it, things still work.
2. Because the element in push is generic over T, which is not bounded
by Debug, we can't emit it in an unimplemented! statement.
We therefore fall back on underscore prefixing.
51b9efc to
1418849
Compare
petertseng
approved these changes
Apr 8, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #484
Includes
_test/check-stubs.sh, which discovers any compilation errors in the stubs.Eliminates all stub warnings, not just unused variables.
simple-linked-list uses generics which are not bounded by
Debug, so we can't use the standard "print it inunimplemented!()trick there. We fall back on underscore-prefixing affected variables in this case.