Skip to content

Commit 9be8ff1

Browse files
committed
Add some comments
1 parent 5276987 commit 9be8ff1

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

compiler/rustc_metadata/src/creader.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,12 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> {
390390
None
391391
}
392392

393-
// The `dependency` type is determined by the command line arguments(`--extern`) and
394-
// `private_dep`. However, sometimes the directly dependent crate is not specified by
395-
// `--extern`, in this case, `private-dep` is none during loading. This is equivalent to the
396-
// scenario where the command parameter is set to `public-dependency`
393+
/// The `dependency` type is determined by the command line arguments(`--extern`) and
394+
/// `private_dep`.
395+
///
396+
/// Sometimes the directly dependent crate is not specified by `--extern`, in this case,
397+
/// `private-dep` is none during loading. This is equivalent to the scenario where the
398+
/// command parameter is set to `public-dependency`
397399
fn is_private_dep(&self, name: &str, private_dep: Option<bool>) -> bool {
398400
self.sess.opts.externs.get(name).map_or(private_dep.unwrap_or(false), |e| e.is_private_dep)
399401
&& private_dep.unwrap_or(true)

compiler/rustc_metadata/src/locator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ pub(crate) struct CrateLocator<'a> {
262262

263263
#[derive(Clone)]
264264
pub(crate) struct CratePaths {
265-
name: Symbol,
265+
pub(crate) name: Symbol,
266266
source: CrateSource,
267267
}
268268

compiler/rustc_middle/src/query/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2128,6 +2128,8 @@ rustc_queries! {
21282128
eval_always
21292129
desc { "calculating the stability index for the local crate" }
21302130
}
2131+
/// All available crates in the graph, including those that should not be user-facing
2132+
/// (such as private crates).
21312133
query crates(_: ()) -> &'tcx [CrateNum] {
21322134
eval_always
21332135
desc { "fetching all foreign CrateNum instances" }

0 commit comments

Comments
 (0)