Skip to content

Commit bb2f23c

Browse files
committed
Spelling librustdoc
* associated * collected * correspondence * inlining * into * javascript * multiline * variadic Signed-off-by: Josh Soref <[email protected]>
1 parent c6fb7b9 commit bb2f23c

File tree

11 files changed

+28
-28
lines changed

11 files changed

+28
-28
lines changed

src/librustdoc/clean/inline.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ pub(crate) fn build_impl(
528528
items: trait_items,
529529
polarity,
530530
kind: if utils::has_doc_flag(tcx, did, sym::fake_variadic) {
531-
ImplKind::FakeVaradic
531+
ImplKind::FakeVariadic
532532
} else {
533533
ImplKind::Normal
534534
},

src/librustdoc/clean/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2356,7 +2356,7 @@ fn clean_impl<'tcx>(
23562356
items,
23572357
polarity: tcx.impl_polarity(def_id),
23582358
kind: if utils::has_doc_flag(tcx, def_id.to_def_id(), sym::fake_variadic) {
2359-
ImplKind::FakeVaradic
2359+
ImplKind::FakeVariadic
23602360
} else {
23612361
ImplKind::Normal
23622362
},

src/librustdoc/clean/types.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl ExternalCrate {
156156
}
157157

158158
/// Attempts to find where an external crate is located, given that we're
159-
/// rendering in to the specified source destination.
159+
/// rendering into the specified source destination.
160160
pub(crate) fn location(
161161
&self,
162162
extern_url: Option<&str>,
@@ -751,7 +751,7 @@ pub(crate) enum ItemKind {
751751
PrimitiveItem(PrimitiveType),
752752
/// A required associated constant in a trait declaration.
753753
TyAssocConstItem(Type),
754-
/// An associated associated constant in a trait impl or a provided one in a trait declaration.
754+
/// An associated constant in a trait impl or a provided one in a trait declaration.
755755
AssocConstItem(Type, ConstantKind),
756756
/// A required associated type in a trait declaration.
757757
///
@@ -2305,7 +2305,7 @@ impl Impl {
23052305
pub(crate) enum ImplKind {
23062306
Normal,
23072307
Auto,
2308-
FakeVaradic,
2308+
FakeVariadic,
23092309
Blanket(Box<Type>),
23102310
}
23112311

@@ -2319,7 +2319,7 @@ impl ImplKind {
23192319
}
23202320

23212321
pub(crate) fn is_fake_variadic(&self) -> bool {
2322-
matches!(self, ImplKind::FakeVaradic)
2322+
matches!(self, ImplKind::FakeVariadic)
23232323
}
23242324

23252325
pub(crate) fn as_blanket_ty(&self) -> Option<&Type> {

src/librustdoc/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ impl Options {
491491
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset
492492
//
493493
// The original key values we have are the same as the DOM storage API keys and the
494-
// command line options, so contain `-`. Our Javascript needs to be able to look
494+
// command line options, so contain `-`. Our JavaScript needs to be able to look
495495
// these values up both in `dataset` and in the storage API, so it needs to be able
496496
// to convert the names back and forth. Despite doing this kebab-case to
497497
// StudlyCaps transformation automatically, the JS DOM API does not provide a

src/librustdoc/html/highlight.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ struct Classifier<'src> {
514514

515515
impl<'src> Classifier<'src> {
516516
/// Takes as argument the source code to HTML-ify, the rust edition to use and the source code
517-
/// file span which will be used later on by the `span_correspondance_map`.
517+
/// file span which will be used later on by the `span_correspondence_map`.
518518
fn new(src: &str, file_span: Span, decoration_info: Option<DecorationInfo>) -> Classifier<'_> {
519519
let tokens = PeekIter::new(TokenIter { src, cursor: Cursor::new(src) });
520520
let decorations = decoration_info.map(Decorations::new);
@@ -649,7 +649,7 @@ impl<'src> Classifier<'src> {
649649
///
650650
/// `before` is the position of the given token in the `source` string and is used as "lo" byte
651651
/// in case we want to try to generate a link for this token using the
652-
/// `span_correspondance_map`.
652+
/// `span_correspondence_map`.
653653
fn advance(
654654
&mut self,
655655
token: TokenKind,
@@ -895,7 +895,7 @@ fn exit_span(out: &mut impl Write, closing_tag: &str) {
895895
/// flexible.
896896
///
897897
/// Note that if `context` is not `None` and that the given `klass` contains a `Span`, the function
898-
/// will then try to find this `span` in the `span_correspondance_map`. If found, it'll then
898+
/// will then try to find this `span` in the `span_correspondence_map`. If found, it'll then
899899
/// generate a link for this element (which corresponds to where its definition is located).
900900
fn string<T: Display>(
901901
out: &mut impl Write,
@@ -916,7 +916,7 @@ fn string<T: Display>(
916916
/// * If `klass` is `Some` but `klass.get_span()` is `None`, it writes the text wrapped in a
917917
/// `<span>` with the provided `klass`.
918918
/// * If `klass` is `Some` and has a [`rustc_span::Span`], it then tries to generate a link (`<a>`
919-
/// element) by retrieving the link information from the `span_correspondance_map` that was filled
919+
/// element) by retrieving the link information from the `span_correspondence_map` that was filled
920920
/// in `span_map.rs::collect_spans_and_sources`. If it cannot retrieve the information, then it's
921921
/// the same as the second point (`klass` is `Some` but doesn't have a [`rustc_span::Span`]).
922922
fn string_without_closing_tag<T: Display>(
@@ -963,7 +963,7 @@ fn string_without_closing_tag<T: Display>(
963963

964964
if let Some(href_context) = href_context {
965965
if let Some(href) =
966-
href_context.context.shared.span_correspondance_map.get(&def_span).and_then(|href| {
966+
href_context.context.shared.span_correspondence_map.get(&def_span).and_then(|href| {
967967
let context = href_context.context;
968968
// FIXME: later on, it'd be nice to provide two links (if possible) for all items:
969969
// one to the documentation page and one to the source definition.

src/librustdoc/html/markdown.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,7 @@ static DEFAULT_ID_MAP: Lazy<FxHashMap<Cow<'static, str>, usize>> = Lazy::new(||
13921392

13931393
fn init_id_map() -> FxHashMap<Cow<'static, str>, usize> {
13941394
let mut map = FxHashMap::default();
1395-
// This is the list of IDs used in Javascript.
1395+
// This is the list of IDs used in JavaScript.
13961396
map.insert("help".into(), 1);
13971397
map.insert("settings".into(), 1);
13981398
map.insert("not-displayed".into(), 1);

src/librustdoc/html/render/context.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ pub(crate) struct SharedContext<'tcx> {
122122
/// the crate.
123123
redirections: Option<RefCell<FxHashMap<String, String>>>,
124124

125-
/// Correspondance map used to link types used in the source code pages to allow to click on
125+
/// Correspondence map used to link types used in the source code pages to allow to click on
126126
/// links to jump to the type's definition.
127-
pub(crate) span_correspondance_map: FxHashMap<rustc_span::Span, LinkFromSrc>,
127+
pub(crate) span_correspondence_map: FxHashMap<rustc_span::Span, LinkFromSrc>,
128128
/// The [`Cache`] used during rendering.
129129
pub(crate) cache: Cache,
130130

@@ -531,7 +531,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
531531
errors: receiver,
532532
redirections: if generate_redirect_map { Some(Default::default()) } else { None },
533533
show_type_layout,
534-
span_correspondance_map: matches,
534+
span_correspondence_map: matches,
535535
cache,
536536
call_locations,
537537
};
@@ -647,7 +647,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
647647
</div>\
648648
<noscript>\
649649
<section>\
650-
You need to enable Javascript be able to update your settings.\
650+
You need to enable JavaScript be able to update your settings.\
651651
</section>\
652652
</noscript>\
653653
<link rel=\"stylesheet\" \
@@ -709,7 +709,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
709709
</div>\
710710
<noscript>\
711711
<section>\
712-
<p>You need to enable Javascript to use keyboard commands or search.</p>\
712+
<p>You need to enable JavaScript to use keyboard commands or search.</p>\
713713
<p>For more information, browse the <a href=\"https://doc.rust-lang.org/rustdoc/\">rustdoc handbook</a>.</p>\
714714
</section>\
715715
</noscript>",

src/librustdoc/json/conversions.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ impl FromWithTcx<clean::Impl> for Impl {
665665
let clean::Impl { unsafety, generics, trait_, for_, items, polarity, kind } = impl_;
666666
// FIXME: use something like ImplKind in JSON?
667667
let (synthetic, blanket_impl) = match kind {
668-
clean::ImplKind::Normal | clean::ImplKind::FakeVaradic => (false, None),
668+
clean::ImplKind::Normal | clean::ImplKind::FakeVariadic => (false, None),
669669
clean::ImplKind::Auto => (true, None),
670670
clean::ImplKind::Blanket(ty) => (false, Some(*ty)),
671671
};
@@ -740,7 +740,7 @@ impl FromWithTcx<clean::Variant> for Variant {
740740
impl FromWithTcx<clean::Discriminant> for Discriminant {
741741
fn from_tcx(disr: clean::Discriminant, tcx: TyCtxt<'_>) -> Self {
742742
Discriminant {
743-
// expr is only none if going through the inlineing path, which gets
743+
// expr is only none if going through the inlining path, which gets
744744
// `rustc_middle` types, not `rustc_hir`, but because JSON never inlines
745745
// the expr is always some.
746746
expr: disr.expr(tcx).unwrap(),

src/librustdoc/scrape_examples.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ pub(crate) fn run(
286286
let (cx, _) = Context::init(krate, renderopts, cache, tcx).map_err(|e| e.to_string())?;
287287

288288
// Collect CrateIds corresponding to provided target crates
289-
// If two different versions of the crate in the dependency tree, then examples will be collcted from both.
289+
// If two different versions of the crate in the dependency tree, then examples will be collected from both.
290290
let all_crates = tcx
291291
.crates(())
292292
.iter()

src/librustdoc/theme/tests.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ rule d
1313
// another line comment
1414
e {}
1515
16-
rule f/* a multine
16+
rule f/* a multiline
1717
1818
comment*/{}
1919
20-
rule g/* another multine
20+
rule g/* another multiline
2121
2222
comment*/h
2323

src/tools/rustdoc-gui/tester.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function parseOptions(args) {
4242
"executable_path": null,
4343
"no_sandbox": false,
4444
};
45-
const correspondances = {
45+
const correspondences = {
4646
"--doc-folder": "doc_folder",
4747
"--tests-folder": "tests_folder",
4848
"--debug": "debug",
@@ -73,7 +73,7 @@ function parseOptions(args) {
7373
}
7474
opts["jobs"] = parseInt(arg_value);
7575
} else if (arg !== "--file") {
76-
opts[correspondances[arg]] = arg_value;
76+
opts[correspondences[arg]] = arg_value;
7777
} else {
7878
opts["files"].push(arg_value);
7979
}
@@ -82,9 +82,9 @@ function parseOptions(args) {
8282
process.exit(0);
8383
} else if (arg === "--no-sandbox") {
8484
console.log("`--no-sandbox` is being used. Be very careful!");
85-
opts[correspondances[arg]] = true;
86-
} else if (correspondances[arg]) {
87-
opts[correspondances[arg]] = true;
85+
opts[correspondences[arg]] = true;
86+
} else if (correspondences[arg]) {
87+
opts[correspondences[arg]] = true;
8888
} else {
8989
console.log("Unknown option `" + arg + "`.");
9090
console.log("Use `--help` to see the list of options");

0 commit comments

Comments
 (0)