Skip to content

book: make the test succeed by avoiding using non-existent function #29198

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

Closed
wants to merge 1 commit into from
Closed

book: make the test succeed by avoiding using non-existent function #29198

wants to merge 1 commit into from

Conversation

tshepang
Copy link
Member

No description provided.

@rust-highfive
Copy link
Contributor

r? @steveklabnik

(rust_highfive has picked a reviewer for you, use r? to override)

@bluss
Copy link
Member

bluss commented Oct 21, 2015

I think it should be identical to the preceding it_works, it's an example in the same context, so this change is unnecessary.

@tshepang
Copy link
Member Author

But the test fails at the moment

@Manishearth
Copy link
Member

Plop in a definition of it_works commented out with #es, then. Testing is supposed to test something, in this case you're testing add_two.

@tshepang
Copy link
Member Author

I will add the add_two function

@tshepang
Copy link
Member Author

fixed

@Manishearth
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Oct 29, 2015

📌 Commit d30ebd1 has been approved by Manishearth

@bors
Copy link
Collaborator

bors commented Oct 29, 2015

💔 Test failed - auto-mac-64-nopt-t

@Manishearth
Copy link
Member

---- The__code_ignore__code__attribute_0 stdout ----
    <anon>:2:5: 4:6 error: visibility has no effect inside functions [E0447]
<anon>:2     pub fn add_two(a: i32) -> i32 {
<anon>:3         a + 2
<anon>:4     }
error: aborting due to previous error

@bors
Copy link
Collaborator

bors commented Oct 30, 2015

☔ The latest upstream changes (presumably #29458) made this pull request unmergeable. Please resolve the merge conflicts.

@tshepang
Copy link
Member Author

test ignored, as is the case with one before it

@Manishearth
Copy link
Member

We don't want to ignore the test.

We want to not mark the function as pub.

Actually, I thought this PR was to solve a doctest failure/ignore, which is why I suggested using a #'d out function. But the doctest passes, since doctests don't even compile #[test] bits.

It's a pretty common pattern in rust docs to use snippets that need parts from previous snippets. Because of this, I'm not sure if this PR is really necessary.

@tshepang
Copy link
Member Author

I think it's marked pub in order to demo that the function is to be used externally... it's a library. Note that pub is used earlier in the file for the same function, and that case has been ignored as well.

I will close this regardless, given your last point.

@tshepang tshepang closed this Oct 31, 2015
@tshepang tshepang deleted the make-test-succeed branch December 17, 2015 18:03
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.

6 participants