Skip to content

Commit 8f76f93

Browse files
author
Isaac Andrade
committed
Add mention to RFC 940 in the Rust Reference.
- It also keeps mentions to RFCs consistent with the format "RFC XXX"
1 parent d80497e commit 8f76f93

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

src/doc/reference.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,20 @@ extern crate std; // equivalent to: extern crate std as std;
845845
extern crate std as ruststd; // linking to 'std' under another name
846846
```
847847

848+
When naming Rust crates, hyphens are disallowed. However, Cargo packages may
849+
make use of them. In such case, when `cargo.toml` doesn't specify a crate name,
850+
Cargo will transparently replace `-` with `_` (Refer to [RFC 940] for more
851+
details).
852+
853+
Here is an example:
854+
855+
```{.ignore}
856+
// Importing the Cargo package hello-world/
857+
extern crate hello_world; // The crate name replaced the hyphen
858+
```
859+
860+
[RFC 940]: https://github.com/rust-lang/rfcs/blob/master/text/0940-hyphens-considered-harmful.md
861+
848862
#### Use declarations
849863

850864
A _use declaration_ creates one or more local name bindings synonymous with
@@ -3720,9 +3734,9 @@ Since `'static` "lives longer" than `'a`, `&'static str` is a subtype of
37203734

37213735
## Type coercions
37223736

3723-
Coercions are defined in [RFC401]. A coercion is implicit and has no syntax.
3737+
Coercions are defined in [RFC 401]. A coercion is implicit and has no syntax.
37243738

3725-
[RFC401]: https://github.com/rust-lang/rfcs/blob/master/text/0401-coercions.md
3739+
[RFC 401]: https://github.com/rust-lang/rfcs/blob/master/text/0401-coercions.md
37263740

37273741
### Coercion sites
37283742

@@ -3862,7 +3876,7 @@ Coercion is allowed between the following types:
38623876

38633877
In the future, coerce_inner will be recursively extended to tuples and
38643878
structs. In addition, coercions from sub-traits to super-traits will be
3865-
added. See [RFC401] for more details.
3879+
added. See [RFC 401] for more details.
38663880

38673881
# Special traits
38683882

0 commit comments

Comments
 (0)