Skip to content

Replace 'crate_id' with 'crate_name' in docs #16540

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
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 5 additions & 5 deletions src/doc/rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -732,8 +732,8 @@ the behavior of the compiler.

~~~~ {.rust}
# #![allow(unused_attribute)]
// Crate ID
#![crate_id = "projx#2.5"]
// Crate Name
#![crate_name = "projx"]

// Additional metadata attributes
#![desc = "Project X"]
Expand Down Expand Up @@ -1870,7 +1870,7 @@ type int8_t = i8;

### Crate-only attributes

- `crate_id` - specify the this crate's crate ID.
- `crate_name` - specify the this crate's name.
- `crate_type` - see [linkage](#linkage).
- `feature` - see [compiler features](#compiler-features).
- `no_builtins` - disable optimizing certain code patterns to invocations of
Expand Down Expand Up @@ -4283,8 +4283,8 @@ specified then log level 4 is assumed. Debug messages can be omitted
by passing `--cfg ndebug` to `rustc`.

As an example, to see all the logs generated by the compiler, you would set
`RUST_LOG` to `rustc`, which is the crate name (as specified in its `crate_id`
[attribute](#attributes)). To narrow down the logs to just crate resolution,
`RUST_LOG` to `rustc`, which is the crate name.
To narrow down the logs to just crate resolution,
Copy link
Member

Choose a reason for hiding this comment

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

This seems like fairly valuable information to leave in (but change crate_id to crate_name?)

you would set it to `rustc::metadata::creader`. To see just error logging
use `rustc=0`.

Expand Down
4 changes: 2 additions & 2 deletions src/doc/rustdoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ comments":
# #![allow(unused_attribute)]
// the "link" crate attribute is currently required for rustdoc, but normally
// isn't needed.
#![crate_id = "universe"]
#![crate_type="lib"]
#![crate_name = "universe"]
#![crate_type = "lib"]

//! Tools for dealing with universes (this is a doc comment, and is shown on
//! the crate index page. The ! makes it apply to the parent of the comment,
Expand Down
6 changes: 3 additions & 3 deletions src/doc/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -3237,7 +3237,7 @@ Therefore, if you plan to compile your crate as a library, you should annotate i
// `lib.rs`

# #![crate_type = "lib"]
#![crate_id = "farm#2.5"]
#![crate_name = "farm"]

// ...
# fn farm() {}
Expand All @@ -3262,7 +3262,7 @@ or setting the crate type (library or executable) explicitly:
// ...

// This crate is a library ("bin" is the default)
#![crate_id = "farm#2.5"]
#![crate_name = "farm"]
#![crate_type = "lib"]

// Turn on a warning
Expand All @@ -3279,7 +3279,7 @@ We define two crates, and use one of them as a library in the other.
~~~~
# #![allow(unused_attribute)]
// `world.rs`
#![crate_id = "world#0.42"]
#![crate_name = "world"]

# mod secret_module_to_make_this_test_run {
pub fn explore() -> &'static str { "world" }
Expand Down