Skip to content

Commit 1086d9b

Browse files
committed
Rename CrateSpecific -> InvocationSpecific
1 parent d4f3f91 commit 1086d9b

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

src/librustdoc/config.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ crate struct RenderOptions {
274274
crate enum EmitType {
275275
Unversioned,
276276
Toolchain,
277-
CrateSpecific,
277+
InvocationSpecific,
278278
}
279279

280280
impl FromStr for EmitType {
@@ -285,15 +285,15 @@ impl FromStr for EmitType {
285285
match s {
286286
"unversioned-shared-resources" => Ok(Unversioned),
287287
"toolchain-shared-resources" => Ok(Toolchain),
288-
"crate-specific" => Ok(CrateSpecific),
288+
"invocation-specific" => Ok(InvocationSpecific),
289289
_ => Err(()),
290290
}
291291
}
292292
}
293293

294294
impl RenderOptions {
295295
crate fn should_emit_crate(&self) -> bool {
296-
self.emit.is_empty() || self.emit.contains(&EmitType::CrateSpecific)
296+
self.emit.is_empty() || self.emit.contains(&EmitType::InvocationSpecific)
297297
}
298298
}
299299

src/librustdoc/html/render/write_shared.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ enum SharedResource<'a> {
4949
///
5050
/// It has a resource suffix.
5151
ToolchainSpecific { basename: &'static str },
52-
/// This file may change for any crate within a build.
52+
/// This file may change for any crate within a build, or based on the CLI arguments.
5353
///
54-
/// This differs from normal crate-specific files because it has a resource suffix.
55-
CrateSpecific { basename: &'a str },
54+
/// This differs from normal invocation-specific files because it has a resource suffix.
55+
InvocationSpecific { basename: &'a str },
5656
}
5757

5858
impl SharedResource<'_> {
@@ -61,15 +61,15 @@ impl SharedResource<'_> {
6161
match self {
6262
Unversioned { name }
6363
| ToolchainSpecific { basename: name }
64-
| CrateSpecific { basename: name } => Path::new(name).extension(),
64+
| InvocationSpecific { basename: name } => Path::new(name).extension(),
6565
}
6666
}
6767

6868
fn path(&self, cx: &Context<'_>) -> PathBuf {
6969
match self {
7070
SharedResource::Unversioned { name } => cx.dst.join(name),
7171
SharedResource::ToolchainSpecific { basename } => cx.suffix_path(basename),
72-
SharedResource::CrateSpecific { basename } => cx.suffix_path(basename),
72+
SharedResource::InvocationSpecific { basename } => cx.suffix_path(basename),
7373
}
7474
}
7575

@@ -80,7 +80,7 @@ impl SharedResource<'_> {
8080
let kind = match self {
8181
SharedResource::Unversioned { .. } => EmitType::Unversioned,
8282
SharedResource::ToolchainSpecific { .. } => EmitType::Toolchain,
83-
SharedResource::CrateSpecific { .. } => EmitType::CrateSpecific,
83+
SharedResource::InvocationSpecific { .. } => EmitType::InvocationSpecific,
8484
};
8585
emit.contains(&kind)
8686
}
@@ -165,7 +165,7 @@ pub(super) fn write_shared(
165165
// Crate resources should always be dynamic.
166166
let write_crate = |p: &_, make_content: &dyn Fn() -> Result<Vec<u8>, Error>| {
167167
let content = make_content()?;
168-
cx.write_shared(SharedResource::CrateSpecific { basename: p }, content, &options.emit)
168+
cx.write_shared(SharedResource::InvocationSpecific { basename: p }, content, &options.emit)
169169
};
170170

171171
// Add all the static files. These may already exist, but we just

src/librustdoc/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ fn opts() -> Vec<RustcOptGroup> {
532532
"",
533533
"emit",
534534
"Comma separated list of types of output for rustdoc to emit",
535-
"[unversioned-shared-resources,toolchain-shared-resources,crate-specific]",
535+
"[unversioned-shared-resources,toolchain-shared-resources,invocation-specific]",
536536
)
537537
}),
538538
]

src/test/run-make/emit-shared-files/Makefile

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
-include ../../run-make-fulldeps/tools.mk
22

3-
CRATE_ONLY = $(TMPDIR)/crate-only
3+
INVOCATION_ONLY = $(TMPDIR)/invocation-only
44
TOOLCHAIN_ONLY = $(TMPDIR)/toolchain-only
55
ALL_SHARED = $(TMPDIR)/all-shared
66

7-
all: crate-only toolchain-only all-shared
7+
all: invocation-only toolchain-only all-shared
88

9-
crate-only:
10-
$(RUSTDOC) -Z unstable-options --emit=crate-specific --output $(CRATE_ONLY) --resource-suffix=-xxx --theme y.css x.rs
11-
[ -e $(CRATE_ONLY)/search-index-xxx.js ]
12-
[ -e $(CRATE_ONLY)/settings.html ]
13-
[ -e $(CRATE_ONLY)/x/all.html ]
14-
[ -e $(CRATE_ONLY)/x/index.html ]
9+
invocation-only:
10+
$(RUSTDOC) -Z unstable-options --emit=invocation-specific --output $(INVOCATION_ONLY) --resource-suffix=-xxx --theme y.css x.rs
11+
[ -e $(INVOCATION_ONLY)/search-index-xxx.js ]
12+
[ -e $(INVOCATION_ONLY)/settings.html ]
13+
[ -e $(INVOCATION_ONLY)/x/all.html ]
14+
[ -e $(INVOCATION_ONLY)/x/index.html ]
1515
# FIXME: this probably shouldn't have a suffix
16-
[ -e $(CRATE_ONLY)/y-xxx.css ]
17-
! [ -e $(CRATE_ONLY)/storage-xxx.js ]
18-
! [ -e $(CRATE_ONLY)/SourceSerifPro-It.ttf.woff ]
16+
[ -e $(INVOCATION_ONLY)/y-xxx.css ]
17+
! [ -e $(INVOCATION_ONLY)/storage-xxx.js ]
18+
! [ -e $(INVOCATION_ONLY)/SourceSerifPro-It.ttf.woff ]
1919

2020
toolchain-only:
2121
$(RUSTDOC) -Z unstable-options --emit=toolchain-shared-resources --output $(TOOLCHAIN_ONLY) --resource-suffix=-xxx x.rs

0 commit comments

Comments
 (0)