Skip to content
Merged
Changes from 1 commit
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
6 changes: 5 additions & 1 deletion src/doc/book/conditional-compilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ they get set in the [`[features]` section][features] of your `Cargo.toml`:
# no features by default
default = []

# Add feature "foo" here, then you can use it.
# Our "foo" feature depends on nothings else.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you change this to "nothing" rather than "nothings" please?

Copy link
Contributor Author

@wuranbo wuranbo Jul 6, 2016

Choose a reason for hiding this comment

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

OK~My english is poor.

Copy link
Contributor

Choose a reason for hiding this comment

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

No worries! 😄 I'm a native speaker and mine is often terrible.

foo = []

# The “secure-password” feature depends on the bcrypt package.
secure-password = ["bcrypt"]
# secure-password = ["bcrypt"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this one being commented out?

Copy link
Contributor Author

@wuranbo wuranbo Jul 6, 2016

Choose a reason for hiding this comment

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

When I run with this line: secure-password = ["bcrypt"]
I got an error
"
error: failed to parse manifest at /Users/wrb/github/wuranbo/gist/rust/workspace/hello_world/Cargo.toml

Caused by:
Feature secure-password includes bcrypt which is neither a dependency nor another feature
"
I did not know how to fix it, so comment. I read the book first time, just a newbie~~
And when I read this line, I got nothing about 'secure-password' in the whole chapter context.Really confused me.

So, tell me, how should I fix it?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah so, as the comment says

depends on the bcrypt package

If you don't have the package as a dependency, then it's going to give an error. Can we just remove these three lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh. thank you. I will remove these.

```

When you do this, Cargo passes along a flag to `rustc`:
Expand Down