diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd8ef0cf..daf542e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,12 @@ jobs: - name: Build documentation and check links run: ./make.py --check-links + - name: Verify glossary generation is reflected immediately + run: rm -f build/generated.glossary.rst && ./make.py --clear && test -f build/generated.glossary.rst + + - name: Verify glossary HTML reproducibility + run: ./tools/verify-html-diff.py --mode repro --ref HEAD + - name: Verify licensing metadata run: uvx reuse lint diff --git a/README.rst b/README.rst index ec2403ee..07a1a2d5 100644 --- a/README.rst +++ b/README.rst @@ -81,6 +81,27 @@ whenever you change a file by passing the ``--serve`` flag:: ./make.py --serve +For a full list of build flags, run:: + + ./make.py --help + +Glossary generation +=================== + +Glossary entries can be authored once and used to render both their chapter +definitions and the glossary. The generated glossary output lives at +``build/generated.glossary.rst``. + +``./make.py`` always regenerates ``build/generated.glossary.rst`` before a +build, including ``--serve`` mode. + +Generate the glossary directly:: + + ./generate-glossary.py + +For reproducibility and cross-ref comparisons, see ``tools/README.rst`` +(``tools/verify-html-diff.py``). + Checking links consistency ========================== diff --git a/exts/ferrocene_spec/README.rst b/exts/ferrocene_spec/README.rst index d7717487..5f0fcab0 100644 --- a/exts/ferrocene_spec/README.rst +++ b/exts/ferrocene_spec/README.rst @@ -139,6 +139,45 @@ Words and characters wrapped within ``$$`` are considered "literals": they will be rendered differently than syntactic categories, and they won't be considered by the extension when looking for syntactic categories. +Glossary entries +================ + +The extension provides directives to keep glossary and chapter definitions in a +single place, and to render a glossary from those entries. + +Use ``glossary-entry`` to declare a term. It accepts a term argument and one or +both content blocks (``:glossary:`` and ``:chapter:``). ``:glossary-dp:`` is +required for any entry exported to the glossary. + +Options: + +* ``:kind:`` selects the entry kind (``term``, ``code``, or ``syntax``). +* ``:propagate:`` controls whether the chapter text is reused as glossary text + when ``:glossary:`` is omitted (``true`` or ``false``). +* ``:glossary-dp:`` provides the glossary anchor ID (``fls_`` + alphanumeric). + +.. code-block:: rst + + .. glossary-entry:: subject expression + :glossary-dp: fls_wee9stfk0abp + :kind: term + :propagate: false + + :glossary: + :dp:`fls_xisqke87ert` + A :dt:`subject expression` is an :t:`expression` that controls + :t:`[for loop]s`, :t:`[if expression]s`, and :t:`[match expression]s`. + + :chapter: + :dp:`fls_pwut2jbmk66k` + A :ds:`SubjectExpression` is any expression in category :s:`Expression`, except + :s:`StructExpression`. + +Use ``glossary-include`` to insert glossary content (typically the generated +glossary file under ``build/generated.glossary.rst``) into a page, with +optional ``:tag:`` and ``:start-after:`` filters, similar to the standard +``include`` directive. + Paragraph IDs ============= diff --git a/exts/ferrocene_spec/__init__.py b/exts/ferrocene_spec/__init__.py index 0b15987f..e6566e91 100644 --- a/exts/ferrocene_spec/__init__.py +++ b/exts/ferrocene_spec/__init__.py @@ -1,7 +1,14 @@ # SPDX-License-Identifier: MIT OR Apache-2.0 # SPDX-FileCopyrightText: The Ferrocene Developers -from . import definitions, informational, syntax_directive, std_role, paragraph_ids +from . import ( + definitions, + glossary, + informational, + syntax_directive, + std_role, + paragraph_ids, +) from . import items_with_rubric, sphinx_fixes from sphinx.domains import Domain @@ -18,6 +25,8 @@ class SpecDomain(Domain): "informational-page": informational.build_directive("page"), "informational-section": informational.build_directive("section"), "items-with-rubric": items_with_rubric.ItemsWithRubricDirective, + "glossary-entry": glossary.GlossaryEntryDirective, + "glossary-include": glossary.GlossaryIncludeDirective, } object_types = definitions.get_object_types() indices = {} @@ -38,6 +47,7 @@ def is_empty(data): def setup(app): app.add_domain(SpecDomain) definitions.setup(app) + glossary.setup(app) paragraph_ids.setup(app) informational.setup(app) items_with_rubric.setup(app) @@ -61,5 +71,6 @@ def setup(app): # Version history: # - 0: initial implementation # - 1: changed how informational sections and pages are stored - "env_version": "1", + # - 2: added glossary-dp metadata to glossary entries + "env_version": "2", } diff --git a/exts/ferrocene_spec/glossary.py b/exts/ferrocene_spec/glossary.py new file mode 100644 index 00000000..0d320ea8 --- /dev/null +++ b/exts/ferrocene_spec/glossary.py @@ -0,0 +1,396 @@ +# SPDX-License-Identifier: MIT OR Apache-2.0 +# SPDX-FileCopyrightText: The Ferrocene Developers + +from dataclasses import dataclass +from pathlib import Path +import re +from docutils import nodes +from docutils.parsers.rst import directives +from docutils.statemachine import StringList +from sphinx.util.docutils import SphinxDirective +from sphinx.environment.collectors import EnvironmentCollector +from sphinx.util import logging + +VALID_KINDS = ("term", "code", "syntax") +GLOSSARY_DP_RE = re.compile(r"^fls_[A-Za-z0-9_]+$") + + +class GlossaryEntryNode(nodes.Element): + __slots__ = ("glossary_lines", "chapter_lines", "glossary_dp") + glossary_lines: list[str] | None + chapter_lines: list[str] | None + glossary_dp: str | None + + +def _parse_bool_option(argument): + if argument is None: + raise ValueError("propagate requires true or false") + value = argument.strip().lower() + if value not in ("true", "false"): + raise ValueError("propagate requires true or false") + return value == "true" + + +@dataclass +class GlossaryEntryData: + term: str + glossary_dp: str | None + kind: str + propagate: bool + glossary_lines: list[str] | None + chapter_lines: list[str] | None + document: str + source: str | None + line: int | None + + +class GlossaryEntryDirective(SphinxDirective): + required_arguments = 1 + has_content = True + final_argument_whitespace = True + option_spec = { + "kind": lambda argument: directives.choice(argument, VALID_KINDS), + "propagate": _parse_bool_option, + "glossary-dp": directives.unchanged_required, + } + + def run(self): + term = self.arguments[0].strip() + if not term: + warn("glossary-entry requires a term argument", self.get_location()) + return [] + + glossary_lines, chapter_lines = parse_section_blocks( + list(self.content), self.get_location() + ) + + if glossary_lines is None and chapter_lines is None: + warn("glossary-entry requires :glossary: or :chapter:", self.get_location()) + return [] + + propagate = self.options.get("propagate", False) + kind = self.options.get("kind", "term") + glossary_dp, glossary_dp_error = normalize_glossary_dp( + self.options.get("glossary-dp"), self.get_location() + ) + requires_glossary_dp = glossary_lines is not None or ( + chapter_lines is not None and propagate + ) + if requires_glossary_dp and glossary_dp is None and not glossary_dp_error: + warn( + "glossary-entry requires :glossary-dp: for exported terms", + self.get_location(), + ) + + node = GlossaryEntryNode() + source, line = self.get_source_info() + node["term"] = term + node["kind"] = kind + node["propagate"] = propagate + node.glossary_lines = glossary_lines + node.chapter_lines = chapter_lines + node.glossary_dp = glossary_dp + node["source"] = source + node["line"] = line + node.source = source + node.line = line + + result: list[nodes.Node] = [node] + if chapter_lines is not None: + result.extend(parse_chapter_lines(self, chapter_lines, source, line)) + return result + + +class GlossaryIncludeDirective(SphinxDirective): + required_arguments = 1 + has_content = False + option_spec = { + "start-after": directives.unchanged_required, + "tag": directives.unchanged_required, + } + + def run(self): + logger = logging.getLogger(__name__) + tag_expr = self.options.get("tag") + include_path = directives.path(self.arguments[0]) + if tag_expr and not self.env.app.tags.eval_condition(tag_expr): + logger.info( + "glossary-include: skipped tag=%r include=%s", + tag_expr, + include_path, + ) + return [] + + source = self.get_source_info()[0] + if source: + source_dir = Path(source).parent + else: + source_dir = Path(self.env.srcdir) + resolved = (source_dir / include_path).resolve() + if not resolved.is_file(): + warn(f"missing include file: {resolved}", self.get_location()) + return [] + + self.env.note_dependency(str(resolved)) + + logger.info( + "glossary-include: using tag=%r include=%s", + tag_expr, + resolved, + ) + + text = resolved.read_text(encoding="utf-8") + lines = text.splitlines() + start_after = self.options.get("start-after") + if start_after: + lines = lines_after_marker( + lines, start_after, resolved, self.get_location() + ) + + viewlist = StringList() + for offset, content in enumerate(lines): + viewlist.append(content, str(resolved), offset + 1) + + container = nodes.container() + self.state.nested_parse( + viewlist, self.content_offset, container, match_titles=True + ) + return list(container.children) + + +def parse_section_blocks( + content_lines: list[str], location +) -> tuple[list[str] | None, list[str] | None]: + sections: dict[str, list[str] | None] = {"glossary": None, "chapter": None} + current: str | None = None + buffer: list[str] = [] + + for line in content_lines: + stripped = line.strip() + if stripped in (":glossary:", ":chapter:") and line.startswith(":"): + if current is not None: + sections[current] = dedent_block(buffer) + current = stripped.strip(":") + if sections[current] is not None: + warn(f"duplicate :{current}: block", location) + buffer = [] + continue + + if current is None: + if stripped: + warn( + "glossary-entry content must be inside :glossary: or :chapter:", + location, + ) + continue + + buffer.append(line) + + if current is not None: + sections[current] = dedent_block(buffer) + + sections["glossary"] = normalize_block(sections["glossary"], location, "glossary") + sections["chapter"] = normalize_block(sections["chapter"], location, "chapter") + + return sections["glossary"], sections["chapter"] + + +def normalize_block( + block_lines: list[str] | None, location, name: str +) -> list[str] | None: + if block_lines is None: + return None + if not any(line.strip() for line in block_lines): + warn(f":{name}: block is empty", location) + return None + return block_lines + + +def dedent_block(lines: list[str]) -> list[str]: + indents = [len(line) - len(line.lstrip(" ")) for line in lines if line.strip()] + indent = min(indents) if indents else 0 + return [line[indent:] if len(line) >= indent else "" for line in lines] + + +def parse_chapter_lines(directive, lines, source, line): + viewlist = StringList() + if line is None: + line = 0 + for offset, content in enumerate(lines): + viewlist.append(content, source, line + offset) + + container = nodes.container() + directive.state.nested_parse(viewlist, directive.content_offset, container) + return list(container.children) + + +def lines_after_marker(lines, marker, path, location): + for index, line in enumerate(lines): + if marker in line: + return lines[index + 1 :] + warn(f"start-after marker not found in {path}", location) + return lines + + +class GlossaryEntryCollector(EnvironmentCollector): + def clear_doc(self, app, env, docname): + storage = get_storage(env) + glossary_dp_storage = get_glossary_dp_storage(env) + for term, entry in list(storage.items()): + if entry.document == docname: + if entry.glossary_dp: + glossary_dp_storage.pop(entry.glossary_dp, None) + del storage[term] + + def merge_other(self, app, env, docnames, other): + current = get_storage(env) + current_glossary_dp = get_glossary_dp_storage(env) + other_storage = get_storage(other) + for entry in other_storage.values(): + if entry.document in docnames: + if entry.term in current: + warn( + f"duplicate glossary-entry for {entry.term}", + (entry.source, entry.line), + ) + current[entry.term] = entry + if entry.glossary_dp: + if entry.glossary_dp in current_glossary_dp: + warn( + f"duplicate glossary-dp for {entry.glossary_dp}", + (entry.source, entry.line), + ) + else: + current_glossary_dp[entry.glossary_dp] = entry.term + + def process_doc(self, app, doctree): + storage = get_storage(app.env) + glossary_dp_storage = get_glossary_dp_storage(app.env) + for node in doctree.findall(GlossaryEntryNode): + term = node["term"] + if term in storage: + warn( + f"duplicate glossary-entry for {term}", + (node.get("source"), node.get("line")), + ) + continue + + glossary_dp = node.glossary_dp + if glossary_dp: + if glossary_dp in glossary_dp_storage: + warn( + f"duplicate glossary-dp for {glossary_dp}", + (node.get("source"), node.get("line")), + ) + else: + glossary_dp_storage[glossary_dp] = term + + storage[term] = GlossaryEntryData( + term=term, + glossary_dp=glossary_dp, + kind=node["kind"], + propagate=node["propagate"], + glossary_lines=node.glossary_lines, + chapter_lines=node.chapter_lines, + document=app.env.docname, + source=node.get("source"), + line=node.get("line"), + ) + + +def get_storage(env): + key = "spec_glossary_entries" + if not hasattr(env, key): + setattr(env, key, {}) + return getattr(env, key) + + +def get_glossary_dp_storage(env): + key = "spec_glossary_dp_ids" + if not hasattr(env, key): + setattr(env, key, {}) + return getattr(env, key) + + +def normalize_glossary_dp(value: str | None, location): + if value is None: + return None, False + value = value.strip() + if not value: + warn(":glossary-dp: requires a value", location) + return None, True + if not GLOSSARY_DP_RE.fullmatch(value): + warn( + f"invalid :glossary-dp: {value} (expected fls_ + [A-Za-z0-9_]+)", + location, + ) + return None, True + return value, False + + +def select_glossary_block(entry: GlossaryEntryData) -> list[str] | None: + if entry.glossary_lines is not None: + return entry.glossary_lines + if entry.chapter_lines is not None and entry.propagate: + return entry.chapter_lines + return None + + +SPLIT_NUMBERS = re.compile(r"([0-9]+)") + + +def natural_sort_key(term: str) -> list[object]: + return [ + int(fragment) if fragment.isdigit() else fragment.casefold() + for fragment in SPLIT_NUMBERS.split(term) + ] + + +def trim_trailing_blanks(lines: list[str]) -> list[str]: + trimmed = list(lines) + while trimmed and trimmed[-1].strip() == "": + trimmed.pop() + return trimmed + + +def render_glossary_entry( + term: str, glossary_dp: str, body_lines: list[str] +) -> list[str]: + heading = "^" * len(term) + body = list(body_lines) + if not body or body[-1].strip() != "": + body.append("") + return [ + f".. _{glossary_dp}:", + "", + term, + heading, + "", + *body, + ] + + +def visit_glossary_entry_node(self, node): + raise nodes.SkipNode + + +def depart_glossary_entry_node(self, node): + pass + + +def warn(message, location): + logger = logging.getLogger(__name__) + logger.warning(message, location=location) + + +def setup(app): + app.add_node( + GlossaryEntryNode, + html=(visit_glossary_entry_node, depart_glossary_entry_node), + latex=(visit_glossary_entry_node, depart_glossary_entry_node), + text=(visit_glossary_entry_node, depart_glossary_entry_node), + man=(visit_glossary_entry_node, depart_glossary_entry_node), + texinfo=(visit_glossary_entry_node, depart_glossary_entry_node), + xml=(visit_glossary_entry_node, depart_glossary_entry_node), + ) + app.add_env_collector(GlossaryEntryCollector) diff --git a/generate-glossary-entry.py b/generate-glossary-entry.py new file mode 100644 index 00000000..5eb31b62 --- /dev/null +++ b/generate-glossary-entry.py @@ -0,0 +1,403 @@ +#!/usr/bin/env -S uv run +# SPDX-License-Identifier: MIT OR Apache-2.0 +# SPDX-FileCopyrightText: The Ferrocene Developers + +from __future__ import annotations + +import argparse +from dataclasses import dataclass +from pathlib import Path +import re +import sys + +DP_RE = re.compile(r":dp:`(?P[^`]+)`") +GLOSSARY_DP_RE = re.compile(r"^fls_[A-Za-z0-9]+$") + +DIRECTIVE_INDENT = 3 +CONTENT_INDENT = 5 + + +@dataclass +class GlossaryStaticEntry: + term: str + glossary_dp: str + body_lines: list[str] + + +@dataclass +class EntryHeader: + start: int + term: str + header_end: int + glossary_dp: str + + +def main() -> int: + parser = argparse.ArgumentParser( + description="Generate a formatted glossary-entry directive for a term." + ) + parser.add_argument("--term", required=True, help="Glossary term") + parser.add_argument("--repo-root", default=".", help="Repo root directory") + parser.add_argument( + "--glossary", + default="build/generated.glossary.rst", + help="Glossary source file (defaults to generated glossary)", + ) + parser.add_argument( + "--glossary-dp", + help="Glossary :glossary-dp: id (fls_ + [A-Za-z0-9]+)", + ) + parser.add_argument( + "--glossary-line", + action="append", + default=[], + help="Glossary text line (repeatable)", + ) + parser.add_argument( + "--glossary-text-file", + help="File with glossary body lines", + ) + parser.add_argument( + "--glossary-stdin", + action="store_true", + help="Read glossary body lines from stdin", + ) + parser.add_argument("--chapter-file", help="Chapter file to extract from") + parser.add_argument( + "--chapter-dp", + action="append", + default=[], + help="Chapter :dp: ids to extract (repeatable)", + ) + parser.add_argument( + "--chapter-line", + action="append", + default=[], + help="Chapter text line (repeatable)", + ) + parser.add_argument( + "--chapter-text-file", + help="File with chapter body lines", + ) + parser.add_argument( + "--chapter-stdin", + action="store_true", + help="Read chapter body lines from stdin", + ) + args = parser.parse_args() + + repo_root = Path(args.repo_root).resolve() + glossary_path = repo_root / args.glossary + + needs_static = ( + not has_manual_lines( + args.glossary_line, args.glossary_text_file, args.glossary_stdin + ) + or args.glossary_dp is None + ) + static_entries = None + if needs_static: + if not glossary_path.is_file(): + print( + "error: missing glossary file at " + f"{glossary_path}; run ./generate-glossary.py or pass glossary text", + file=sys.stderr, + ) + return 1 + static_entries = parse_glossary_static(glossary_path) + + glossary_lines = resolve_block_lines( + static_entries, + glossary_path, + args.term, + args.glossary_line, + args.glossary_text_file, + args.glossary_stdin, + ) + if not glossary_lines: + print("error: glossary lines are empty", file=sys.stderr) + return 1 + + glossary_dp = resolve_glossary_dp(args.glossary_dp, args.term, static_entries) + + chapter_lines = resolve_chapter_lines( + repo_root, + args.chapter_file, + args.chapter_dp, + args.chapter_line, + args.chapter_text_file, + args.chapter_stdin, + ) + + output_lines = render_entry(args.term, glossary_dp, glossary_lines, chapter_lines) + print("\n".join(output_lines)) + return 0 + + +def resolve_block_lines( + static_entries: dict[str, GlossaryStaticEntry] | None, + glossary_path: Path, + term: str, + line_args: list[str], + text_file: str | None, + stdin_flag: bool, +) -> list[str]: + manual_lines = load_manual_lines(line_args, text_file, stdin_flag, "glossary") + if manual_lines is not None: + return trim_trailing_blanks(manual_lines) + + if static_entries is None: + print( + "error: glossary text not provided and glossary source is unavailable; " + f"run ./generate-glossary.py (expected {glossary_path})", + file=sys.stderr, + ) + raise SystemExit(1) + entry = static_entries.get(term) + if entry is None: + print(f"error: term not found in glossary: {term}", file=sys.stderr) + raise SystemExit(1) + return trim_trailing_blanks(entry.body_lines) + + +def has_manual_lines( + line_args: list[str], text_file: str | None, stdin_flag: bool +) -> bool: + return bool(line_args) or bool(text_file) or stdin_flag + + +def resolve_glossary_dp( + glossary_dp: str | None, + term: str, + static_entries: dict[str, GlossaryStaticEntry] | None, +) -> str: + if glossary_dp is not None: + glossary_dp = glossary_dp.strip() + if not glossary_dp: + print("error: --glossary-dp requires a value", file=sys.stderr) + raise SystemExit(1) + if not GLOSSARY_DP_RE.fullmatch(glossary_dp): + print( + "error: --glossary-dp must match fls_ + [A-Za-z0-9]+", + file=sys.stderr, + ) + raise SystemExit(1) + return glossary_dp + + if static_entries is None: + print( + "error: --glossary-dp is required when glossary source is unavailable", + file=sys.stderr, + ) + raise SystemExit(1) + entry = static_entries.get(term) + if entry is None: + print(f"error: term not found in glossary: {term}", file=sys.stderr) + raise SystemExit(1) + return entry.glossary_dp + + +def resolve_chapter_lines( + repo_root: Path, + chapter_file: str | None, + chapter_dp: list[str], + line_args: list[str], + text_file: str | None, + stdin_flag: bool, +) -> list[str] | None: + manual_lines = load_manual_lines(line_args, text_file, stdin_flag, "chapter") + if manual_lines is not None: + return trim_trailing_blanks(manual_lines) + + if chapter_file is None and not chapter_dp: + return None + if chapter_file is None or not chapter_dp: + print( + "error: --chapter-file and --chapter-dp must be provided together", + file=sys.stderr, + ) + raise SystemExit(1) + + path = (repo_root / chapter_file).resolve() + if not path.is_file(): + print(f"error: missing chapter file at {path}", file=sys.stderr) + raise SystemExit(1) + + lines = read_lines(path) + blocks: list[str] = [] + for dp_id in chapter_dp: + start = find_dp_line_index(lines, dp_id) + if start is None: + print(f"error: :dp: {dp_id} not found in {chapter_file}", file=sys.stderr) + raise SystemExit(1) + end = find_block_end(lines, start) + blocks.extend(dedent_block(lines[start:end])) + return trim_trailing_blanks(blocks) + + +def load_manual_lines( + line_args: list[str], + text_file: str | None, + stdin_flag: bool, + label: str, +) -> list[str] | None: + sources = [bool(line_args), bool(text_file), stdin_flag] + if sum(sources) > 1: + print(f"error: multiple {label} sources provided", file=sys.stderr) + raise SystemExit(1) + if line_args: + return list(line_args) + if text_file: + return read_lines(Path(text_file)) + if stdin_flag: + return sys.stdin.read().splitlines() + return None + + +def render_entry( + term: str, + glossary_dp: str, + glossary_lines: list[str], + chapter_lines: list[str] | None, +) -> list[str]: + output: list[str] = [ + f".. glossary-entry:: {term}", + " " * DIRECTIVE_INDENT + f":glossary-dp: {glossary_dp}", + " " * DIRECTIVE_INDENT, + ] + output.append(" " * DIRECTIVE_INDENT + ":glossary:") + output.extend(indent_block(glossary_lines, CONTENT_INDENT)) + if chapter_lines is not None: + output.append(" " * DIRECTIVE_INDENT + ":chapter:") + output.extend(indent_block(chapter_lines, CONTENT_INDENT)) + return output + + +def indent_block(lines: list[str], indent: int) -> list[str]: + prefix = " " * indent + output: list[str] = [] + for line in lines: + if line == "": + output.append(prefix) + else: + output.append(prefix + line) + return output + + +def dedent_block(lines: list[str]) -> list[str]: + indents = [len(line) - len(line.lstrip(" ")) for line in lines if line.strip()] + indent = min(indents) if indents else 0 + return [line[indent:] if len(line) >= indent else "" for line in lines] + + +def find_dp_line_index(lines: list[str], dp_id: str) -> int | None: + target = f":dp:`{dp_id}`" + for index, line in enumerate(lines): + if target in line: + return index + return None + + +def find_block_end(lines: list[str], start_index: int) -> int: + index = start_index + 1 + while index < len(lines): + if index != start_index and is_dp_line(lines[index]): + break + index += 1 + return index + + +def is_dp_line(line: str) -> bool: + stripped = line.lstrip() + if stripped.startswith("* - "): + stripped = stripped[4:] + elif stripped.startswith("* "): + stripped = stripped[2:] + elif stripped.startswith("- "): + stripped = stripped[2:] + elif stripped.startswith("#. "): + stripped = stripped[3:] + return stripped.startswith(":dp:`") + + +def parse_glossary_static(path: Path) -> dict[str, GlossaryStaticEntry]: + lines = read_lines(path) + headers: list[EntryHeader] = [] + for index in range(len(lines)): + header = parse_entry_header(lines, index) + if header is not None: + headers.append(header) + + entries: dict[str, GlossaryStaticEntry] = {} + glossary_dps: set[str] = set() + for pos, header in enumerate(headers): + next_start = headers[pos + 1].start if pos + 1 < len(headers) else len(lines) + body_lines = trim_trailing_blanks(lines[header.header_end : next_start]) + if header.term in entries: + print(f"error: duplicate term in glossary: {header.term}", file=sys.stderr) + raise SystemExit(1) + if header.glossary_dp in glossary_dps: + print( + f"error: duplicate glossary anchor in glossary: {header.glossary_dp}", + file=sys.stderr, + ) + raise SystemExit(1) + glossary_dps.add(header.glossary_dp) + entries[header.term] = GlossaryStaticEntry( + term=header.term, + glossary_dp=header.glossary_dp, + body_lines=body_lines, + ) + return entries + + +def parse_entry_header(lines: list[str], index: int) -> EntryHeader | None: + line = lines[index] + if not line.startswith(".. _fls_"): + return None + + anchor = line.strip().removeprefix(".. _").removesuffix(":") + if not anchor: + return None + + cursor = index + 1 + while cursor < len(lines) and lines[cursor].strip() == "": + cursor += 1 + if cursor + 1 >= len(lines): + return None + + title = lines[cursor] + underline = lines[cursor + 1] + if not is_caret_underline(underline): + return None + + header_end = cursor + 2 + if header_end < len(lines) and lines[header_end].strip() == "": + header_end += 1 + + return EntryHeader( + start=index, + term=title.strip(), + header_end=header_end, + glossary_dp=anchor, + ) + + +def is_caret_underline(line: str) -> bool: + stripped = line.strip() + return bool(stripped) and set(stripped) == {"^"} + + +def trim_trailing_blanks(lines: list[str]) -> list[str]: + trimmed = list(lines) + while trimmed and trimmed[-1].strip() == "": + trimmed.pop() + return trimmed + + +def read_lines(path: Path) -> list[str]: + return path.read_text(encoding="utf-8").splitlines() + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/generate-glossary.py b/generate-glossary.py new file mode 100755 index 00000000..5679cc1e --- /dev/null +++ b/generate-glossary.py @@ -0,0 +1,208 @@ +#!/usr/bin/env -S uv run +# SPDX-License-Identifier: MIT OR Apache-2.0 +# SPDX-FileCopyrightText: The Ferrocene Developers + +from __future__ import annotations + +import argparse +from dataclasses import dataclass +from pathlib import Path +import sys + +from sphinx.application import Sphinx + +ROOT = Path(__file__).resolve().parent +GLOSSARY_ANCHOR = ".. _fls_bc2qwbfibrcs:" + + +def load_glossary_ext(): + exts_path = str(ROOT / "exts") + if exts_path not in sys.path: + sys.path.append(exts_path) + from ferrocene_spec import glossary as glossary_ext + + return glossary_ext + + +@dataclass +class GlossaryPrelude: + lines: list[str] + trailing_newline: bool + + +def main() -> int: + parser = argparse.ArgumentParser() + parser.add_argument("--src", default="src", help="Source directory") + parser.add_argument( + "--prelude", + default="src/glossary.prelude.rst.inc", + help="Glossary prelude file", + ) + parser.add_argument( + "--output", + default="build/generated.glossary.rst", + help="Generated glossary output file", + ) + parser.add_argument( + "-t", + "--tag", + action="append", + default=[], + help="Sphinx tag (repeatable)", + ) + args = parser.parse_args() + + src_dir = (ROOT / args.src).resolve() + prelude_path = (ROOT / args.prelude).resolve() + output_path = (ROOT / args.output).resolve() + + if not prelude_path.is_file(): + print(f"error: missing glossary prelude at {prelude_path}", file=sys.stderr) + return 1 + + prelude = load_prelude(prelude_path) + output_path.parent.mkdir(parents=True, exist_ok=True) + + tags = list(dict.fromkeys(args.tag)) + write_lines(output_path, prelude.lines, prelude.trailing_newline) + + glossary_ext = load_glossary_ext() + app = build_sphinx_app(src_dir, ROOT, tags) + entries = list(glossary_ext.get_storage(app.env).values()) + + exported = [] + glossary_dp_index: dict[str, str] = {} + errors: list[str] = [] + + for entry in entries: + block = glossary_ext.select_glossary_block(entry) + if block is None: + if entry.chapter_lines is not None and not entry.propagate: + warn( + entry.source, + entry.line, + f"glossary-entry for {entry.term} not exported", + ) + continue + + if entry.glossary_dp is None: + errors.append(f"missing :glossary-dp: for {entry.term}") + continue + + existing = glossary_dp_index.get(entry.glossary_dp) + if existing is not None: + errors.append( + "duplicate :glossary-dp: " + f"{entry.glossary_dp} for {entry.term} and {existing}" + ) + continue + + glossary_dp_index[entry.glossary_dp] = entry.term + exported.append((entry, block)) + + if errors: + for message in errors: + print(f"error: {message}", file=sys.stderr) + return 1 + + exported.sort( + key=lambda item: (glossary_ext.natural_sort_key(item[0].term), item[0].term) + ) + + output_lines = list(prelude.lines) + for entry, block in exported: + output_lines.extend( + glossary_ext.render_glossary_entry(entry.term, entry.glossary_dp, block) + ) + output_lines = glossary_ext.trim_trailing_blanks(output_lines) + + write_lines(output_path, output_lines, prelude.trailing_newline) + + return 0 + + +def build_sphinx_app(src_dir: Path, root: Path, tags: list[str]) -> Sphinx: + build_dir = root / "build" / "glossary-env" + out_dir = build_dir / "out" + doctree_dir = build_dir / "doctrees" + out_dir.mkdir(parents=True, exist_ok=True) + doctree_dir.mkdir(parents=True, exist_ok=True) + + app = Sphinx( + srcdir=str(src_dir), + confdir=str(src_dir), + outdir=str(out_dir), + doctreedir=str(doctree_dir), + buildername="dummy", + status=sys.stdout, + warning=sys.stderr, + freshenv=True, + warningiserror=False, + ) + for tag in tags: + app.tags.add(tag) + app.build(force_all=True) + return app + + +def load_prelude(prelude_path: Path) -> GlossaryPrelude: + lines, trailing_newline = read_lines(prelude_path) + try: + anchor_index = lines.index(GLOSSARY_ANCHOR) + except ValueError: + print( + f"error: glossary anchor {GLOSSARY_ANCHOR} not found in {prelude_path}", + file=sys.stderr, + ) + raise SystemExit(1) + + cursor = anchor_index + 1 + while cursor < len(lines) and lines[cursor].strip() == "": + cursor += 1 + if cursor + 1 >= len(lines): + print(f"error: glossary title missing in {prelude_path}", file=sys.stderr) + raise SystemExit(1) + + title = lines[cursor].strip() + if not title: + print(f"error: glossary title missing in {prelude_path}", file=sys.stderr) + raise SystemExit(1) + + after = cursor + 2 + while after < len(lines) and lines[after].strip() == "": + after += 1 + + prelude: list[str] = [] + prelude.extend(lines[:anchor_index]) + prelude.append(lines[anchor_index]) + prelude.extend(lines[anchor_index + 1 : cursor]) + prelude.append(title) + prelude.append("=" * len(title)) + prelude.extend(lines[cursor + 2 : after]) + if not prelude or prelude[-1].strip() != "": + prelude.append("") + return GlossaryPrelude(lines=prelude, trailing_newline=trailing_newline) + + +def read_lines(path: Path) -> tuple[list[str], bool]: + data = path.read_text(encoding="utf-8") + return data.splitlines(), data.endswith("\n") + + +def write_lines(path: Path, lines: list[str], trailing_newline: bool) -> None: + path.parent.mkdir(parents=True, exist_ok=True) + text = "\n".join(lines) + if trailing_newline: + text += "\n" + path.write_text(text, encoding="utf-8") + + +def warn(source: str | None, line: int | None, message: str) -> None: + location = "" + if source and line: + location = f"{source}:{line}: " + print(f"warning: {location}{message}", file=sys.stderr) + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/make.py b/make.py index 5fec3818..71af892f 100755 --- a/make.py +++ b/make.py @@ -4,17 +4,108 @@ # SPDX-FileCopyrightText: The Rust Project Contributors import os +import sys from pathlib import Path import argparse +import shlex import subprocess import shutil +import threading +import time # Automatically watch the following extra directories when --serve is used. EXTRA_WATCH_DIRS = ["exts", "themes"] -def build_docs(root, builder, clear, serve, debug): +def run_with_log(command, log_path): + log_path.parent.mkdir(parents=True, exist_ok=True) + command = [str(part) for part in command] + with log_path.open("w", encoding="utf-8") as log_file: + process = subprocess.Popen( + command, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + text=True, + ) + try: + assert process.stdout is not None + for line in process.stdout: + sys.stdout.write(line) + sys.stdout.flush() + log_file.write(line) + return process.wait() + except KeyboardInterrupt: + process.terminate() + process.wait() + raise + + +def generate_glossary_command(root, tags): + command = [sys.executable, str(root / "generate-glossary.py")] + for tag in tags: + command += ["-t", tag] + return command + + +def run_generate_glossary(root, tags): + subprocess.run(generate_glossary_command(root, tags), check=True) + + +def supports_pre_build(): + try: + result = subprocess.run( + ["sphinx-autobuild", "--help"], + check=True, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + text=True, + ) + except (FileNotFoundError, subprocess.CalledProcessError): + return False + return "--pre-build" in result.stdout + + +def iter_glossary_sources(root): + src_dir = root / "src" + yield from src_dir.rglob("*.rst") + yield from src_dir.rglob("*.rst.inc") + + +def snapshot_glossary_sources(root): + snapshot = {} + for path in iter_glossary_sources(root): + try: + snapshot[path] = path.stat().st_mtime + except FileNotFoundError: + continue + return snapshot + + +def start_glossary_watcher(root, tags, stamp_path, stop_event): + def watcher(): + previous = snapshot_glossary_sources(root) + while not stop_event.is_set(): + time.sleep(0.5) + current = snapshot_glossary_sources(root) + if current == previous: + continue + previous = current + try: + run_generate_glossary(root, tags) + stamp_path.touch() + except subprocess.CalledProcessError: + print( + "warning: glossary generator failed during serve", file=sys.stderr + ) + + thread = threading.Thread(target=watcher, daemon=True) + thread.start() + return thread + + +def build_docs(root, builder, clear, serve, debug, tags): dest = root / "build" + dest.mkdir(parents=True, exist_ok=True) output_dir = dest / builder args = ["-b", builder, "-d", dest / "doctrees"] @@ -33,6 +124,8 @@ def build_docs(root, builder, clear, serve, debug): shutil.rmtree(output_dir) # Using a fresh environment args.append("-E") + for tag in tags: + args += ["-t", tag] if serve: for extra_watch_dir in EXTRA_WATCH_DIRS: extra_watch_dir = root / extra_watch_dir @@ -46,19 +139,46 @@ def build_docs(root, builder, clear, serve, debug): if commit is not None: args += ["-D", f"html_theme_options.commit={commit}"] + run_generate_glossary(root, tags) + + watcher_thread = None + watcher_stop = None + if serve: + pre_build_command = shlex.join(generate_glossary_command(root, tags)) + if supports_pre_build(): + args += ["--pre-build", pre_build_command] + else: + stamp_dir = dest / "glossary-watch" + stamp_dir.mkdir(parents=True, exist_ok=True) + stamp_path = stamp_dir / "glossary.stamp" + stamp_path.touch() + args += ["--watch", stamp_dir] + watcher_stop = threading.Event() + watcher_thread = start_glossary_watcher( + root, tags, stamp_path, watcher_stop + ) + + log_path = dest / "sphinx-build.log" try: - subprocess.run( + returncode = run_with_log( [ "sphinx-autobuild" if serve else "sphinx-build", *args, root / "src", output_dir, ], - check=True, + log_path, ) except KeyboardInterrupt: + if watcher_stop is not None: + watcher_stop.set() exit(1) - except subprocess.CalledProcessError: + finally: + if watcher_stop is not None: + watcher_stop.set() + if watcher_thread is not None: + watcher_thread.join() + if returncode != 0: print("\nhint: if you see an exception, pass --debug to see the full traceback") exit(1) @@ -142,10 +262,24 @@ def main(root): help="Debug mode for the extensions, showing exceptions", action="store_true", ) + parser.add_argument( + "-t", + "--tag", + action="append", + default=[], + help="Sphinx tag (repeatable)", + ) args = parser.parse_args() + tags = list(dict.fromkeys(args.tag)) + rendered = build_docs( - root, "xml" if args.xml else "html", args.clear, args.serve, args.debug + root, + "xml" if args.xml else "html", + args.clear, + args.serve, + args.debug, + tags, ) if args.check_links: diff --git a/src/associated-items.rst b/src/associated-items.rst index 36792aa0..a6990bb4 100644 --- a/src/associated-items.rst +++ b/src/associated-items.rst @@ -24,21 +24,91 @@ Associated Items .. rubric:: Legality Rules -:dp:`fls_ckzd25qd213t` -An :t:`associated item` is an :t:`item` that appears within an -:t:`implementation` or a :t:`trait`. - -:dp:`fls_5y6ae0xqux57` -An :t:`associated constant` is a :t:`constant` that appears as an -:t:`associated item`. - -:dp:`fls_lj7492aq7fzo` -An :t:`associated function` is a :t:`function` that appears as an -:t:`associated item`. - -:dp:`fls_8cz4rdrklaj4` -An :t:`associated type` is a :t:`type alias` that appears as an -:t:`associated item`. +.. glossary-entry:: associated item + :glossary-dp: fls_f3ferow5ugp + + :glossary: + :dp:`fls_o5ysjk7l91ni` + An :dt:`associated item` is an :t:`item` that appears within an + :t:`implementation` or a :t:`trait`. + + :dp:`fls_44vtqu7tvhi2` + See :s:`AssociatedItem`. + :chapter: + :dp:`fls_ckzd25qd213t` + An :t:`associated item` is an :t:`item` that appears within an + :t:`implementation` or a :t:`trait`. + +.. glossary-entry:: associated constant + :glossary-dp: fls_pjb22ylz5swp + + :glossary: + :dp:`fls_hi9qa0k2nujb` + An :dt:`associated constant` is a :t:`constant` that appears as an + :t:`associated item`. + :chapter: + :dp:`fls_5y6ae0xqux57` + An :t:`associated constant` is a :t:`constant` that appears as an + :t:`associated item`. + +.. glossary-entry:: incomplete associated constant + :glossary-dp: fls_j44ow2k5va3s + + :glossary: + :dp:`fls_bq48gl84bul0` + An :dt:`incomplete associated constant` is an :t:`associated constant` without + a :t:`constant initializer`. + +.. glossary-entry:: associated function + :glossary-dp: fls_vxiitesidcc2 + + :glossary: + :dp:`fls_zcy5pat39bq7` + An :dt:`associated function` is a :t:`function` that appears as an + :t:`associated item`. + :chapter: + :dp:`fls_lj7492aq7fzo` + An :t:`associated function` is a :t:`function` that appears as an + :t:`associated item`. + +.. glossary-entry:: incomplete associated function + :glossary-dp: fls_ga2n4nbm1pkk + + :glossary: + :dp:`fls_iboondra204w` + An :dt:`incomplete associated function` is an :t:`associated function` without + a :t:`function body`. + +.. glossary-entry:: associated type + :glossary-dp: fls_zfs68g3yk0uw + + :glossary: + :dp:`fls_rs0n72c2d8f` + An :dt:`associated type` is a :t:`type alias` that appears as an + :t:`associated item`. + :chapter: + :dp:`fls_8cz4rdrklaj4` + An :t:`associated type` is a :t:`type alias` that appears as an + :t:`associated item`. + +.. glossary-entry:: incomplete associated type + :glossary-dp: fls_n99acc2tr9qm + + :glossary: + :dp:`fls_tka0gth8rc9x` + An :dt:`incomplete associated type` is an :t:`associated type` without an + :t:`initialization type`. + +.. glossary-entry:: initialization type + :glossary-dp: fls_pd30dl2envjn + + :glossary: + :dp:`fls_crn87nne7k38` + An :dt:`initialization type` is the :t:`type` a :t:`type alias` defines a + :t:`name` for. + + :dp:`fls_3r85y1lh1oxo` + See :s:`InitializationType`. :dp:`fls_w8nu8suy7t5` An :t:`associated type` shall not be used in the :t:`path expression` of a @@ -48,9 +118,17 @@ An :t:`associated type` shall not be used in the :t:`path expression` of a An :t:`associated type` with a :s:`TypeBoundList` shall appear only as an :t:`associated trait type`. -:dp:`fls_PeD0DzjK57be` -A :t:`generic associated type` is an :t:`associated type` with -:t:`[generic parameter]s`. +.. glossary-entry:: generic associated type + :glossary-dp: fls_nooYIxMnV8Ps + + :glossary: + :dp:`fls_O4wckPZPmree` + A :dt:`generic associated type` is an :t:`associated type` with + :t:`[generic parameter]s`. + :chapter: + :dp:`fls_PeD0DzjK57be` + A :t:`generic associated type` is an :t:`associated type` with + :t:`[generic parameter]s`. :dp:`fls_3foYUch29ZtF` A :t:`lifetime parameter` of a :t:`generic associated type` requires a @@ -69,43 +147,99 @@ or :c:`Self` and ``'lifetime`` is the :t:`lifetime parameter`, when * :dp:`fls_AtItgS1UvwiX` The intersection of all such uses is not empty. -:dp:`fls_l3iwn56n1uz8` -An :t:`associated implementation constant` is an :t:`associated constant` that -appears within an :t:`implementation`. +.. glossary-entry:: associated implementation constant + :glossary-dp: fls_9mcx6h6irrlx + + :glossary: + :dp:`fls_rfaxcrrrb5q9` + An :dt:`associated implementation constant` is an :t:`associated constant` that + appears within an :t:`implementation`. + :chapter: + :dp:`fls_l3iwn56n1uz8` + An :t:`associated implementation constant` is an :t:`associated constant` that + appears within an :t:`implementation`. :dp:`fls_4ftfefcotb4g` An :t:`associated implementation constant` shall have a :t:`constant initializer`. -:dp:`fls_qb5qpfe0uwk` -An :t:`associated implementation function` is an :t:`associated function` that -appears within an :t:`implementation`. +.. glossary-entry:: associated implementation function + :glossary-dp: fls_n85fwe75ku60 + + :glossary: + :dp:`fls_7xbmvl3jrc27` + An :dt:`associated implementation function` is an :t:`associated function` that + appears within an :t:`implementation`. + :chapter: + :dp:`fls_qb5qpfe0uwk` + An :t:`associated implementation function` is an :t:`associated function` that + appears within an :t:`implementation`. :dp:`fls_1zlkeb6fz10j` An :t:`associated implementation function` shall have a :t:`function body`. -:dp:`fls_tw8u0cc5867l` -An :t:`associated implementation type` is an :t:`associated type` that appears -within an :t:`implementation`. +.. glossary-entry:: associated implementation type + :glossary-dp: fls_c0hekhwpznyq + + :glossary: + :dp:`fls_6g5t81gx9ayx` + An :dt:`associated implementation type` is an :t:`associated type` that appears + within an :t:`implementation`. + :chapter: + :dp:`fls_tw8u0cc5867l` + An :t:`associated implementation type` is an :t:`associated type` that appears + within an :t:`implementation`. :dp:`fls_bx7931x4155h` An :t:`associated implementation type` shall have an :t:`initialization type`. -:dp:`fls_bnTcCbDvdp94` -An :t:`associated trait item` is an :t:`associated item` that appears -within a :t:`trait`. - -:dp:`fls_N3cdn4lCZ2Bf` -An :t:`associated trait implementation item` is an :t:`associated item` that -appears within a :t:`trait implementation`. - -:dp:`fls_x564isbhobym` -An :t:`associated trait constant` is an :t:`associated constant` that appears -within a :t:`trait`. - -:dp:`fls_b6nns7oqvdpm` -An :t:`associated trait function` is an :t:`associated function` that appears -within a :t:`trait`. +.. glossary-entry:: associated trait item + :glossary-dp: fls_J946yIcmlAyV + + :glossary: + :dp:`fls_IlRrVLm05GTf` + An :dt:`associated trait item` is an :t:`associated item` that appears + within a :t:`trait`. + :chapter: + :dp:`fls_bnTcCbDvdp94` + An :t:`associated trait item` is an :t:`associated item` that appears + within a :t:`trait`. + +.. glossary-entry:: associated trait implementation item + :glossary-dp: fls_47xtji9Pk8Lw + + :glossary: + :dp:`fls_PaENehzTVgfB` + An :dt:`associated trait implementation item` is an :t:`associated item` that + appears within a :t:`trait implementation`. + :chapter: + :dp:`fls_N3cdn4lCZ2Bf` + An :t:`associated trait implementation item` is an :t:`associated item` that + appears within a :t:`trait implementation`. + +.. glossary-entry:: associated trait constant + :glossary-dp: fls_8p8teeamua55 + + :glossary: + :dp:`fls_xhhsej8db74y` + An :dt:`associated trait constant` is an :t:`associated constant` that appears + within a :t:`trait`. + :chapter: + :dp:`fls_x564isbhobym` + An :t:`associated trait constant` is an :t:`associated constant` that appears + within a :t:`trait`. + +.. glossary-entry:: associated trait function + :glossary-dp: fls_4h7s8u1zumnq + + :glossary: + :dp:`fls_r927r0pdkb6h` + An :dt:`associated trait function` is an :t:`associated function` that appears + within a :t:`trait`. + :chapter: + :dp:`fls_b6nns7oqvdpm` + An :t:`associated trait function` is an :t:`associated function` that appears + within a :t:`trait`. :dp:`fls_2TRwCz38kuRz` An :t:`associated trait function` shall not be subject to :t:`keyword` ``const``. @@ -115,9 +249,17 @@ Every occurrence of an :t:`impl trait type` in the :t:`return type` of an :t:`associated trait function` is equivalent to referring to a new anonymous :t:`associated trait type` of the :t:`implemented trait`. -:dp:`fls_yyhebj4qyk34` -An :t:`associated trait type` is an :t:`associated type` that appears within -a :t:`trait`. +.. glossary-entry:: associated trait type + :glossary-dp: fls_azz308k3ra99 + + :glossary: + :dp:`fls_dndsgkiq9r7i` + An :dt:`associated trait type` is an :t:`associated type` that appears within + a :t:`trait`. + :chapter: + :dp:`fls_yyhebj4qyk34` + An :t:`associated trait type` is an :t:`associated type` that appears within + a :t:`trait`. :dp:`fls_kl9p3ycl5mzf` An :t:`associated trait type` shall not have an :t:`initialization type`. @@ -144,9 +286,17 @@ is equivalent to a :t:`where clause` of the following form: type X; } -:dp:`fls_amWtS80fPtza` -An :t:`associated trait implementation function` is an :t:`associated function` -that appears within a :t:`trait implementation`. +.. glossary-entry:: associated trait implementation function + :glossary-dp: fls_fufF4UmzLg5G + + :glossary: + :dp:`fls_bzdXloUGlVSC` + An :dt:`associated trait implementation function` is an :t:`associated function` + that appears within a :t:`trait implementation`. + :chapter: + :dp:`fls_amWtS80fPtza` + An :t:`associated trait implementation function` is an :t:`associated function` + that appears within a :t:`trait implementation`. :dp:`fls_Cu8FWrisrqz1` Every occurrence of an :t:`impl trait type` in the :t:`return type` of an @@ -154,8 +304,15 @@ Every occurrence of an :t:`impl trait type` in the :t:`return type` of an corresponding :t:`associated trait type` of the corresponding :t:`associated trait function`. -:dp:`fls_oy92gzxgc273` -A :t:`method` is an :t:`associated function` with a :t:`self parameter`. +.. glossary-entry:: method + :glossary-dp: fls_bi3g8xkk9ekf + + :glossary: + :dp:`fls_n4opbiofu9q6` + A :dt:`method` is an :t:`associated function` with a :t:`self parameter`. + :chapter: + :dp:`fls_oy92gzxgc273` + A :t:`method` is an :t:`associated function` with a :t:`self parameter`. :dp:`fls_WXnCWfJGoQx3` The type of a :t:`self parameter` shall be one of the following: diff --git a/src/attributes.rst b/src/attributes.rst index 52f3f5b3..f32883c1 100644 --- a/src/attributes.rst +++ b/src/attributes.rst @@ -43,21 +43,62 @@ Attributes .. rubric:: Legality Rules -:dp:`fls_rnzxj1t0hehl` -An :t:`attribute` is a general, free-form metadatum that is interpreted based on -its :t:`name`, convention, language, and tool. - -:dp:`fls_yd0ehw5csaur` -An :t:`inner attribute` is an :t:`attribute` that applies to an enclosing -:t:`item`. - -:dp:`fls_8o6vmzbw1b1j` -An :t:`outer attribute` is an :t:`attribute` that applies to a subsequent -:t:`item`. - -:dp:`fls_9TMRVlQwAdTB` -An :t:`attribute content` is a :t:`construct` that provides the content of -an :t:`attribute`. +.. glossary-entry:: attribute + :glossary-dp: fls_w1plocebd7kg + + :glossary: + :dp:`fls_o74rfpe6zo6a` + An :dt:`attribute` is a general, free-form metadatum that is interpreted based + on its name, convention, language, and tool. + :chapter: + :dp:`fls_rnzxj1t0hehl` + An :t:`attribute` is a general, free-form metadatum that is interpreted based on + its :t:`name`, convention, language, and tool. + +.. glossary-entry:: inner attribute + :glossary-dp: fls_joxepyv84ajz + + :glossary: + :dp:`fls_l7kxkav42l5d` + An :dt:`inner attribute` is an :t:`attribute` that applies to an enclosing + :t:`item`. + + :dp:`fls_umkk8xwktat1` + See :s:`InnerAttribute`. + :chapter: + :dp:`fls_yd0ehw5csaur` + An :t:`inner attribute` is an :t:`attribute` that applies to an enclosing + :t:`item`. + +.. glossary-entry:: outer attribute + :glossary-dp: fls_gllzixm9yt9w + + :glossary: + :dp:`fls_gffxnbilsqly` + An :dt:`outer attribute` is an :t:`attribute` that applies to a subsequent + :t:`item`. + + :dp:`fls_ty6ihy6x3kf` + See :s:`OuterAttribute`. + :chapter: + :dp:`fls_8o6vmzbw1b1j` + An :t:`outer attribute` is an :t:`attribute` that applies to a subsequent + :t:`item`. + +.. glossary-entry:: attribute content + :glossary-dp: fls_SsMRqkHLDAgG + + :glossary: + :dp:`fls_sn0GvVmM3o38` + An :dt:`attribute content` is a :t:`construct` that provides the content of + an :t:`attribute`. + + :dp:`fls_YwyrWC8fcmRm` + See :s:`AttributeContent`. + :chapter: + :dp:`fls_9TMRVlQwAdTB` + An :t:`attribute content` is a :t:`construct` that provides the content of + an :t:`attribute`. .. rubric:: Examples @@ -77,13 +118,29 @@ Attribute Properties .. rubric:: Legality Rules -:dp:`fls_p4potvq7x532` -An :t:`active attribute` is an :t:`attribute` that is removed from the :t:`item` -it decorates. - -:dp:`fls_xk7lb2g02sy7` -An :t:`inert attribute` is an :t:`attribute` that remains with the :t:`item` -it decorates. +.. glossary-entry:: active attribute + :glossary-dp: fls_5fu0ncvnjyna + + :glossary: + :dp:`fls_r8rzj8mtxtp1` + An :dt:`active attribute` is an :t:`attribute` that is removed from the + :t:`item` it decorates. + :chapter: + :dp:`fls_p4potvq7x532` + An :t:`active attribute` is an :t:`attribute` that is removed from the :t:`item` + it decorates. + +.. glossary-entry:: inert attribute + :glossary-dp: fls_gccnknktzp7g + + :glossary: + :dp:`fls_o4e3tyjz7l1h` + An :dt:`inert attribute` is an :t:`attribute` that remains with the :t:`item` + it decorates. + :chapter: + :dp:`fls_xk7lb2g02sy7` + An :t:`inert attribute` is an :t:`attribute` that remains with the :t:`item` + it decorates. :dp:`fls_q8wl7pidx2za` The following :t:`[attribute]s` are :t:`[active attribute]s`: @@ -165,8 +222,18 @@ Built-in Attributes .. rubric:: Legality Rules -:dp:`fls_92tqo8uas8kd` -A :t:`built-in attribute` is a language-defined :t:`attribute`. +.. glossary-entry:: built-in attribute + :glossary-dp: fls_82ev7wknxqmk + + :glossary: + :dp:`fls_a40rclur4orm` + A :dt:`built-in attribute` is a language-defined :t:`attribute`. + + :dp:`fls_ooq5g8zffyfb` + See :s:`InnerBuiltinAttribute`, :s:`OuterBuiltinAttribute`. + :chapter: + :dp:`fls_92tqo8uas8kd` + A :t:`built-in attribute` is a language-defined :t:`attribute`. :dp:`fls_bxucstrfcco8` The following :t:`[built-in attribute]s` are :dt:`[code generation attribute]s`: @@ -879,6 +946,22 @@ It is a :t:`safety invariant` for the :t:`function body` to :t:`diverge ` are -:t:`explicitly declared entities `: +.. glossary-entry:: entity + :glossary-dp: fls_1qu1t74ga8aa + + :glossary: + :dp:`fls_mdbck557k8sy` + An :dt:`entity` is a :t:`construct` that can be referred to within program + text, usually via a :t:`field access expression` or a :t:`path`. + :chapter: + :dp:`fls_x7j6wcigqt7u` + An :t:`entity` is a :t:`construct` that can be referred to within program text, + usually via a :t:`field access expression` or a :t:`path`. + +.. glossary-entry:: name + :glossary-dp: fls_kad7fzn94x4d + + :glossary: + :dp:`fls_jjpzrs38vs3y` + A :dt:`name` is an :t:`identifier` that refers to an :t:`entity`. + + :dp:`fls_yrzevg5kd4bi` + See :s:`Name`. + :chapter: + :dp:`fls_40d2g0hvq2il` + A :t:`name` is an :t:`identifier` that refers to an :t:`entity`. + +.. glossary-entry:: declaration + :glossary-dp: fls_9qgy7x6w5ro5 + + :glossary: + :dp:`fls_kct7ducpli6k` + A :dt:`declaration` is a :t:`construct` that introduces a :t:`name` for an + :t:`entity`. + :chapter: + :dp:`fls_lcca91wjwnpx` + A :t:`declaration` is a :t:`construct` that introduces a :t:`name` for an + :t:`entity`. + +.. glossary-entry:: explicitly declared entity + :glossary-dp: fls_lqxcnZqvwcsH + + :glossary: + :dp:`fls_shpNJ0JCSCwa` + An :dt:`explicitly declared entity` is an :t:`entity` that has a + :t:`declaration`. + :chapter: + :dp:`fls_94l2d7ti0hjw` + An :t:`explicitly declared entity` is an :t:`entity` that has a + :t:`declaration`. The following :t:`entities ` are + :t:`explicitly declared entities `: * :dp:`fls_kvdqmo8gmdxi` :t:`[Associated item]s`, @@ -89,10 +123,18 @@ An :t:`explicitly declared entity` is an :t:`entity` that has a * :dp:`fls_v7w8ptbyxv9w` :t:`[Union type]s`. -:dp:`fls_ig1l38gpy5gy` -An :t:`implicitly declared entity` is an :t:`entity` that lacks an explicit -:t:`declaration`. The following :t:`entities ` are -:t:`implicitly declared entities `: +.. glossary-entry:: implicitly declared entity + :glossary-dp: fls_i3iB9xP8h8Ci + + :glossary: + :dp:`fls_VQs1jd4Nx3qR` + An :dt:`implicitly declared entity` is an :t:`entity` that lacks an explicit + :t:`declaration`. + :chapter: + :dp:`fls_ig1l38gpy5gy` + An :t:`implicitly declared entity` is an :t:`entity` that lacks an explicit + :t:`declaration`. The following :t:`entities ` are + :t:`implicitly declared entities `: * :dp:`fls_ed0t6u7fo3fi` :t:`[Built-in attribute]s`. @@ -133,36 +175,103 @@ Visibility .. rubric:: Legality Rules -:dp:`fls_7kpepal8ghuj` -:t:`Visibility` is a property of :t:`[field]s` and :t:`[item]s` that determines -which :t:`[module]s` can refer to the :t:`name` of the :t:`field` or :t:`item`. - -:dp:`fls_qo0itr5il1kk` -:t:`Public visibility` is a kind of :t:`visibility` that allows for a :t:`name` -to be referred to from arbitrary :t:`module` ``M`` as long as the ancestor -:t:`[module]s` of the related :t:`entity` can be referred to from ``M``. - -:dp:`fls_knjruq5wppv` -:t:`Private visibility` is a kind of :t:`visibility` that allows a :t:`name` -to be referred to only by the current :t:`module` of the :t:`entity`, and its -descendant :t:`[module]s`. - -:dp:`fls_t7i4n19qdgn4` -A :t:`visibility modifier` sets the :t:`visibility` of a :t:`name`. - -:dp:`fls_aa4f3rvir9lm` -A :t:`crate public modifier` is a :t:`visibility modifier` that grants a -:t:`name` :t:`public visibility` within the current :t:`crate` only. - -:dp:`fls_tnh7o3pb4e22` -A :t:`self public modifier` is a :t:`visibility modifier` that grants a -:t:`name` :t:`private visibility`. A :t:`self public modifier` is equivalent -to a :t:`simple path public modifier` where the :t:`simple path` denotes -:t:`keyword` ``self``. - -:dp:`fls_yymgpyi67dty` -A :t:`simple path public modifier` is a :t:`visibility modifier` that grants a -:t:`name` :t:`public visibility` within the provided :t:`simple path` only. +.. glossary-entry:: visibility + :glossary-dp: fls_svx87y4p8fdx + + :glossary: + :dp:`fls_sadmsqhptlho` + :dt:`Visibility` is a property of :t:`[field]s` and :t:`[item]s` that determines + which :t:`[module]s` can refer to the :t:`name` of the :t:`field` or :t:`item`. + :chapter: + :dp:`fls_7kpepal8ghuj` + :t:`Visibility` is a property of :t:`[field]s` and :t:`[item]s` that determines + which :t:`[module]s` can refer to the :t:`name` of the :t:`field` or :t:`item`. + +.. glossary-entry:: public visibility + :glossary-dp: fls_v2rjlovqsdyr + + :glossary: + :dp:`fls_6cfxqtl921ko` + :dt:`Public visibility` is a kind of :t:`visibility` that allows a :t:`name` + to be referred to from arbitrary :t:`module` ``M`` as long as the ancestor + :t:`[module]s` of the related :t:`entity` can be referred to from ``M``. + :chapter: + :dp:`fls_qo0itr5il1kk` + :t:`Public visibility` is a kind of :t:`visibility` that allows for a :t:`name` + to be referred to from arbitrary :t:`module` ``M`` as long as the ancestor + :t:`[module]s` of the related :t:`entity` can be referred to from ``M``. + +.. glossary-entry:: private visibility + :glossary-dp: fls_v1u1mevpj0kj + + :glossary: + :dp:`fls_duop22hyaweq` + :dt:`Private visibility` is a kind of :t:`visibility` that allows a :t:`name` + to be referred to only by the current :t:`module` of the :t:`entity`, and its + descendant :t:`[module]s`. + :chapter: + :dp:`fls_knjruq5wppv` + :t:`Private visibility` is a kind of :t:`visibility` that allows a :t:`name` + to be referred to only by the current :t:`module` of the :t:`entity`, and its + descendant :t:`[module]s`. + +.. glossary-entry:: visibility modifier + :glossary-dp: fls_xqjk8avt7t51 + + :glossary: + :dp:`fls_ze7befho4jhs` + A :dt:`visibility modifier` sets the :t:`visibility` of the :t:`name` of an + :t:`item`. + :chapter: + :dp:`fls_t7i4n19qdgn4` + A :t:`visibility modifier` sets the :t:`visibility` of a :t:`name`. + +.. glossary-entry:: crate public modifier + :glossary-dp: fls_yf9yjzzhw0rn + + :glossary: + :dp:`fls_dj7fmrqhbhsv` + A :dt:`crate public modifier` is a :t:`visibility modifier` that grants a + :t:`name` :t:`public visibility` within the current :t:`crate` only. + + :dp:`fls_wjfupeyeczp0` + See :s:`CratePublicModifier`. + :chapter: + :dp:`fls_aa4f3rvir9lm` + A :t:`crate public modifier` is a :t:`visibility modifier` that grants a + :t:`name` :t:`public visibility` within the current :t:`crate` only. + +.. glossary-entry:: self public modifier + :glossary-dp: fls_jq213cesxhyp + + :glossary: + :dp:`fls_ln3bzqgctfym` + A :dt:`self public modifier` is a :t:`visibility modifier` that grants a + :t:`name` :t:`private visibility`. + + :dp:`fls_21cvbfjpckkt` + See :s:`SelfPublicModifier`. + :chapter: + :dp:`fls_tnh7o3pb4e22` + A :t:`self public modifier` is a :t:`visibility modifier` that grants a + :t:`name` :t:`private visibility`. A :t:`self public modifier` is equivalent + to a :t:`simple path public modifier` where the :t:`simple path` denotes + :t:`keyword` ``self``. + +.. glossary-entry:: simple path public modifier + :glossary-dp: fls_sgy9q06yt6cl + + :glossary: + :dp:`fls_mby9r0jm6uyv` + A :dt:`simple path public modifier` is a :t:`visibility modifier` that grants a + :t:`name` :t:`public visibility` within the provided :t:`simple path` only. + + :dp:`fls_mud4hw74kuh6` + See :s:`SimplePathPublicModifier`. + :chapter: + :dp:`fls_yymgpyi67dty` + A :t:`simple path public modifier` is a :t:`visibility modifier` that grants a + :t:`name` :t:`public visibility` within the provided :t:`simple path` only. :dp:`fls_hc121mxknq03` The :t:`simple path` of a :t:`simple path public modifier` shall start @@ -174,15 +283,37 @@ The :t:`simple path` of a :t:`simple path public modifier` shall resolve to an ancestor :t:`module` of the current :t:`module` or the current :t:`module` itself. -:dp:`fls_np8aghofjqhm` -A :t:`simple public modifier` is a :t:`visibility modifier` that grants a -:t:`name` :t:`public visibility`. - -:dp:`fls_quzvhzpr0124` -A :t:`super public modifier` is a :t:`visibility modifier` that grants a -:t:`name` :t:`public visibility` within the parent :t:`module` only. A -:t:`super public modifier` is equivalent to a :t:`simple path public modifier` -where the :t:`simple path` denotes :t:`keyword` ``super``. +.. glossary-entry:: simple public modifier + :glossary-dp: fls_k5uqt5oj7wvl + + :glossary: + :dp:`fls_ce1ounn1g68` + A :dt:`simple public modifier` is a :t:`visibility modifier` that grants a + :t:`name` :t:`public visibility`. + + :dp:`fls_rd68vm2f2qy5` + See :s:`SelfPublicModifier`. + :chapter: + :dp:`fls_np8aghofjqhm` + A :t:`simple public modifier` is a :t:`visibility modifier` that grants a + :t:`name` :t:`public visibility`. + +.. glossary-entry:: super public modifier + :glossary-dp: fls_12bluakt0jnj + + :glossary: + :dp:`fls_vry5mhs3a5wv` + A :dt:`super public modifier` is a :t:`visibility modifier` that grants a + :t:`name` :t:`public visibility` within the parent :t:`module` only. + + :dp:`fls_4a1s9bcrk5oy` + See :s:`SuperPublicModifier`. + :chapter: + :dp:`fls_quzvhzpr0124` + A :t:`super public modifier` is a :t:`visibility modifier` that grants a + :t:`name` :t:`public visibility` within the parent :t:`module` only. A + :t:`super public modifier` is equivalent to a :t:`simple path public modifier` + where the :t:`simple path` denotes :t:`keyword` ``super``. :dp:`fls_utgjx6l5zwfl` An external :t:`item`, a :t:`field`, or an :t:`item` that appears without a @@ -284,12 +415,30 @@ Paths .. rubric:: Legality Rules -:dp:`fls_klcltwcwrw6i` -A :t:`path` is a sequence of :t:`[path segment]s` logically separated by -:t:`namespace qualifier` ``::`` that resolves to an :t:`entity`. - -:dp:`fls_y1z7kougmahd` -A :t:`path segment` is an element of a :t:`path`. +.. glossary-entry:: path + :glossary-dp: fls_9zl72vtkgkuo + + :glossary: + :dp:`fls_u3jyud6mhy1f` + A :dt:`path` is a sequence of :t:`[path segment]s` logically separated by + :dt:`namespace qualifier` ``::`` that resolves to an :t:`entity`. + :chapter: + :dp:`fls_klcltwcwrw6i` + A :t:`path` is a sequence of :t:`[path segment]s` logically separated by + :t:`namespace qualifier` ``::`` that resolves to an :t:`entity`. + +.. glossary-entry:: path segment + :glossary-dp: fls_xb54s9cs7h08 + + :glossary: + :dp:`fls_gsumebjc2bsp` + A :dt:`path segment` is a constituent of a :t:`path`. + + :dp:`fls_m067uq7fo66i` + See :s:`PathSegment`, :s:`SimplePathSegment`, :s:`TypePathSegment`. + :chapter: + :dp:`fls_y1z7kougmahd` + A :t:`path segment` is an element of a :t:`path`. :dp:`fls_8q8nqfpSz7Ly` A :t:`path` is subject to :t:`path resolution`. @@ -309,14 +458,33 @@ If a :t:`path segment` is expressed as :t:`keyword` ``super``, then the or the previous :t:`path segment` of the :t:`path` shall also be expressed as :t:`keyword` ``super``. -:dp:`fls_7kb6ltajgiou` -A :t:`global path` is a :t:`path` that starts with :t:`namespace qualifier` -``::``. - -:dp:`fls_n77icl6idazp` -A :t:`simple path` is a :t:`path` whose :t:`[path segment]s` consist of either -:t:`[identifier]s` or certain :t:`[keyword]s` as defined in the syntax rules -above. +.. glossary-entry:: global path + :glossary-dp: fls_g6g8c58bilen + + :glossary: + :dp:`fls_msg8jw9momfw` + A :dt:`global path` is a :t:`path` that starts with :t:`namespace qualifier` + ``::``. + :chapter: + :dp:`fls_7kb6ltajgiou` + A :t:`global path` is a :t:`path` that starts with :t:`namespace qualifier` + ``::``. + +.. glossary-entry:: simple path + :glossary-dp: fls_o5kv9lrtz4fq + + :glossary: + :dp:`fls_db91duoug4eb` + A :dt:`simple path` is a :t:`path` whose :t:`[path segment]s` consist of either + :t:`[identifier]s` or certain :t:`[keyword]s`. + + :dp:`fls_cm7ysyfrdwom` + See :s:`SimplePath`. + :chapter: + :dp:`fls_n77icl6idazp` + A :t:`simple path` is a :t:`path` whose :t:`[path segment]s` consist of either + :t:`[identifier]s` or certain :t:`[keyword]s` as defined in the syntax rules + above. :dp:`fls_YnUsdSM4x9eq` A :dt:`path prefix` is a :t:`path` with its last :t:`path segment` and @@ -338,37 +506,93 @@ be part of the :s:`UseImportContent` of a :t:`nesting import` as long as the :dp:`fls_kv5bpq8rf1j9` A :t:`simple path` is subject to :t:`simple path resolution`. -:dp:`fls_chtj3hcfe3ap` -A :t:`single segment path` is a :t:`path` consisting of exactly one -:t:`path segment`. - -:dp:`fls_wm61yeclairz` -A :t:`multi segment path` is a :t:`path` consisting of more than one -:t:`path segment`. - -:dp:`fls_nRgjCLYZL3iX` -An :t:`unqualified path expression` is a :t:`path expression` without a :t:`qualified type`. +.. glossary-entry:: single segment path + :glossary-dp: fls_JS91BDzd03Qj + + :glossary: + :dp:`fls_Hun5BCZsqd6k` + A :dt:`single segment path` is a :t:`path` consisting of exactly one + :t:`path segment`. + :chapter: + :dp:`fls_chtj3hcfe3ap` + A :t:`single segment path` is a :t:`path` consisting of exactly one + :t:`path segment`. + +.. glossary-entry:: multi segment path + :glossary-dp: fls_iw2vYgmLhlsg + + :glossary: + :dp:`fls_T4Xd6W6EqPSb` + A :dt:`multi segment path` is a :t:`path` consisting of more than one + :t:`path segment`. + :chapter: + :dp:`fls_wm61yeclairz` + A :t:`multi segment path` is a :t:`path` consisting of more than one + :t:`path segment`. + +.. glossary-entry:: unqualified path expression + :glossary-dp: fls_cDVmvrVhUBmr + + :glossary: + :dp:`fls_9xKgP8uVsOaR` + An :dt:`unqualified path expression` is a :t:`path expression` without a :t:`qualified type`. + :chapter: + :dp:`fls_nRgjCLYZL3iX` + An :t:`unqualified path expression` is a :t:`path expression` without a :t:`qualified type`. :dp:`fls_tvvycup09b51` A :t:`path expression` is subject to :t:`path expression resolution`. -:dp:`fls_h2zikgmazoxx` -A :t:`type path` is a :t:`path` that acts as a :t:`type specification`. +.. glossary-entry:: type path + :glossary-dp: fls_QDCiXh7uSj9r + + :glossary: + :dp:`fls_UBR5czHrMTrx` + A :dt:`type path` is a :t:`path` that acts as a :t:`type specification`. + + :dp:`fls_7CbNAZYSZayW` + See :s:`TypePath`. + :chapter: + :dp:`fls_h2zikgmazoxx` + A :t:`type path` is a :t:`path` that acts as a :t:`type specification`. :dp:`fls_nj7s6xmzx55f` A :t:`type path` is subject to :t:`type path resolution`. -:dp:`fls_e65q3iz50j6a` -A :t:`qualifying trait` is a :t:`trait` that imposes a restriction on a -:t:`qualified type`. +.. glossary-entry:: qualifying trait + :glossary-dp: fls_B0m82A8jIerQ + + :glossary: + :dp:`fls_zKY1dWBMrqXZ` + A :dt:`qualifying trait` is a :t:`trait` that imposes a restriction on a + :t:`qualified type`. + + :dp:`fls_z6OeUWBnec90` + See :s:`QualifyingTrait`. + :chapter: + :dp:`fls_e65q3iz50j6a` + A :t:`qualifying trait` is a :t:`trait` that imposes a restriction on a + :t:`qualified type`. :dp:`fls_Ai1jN5a8h3Dz` A :t:`qualifying trait` shall resolve to a :t:`trait`. -:dp:`fls_ybv0tdu7dnj5` -A :t:`qualified type` is a :t:`type` that is restricted to a set of -:t:`[implementation]s` that exhibit :t:`implementation conformance` to a -:t:`qualifying trait`. +.. glossary-entry:: qualified type + :glossary-dp: fls_Qv0UvhSfwBuM + + :glossary: + :dp:`fls_e7YyZXOFo6ei` + A :dt:`qualified type` is a :t:`type` that is restricted to a set of + :t:`[implementation]s` that exhibit :t:`implementation conformance` to a + :t:`qualifying trait`. + + :dp:`fls_a4heXjzO3jem` + See :s:`QualifiedType`. + :chapter: + :dp:`fls_ybv0tdu7dnj5` + A :t:`qualified type` is a :t:`type` that is restricted to a set of + :t:`[implementation]s` that exhibit :t:`implementation conformance` to a + :t:`qualifying trait`. :dp:`fls_qkYF2J7GVah8` A :t:`qualified type` shall resolve to a :t:`type`. @@ -376,18 +600,49 @@ A :t:`qualified type` shall resolve to a :t:`type`. :dp:`fls_QjNQbQhUcRTT` A :t:`qualified type` shall implement its related :t:`qualifying trait`. -:dp:`fls_7sm3206va03c` -A :t:`qualified path expression` is a :t:`path expression` that resolves -through a :t:`qualified type`. - -:dp:`fls_huynsyx13gsz` -A :t:`qualified type path` is a :t:`type path` that resolves through a -:t:`qualified type`. - -:dp:`fls_RZvIsApi4WQm` -An :t:`associated type projection` is a :t:`qualified type path` of the form -``::associated_type``, where ``type`` is a :t:`type`, ``trait`` -is a :t:`qualifying trait`, and ``associated type`` is an :t:`associated type`. +.. glossary-entry:: qualified path expression + :glossary-dp: fls_O6CFtnpN3UEE + + :glossary: + :dp:`fls_wKAS6FxqGmTf` + A :dt:`qualified path expression` is a :t:`path expression` that resolves + through a :t:`qualified type`. + + :dp:`fls_MXxJn64eJpC5` + See :s:`QualifiedPathExpression`. + :chapter: + :dp:`fls_7sm3206va03c` + A :t:`qualified path expression` is a :t:`path expression` that resolves + through a :t:`qualified type`. + +.. glossary-entry:: qualified type path + :glossary-dp: fls_koVlQq8aPdPv + + :glossary: + :dp:`fls_S0QT9ib38i8E` + A :dt:`qualified type path` is a :t:`type path` that resolves through a + :t:`qualified type`. + + :dp:`fls_RR8fFLD7Rxlt` + See :s:`QualifiedTypePath`. + :chapter: + :dp:`fls_huynsyx13gsz` + A :t:`qualified type path` is a :t:`type path` that resolves through a + :t:`qualified type`. + +.. glossary-entry:: associated type projection + :glossary-dp: fls_zOe783MlE9i9 + + :glossary: + :dp:`fls_4moFUY6epk0v` + An :dt:`associated type projection` is a :t:`qualified type path` of the form + ``::associated_type``, where ``type`` is a :t:`type`, ``trait`` + is a :t:`qualifying trait`, and ``associated type`` is an :t:`associated type`. + :chapter: + :dp:`fls_RZvIsApi4WQm` + An :t:`associated type projection` is a :t:`qualified type path` of the form + ``::associated_type``, where ``type`` is a :t:`type`, ``trait`` + is a :t:`qualifying trait`, and ``associated type`` is an :t:`associated type`. :dp:`fls_f1ciozzetj5a` A :dt:`qualified fn trait` is a :t:`construct` that refers to the @@ -457,9 +712,23 @@ Scopes .. rubric:: Legality Rules -:dp:`fls_5x5xykocwyiy` -A :t:`scope` is a region of program text where an :t:`entity` can be referred -to. An :t:`entity` is :t:`in scope` when it can be referred to. +.. glossary-entry:: scope + :glossary-dp: fls_fj8mdxi967px + + :glossary: + :dp:`fls_fachaj550cq1` + A :dt:`scope` is a region of program text where a :t:`name` can be referred to. + :chapter: + :dp:`fls_5x5xykocwyiy` + A :t:`scope` is a region of program text where an :t:`entity` can be referred + to. An :t:`entity` is :t:`in scope` when it can be referred to. + +.. glossary-entry:: in scope + :glossary-dp: fls_3lo8ygoyxxyf + + :glossary: + :dp:`fls_sy380geqvf2l` + A :t:`name` is :dt:`in scope` when it can be referred to. .. _fls_6ozthochxz1i: @@ -468,8 +737,15 @@ Binding Scopes .. rubric:: Legality Rules -:dp:`fls_ncg9etb3x7k0` -A :t:`binding scope` is a :t:`scope` for :t:`[binding]s`. +.. glossary-entry:: binding scope + :glossary-dp: fls_5ep4xSGZwtoL + + :glossary: + :dp:`fls_6qPYH5NJ8usI` + A :dt:`binding scope` is a :t:`scope` for :t:`[binding]s`. + :chapter: + :dp:`fls_ncg9etb3x7k0` + A :t:`binding scope` is a :t:`scope` for :t:`[binding]s`. :dp:`fls_u52mx4xw8zod` The :t:`binding` of a :t:`closure parameter` is :t:`in scope` within the @@ -507,8 +783,15 @@ Generic Parameter Scope .. rubric:: Legality Rules -:dp:`fls_amoh8r4gghyj` -A :t:`generic parameter scope` is a :t:`scope` for :t:`[generic parameter]s`. +.. glossary-entry:: generic parameter scope + :glossary-dp: fls_CzudKdaYbfBF + + :glossary: + :dp:`fls_e2tICijmLkj4` + A :dt:`generic parameter scope` is a :t:`scope` for :t:`[generic parameter]s`. + :chapter: + :dp:`fls_amoh8r4gghyj` + A :t:`generic parameter scope` is a :t:`scope` for :t:`[generic parameter]s`. :dp:`fls_6o38qhbna46z` A :t:`generic parameter` is :t:`in scope` of a :s:`GenericParameterList`. @@ -560,8 +843,15 @@ Item Scope .. rubric:: Legality Rules -:dp:`fls_p5o243hhe1y3` -An :t:`item scope` is a :t:`scope` for :t:`[item]s`. +.. glossary-entry:: item scope + :glossary-dp: fls_wojJZZ4gYGfl + + :glossary: + :dp:`fls_mW7IwWGSjrl2` + An :dt:`item scope` is a :t:`scope` for :t:`[item]s`. + :chapter: + :dp:`fls_p5o243hhe1y3` + An :t:`item scope` is a :t:`scope` for :t:`[item]s`. :dp:`fls_huvo0mp2i6fb` An :t:`item` declared within the :t:`block expression` of an @@ -580,8 +870,15 @@ Label Scope .. rubric:: Legality Rules -:dp:`fls_96kczd4zhpco` -A :t:`label scope` is a :t:`scope` for :t:`[label]s`. +.. glossary-entry:: label scope + :glossary-dp: fls_P0on44EAB3cn + + :glossary: + :dp:`fls_2H6HkQ102hVS` + A :dt:`label scope` is a :t:`scope` for :t:`[label]s`. + :chapter: + :dp:`fls_96kczd4zhpco` + A :t:`label scope` is a :t:`scope` for :t:`[label]s`. :dp:`fls_8sevg1sa82h4` A :t:`label` is :t:`in scope` within the :t:`block expression` of the related @@ -591,6 +888,15 @@ A :t:`label` is :t:`in scope` within the :t:`block expression` of the related A :t:`label` is not :t:`in scope` within nested :t:`[async block]s`, :t:`[closure expression]s`, :t:`[constant context]s`, and :t:`[item]s`. +.. glossary-entry:: Self + :glossary-dp: fls_9o2hcy6t7dac + + :glossary: + :dp:`fls_q6whqbfusswf` + :dc:`Self` is either an implicit :t:`type parameter` in :t:`[trait]s` or an + implicit :t:`type alias` in :t:`[implementation]s`. :c:`Self` refers to the + :t:`type` that implements a :t:`trait`. + .. _fls_kgbi26212eof: Self Scope @@ -598,8 +904,15 @@ Self Scope .. rubric:: Legality Rules -:dp:`fls_kgt81m4f72ne` -A :t:`Self scope` is a :t:`scope` for :c:`Self`. +.. glossary-entry:: Self scope + :glossary-dp: fls_exMZlNMxQvP7 + + :glossary: + :dp:`fls_pSvqWGRmFmH0` + A :dt:`Self scope` is a :t:`scope` for :c:`Self`. + :chapter: + :dp:`fls_kgt81m4f72ne` + A :t:`Self scope` is a :t:`scope` for :c:`Self`. :dp:`fls_kxdwq4b136tl` :c:`Self` of an :t:`enum type` is :t:`in scope` within the related @@ -631,8 +944,15 @@ Textual Macro Scope .. rubric:: Legality Rules -:dp:`fls_xkh8cqubhxad` -A :t:`textual macro scope` is a :t:`scope` for :t:`[declarative macro]s`. +.. glossary-entry:: textual macro scope + :glossary-dp: fls_AVZGZPd6WXXO + + :glossary: + :dp:`fls_xyeYk6vrmlWp` + A :dt:`textual macro scope` is a :t:`scope` for :t:`[declarative macro]s`. + :chapter: + :dp:`fls_xkh8cqubhxad` + A :t:`textual macro scope` is a :t:`scope` for :t:`[declarative macro]s`. :dp:`fls_iec3otx863yp` A :t:`declarative macro` is :t:`in scope` after the related :t:`macro` @@ -652,11 +972,19 @@ Scope Hierarchy .. rubric:: Legality Rules -:dp:`fls_4o7vfo6v39l7` -The :t:`scope hierarchy` reflects the nesting of :t:`[scope]s` as introduced -by :t:`[scoping construct]s`. An inner :t:`scope` introduced by a nested -:t:`scoping construct` is the child of an outer :t:`scope` introduced by an -enclosing :t:`scoping construct`. +.. glossary-entry:: scope hierarchy + :glossary-dp: fls_xZUiNkBN5e00 + + :glossary: + :dp:`fls_Spcc3L9X939d` + The :dt:`scope hierarchy` reflects the nesting of :t:`[scope]s` as introduced + by :t:`[scoping construct]s`. + :chapter: + :dp:`fls_4o7vfo6v39l7` + The :t:`scope hierarchy` reflects the nesting of :t:`[scope]s` as introduced + by :t:`[scoping construct]s`. An inner :t:`scope` introduced by a nested + :t:`scoping construct` is the child of an outer :t:`scope` introduced by an + enclosing :t:`scoping construct`. :dp:`fls_ns4eog3od4kw` A :dt:`scoping construct` is a :t:`construct` that introduces :t:`[scope]s` @@ -800,10 +1128,19 @@ Namespaces .. rubric:: Legality Rules -:dp:`fls_1d4jm61qnt4l` -A :t:`namespace` is a logical grouping of :t:`[name]s` such that the occurrence -of a :t:`name` in one :t:`namespace` does not conflict with an occurrence of -the same :t:`name` in another :t:`namespace`. +.. glossary-entry:: namespace + :glossary-dp: fls_GesmsWSVhv3f + + :glossary: + :dp:`fls_er8lcvnEqxa5` + A :dt:`namespace` is a logical grouping of :t:`[name]s` such that the + occurrence of a :t:`name` in one :t:`namespace` does not conflict with an + occurrence of the same :t:`name` in another :t:`namespace`. + :chapter: + :dp:`fls_1d4jm61qnt4l` + A :t:`namespace` is a logical grouping of :t:`[name]s` such that the occurrence + of a :t:`name` in one :t:`namespace` does not conflict with an occurrence of + the same :t:`name` in another :t:`namespace`. :dp:`fls_avsua7bho205` :t:`[Name]s` are segregated into one of five :t:`[namespace]s` based on the @@ -932,12 +1269,34 @@ Preludes .. rubric:: Legality Rules -:dp:`fls_po4gw6t2ptwu` -A :t:`prelude` is a collection of :t:`entities ` that are automatically -brought :t:`in scope` of every :t:`module` in a :t:`crate`. Such -:t:`entities ` are referred to as -:t:`prelude entities `. The :t:`name` of a :t:`prelude entity` -is referred to as a :t:`prelude name`. +.. glossary-entry:: prelude + :glossary-dp: fls_8Gn72FJBarfb + + :glossary: + :dp:`fls_D0PJioOZjKNN` + A :dt:`prelude` is a collection of :t:`entities ` that are + automatically brought :t:`in scope` of every :t:`module` in a :t:`crate`. + :chapter: + :dp:`fls_po4gw6t2ptwu` + A :t:`prelude` is a collection of :t:`entities ` that are automatically + brought :t:`in scope` of every :t:`module` in a :t:`crate`. Such + :t:`entities ` are referred to as + :t:`prelude entities `. The :t:`name` of a :t:`prelude entity` + is referred to as a :t:`prelude name`. + +.. glossary-entry:: prelude entity + :glossary-dp: fls_AWySDxPgypiw + + :glossary: + :dp:`fls_2lU7RUjzFlsz` + A :dt:`prelude entity` is an :t:`entity` declared in a :t:`prelude`. + +.. glossary-entry:: prelude name + :glossary-dp: fls_FYn5JqPOhiIs + + :glossary: + :dp:`fls_6Jk7fUAK122A` + A :dt:`prelude name` is a :t:`name` of a :t:`prelude entity`. :dp:`fls_n4102qskkmz2` The :dt:`core prelude` is a :t:`prelude` that brings :t:`in scope` of every @@ -1012,14 +1371,37 @@ Use Imports .. rubric:: Legality Rules -:dp:`fls_lyw4t098sxrj` -A :t:`use import` brings :t:`entities ` :t:`in scope` within the -:t:`block expression` of an :t:`expression-with-block` or :t:`module` where the -:t:`use import` resides. - -:dp:`fls_sxo1jb25pl8a` -A :t:`simple path prefix` is the leading :t:`simple path` of a :t:`glob import` -or a :t:`nesting import`. +.. glossary-entry:: use import + :glossary-dp: fls_fow1bnvduafi + + :glossary: + :dp:`fls_uccv9zthh5vt` + A :dt:`use import` brings :t:`entities ` :t:`in scope` within the + :t:`block expression` of an :t:`expression-with-block` or :t:`module` where the + :t:`use import` resides. + + :dp:`fls_ib5wf62j4uhr` + See :s:`UseImport`. + :chapter: + :dp:`fls_lyw4t098sxrj` + A :t:`use import` brings :t:`entities ` :t:`in scope` within the + :t:`block expression` of an :t:`expression-with-block` or :t:`module` where the + :t:`use import` resides. + +.. glossary-entry:: simple path prefix + :glossary-dp: fls_23G6TAntJXqa + + :glossary: + :dp:`fls_ijc2yHQuIltY` + A :dt:`simple path prefix` is the leading :t:`simple path` of a + :t:`glob import` or a :t:`nesting import`. + + :dp:`fls_ImHceyHhK6OZ` + See :s:`SimplePathPrefix`. + :chapter: + :dp:`fls_sxo1jb25pl8a` + A :t:`simple path prefix` is the leading :t:`simple path` of a :t:`glob import` + or a :t:`nesting import`. :dp:`fls_WAA4WmohGu6T` An :dt:`import path prefix` is the fully constructed :t:`path` prefix of a @@ -1048,15 +1430,47 @@ An :dt:`import path prefix` is the fully constructed :t:`path` prefix of a :t:`import path prefix`. Repeat this step with the :t:`nesting import` as the current :t:`use import`. -:dp:`fls_2bkcn83smy2y` -A :t:`simple import` is a :t:`use import` that brings all :t:`entities ` -it refers to into scope, optionally with a different -:t:`name` than they are declared with by using a :t:`renaming`. - -:dp:`fls_v3a6y2ze44v2` -A :t:`glob import` is a :t:`use import` that brings all :t:`entities ` -exported by the :t:`module` or :t:`enum` its :t:`import path prefix` resolves to -into :t:`scope`. +.. glossary-entry:: renaming + :glossary-dp: fls_8ibsdx4dx6s7 + + :glossary: + :dp:`fls_cp8u9kq44o8a` + A :dt:`renaming` provides an alternative :t:`name` for an existing name. + + :dp:`fls_8inznqig2ibr` + See :s:`Renaming`. + +.. glossary-entry:: simple import + :glossary-dp: fls_6mcm7xdcyn40 + + :glossary: + :dp:`fls_jrlzpoauui9g` + A :dt:`simple import` is a :t:`use import` that binds a :t:`simple path` to a + local :t:`name` by using an optional :t:`renaming`. + + :dp:`fls_ta5t4h25unsw` + See :s:`SimpleImport`. + :chapter: + :dp:`fls_2bkcn83smy2y` + A :t:`simple import` is a :t:`use import` that brings all :t:`entities ` + it refers to into scope, optionally with a different + :t:`name` than they are declared with by using a :t:`renaming`. + +.. glossary-entry:: glob import + :glossary-dp: fls_euukteybsbi + + :glossary: + :dp:`fls_90qsib7g8e9j` + A :dt:`glob import` is a :t:`use import` that brings all :t:`[name]s` with + :t:`public visibility` prefixed by its :t:`path` prefix into :t:`scope`. + + :dp:`fls_n4plc55cij0j` + See :s:`GlobImport`. + :chapter: + :dp:`fls_v3a6y2ze44v2` + A :t:`glob import` is a :t:`use import` that brings all :t:`entities ` + exported by the :t:`module` or :t:`enum` its :t:`import path prefix` resolves to + into :t:`scope`. :dp:`fls_JHU0ersYB6eL` An :t:`import path prefix` shall resolve to a :t:`module` or :t:`enum`. @@ -1107,9 +1521,20 @@ A :t:`trait` imported by a :t:`simple import` subject to a :t:`renaming` with character underscore ``_`` is added into :t:`scope` without a :t:`name`. -:dp:`fls_ldr7tsuqw34s` -A :t:`nesting import` is a :t:`use import` that provides a common -:t:`simple path prefix` for its nested :t:`[use import]s`. +.. glossary-entry:: nesting import + :glossary-dp: fls_6rlvd0u4w6h2 + + :glossary: + :dp:`fls_nhkqkdqo32xs` + A :dt:`nesting import` is a :t:`use import` that provides a common :t:`path` + prefix for its nested :t:`[use import]s`. + + :dp:`fls_z4d611glen13` + See :s:`NestingImport`. + :chapter: + :dp:`fls_ldr7tsuqw34s` + A :t:`nesting import` is a :t:`use import` that provides a common + :t:`simple path prefix` for its nested :t:`[use import]s`. :dp:`fls_iNUBX5fJAI1N` A :t:`glob import` outside of a :t:`nesting import` without a :t:`simple path @@ -1173,11 +1598,20 @@ Shadowing .. rubric:: Legality Rules -:dp:`fls_ob0riinmitkl` -:t:`Shadowing` is a property of :t:`[name]s`. A :t:`name` is said to be -:t:`shadowed` when another :t:`name` with the same characters is introduced -in the same :t:`scope` within the same :t:`namespace`, effectively hiding it. -A :t:`name` cannot be referred to by any means once it is :t:`shadowed`. +.. glossary-entry:: shadowing + :glossary-dp: fls_HUklMSWzx8Mg + + :glossary: + :dp:`fls_li3NXOPEH9cL` + :dt:`Shadowing` is a property of :t:`[name]s`. A :t:`name` is said to be + :dt:`shadowed` when another :t:`name` with the same characters is introduced + in the same :t:`scope` within the same :t:`namespace`, effectively hiding it. + :chapter: + :dp:`fls_ob0riinmitkl` + :t:`Shadowing` is a property of :t:`[name]s`. A :t:`name` is said to be + :t:`shadowed` when another :t:`name` with the same characters is introduced + in the same :t:`scope` within the same :t:`namespace`, effectively hiding it. + A :t:`name` cannot be referred to by any means once it is :t:`shadowed`. :dp:`fls_fslg89a70e3n` No :t:`name` shall be :t:`shadowed` except for @@ -1218,22 +1652,52 @@ Resolution .. rubric:: Legality Rules -:dp:`fls_ho4kem1slcxg` -:t:`Resolution` is the process of finding a unique interpretation for a -:t:`field access expression`, a :t:`method call expression`, a :t:`call -expression` or a :t:`path`. - -:dp:`fls_7le2vcdbtxbq` -A :t:`construct` that is being resolved is said to be :t:`under resolution`. - -:dp:`fls_x3alg07yd7hx` -A :t:`dereference type` is either a :t:`reference type` or a :t:`type` that -implements the :std:`core::ops::Deref` :t:`trait`. - -:dp:`fls_4hulwazdu20i` -A :t:`dereference type chain` is a sequence of :t:`[dereference type]s`. A -:t:`dereference type chain` starts with an initial :t:`dereference type`. From -then on, the :t:`dereference type chain` continues as follows: +.. glossary-entry:: resolution + :glossary-dp: fls_O5iuGATZgyBu + + :glossary: + :dp:`fls_PQjEvLs5cE4y` + :dt:`Resolution` is the process of finding a unique interpretation for a + :t:`field access expression`, a :t:`method call expression`, or a :t:`path`. + :chapter: + :dp:`fls_ho4kem1slcxg` + :t:`Resolution` is the process of finding a unique interpretation for a + :t:`field access expression`, a :t:`method call expression`, a :t:`call + expression` or a :t:`path`. + +.. glossary-entry:: under resolution + :glossary-dp: fls_X6XjWwYeTnVR + + :glossary: + :dp:`fls_BppwXSVUWtEu` + A :t:`construct` that is being resolved is said to be :dt:`under resolution`. + :chapter: + :dp:`fls_7le2vcdbtxbq` + A :t:`construct` that is being resolved is said to be :t:`under resolution`. + +.. glossary-entry:: dereference type + :glossary-dp: fls_xbN0GtcH8emc + + :glossary: + :dp:`fls_HfuUQ7IaoI5j` + A :dt:`dereference type` is either a :t:`reference type` or a :t:`type` that + implements the :std:`core::ops::Deref` :t:`trait`. + :chapter: + :dp:`fls_x3alg07yd7hx` + A :t:`dereference type` is either a :t:`reference type` or a :t:`type` that + implements the :std:`core::ops::Deref` :t:`trait`. + +.. glossary-entry:: dereference type chain + :glossary-dp: fls_T380NdEsFxIp + + :glossary: + :dp:`fls_kIzoAEf069HE` + A :dt:`dereference type chain` is a sequence of :t:`[dereference type]s`. + :chapter: + :dp:`fls_4hulwazdu20i` + A :t:`dereference type chain` is a sequence of :t:`[dereference type]s`. A + :t:`dereference type chain` starts with an initial :t:`dereference type`. From + then on, the :t:`dereference type chain` continues as follows: * :dp:`fls_ptocwx5p25lj` If the previous :t:`dereference type` is a :t:`reference type`, then the @@ -1251,9 +1715,17 @@ Field Resolution .. rubric:: Legality Rules -:dp:`fls_1nxknwjdp0am` -:t:`Field resolution` is a form of :t:`resolution` that applies to a -:t:`field access expression`. +.. glossary-entry:: field resolution + :glossary-dp: fls_BlZwxp6H62sS + + :glossary: + :dp:`fls_nL8UuclgxfGL` + :dt:`Field resolution` is a form of :t:`resolution` that applies to a + :t:`field access expression`. + :chapter: + :dp:`fls_1nxknwjdp0am` + :t:`Field resolution` is a form of :t:`resolution` that applies to a + :t:`field access expression`. :dp:`fls_j1bip4w30q8` A :dt:`candidate container type` is the :t:`type` of the :t:`container operand` @@ -1299,6 +1771,17 @@ the characters of a :t:`named field selector`. resolves to that :t:`candidate indexed field` and :t:`field resolution` stops. +.. glossary-entry:: named field selector + :glossary-dp: fls_cvxdoycoytc5 + + :glossary: + :dp:`fls_cczpgxqdyh1e` + A :dt:`named field selector` is a :t:`field selector` where the selected + :t:`field` is indicated by an :t:`identifier`. + + :dp:`fls_hpw0n89ez5nw` + See :s:`NamedFieldSelector`. + :dp:`fls_p6hgoqo0kcx` :t:`Field resolution` of a :t:`field access expression` with a :t:`named field selector` proceeds as follows: @@ -1327,13 +1810,28 @@ Method Resolution .. rubric:: Legality Rules -:dp:`fls_e5a5z5yht26l` -:t:`Method resolution` is a kind of :t:`resolution` that applies to a -:t:`method call expression`. - -:dp:`fls_mbdS0xiNlj92` -A :dt:`receiver type` is the :t:`type` of the :t:`receiver operand` -of a :t:`method call expression`. +.. glossary-entry:: method resolution + :glossary-dp: fls_05yFh5Ud0YkW + + :glossary: + :dp:`fls_LbW4z6OTuD1l` + :dt:`Method resolution` is a kind of :t:`resolution` that applies to a + :t:`method call expression`. + :chapter: + :dp:`fls_e5a5z5yht26l` + :t:`Method resolution` is a kind of :t:`resolution` that applies to a + :t:`method call expression`. + +.. glossary-entry:: receiver type + :glossary-dp: fls_Kpkm0J40xq5J + + :glossary: + :dp:`fls_vgQmMlpFas5t` + A :dt:`receiver type` is the :t:`type` of a :t:`receiver operand`. + :chapter: + :dp:`fls_mbdS0xiNlj92` + A :dt:`receiver type` is the :t:`type` of the :t:`receiver operand` + of a :t:`method call expression`. :dp:`fls_z80ylmlu1f3q` A :dt:`candidate receiver type` is the :t:`type` of the :t:`receiver operand` @@ -1456,9 +1954,17 @@ Call Resolution .. rubric:: Legality Rules -:dp:`fls_ZjJ7y9r6QQMW` -:t:`Call resolution` is a form of :t:`resolution` that applies to a -:t:`call expression`. +.. glossary-entry:: call resolution + :glossary-dp: fls_zSh4enFjxeaN + + :glossary: + :dp:`fls_fS1ZjGGypvbn` + :dt:`Call resolution` is a kind of :t:`resolution` that applies to a + :t:`call expression`. + :chapter: + :dp:`fls_ZjJ7y9r6QQMW` + :t:`Call resolution` is a form of :t:`resolution` that applies to a + :t:`call expression`. :dp:`fls_zBSloU2Gjv7x` A :dt:`candidate callee type` is the :t:`type` of the :t:`call operand` @@ -1489,12 +1995,19 @@ Path Resolution .. rubric:: Legality Rules -:dp:`fls_8slvisr3jfja` -:t:`Path resolution` is a form of :t:`resolution` that applies to a :t:`path`. - -:dp:`fls_nmev0tnzgw35` -:t:`Path resolution` resolves a :t:`path` by resolving individual -:t:`[path segment]s` in sequence, starting from the leftmost :t:`path segment`. +.. glossary-entry:: path resolution + :glossary-dp: fls_J8kiBhcawvnj + + :glossary: + :dp:`fls_uy9Ai9vwTkjB` + :dt:`Path resolution` is a form of :t:`resolution` that applies to a :t:`path`. + :chapter: + :dp:`fls_8slvisr3jfja` + :t:`Path resolution` is a form of :t:`resolution` that applies to a :t:`path`. + + :dp:`fls_nmev0tnzgw35` + :t:`Path resolution` resolves a :t:`path` by resolving individual + :t:`[path segment]s` in sequence, starting from the leftmost :t:`path segment`. :dp:`fls_p23q1ob2qitz` A :t:`path segment` shall resolve to exactly one :t:`entity`. @@ -1629,9 +2142,17 @@ Simple Path Resolution .. rubric:: Legality Rules -:dp:`fls_uml24jw5jo7a` -:t:`Simple path resolution` is a kind of :t:`path resolution` that applies to -a :t:`simple path`. +.. glossary-entry:: simple path resolution + :glossary-dp: fls_gT5rZ4qC3pHo + + :glossary: + :dp:`fls_CQlepoN6PmKq` + :dt:`Simple path resolution` is a kind of :t:`path resolution` that applies to + a :t:`simple path`. + :chapter: + :dp:`fls_uml24jw5jo7a` + :t:`Simple path resolution` is a kind of :t:`path resolution` that applies to + a :t:`simple path`. :dp:`fls_59wd7loxst43` The :t:`namespace context` of :t:`simple path resolution` is determined as @@ -1678,9 +2199,17 @@ Path Expression Resolution .. rubric:: Legality Rules -:dp:`fls_akjlqm3a2lb1` -:t:`Path expression resolution` is a form of :t:`path resolution` that applies -to a :t:`unqualified path expression`. +.. glossary-entry:: path expression resolution + :glossary-dp: fls_EIFtIeLGZNy5 + + :glossary: + :dp:`fls_WYcEVyc3SHuK` + :dt:`Path expression resolution` is a form of :t:`path resolution` that applies + to a :t:`path expression`. + :chapter: + :dp:`fls_akjlqm3a2lb1` + :t:`Path expression resolution` is a form of :t:`path resolution` that applies + to a :t:`unqualified path expression`. :dp:`fls_xyzdajtf4u2t` The :t:`namespace context` of :t:`path expression resolution` is the @@ -1812,9 +2341,17 @@ Type Path Resolution .. rubric:: Legality Rules -:dp:`fls_2zuncql8ir5k` -:t:`Type path resolution` is a form of :t:`path resolution` that applies to -a :t:`type path`. +.. glossary-entry:: type path resolution + :glossary-dp: fls_wa3biT0rQ102 + + :glossary: + :dp:`fls_Xv6JbfdIyvA3` + :dt:`Type path resolution` is a form of :t:`path resolution` that applies to + a :t:`type path`. + :chapter: + :dp:`fls_2zuncql8ir5k` + :t:`Type path resolution` is a form of :t:`path resolution` that applies to + a :t:`type path`. :dp:`fls_bv5cj918dqqe` The :t:`namespace context` of :t:`type path resolution` is the diff --git a/src/exceptions-and-errors.rst b/src/exceptions-and-errors.rst index d9b354fc..51afc00b 100644 --- a/src/exceptions-and-errors.rst +++ b/src/exceptions-and-errors.rst @@ -42,9 +42,17 @@ Panic .. rubric:: Legality Rules -:dp:`fls_a554v4n0khye` -A :t:`panic` is an abnormal program state caused by invoking :t:`macro` -:std:`core::panic`. +.. glossary-entry:: panic + :glossary-dp: fls_wzpivxkhpln + + :glossary: + :dp:`fls_t3kpbnmohtp6` + A :dt:`panic` is an abnormal program state caused by invoking :t:`macro` + :std:`core::panic`. + :chapter: + :dp:`fls_a554v4n0khye` + A :t:`panic` is an abnormal program state caused by invoking :t:`macro` + :std:`core::panic`. .. rubric:: Dynamic Semantics @@ -71,8 +79,15 @@ Abort .. rubric:: Legality Rules -:dp:`fls_9a1izu3omkbn` -:t:`Abort` is the immediate termination of a program. +.. glossary-entry:: abort + :glossary-dp: fls_ymnz0mt7i4m8 + + :glossary: + :dp:`fls_u4o7tda3ilv0` + :dt:`Abort` is the immediate termination of a program. + :chapter: + :dp:`fls_9a1izu3omkbn` + :t:`Abort` is the immediate termination of a program. .. rubric:: Dynamic Semantics @@ -84,4 +99,3 @@ Abort #. :dp:`fls_7bnrbjb0pq5n` The program terminates. - diff --git a/src/expressions.rst b/src/expressions.rst index 7db73d03..251f0488 100644 --- a/src/expressions.rst +++ b/src/expressions.rst @@ -64,38 +64,140 @@ Expressions RightOperand ::= Operand -:dp:`fls_pwut2jbmk66k` -A :ds:`SubjectExpression` is any expression in category :s:`Expression`, except -:s:`StructExpression`. - -:dp:`fls_361q9ljc6ybz` -A :ds:`SubjectLetExpression` is any expression in category -:s:`SubjectExpression`, except :s:`LazyBooleanExpression`. +.. glossary-entry:: subject expression + :glossary-dp: fls_wee9stfk0abp + + :glossary: + :dp:`fls_xisqke87ert` + A :dt:`subject expression` is an :t:`expression` that controls + :t:`[for loop]s`, :t:`[if expression]s`, and :t:`[match expression]s`. + + :dp:`fls_gph5doham4js` + See :s:`SubjectExpression`. + :chapter: + :dp:`fls_pwut2jbmk66k` + A :ds:`SubjectExpression` is any expression in category :s:`Expression`, except + :s:`StructExpression`. + +.. glossary-entry:: subject let expression + :glossary-dp: fls_dc5ibvnnhs7e + + :glossary: + :dp:`fls_b3ckv6zgnaeb` + A :dt:`subject let expression` is an :t:`expression` that controls + :t:`[if let expression]s` and :t:`[while let loop]s`. + + :dp:`fls_vnzaargh5yok` + See :s:`SubjectLetExpression`. + :chapter: + :dp:`fls_361q9ljc6ybz` + A :ds:`SubjectLetExpression` is any expression in category + :s:`SubjectExpression`, except :s:`LazyBooleanExpression`. + +.. glossary-entry:: subexpression + :glossary-dp: fls_feZ3iDff05Cb + + :glossary: + :dp:`fls_bNSHwD4Kpfm0` + A :dt:`subexpression` is an :t:`expression` nested within another + :t:`expression`. .. rubric:: Legality Rules -:dp:`fls_h5o6tgul4yor` -An :t:`expression` is a :t:`construct` that produces a :t:`value`, and may have -side effects at run-time. - -:dp:`fls_xmklb3070sp` -An :t:`expression-with-block` is an :t:`expression` whose structure involves a -:t:`block expression`. - -:dp:`fls_p15oeage4j0e` -An :t:`expression-without-block` is an :t:`expression` whose structure does not -involve a :t:`block expression`. - -:dp:`fls_gwgttltgjma4` -An :t:`operand` is an :t:`expression` nested within an :t:`expression`. - -:dp:`fls_1r29rtnjlkql` -A :t:`left operand` is an :t:`operand` that appears on the left-hand side of a -:t:`binary operator`. - -:dp:`fls_qxdpyf4u3hbz` -A :t:`right operand` is an :t:`operand` that appears on the right-hand side of a -:t:`binary operator`. +.. glossary-entry:: expression + :glossary-dp: fls_q8ofwncggngd + + :glossary: + :dp:`fls_f7iuwgbs1lql` + An :dt:`expression` is a :t:`construct` that produces a :t:`value`, and may + have side effects at run-time. + + :dp:`fls_8l9hru1x586q` + See :s:`Expression`. + :chapter: + :dp:`fls_h5o6tgul4yor` + An :t:`expression` is a :t:`construct` that produces a :t:`value`, and may have + side effects at run-time. + +.. glossary-entry:: expression-with-block + :glossary-dp: fls_u6huewic8650 + + :glossary: + :dp:`fls_ujlm50le5dnj` + An :dt:`expression-with-block` is an :t:`expression` whose structure involves a + :t:`block expression`. + + :dp:`fls_iwheys965ml3` + See :s:`ExpressionWithBlock`. + :chapter: + :dp:`fls_xmklb3070sp` + An :t:`expression-with-block` is an :t:`expression` whose structure involves a + :t:`block expression`. + +.. glossary-entry:: expression-without-block + :glossary-dp: fls_378e2xhxzk26 + + :glossary: + :dp:`fls_xfh9xmsphzqb` + An :dt:`expression-without-block` is an :t:`expression` whose structure does + not involve a :t:`block expression`. + + :dp:`fls_miaphjnikd51` + See :s:`ExpressionWithoutBlock`. + :chapter: + :dp:`fls_p15oeage4j0e` + An :t:`expression-without-block` is an :t:`expression` whose structure does not + involve a :t:`block expression`. + +.. glossary-entry:: operand + :glossary-dp: fls_pv4lok5qcn8y + + :glossary: + :dp:`fls_3mnn1au9ob6q` + An :dt:`operand` is an :t:`expression` nested within an expression. + + :dp:`fls_8299xfhdsd1` + See :s:`Operand`. + :chapter: + :dp:`fls_gwgttltgjma4` + An :t:`operand` is an :t:`expression` nested within an :t:`expression`. + +.. glossary-entry:: binary operator + :glossary-dp: fls_xydujcfvvb8p + + :glossary: + :dp:`fls_v0he0zp9ph7a` + A :dt:`binary operator` is an operator that operates on two :t:`[operand]s`. + +.. glossary-entry:: left operand + :glossary-dp: fls_x6vo9pysmex2 + + :glossary: + :dp:`fls_m821x5195ac9` + A :dt:`left operand` is an :t:`operand` that appears on the left-hand side of a + :t:`binary operator`. + + :dp:`fls_ghlbsklg7wdb` + See :s:`LeftOperand`. + :chapter: + :dp:`fls_1r29rtnjlkql` + A :t:`left operand` is an :t:`operand` that appears on the left-hand side of a + :t:`binary operator`. + +.. glossary-entry:: right operand + :glossary-dp: fls_76o7m8vny72n + + :glossary: + :dp:`fls_e1j9s4odze9b` + A :dt:`right operand` is an :t:`operand` that appears on the right-hand side of + a :t:`binary operator`. + + :dp:`fls_hq7x1t5dmdlp` + See :s:`RightOperand`. + :chapter: + :dp:`fls_qxdpyf4u3hbz` + A :t:`right operand` is an :t:`operand` that appears on the right-hand side of a + :t:`binary operator`. :dp:`fls_2j132xueobfv` A :t:`subject expression` is an :t:`expression` that controls :t:`[for loop]s`, @@ -107,9 +209,24 @@ A :t:`subject let expression` is an :t:`expression` that controls .. rubric:: Dynamic Semantics -:dp:`fls_1223lwh4nq49` -:t:`Evaluation` is the process by which an :t:`expression` achieves its runtime -effects. +.. glossary-entry:: evaluation + :glossary-dp: fls_p3gre0895k2u + + :glossary: + :dp:`fls_8zmtio6razl1` + :dt:`Evaluation` is the process by which an :t:`expression` achieves its + runtime effects. + :chapter: + :dp:`fls_1223lwh4nq49` + :t:`Evaluation` is the process by which an :t:`expression` achieves its runtime + effects. + +.. glossary-entry:: evaluated + :glossary-dp: fls_pefe9ng1mm81 + + :glossary: + :dp:`fls_769tm6hn9g5e` + See :t:`evaluation`. .. _fls_isyftqu120l: @@ -123,10 +240,18 @@ Assignee Expressions .. rubric:: Legality Rules -:dp:`fls_oqj7s9fi3j3j` -An :t:`assignee expression` is an :t:`expression` that appears as the -:t:`left operand` of an :t:`assignment expression`. The following -:t:`[expression]s` are :t:`[assignee expression]s`: +.. glossary-entry:: assignee expression + :glossary-dp: fls_m1mim5qdzf2u + + :glossary: + :dp:`fls_wpmcexvbynbu` + An :dt:`assignee expression` is an :t:`expression` that appears as the + :t:`left operand` of an :t:`assignment expression`. + :chapter: + :dp:`fls_oqj7s9fi3j3j` + An :t:`assignee expression` is an :t:`expression` that appears as the + :t:`left operand` of an :t:`assignment expression`. The following + :t:`[expression]s` are :t:`[assignee expression]s`: * :dp:`fls_skopz71arbwa` :t:`[Place expression]s`, @@ -157,11 +282,19 @@ Constant Expressions .. rubric:: Legality Rules -:dp:`fls_1ji7368ieg0b` -A :t:`constant expression` is an :t:`expression` that can be evaluated -statically. The following :t:`[construct]s` are :t:`[constant expression]s` as -long as their :t:`[operand]s` are also :t:`[constant expression]s` and do not -involve :t:`[type]s` that require :t:`destruction`: +.. glossary-entry:: constant expression + :glossary-dp: fls_iofbib2gavnv + + :glossary: + :dp:`fls_rmn8w4rh3juf` + A :dt:`constant expression` is an :t:`expression` that can be evaluated + statically. + :chapter: + :dp:`fls_1ji7368ieg0b` + A :t:`constant expression` is an :t:`expression` that can be evaluated + statically. The following :t:`[construct]s` are :t:`[constant expression]s` as + long as their :t:`[operand]s` are also :t:`[constant expression]s` and do not + involve :t:`[type]s` that require :t:`destruction`: * :dp:`fls_y6ore0iwx7e0` :t:`[Arithmetic expression]s` of :t:`[scalar type]s`, @@ -282,10 +415,18 @@ It is a static error if the :t:`size operand` of an :t:`array repetition constructor` or an :t:`array type` depends on :t:`[generic parameter]s`. -:dp:`fls_kjhma680hz3g` -A :t:`constant context` is a :t:`construct` that requires a -:t:`constant expression`. The following :t:`[construct]s` are -:t:`[constant context]s`: +.. glossary-entry:: constant context + :glossary-dp: fls_mtbhv6e9izzm + + :glossary: + :dp:`fls_9j6mc4i1t73z` + A :dt:`constant context` is a :t:`construct` that requires a + :t:`constant expression`. + :chapter: + :dp:`fls_kjhma680hz3g` + A :t:`constant context` is a :t:`construct` that requires a + :t:`constant expression`. The following :t:`[construct]s` are + :t:`[constant context]s`: * :dp:`fls_ljc6jq5ksbcs` The :t:`constant initializer` of an :t:`associated constant` or a @@ -354,9 +495,17 @@ Diverging Expressions .. rubric:: Legality Rules -:dp:`fls_oth9vFtcb9l4` -A :t:`diverging expression` is an :t:`expression` whose :t:`evaluation` causes -program flow to diverge from the normal :t:`evaluation` order. +.. glossary-entry:: diverging expression + :glossary-dp: fls_gDFsAj1Bvx7A + + :glossary: + :dp:`fls_fLlNzmB34cj9` + A :dt:`diverging expression` is an :t:`expression` whose :t:`evaluation` causes + program flow to diverge from the normal :t:`evaluation` order. + :chapter: + :dp:`fls_oth9vFtcb9l4` + A :t:`diverging expression` is an :t:`expression` whose :t:`evaluation` causes + program flow to diverge from the normal :t:`evaluation` order. :dp:`fls_cmBVodJMjZi7` :t:`[Diverging expression]s` are: @@ -389,9 +538,24 @@ Place Expressions .. rubric:: Legality Rules -:dp:`fls_qbrcg3cl9td` -A :t:`place expression` is an :t:`expression` that represents a memory -location. The following :t:`[expression]s` are :t:`[place expression]s`: +.. glossary-entry:: place + :glossary-dp: fls_5zjHBZMsCqJZ + + :glossary: + :dp:`fls_uCTiUBWHMPY9` + A :dt:`place` is a location where a :t:`value` resides. + +.. glossary-entry:: place expression + :glossary-dp: fls_7x6jhh0sz2f + + :glossary: + :dp:`fls_z6mgu2mk142r` + A :dt:`place expression` is an :t:`expression` that represents a memory + location. + :chapter: + :dp:`fls_qbrcg3cl9td` + A :t:`place expression` is an :t:`expression` that represents a memory + location. The following :t:`[expression]s` are :t:`[place expression]s`: * :dp:`fls_jpmhibm4omm7` :t:`[Dereference expression]s`, @@ -412,10 +576,18 @@ location. The following :t:`[expression]s` are :t:`[place expression]s`: * :dp:`fls_gv4M0DE3OMwk` A :t:`temporary`. -:dp:`fls_ku38h562vfyl` -A :t:`mutable place expression` is a :t:`place expression` whose memory -location can be modified. The following :t:`[place expression]s` are -:t:`[mutable place expression]s`: +.. glossary-entry:: mutable place expression + :glossary-dp: fls_7eyza445ew53 + + :glossary: + :dp:`fls_kq877s3vij70` + A :dt:`mutable place expression` is a :t:`place expression` whose memory + location can be modified. + :chapter: + :dp:`fls_ku38h562vfyl` + A :t:`mutable place expression` is a :t:`place expression` whose memory + location can be modified. The following :t:`[place expression]s` are + :t:`[mutable place expression]s`: * :dp:`fls_1tq2o2huda9l` A :t:`dereference expression` whose :t:`operand`'s :t:`type` implements the @@ -451,14 +623,30 @@ location can be modified. The following :t:`[place expression]s` are * :dp:`fls_dcm3yr3y9y0a` A :t:`temporary`. -:dp:`fls_cPEMHZtPkctX` -An :t:`immutable place expression` is a :t:`place expression` whose memory -location cannot be modified. All :t:`[place expression]s` that are not -:t:`[mutable place expression]s` are :t:`[immutable place expression]s`. - -:dp:`fls_4vxi1ji93dxb` -A :t:`place expression context` is a :t:`construct` that may evaluate its -:t:`operand` as a memory location. +.. glossary-entry:: immutable place expression + :glossary-dp: fls_TXQzFM77s4uj + + :glossary: + :dp:`fls_MXBEZjzBxw5Z` + An :dt:`immutable place expression` is a :t:`place expression` whose memory + location cannot be modified. + :chapter: + :dp:`fls_cPEMHZtPkctX` + An :t:`immutable place expression` is a :t:`place expression` whose memory + location cannot be modified. All :t:`[place expression]s` that are not + :t:`[mutable place expression]s` are :t:`[immutable place expression]s`. + +.. glossary-entry:: place expression context + :glossary-dp: fls_tshbqttxdox1 + + :glossary: + :dp:`fls_fqcx8suiy5k` + A :dt:`place expression context` is a :t:`construct` that may evaluate its + operand as a memory location. + :chapter: + :dp:`fls_4vxi1ji93dxb` + A :t:`place expression context` is a :t:`construct` that may evaluate its + :t:`operand` as a memory location. :dp:`fls_fzsrdrHnndRd` The following :t:`[construct]s` are :t:`[place expression context]s`: @@ -498,10 +686,26 @@ The following :t:`[construct]s` are :t:`[place expression context]s`: * :dp:`fls_JBfZuFDQg3mU` The :t:`base initializer` of a :t:`struct expression`. -:dp:`fls_wxGAOWEVT77u` -A :t:`mutable place expression context` is a :t:`place expression context` that -may evaluate its :t:`operand` as a mutable memory location. The following -:t:`[construct]s` are :t:`[mutable place expression context]s`: +.. glossary-entry:: immutable place expression context + :glossary-dp: fls_O0924m8mSfIa + + :glossary: + :dp:`fls_UvrQ49dSoQGc` + An :dt:`immutable place expression context` is a :t:`place expression context` + whose memory location cannot be modified. + +.. glossary-entry:: mutable place expression context + :glossary-dp: fls_x5BKVLc4KDlK + + :glossary: + :dp:`fls_2ixH8LWGHi3k` + A :dt:`mutable place expression context` is a :t:`place expression context` + that may evaluate its :t:`operand` as a mutable memory location. + :chapter: + :dp:`fls_wxGAOWEVT77u` + A :t:`mutable place expression context` is a :t:`place expression context` that + may evaluate its :t:`operand` as a mutable memory location. The following + :t:`[construct]s` are :t:`[mutable place expression context]s`: * :dp:`fls_qytgkbhqr5ln` The :t:`indexed operand` of an :t:`index expression` if evaluated in a @@ -548,14 +752,29 @@ Value Expressions .. rubric:: Legality Rules -:dp:`fls_7q4hrt6yfr9b` -A :t:`value expression` is an :t:`expression` that represents a :t:`value`. -All :t:`[expression]s` that are not :t:`[place expression]s` are -:t:`[value expression]s`. - -:dp:`fls_pB6xlp4uAg37` -A :t:`value expression context` is an expression context that is not a -:t:`place expression context`. +.. glossary-entry:: value expression + :glossary-dp: fls_h03noz6jzpyl + + :glossary: + :dp:`fls_mn6tcuz5j3p` + A :dt:`value expression` is an :t:`expression` that represents a :t:`value`. + :chapter: + :dp:`fls_7q4hrt6yfr9b` + A :t:`value expression` is an :t:`expression` that represents a :t:`value`. + All :t:`[expression]s` that are not :t:`[place expression]s` are + :t:`[value expression]s`. + +.. glossary-entry:: value expression context + :glossary-dp: fls_7xiaXXSwy4GP + + :glossary: + :dp:`fls_NGGZEbmoLRbD` + A :dt:`value expression context` is an expression context that is not a + :t:`place expression context`. + :chapter: + :dp:`fls_pB6xlp4uAg37` + A :t:`value expression context` is an expression context that is not a + :t:`place expression context`. :dp:`fls_8uhfwqurbyqf` The evaluation of a :t:`value expression` in a :t:`place expression context` @@ -576,8 +795,18 @@ Literal Expressions .. rubric:: Legality Rules -:dp:`fls_rbwwczom3agt` -A :t:`literal expression` is an :t:`expression` that denotes a :t:`literal`. +.. glossary-entry:: literal expression + :glossary-dp: fls_b57clq8jhw5w + + :glossary: + :dp:`fls_otaauusc24v5` + A :dt:`literal expression` is an :t:`expression` that denotes a :t:`literal`. + + :dp:`fls_7po7zobtlhzn` + See :s:`LiteralExpression`. + :chapter: + :dp:`fls_rbwwczom3agt` + A :t:`literal expression` is an :t:`expression` that denotes a :t:`literal`. :dp:`fls_w30su9x4q13r` The :t:`type` of a :t:`literal expression` is the :t:`type` of the corresponding @@ -615,8 +844,18 @@ Path Expressions .. rubric:: Legality Rules -:dp:`fls_gvanx4874ycy` -A :t:`path expression` is an :t:`expression` that denotes a :t:`path`. +.. glossary-entry:: path expression + :glossary-dp: fls_1xdj34py8zc3 + + :glossary: + :dp:`fls_4ik66nmvx5hn` + A :dt:`path expression` is a :t:`path` that acts as an :t:`expression`. + + :dp:`fls_3qjpjqm0legc` + See :s:`PathExpression`. + :chapter: + :dp:`fls_gvanx4874ycy` + A :t:`path expression` is an :t:`expression` that denotes a :t:`path`. :dp:`fls_EOkrcIj9CuhV` A :t:`path expression` shall resolve to either a :t:`constant parameter`, a @@ -662,13 +901,32 @@ Block Expressions .. rubric:: Legality Rules -:dp:`fls_nf65p0l0v0gr` -A :t:`block expression` is an :t:`expression` that sequences :t:`[expression]s` -and :t:`[statement]s`. - -:dp:`fls_tn3hj7k2lliu` -A :t:`tail expression` is the last :t:`expression` within a :t:`block -expression`. +.. glossary-entry:: block expression + :glossary-dp: fls_c5qn7wjk0mnx + + :glossary: + :dp:`fls_gvjvzxi2xps4` + A :dt:`block expression` is an :t:`expression` that sequences expressions and + :t:`[statement]s`. + + :dp:`fls_h8j9t2xq2i1u` + See :s:`BlockExpression`. + :chapter: + :dp:`fls_nf65p0l0v0gr` + A :t:`block expression` is an :t:`expression` that sequences :t:`[expression]s` + and :t:`[statement]s`. + +.. glossary-entry:: tail expression + :glossary-dp: fls_psd2ll10ixs + + :glossary: + :dp:`fls_6k873f1knasi` + A :dt:`tail expression` is the last :t:`expression` within a + :t:`block expression`. + :chapter: + :dp:`fls_tn3hj7k2lliu` + A :t:`tail expression` is the last :t:`expression` within a :t:`block + expression`. :dp:`fls_DfCne8YWevLE` When the remaining :t:`[lexical element]s` of a :s:`StatementList` match either @@ -745,10 +1003,29 @@ Async Blocks .. rubric:: Legality Rules -:dp:`fls_hhidi5ukxo` -An :t:`async block expression` is a :t:`block expression` that is specified -with :t:`keyword` ``async`` and encapsulates behavior which is executed in -an asynchronous manner. +.. glossary-entry:: async block + :glossary-dp: fls_9speqyus5ku3 + + :glossary: + :dp:`fls_pf6lrmcjywoj` + For :dt:`async block`, see :t:`async block expression`. + +.. glossary-entry:: async block expression + :glossary-dp: fls_n5m58be9jnjj + + :glossary: + :dp:`fls_p6nvfs7bfoxd` + An :dt:`async block expression` is a :t:`block expression` that is specified + with :t:`keyword` ``async`` and encapsulates behavior which is executed in + an asynchronous manner. + + :dp:`fls_je689rormhd6` + See :s:`AsyncBlockExpression`. + :chapter: + :dp:`fls_hhidi5ukxo` + An :t:`async block expression` is a :t:`block expression` that is specified + with :t:`keyword` ``async`` and encapsulates behavior which is executed in + an asynchronous manner. :dp:`fls_oisws5qykedi` An :t:`async block expression` denotes a new :t:`async control flow boundary`. @@ -793,10 +1070,19 @@ Const Blocks .. rubric:: Legality Rules -:dp:`fls_0lcunL4bo8ka` -A :t:`const block expression` is a :t:`block expression` that is specified -with :t:`keyword` ``const`` and encapsulates behavior which is evaluated -statically. +.. glossary-entry:: const block expression + :glossary-dp: fls_vuBjK3kdImTn + + :glossary: + :dp:`fls_5ApoJzRSTZGH` + A :dt:`const block expression` is a :t:`block expression` that is specified + with :t:`keyword` ``const`` and encapsulates behavior which is evaluated + statically. + :chapter: + :dp:`fls_0lcunL4bo8ka` + A :t:`const block expression` is a :t:`block expression` that is specified + with :t:`keyword` ``const`` and encapsulates behavior which is evaluated + statically. :dp:`fls_veEGzEbpT4ny` An :t:`const block expression` denotes a new :t:`control flow boundary`. @@ -835,8 +1121,15 @@ Named Blocks .. rubric:: Legality Rules -:dp:`fls_J8wJNfcSAYrS` -A :t:`named block expression` is a :t:`block expression` with a :t:`label`. +.. glossary-entry:: named block expression + :glossary-dp: fls_CxzbzLu4pWPY + + :glossary: + :dp:`fls_ivFb8uAMVY3Q` + A :dt:`named block expression` is a :t:`block expression` with a :t:`label`. + :chapter: + :dp:`fls_J8wJNfcSAYrS` + A :t:`named block expression` is a :t:`block expression` with a :t:`label`. :dp:`fls_B4NBv2jfZLuy` The :t:`type` of the :t:`named block expression` is the :t:`type` of its @@ -869,9 +1162,27 @@ Unsafe Blocks .. rubric:: Legality Rules -:dp:`fls_2az5huhcxzzy` -An :t:`unsafe block expression` is a :t:`block expression` that is specified -with :t:`keyword` ``unsafe``. +.. glossary-entry:: unsafe block + :glossary-dp: fls_6349nvapfj9d + + :glossary: + :dp:`fls_8tkolhmd6xfp` + For :dt:`unsafe block`, see :t:`unsafe block expression`. + +.. glossary-entry:: unsafe block expression + :glossary-dp: fls_u8sdp2fxz9pn + + :glossary: + :dp:`fls_et2h89jyivhs` + An :dt:`unsafe block expression` is a :t:`block expression` that is specified + with :t:`keyword` ``unsafe``. + + :dp:`fls_c94rudunhp5b` + See :s:`UnsafeBlockExpression`. + :chapter: + :dp:`fls_2az5huhcxzzy` + An :t:`unsafe block expression` is a :t:`block expression` that is specified + with :t:`keyword` ``unsafe``. :dp:`fls_5ucvvja4dzoc` An :t:`unsafe block expression` allows :t:`unsafety`. @@ -923,8 +1234,25 @@ Operator Expressions .. rubric:: Legality Rules -:dp:`fls_ursc5ynymoy` -An :t:`operator expression` is an :t:`expression` that involves an operator. +.. glossary-entry:: operator expression + :glossary-dp: fls_smk8mi72lt57 + + :glossary: + :dp:`fls_6ev01xwcfow1` + An :dt:`operator expression` is an :t:`expression` that involves an operator. + + :dp:`fls_qdszbyeuo7w1` + See :s:`OperatorExpression`. + :chapter: + :dp:`fls_ursc5ynymoy` + An :t:`operator expression` is an :t:`expression` that involves an operator. + +.. glossary-entry:: unary operator + :glossary-dp: fls_p032easjag3d + + :glossary: + :dp:`fls_p6mk2zrwgwem` + A :dt:`unary operator` operates on one :t:`operand`. .. rubric:: Dynamic Semantics @@ -945,18 +1273,54 @@ Borrow Expression .. rubric:: Legality Rules -:dp:`fls_nnqfkl228hjx` -A :t:`borrow expression` is an :t:`expression` that borrows the :t:`value` of -its :t:`operand` and creates a :t:`reference` to the memory location of its -:t:`operand`. - -:dp:`fls_r7ix8webgqlm` -An :t:`immutable borrow expression` is a :t:`borrow expression` that lacks -:t:`keyword` ``mut``. - -:dp:`fls_50j167r4v61b` -A :t:`mutable borrow expression` is a :t:`borrow expression` that has -:t:`keyword` ``mut``. +.. glossary-entry:: borrow expression + :glossary-dp: fls_u0hymkjwyur7 + + :glossary: + :dp:`fls_2f55piwg78ru` + A :dt:`borrow expression` is an :t:`expression` that borrows the :t:`value` + of its :t:`operand` and creates a :t:`reference` to the memory location of its + operand. + + :dp:`fls_c3hydbp2exok` + See :s:`BorrowExpression`. + :chapter: + :dp:`fls_nnqfkl228hjx` + A :t:`borrow expression` is an :t:`expression` that borrows the :t:`value` of + its :t:`operand` and creates a :t:`reference` to the memory location of its + :t:`operand`. + +.. glossary-entry:: immutable borrow expression + :glossary-dp: fls_pqunxp6io1n9 + + :glossary: + :dp:`fls_dojod5pg4r7l` + An :dt:`immutable borrow expression` is a :t:`borrow expression` that lacks + :t:`keyword` ``mut``. + :chapter: + :dp:`fls_r7ix8webgqlm` + An :t:`immutable borrow expression` is a :t:`borrow expression` that lacks + :t:`keyword` ``mut``. + +.. glossary-entry:: shared borrow + :glossary-dp: fls_c9xwhhg639u5 + + :glossary: + :dp:`fls_gmbskxin90zi` + A :dt:`shared borrow` is a :t:`borrow` produced by evaluating an + :t:`immutable borrow expression`. + +.. glossary-entry:: mutable borrow expression + :glossary-dp: fls_kw3oiotr98tt + + :glossary: + :dp:`fls_80kcc4y21hu6` + A :dt:`mutable borrow expression` is a :t:`borrow expression` that has + :t:`keyword` ``mut``. + :chapter: + :dp:`fls_50j167r4v61b` + A :t:`mutable borrow expression` is a :t:`borrow expression` that has + :t:`keyword` ``mut``. :dp:`fls_ya77l2zgtilp` When the :t:`operand` of a :t:`borrow expression` is a :t:`place expression`, @@ -964,6 +1328,14 @@ the :t:`borrow expression` produces a :t:`reference` to the memory location indicated by the :t:`operand`. The memory location is placed in a borrowed state, or simply :t:`borrowed`. +.. glossary-entry:: borrowed + :glossary-dp: fls_gl84828b074a + + :glossary: + :dp:`fls_3gnps2s95ck4` + A memory location is :dt:`borrowed` when a :t:`reference` pointing to it is + :t:`active`. + :dp:`fls_chr03xll75d` The :t:`type` of a :t:`borrow expression` is determined as follows: @@ -1015,8 +1387,18 @@ Raw Borrow Expression .. rubric:: Legality Rules -:dp:`fls_TS6DvMon5h27` -A :t:`raw borrow expression` is an :t:`expression` that creates a :t:`raw pointer` to the memory location of its :t:`operand` without incurring a :t:`borrow`. +.. glossary-entry:: raw borrow expression + :glossary-dp: fls_YLhE2qpzYXRK + + :glossary: + :dp:`fls_Fe39wLb0vvEg` + A :dt:`raw borrow expression` is an :t:`expression` that creates a :t:`raw pointer` to the memory location of its :t:`operand` without incurring a :t:`borrow`. + + :dp:`fls_I71jq8BGyLqi` + See :s:`RawBorrowExpression`. + :chapter: + :dp:`fls_TS6DvMon5h27` + A :t:`raw borrow expression` is an :t:`expression` that creates a :t:`raw pointer` to the memory location of its :t:`operand` without incurring a :t:`borrow`. :dp:`fls_UtjWrE2qeplQ` An :dt:`immutable raw borrow expression` is a :t:`raw borrow expression` that has :t:`keyword` ``const``. @@ -1074,9 +1456,28 @@ Dereference Expression .. rubric:: Legality Rules -:dp:`fls_f6wktzofzdn1` -A :t:`dereference expression` is an :t:`expression` that obtains the pointed-to -memory location of its :t:`operand`. +.. glossary-entry:: dereference expression + :glossary-dp: fls_o588wfq878rm + + :glossary: + :dp:`fls_3cuyhbh2llei` + A :dt:`dereference expression` is an :t:`expression` that obtains the + pointed-to memory location of its :t:`operand`. + + :dp:`fls_hx0jwahdb1nf` + See :s:`DereferenceExpression`. + :chapter: + :dp:`fls_f6wktzofzdn1` + A :t:`dereference expression` is an :t:`expression` that obtains the pointed-to + memory location of its :t:`operand`. + +.. glossary-entry:: dereference + :glossary-dp: fls_127n1n5ssk2b + + :glossary: + :dp:`fls_hk97pb1qt04y` + A :dt:`dereference` is the memory location produced by evaluating a + :t:`dereference expression`. :dp:`fls_aeh5pzpcjveq` When the :t:`operand` of a :t:`dereference expression` is of a :t:`pointer @@ -1129,6 +1530,15 @@ The :t:`value` of a :t:`dereference expression` is determined as follows: :dp:`fls_72bpdsxxbgeq` The :t:`evaluation` of a :t:`dereference expression` evaluates its :t:`operand`. +.. glossary-entry:: dangling + :glossary-dp: fls_76cj65bptdpn + + :glossary: + :dp:`fls_lq2urzh7bzxx` + A :t:`value` of an :t:`indirection type` is :dt:`dangling` if it is either + :c:`null` or not all of the bytes at the referred memory location are part of + the same allocation. + .. rubric:: Undefined Behavior :dp:`fls_9wgldua1u8yt` @@ -1158,10 +1568,22 @@ Error Propagation Expression .. rubric:: Legality Rules -:dp:`fls_8q59wbumrt5s` -An :t:`error propagation expression` is an :t:`expression` that either evaluates -to a :t:`value` of its :t:`operand` or returns a value to the enclosing control -flow boundary. +.. glossary-entry:: error propagation expression + :glossary-dp: fls_kz7tgpi8xkt4 + + :glossary: + :dp:`fls_5kebgodxtqqt` + An :dt:`error propagation expression` is an :t:`expression` that either + evaluates to a :t:`value` of its :t:`operand` or returns a value to the next + control flow boundary. + + :dp:`fls_agyqvyda3rcj` + See :s:`ErrorPropagationExpression`. + :chapter: + :dp:`fls_8q59wbumrt5s` + An :t:`error propagation expression` is an :t:`expression` that either evaluates + to a :t:`value` of its :t:`operand` or returns a value to the enclosing control + flow boundary. :dp:`fls_mq2h4seoxah` An :t:`error propagation expression` shall appear within a :t:`control flow @@ -1242,8 +1664,18 @@ Negation Expression .. rubric:: Legality Rules -:dp:`fls_pfa81kv2mru8` -A :t:`negation expression` is an :t:`expression` that negates its :t:`operand`. +.. glossary-entry:: negation expression + :glossary-dp: fls_3sp4twvfvb32 + + :glossary: + :dp:`fls_pmn6cjamdt0a` + A :dt:`negation expression` is an :t:`expression` that negates its :t:`operand`. + + :dp:`fls_o1f35ud4klvv` + See :s:`NegationExpression`. + :chapter: + :dp:`fls_pfa81kv2mru8` + A :t:`negation expression` is an :t:`expression` that negates its :t:`operand`. :dp:`fls_plcut8vzdwox` The :t:`type` of the :t:`operand` of a :t:`negation expression` with a @@ -1383,12 +1815,41 @@ Arithmetic Expressions .. rubric:: Legality Rules -:dp:`fls_asibqpe3z95h` -An :t:`arithmetic expression` is an :t:`expression` that computes a :t:`value` -from two :t:`[operand]s` using arithmetic. - -:dp:`fls_kr8Opj3c7uvb` -An :t:`addition expression` is an :t:`arithmetic expression` that uses addition. +.. glossary-entry:: arithmetic operator + :glossary-dp: fls_kSuc3Gi7cdly + + :glossary: + :dp:`fls_Qf7DckakqvRq` + An :dt:`arithmetic operator` is the operator of an :t:`arithmetic expression`. + +.. glossary-entry:: arithmetic expression + :glossary-dp: fls_kf81ozijral2 + + :glossary: + :dp:`fls_u3z2r1fw89xo` + An :dt:`arithmetic expression` is an :t:`expression` that computes a :t:`value` + from two :t:`[operand]s` using arithmetic. + + :dp:`fls_in59ccg4g3we` + See :s:`ArithmeticExpression`. + :chapter: + :dp:`fls_asibqpe3z95h` + An :t:`arithmetic expression` is an :t:`expression` that computes a :t:`value` + from two :t:`[operand]s` using arithmetic. + +.. glossary-entry:: addition expression + :glossary-dp: fls_mcabdigrqv21 + + :glossary: + :dp:`fls_ylfdtuajmi0t` + An :dt:`addition expression` is an :t:`arithmetic expression` that uses + addition. + + :dp:`fls_5bgx5dyi817x` + See :s:`AdditionExpression`. + :chapter: + :dp:`fls_kr8Opj3c7uvb` + An :t:`addition expression` is an :t:`arithmetic expression` that uses addition. :dp:`fls_8imzo7agyx0k` The :t:`type` of the :t:`left operand` of an :t:`addition expression` shall @@ -1403,8 +1864,18 @@ The :t:`type` of an :t:`addition expression` is :t:`associated type` The :t:`value` of an :t:`addition expression` is the result of ``core::ops::Add::add(left_operand, right_operand)``. -:dp:`fls_dstca76y08ge` -A :t:`division expression` is an :t:`arithmetic expression` that uses division. +.. glossary-entry:: division expression + :glossary-dp: fls_vxd5q8nekkn0 + + :glossary: + :dp:`fls_du05yp205f4y` + A :dt:`division expression` is an :t:`arithmetic expression` that uses division. + + :dp:`fls_d3vwk4autyd` + See :s:`DivisionExpression`. + :chapter: + :dp:`fls_dstca76y08ge` + A :t:`division expression` is an :t:`arithmetic expression` that uses division. :dp:`fls_f1puss9t4btz` The :t:`type` of the :t:`left operand` of a :t:`division expression` shall @@ -1419,9 +1890,20 @@ The :t:`type` of a :t:`division expression` is :t:`associated type` The :t:`value` of a :t:`division expression` is the result of ``core::ops::Div::div(left_operand, right_operand)``. -:dp:`fls_kf41bphvlse3` -A :t:`multiplication expression` is an :t:`arithmetic expression` that uses -multiplication. +.. glossary-entry:: multiplication expression + :glossary-dp: fls_bgtznqqgtmd8 + + :glossary: + :dp:`fls_324qh8wz474b` + A :dt:`multiplication expression` is an :t:`arithmetic expression` that uses + multiplication. + + :dp:`fls_34bkl5i75q5` + See :s:`MultiplicationExpression`. + :chapter: + :dp:`fls_kf41bphvlse3` + A :t:`multiplication expression` is an :t:`arithmetic expression` that uses + multiplication. :dp:`fls_hrml95g2txcj` The :t:`type` of the :t:`left operand` of a :t:`multiplication expression` @@ -1436,9 +1918,20 @@ The :t:`type` of a :t:`multiplication expression` is :t:`associated type` The :t:`value` of a :t:`multiplication expression` is the result of ``core::ops::Mul::mul(left_operand, right_operand)``. -:dp:`fls_3de9ulyzuoa` -A :t:`remainder expression` is an :t:`arithmetic expression` that uses remainder -division. +.. glossary-entry:: remainder expression + :glossary-dp: fls_f15h4919ln3k + + :glossary: + :dp:`fls_l6muwnclm1do` + A :dt:`remainder expression` is an :t:`arithmetic expression` that uses + remainder division. + + :dp:`fls_h98qlby2uiru` + See :s:`RemainderExpression`. + :chapter: + :dp:`fls_3de9ulyzuoa` + A :t:`remainder expression` is an :t:`arithmetic expression` that uses remainder + division. :dp:`fls_8fbhreyynhid` The :t:`type` of the :t:`left operand` of a :t:`remainder expression` shall @@ -1453,9 +1946,20 @@ The :t:`type` of a :t:`remainder expression` is :t:`associated type` The :t:`value` of a :t:`remainder expression` is the result of ``core::ops::Rem::rem(left_operand, right_operand)``. -:dp:`fls_aalxhbvu8kdi` -A :t:`subtraction expression` is an :t:`arithmetic expression` that uses -subtraction. +.. glossary-entry:: subtraction expression + :glossary-dp: fls_25ru96mfdcsn + + :glossary: + :dp:`fls_caamjgpw59id` + A :dt:`subtraction expression` is an :t:`arithmetic expression` that uses + subtraction. + + :dp:`fls_mx3olnbntpye` + See :s:`SubtractionExpression`. + :chapter: + :dp:`fls_aalxhbvu8kdi` + A :t:`subtraction expression` is an :t:`arithmetic expression` that uses + subtraction. :dp:`fls_fjcv1nm8tlgf` The :t:`type` of the :t:`left operand` of a :t:`subtraction expression` shall @@ -1640,12 +2144,34 @@ Bit Expressions .. rubric:: Legality Rules -:dp:`fls_3zd59yuywz6l` -A :t:`bit expression` is an :t:`expression` that computes a :t:`value` from two -:t:`[operand]s` using bit arithmetic. - -:dp:`fls_f6mmva3lbj1i` -A :t:`bit and expression` is a :t:`bit expression` that uses bit and arithmetic. +.. glossary-entry:: bit expression + :glossary-dp: fls_ed6yltkt0gb1 + + :glossary: + :dp:`fls_b3p5xqsfolqo` + A :dt:`bit expression` is an :t:`expression` that computes a :t:`value` from + two :t:`[operand]s` using bit arithmetic. + + :dp:`fls_iw1k2cfwfjou` + See :s:`BitExpression`. + :chapter: + :dp:`fls_3zd59yuywz6l` + A :t:`bit expression` is an :t:`expression` that computes a :t:`value` from two + :t:`[operand]s` using bit arithmetic. + +.. glossary-entry:: bit and expression + :glossary-dp: fls_h6sh4im3gjys + + :glossary: + :dp:`fls_c1g5gljnr9kz` + A :dt:`bit and expression` is a :t:`bit expression` that uses bit and + arithmetic. + + :dp:`fls_vbsvu0troqci` + See :s:`BitAndExpression`. + :chapter: + :dp:`fls_f6mmva3lbj1i` + A :t:`bit and expression` is a :t:`bit expression` that uses bit and arithmetic. :dp:`fls_cmowpfrcelke` The :t:`type` of the :t:`left operand` of a :t:`bit and expression` shall @@ -1660,8 +2186,18 @@ The :t:`type` of a :t:`bit and expression` is :t:`associated type` The :t:`value` of a :t:`bit and expression` is the result of ``core::ops::BitAnd::bitand(left_operand, right_operand)``. -:dp:`fls_3136k1y6x3cu` -A :t:`bit or expression` is a :t:`bit expression` that uses bit or arithmetic. +.. glossary-entry:: bit or expression + :glossary-dp: fls_m33m8nd2rnf8 + + :glossary: + :dp:`fls_183aem60of9o` + A :dt:`bit or expression` is a :t:`bit expression` that uses bit or arithmetic. + + :dp:`fls_ctqsjp653tbt` + See :s:`BitOrExpression`. + :chapter: + :dp:`fls_3136k1y6x3cu` + A :t:`bit or expression` is a :t:`bit expression` that uses bit or arithmetic. :dp:`fls_oo2ynd8e1ys6` The :t:`type` of the :t:`left operand` of a :t:`bit or expression` shall @@ -1676,9 +2212,20 @@ The :t:`type` of a :t:`bit or expression` is :t:`associated type` The :t:`value` of a :t:`bit or expression` is the result of ``core::ops::BitOr::bitor(left_operand, right_operand)``. -:dp:`fls_j7ujcuthga1i` -A :t:`bit xor expression` is a :t:`bit expression` that uses bit exclusive or -arithmetic. +.. glossary-entry:: bit xor expression + :glossary-dp: fls_ixw1601j8u39 + + :glossary: + :dp:`fls_kccsvtzfhbp1` + A :dt:`bit xor expression` is a :t:`bit expression` that uses bit exclusive or + arithmetic. + + :dp:`fls_6qulwlo43w6m` + See :s:`BitXorExpression`. + :chapter: + :dp:`fls_j7ujcuthga1i` + A :t:`bit xor expression` is a :t:`bit expression` that uses bit exclusive or + arithmetic. :dp:`fls_fnywefl9nty2` The :t:`type` of the :t:`left operand` of a :t:`bit xor expression` shall @@ -1693,9 +2240,20 @@ The :t:`type` of a :t:`bit xor expression` is :t:`associated type` The :t:`value` of a :t:`bit xor expression` is the result of ``core::ops::BitXor::bitxor(left_operand, right_operand)``. -:dp:`fls_caxn774ij8lk` -A :t:`shift left expression` is a :t:`bit expression` that uses bit shift left -arithmetic. +.. glossary-entry:: shift left expression + :glossary-dp: fls_sru4wi5jomoe + + :glossary: + :dp:`fls_phiv6k4emauc` + A :dt:`shift left expression` is a :t:`bit expression` that uses bit shift left + arithmetic. + + :dp:`fls_56lu9kenzig9` + See :s:`ShiftLeftExpression`. + :chapter: + :dp:`fls_caxn774ij8lk` + A :t:`shift left expression` is a :t:`bit expression` that uses bit shift left + arithmetic. :dp:`fls_1f4pc612f2a8` The :t:`type` of the :t:`left operand` of a :t:`shift left expression` shall @@ -1710,9 +2268,20 @@ The :t:`type` of a :t:`shift left expression` is :t:`associated type` The :t:`value` of a :t:`shift left expression` is the result of ``core::ops::Shl::shl(left_operand, right_operand)``. -:dp:`fls_t709sl4co3al` -A :t:`shift right expression` is a :t:`bit expression` that uses bit shift right -arithmetic. +.. glossary-entry:: shift right expression + :glossary-dp: fls_dj6epbraptqn + + :glossary: + :dp:`fls_j6itily0u0k9` + A :dt:`shift right expression` is a :t:`bit expression` that uses bit shift + right arithmetic. + + :dp:`fls_ex1mopil8w1p` + See :s:`ShiftRightExpression`. + :chapter: + :dp:`fls_t709sl4co3al` + A :t:`shift right expression` is a :t:`bit expression` that uses bit shift right + arithmetic. :dp:`fls_onutb0b9p9zj` The :t:`type` of the :t:`left operand` of a :t:`shift right expression` shall @@ -1858,9 +2427,20 @@ Comparison Expressions .. rubric:: Legality Rules -:dp:`fls_yzuceqx6nxwa` -A :t:`comparison expression` is an :t:`expression` that compares the -:t:`[value]s` of two :t:`[operand]s`. +.. glossary-entry:: comparison expression + :glossary-dp: fls_hjxuoe1hwlhm + + :glossary: + :dp:`fls_394p7gdruvk7` + A :dt:`comparison expression` is an :t:`expression` that compares the + :t:`[value]s` of two :t:`[operand]s`. + + :dp:`fls_1jk0s7389mt0` + See :s:`ComparisonExpression`. + :chapter: + :dp:`fls_yzuceqx6nxwa` + A :t:`comparison expression` is an :t:`expression` that compares the + :t:`[value]s` of two :t:`[operand]s`. :dp:`fls_asfrqemqviad` A :t:`comparison expression` implicitly takes :t:`[shared borrow]s` of its @@ -1869,8 +2449,18 @@ A :t:`comparison expression` implicitly takes :t:`[shared borrow]s` of its :dp:`fls_9s4re3ujnfis` The :t:`type` of a :t:`comparison expression` is :t:`type` :c:`bool`. -:dp:`fls_ruyho6cu7rxg` -An :t:`equals expression` is a :t:`comparison expression` that tests equality. +.. glossary-entry:: equals expression + :glossary-dp: fls_alifv570nx7q + + :glossary: + :dp:`fls_mn1g2hijtd6f` + An :dt:`equals expression` is a :t:`comparison expression` that tests equality. + + :dp:`fls_j32l4do0xw4d` + See :s:`EqualsExpression`. + :chapter: + :dp:`fls_ruyho6cu7rxg` + An :t:`equals expression` is a :t:`comparison expression` that tests equality. :dp:`fls_8echqk9po1cf` The :t:`type` of the :t:`left operand` of an :t:`equals expression` shall @@ -1881,9 +2471,20 @@ implement the :std:`core::cmp::PartialEq` :t:`trait` where the :t:`type` of the The :t:`value` of an :t:`equals expression` is the result of ``core::cmp::PartialEq::eq(&left_operand, &right_operand)``. -:dp:`fls_wapl0ir7uvbp` -A :t:`greater-than expression` is a :t:`comparison expression` that tests for a -greater-than relationship. +.. glossary-entry:: greater-than expression + :glossary-dp: fls_g4n20dy3utzy + + :glossary: + :dp:`fls_j7x5qii6rhwj` + A :dt:`greater-than expression` is a :t:`comparison expression` that tests for + a greater-than relationship. + + :dp:`fls_yni50ba3ufvs` + See :s:`GreaterThanExpression`. + :chapter: + :dp:`fls_wapl0ir7uvbp` + A :t:`greater-than expression` is a :t:`comparison expression` that tests for a + greater-than relationship. :dp:`fls_x2s6ydvj5zyd` The :t:`type` of the :t:`left operand` of a :t:`greater-than expression` shall @@ -1894,9 +2495,20 @@ implement the :std:`core::cmp::PartialOrd` :t:`trait` where the :t:`type` of the The :t:`value` of a :t:`greater-than expression` is the result of ``core::cmp::PartialOrd::gt(&left_operand, &right_operand)``. -:dp:`fls_7n5gol6a8lod` -A :t:`greater-than-or-equals expression` is a :t:`comparison expression` that -tests for a greater-than-or-equals relationship. +.. glossary-entry:: greater-than-or-equals expression + :glossary-dp: fls_mxz589rq4hiy + + :glossary: + :dp:`fls_wvspqc2otn6v` + A :dt:`greater-than-or-equals expression` is a :t:`comparison expression` that + tests for a greater-than-or-equals relationship. + + :dp:`fls_9azbvj9xux6y` + See :s:`GreaterThanOrEqualsExpression`. + :chapter: + :dp:`fls_7n5gol6a8lod` + A :t:`greater-than-or-equals expression` is a :t:`comparison expression` that + tests for a greater-than-or-equals relationship. :dp:`fls_hholzcbp5u3n` The :t:`type` of the :t:`left operand` of a @@ -1908,9 +2520,20 @@ The :t:`type` of the :t:`left operand` of a The :t:`value` of a :t:`greater-than-or-equals expression` is the result of ``core::cmp::PartialOrd::ge(&left_operand, &right_operand)``. -:dp:`fls_yd4qqi39w248` -A :t:`less-than expression` is a :t:`comparison expression` that tests for a -less-than relationship. +.. glossary-entry:: less-than expression + :glossary-dp: fls_ulmspewtlo57 + + :glossary: + :dp:`fls_9ttxqxt9ui4t` + A :dt:`less-than expression` is a :t:`comparison expression` that tests for a + less-than relationship. + + :dp:`fls_rhnbdyo2l4kp` + See :s:`LessThanExpression`. + :chapter: + :dp:`fls_yd4qqi39w248` + A :t:`less-than expression` is a :t:`comparison expression` that tests for a + less-than relationship. :dp:`fls_ynibdcke3etb` The :t:`type` of the :t:`left operand` of a :t:`less-than expression` shall @@ -1921,9 +2544,20 @@ the :t:`right operand` is the :t:`trait implementation` :t:`type parameter`. The :t:`value` of a :t:`less-than expression` is the result of ``core::cmp::PartialOrd::lt(&left_operand, &right_operand)``. -:dp:`fls_yxwe1o27u6ns` -A :t:`less-than-or-equals expression` is a :t:`comparison expression` that tests -for a less-than-or-equals relationship. +.. glossary-entry:: less-than-or-equals expression + :glossary-dp: fls_es169x7ars9a + + :glossary: + :dp:`fls_8pya58ug180j` + A :dt:`less-than-or-equals expression` is a :t:`comparison expression` that + tests for a less-than-or-equals relationship. + + :dp:`fls_ft5aeo4ilgwc` + See :s:`LessThanOrEqualsExpression`. + :chapter: + :dp:`fls_yxwe1o27u6ns` + A :t:`less-than-or-equals expression` is a :t:`comparison expression` that tests + for a less-than-or-equals relationship. :dp:`fls_6dgfieyxdan0` The :t:`type` of the :t:`left operand` of a :t:`less-than-or-equals expression` @@ -1934,9 +2568,20 @@ of the :t:`right operand` is the :t:`trait implementation` :t:`type parameter`. The :t:`value` of a :t:`less-than-or-equals expression` is the result of ``core::cmp::PartialOrd::le(&left_operand, &right_operand)``. -:dp:`fls_w71j7i3n1kit` -A :t:`not-equals expression` is a :t:`comparison expression` that tests for -inequality. +.. glossary-entry:: not-equals expression + :glossary-dp: fls_shgatqvpdqkg + + :glossary: + :dp:`fls_2hmynl94uusk` + A :dt:`not-equals expression` is a :t:`comparison expression` that tests for + inequality. + + :dp:`fls_5d6vvr9m35n2` + See :s:`NotEqualsExpression`. + :chapter: + :dp:`fls_w71j7i3n1kit` + A :t:`not-equals expression` is a :t:`comparison expression` that tests for + inequality. :dp:`fls_qzo1torhv5i3` The :t:`type` of the :t:`left operand` of a :t:`not-equals expression` shall @@ -2055,17 +2700,50 @@ Lazy Boolean Expressions .. rubric:: Legality Rules -:dp:`fls_gpbvus89iy4c` -A :t:`lazy boolean expression` is an :t:`expression` that performs short circuit -Boolean arithmetic. - -:dp:`fls_40jya46h62yi` -A :t:`lazy and expression` is a :t:`lazy boolean expression` that uses short -circuit and arithmetic. - -:dp:`fls_k8u77ow5bb6c` -A :t:`lazy or expression` is a :t:`lazy boolean expression` that uses short -circuit or arithmetic. +.. glossary-entry:: lazy boolean expression + :glossary-dp: fls_4a6yhxj783a1 + + :glossary: + :dp:`fls_jpv7l86sdh6i` + A :dt:`lazy boolean expression` is an :t:`expression` that performs short + circuit Boolean arithmetic. + + :dp:`fls_9tu5x810ztbg` + See :s:`LazyBooleanExpression`. + :chapter: + :dp:`fls_gpbvus89iy4c` + A :t:`lazy boolean expression` is an :t:`expression` that performs short circuit + Boolean arithmetic. + +.. glossary-entry:: lazy and expression + :glossary-dp: fls_bputdgkeezfs + + :glossary: + :dp:`fls_v2e6t73uk6nt` + A :dt:`lazy and expression` is a :t:`lazy boolean expression` that uses short + circuit and arithmetic. + + :dp:`fls_rkthjuvems6v` + See :s:`LazyAndExpression`. + :chapter: + :dp:`fls_40jya46h62yi` + A :t:`lazy and expression` is a :t:`lazy boolean expression` that uses short + circuit and arithmetic. + +.. glossary-entry:: lazy or expression + :glossary-dp: fls_9mvrfhsegwp0 + + :glossary: + :dp:`fls_aln8bbvx9kzm` + A :dt:`lazy or expression` is a :t:`lazy boolean expression` that uses short + circuit or arithmetic. + + :dp:`fls_jiv7e3mr86kf` + See :s:`LazyOrExpression`. + :chapter: + :dp:`fls_k8u77ow5bb6c` + A :t:`lazy or expression` is a :t:`lazy boolean expression` that uses short + circuit or arithmetic. :dp:`fls_u0gwo0s2l0tn` The :t:`[type]s` of the :t:`[operand]s` of a :t:`lazy boolean expression` shall @@ -2127,13 +2805,32 @@ Type Cast Expressions .. rubric:: Legality Rules -:dp:`fls_ltioqbhl14g0` -A :t:`type cast expression` is an :t:`expression` that changes the :t:`type` of -an :t:`operand`. - -:dp:`fls_99kvyh4puy57` -:t:`Cast` or :t:`casting` is the process of changing the :t:`type` of an -:t:`expression`. +.. glossary-entry:: type cast expression + :glossary-dp: fls_k24jb967nu1q + + :glossary: + :dp:`fls_j6zo3rir1x76` + A :dt:`type cast expression` is an :t:`expression` that changes the :t:`type` + of an :t:`operand`. + + :dp:`fls_dvh1xy9w74ch` + See :s:`TypeCastExpression`. + :chapter: + :dp:`fls_ltioqbhl14g0` + A :t:`type cast expression` is an :t:`expression` that changes the :t:`type` of + an :t:`operand`. + +.. glossary-entry:: cast + :glossary-dp: fls_pcaygpx7db24 + + :glossary: + :dp:`fls_e5hvszhcrtmj` + :dt:`Cast` or :dt:`casting` is the process of changing the :t:`type` of an + :t:`expression`. + :chapter: + :dp:`fls_99kvyh4puy57` + :t:`Cast` or :t:`casting` is the process of changing the :t:`type` of an + :t:`expression`. :dp:`fls_a6midh2m0w0b` The ``TypeSpecificationWithoutBounds`` describes the :dt:`target type` of the @@ -2326,6 +3023,13 @@ See :p:`fls_2jd0mgw4zja4` for the declaration of ``answer``. Assignment Expressions ~~~~~~~~~~~~~~~~~~~~~~ +.. glossary-entry:: assignment + :glossary-dp: fls_f6ztsofr6xa9 + + :glossary: + :dp:`fls_j9pyuucyplmi` + See :t:`assignment expression`. + .. rubric:: Syntax .. syntax:: @@ -2341,17 +3045,50 @@ Assignment Expressions .. rubric:: Legality Rules -:dp:`fls_nhgexeu2h6wi` -An :t:`assignment expression` is an :t:`expression` that assigns the :t:`value` -of a :t:`value operand` to an :t:`assignee operand`. - -:dp:`fls_bsjw6f4a3wol` -An :t:`assignee operand` is the target :t:`operand` of an -:t:`assignment expression`. - -:dp:`fls_uinh05sslxeo` -A :t:`value operand` is an :t:`operand` that supplies the :t:`value` that is -assigned to an :t:`assignee operand` by an :t:`assignment expression`. +.. glossary-entry:: assignment expression + :glossary-dp: fls_2d2elg5eukv4 + + :glossary: + :dp:`fls_6jkc6a6me3zr` + An :dt:`assignment expression` is an :t:`expression` that assigns the + :t:`value` of a :t:`value operand` to an :t:`assignee operand`. + + :dp:`fls_njw68i3bp9qq` + See :s:`AssignmentExpression`. + :chapter: + :dp:`fls_nhgexeu2h6wi` + An :t:`assignment expression` is an :t:`expression` that assigns the :t:`value` + of a :t:`value operand` to an :t:`assignee operand`. + +.. glossary-entry:: assignee operand + :glossary-dp: fls_3hs9hqsthil1 + + :glossary: + :dp:`fls_4tgf0wu2mr3l` + An :dt:`assignee operand` is the target :t:`operand` of an + :t:`assignment expression`. + + :dp:`fls_df0j0vnnq20a` + See :s:`AssigneeOperand`. + :chapter: + :dp:`fls_bsjw6f4a3wol` + An :t:`assignee operand` is the target :t:`operand` of an + :t:`assignment expression`. + +.. glossary-entry:: value operand + :glossary-dp: fls_a5xof9jlpc2e + + :glossary: + :dp:`fls_x4seemjknk2z` + A :dt:`value operand` is an :t:`operand` that supplies the :t:`value` that is + assigned to an :t:`assignee operand` by an :t:`assignment expression`. + + :dp:`fls_cl4fakfkpscp` + See :s:`ValueOperand`. + :chapter: + :dp:`fls_uinh05sslxeo` + A :t:`value operand` is an :t:`operand` that supplies the :t:`value` that is + assigned to an :t:`assignee operand` by an :t:`assignment expression`. :dp:`fls_qengy157fa4a` The :t:`type` of an :t:`assignment expression` is the :t:`unit type`. @@ -2366,9 +3103,17 @@ Basic Assignment .. rubric:: Legality Rules -:dp:`fls_uhcodvq75nlr` -A :t:`basic assignment` is an :t:`assignment expression` that is not a -:t:`destructuring assignment`. +.. glossary-entry:: basic assignment + :glossary-dp: fls_bii5eu1wznzk + + :glossary: + :dp:`fls_byq9e2jf8r22` + A :dt:`basic assignment` is an :t:`assignment expression` that is not a + :t:`destructuring assignment`. + :chapter: + :dp:`fls_uhcodvq75nlr` + A :t:`basic assignment` is an :t:`assignment expression` that is not a + :t:`destructuring assignment`. .. rubric:: Dynamic Semantics @@ -2403,10 +3148,19 @@ Destructuring Assignment .. rubric:: Legality Rules -:dp:`fls_2eheo4yo2orm` -A :t:`destructuring assignment` is an :t:`assignment expression` where -the :t:`assignee operand` is either an :t:`array expression`, a :t:`struct -expression`, a :t:`tuple expression` or a :t:`tuple struct call expression`. +.. glossary-entry:: destructuring assignment + :glossary-dp: fls_2fuu3zr9rn2q + + :glossary: + :dp:`fls_7jienn9uzn5k` + A :dt:`destructuring assignment` is an :t:`assignment expression` where + the :t:`assignee operand` is either an :t:`array expression`, a + :t:`struct expression`, or a :t:`tuple expression`. + :chapter: + :dp:`fls_2eheo4yo2orm` + A :t:`destructuring assignment` is an :t:`assignment expression` where + the :t:`assignee operand` is either an :t:`array expression`, a :t:`struct + expression`, a :t:`tuple expression` or a :t:`tuple struct call expression`. :dp:`fls_z8c3b9s9de3x` The :t:`assignee operand` of a :t:`destructuring assignment` is treated as an @@ -2449,6 +3203,14 @@ an :t:`irrefutable pattern`. A :t:`destructuring assignment` is equivalent to a :t:`block expression` of the following form: +.. glossary-entry:: initialization expression + :glossary-dp: fls_ctusGvpQvJue + + :glossary: + :dp:`fls_KUeiSByPUc4w` + An :dt:`initialization expression` is either a :t:`constant initializer` or a + :t:`static initializer`. + * :dp:`fls_u0iqhbw37xvq` The first :t:`statement` is a :t:`let statement` with its :t:`pattern` equivalent to the lowered :t:`assignee pattern` and its @@ -2551,56 +3313,286 @@ Compound Assignment Expressions ModifyingOperand ::= Operand -.. rubric:: Legality Rules - -:dp:`fls_3bu3g8o5nopc` -A :t:`compound assignment expression` is an expression that first computes -a :t:`value` from two :t:`[operand]s` and then assigns the value to an -:t:`assigned operand`. - -:dp:`fls_w2hbhb989yr4` -A :t:`bit and assignment expression` is a :t:`compound assignment expression` -that uses bit and arithmetic. - -:dp:`fls_ak4g5112jkl` -A :t:`bit or assignment expression` is a :t:`compound assignment expression` -that uses bit or arithmetic. - -:dp:`fls_lkjwyy78m2vx` -A :t:`bit xor assignment expression` is a :t:`compound assignment expression` -that uses bit exclusive or arithmetic. +.. glossary-entry:: addition assignment + :glossary-dp: fls_xqZapSv9tM1F + + :glossary: + :dp:`fls_FVgKeCXlmuPe` + For :dt:`addition assignment`, see :t:`addition assignment expression`. + +.. glossary-entry:: addition assignment expression + :glossary-dp: fls_iw30dqjaeqle + + :glossary: + :dp:`fls_w83tf9m7vu67` + An :dt:`addition assignment expression` is a + :t:`compound assignment expression` that uses addition. + + :dp:`fls_hihh97p0rnt8` + See :s:`AdditionAssignmentExpression`. + +.. glossary-entry:: bit and assignment + :glossary-dp: fls_clut5DWMQin8 + + :glossary: + :dp:`fls_wIl0K7O6lTXJ` + For :dt:`bit and assignment`, see :t:`bit and assignment expression`. + +.. glossary-entry:: bit or assignment + :glossary-dp: fls_90E3eiBYgicI + + :glossary: + :dp:`fls_21iFIDCu7Pk4` + For :dt:`bit or assignment`, see :t:`bit or assignment expression`. + +.. glossary-entry:: bit xor assignment + :glossary-dp: fls_jEnv7RjEUZvm + + :glossary: + :dp:`fls_VJpCPVCuszs1` + For :dt:`bit xor assignment`, see :t:`bit xor assignment expression`. + +.. glossary-entry:: compound assignment + :glossary-dp: fls_pTMrfPXETibe + + :glossary: + :dp:`fls_lGV9QvCmYGcH` + For :dt:`compound assignment`, see :t:`compound assignment expression`. -:dp:`fls_pkzj0uigfcgm` -A :t:`division assignment expression` is a :t:`compound assignment expression` -that uses division. - -:dp:`fls_ndlv3k9uclz2` -A :t:`multiplication assignment expression` is a -:t:`compound assignment expression` that uses multiplication. - -:dp:`fls_fbp5dojti27r` -A :t:`remainder assignment expression` is a :t:`compound assignment expression` -that uses remainder division. - -:dp:`fls_oy9ur11k78t` -A :t:`shift left assignment expression` is a :t:`compound assignment expression` -that uses bit shift left arithmetic. - -:dp:`fls_s7rey2bndfei` -A :t:`shift right assignment expression` is a -:t:`compound assignment expression` that uses bit shift right arithmetic. - -:dp:`fls_7l7v7vigw3fu` -A :t:`subtraction assignment expression` is a -:t:`compound assignment expression` that uses subtraction. - -:dp:`fls_dvy201zd6oym` -An :t:`assigned operand` is the target :t:`operand` of a -:t:`compound assignment expression`. +.. rubric:: Legality Rules -:dp:`fls_9v09ayi2azpe` -A :t:`modifying operand` is an :t:`operand` that supplies the :t:`value` that -is used in the calculation of a :t:`compound assignment expression`. +.. glossary-entry:: compound assignment expression + :glossary-dp: fls_iktiir89xbo2 + + :glossary: + :dp:`fls_mkxpk2jhe5s0` + A :dt:`compound assignment expression` is an expression that first computes + a :t:`value` from two :t:`[operand]s` and then assigns the value to an + :t:`assigned operand`. + + :dp:`fls_55abuw8symub` + See :s:`CompoundAssignmentExpression`. + :chapter: + :dp:`fls_3bu3g8o5nopc` + A :t:`compound assignment expression` is an expression that first computes + a :t:`value` from two :t:`[operand]s` and then assigns the value to an + :t:`assigned operand`. + +.. glossary-entry:: bit and assignment expression + :glossary-dp: fls_y72vyr2tmdyb + + :glossary: + :dp:`fls_dvqotpte0pc2` + A :dt:`bit and assignment expression` is a :t:`compound assignment expression` + that uses bit and arithmetic. + + :dp:`fls_ix9ecb5olcx` + See :s:`BitAndAssignmentExpression`. + :chapter: + :dp:`fls_w2hbhb989yr4` + A :t:`bit and assignment expression` is a :t:`compound assignment expression` + that uses bit and arithmetic. + +.. glossary-entry:: bit or assignment expression + :glossary-dp: fls_ehorb0lul906 + + :glossary: + :dp:`fls_tu1owkfk0lu0` + A :dt:`bit or assignment expression` is a :t:`compound assignment expression` + that uses bit or arithmetic. + + :dp:`fls_utjcsfz8up88` + See :s:`BitOrAssignmentExpression`. + :chapter: + :dp:`fls_ak4g5112jkl` + A :t:`bit or assignment expression` is a :t:`compound assignment expression` + that uses bit or arithmetic. + +.. glossary-entry:: bit xor assignment expression + :glossary-dp: fls_u3fcq7jjyxux + + :glossary: + :dp:`fls_ma980ujltab2` + A :dt:`bit xor assignment expression` is a :t:`compound assignment expression` + that uses bit exclusive or arithmetic. + + :dp:`fls_lcrd0birf0un` + See :s:`BitXorAssignmentExpression`. + :chapter: + :dp:`fls_lkjwyy78m2vx` + A :t:`bit xor assignment expression` is a :t:`compound assignment expression` + that uses bit exclusive or arithmetic. + +.. glossary-entry:: division assignment + :glossary-dp: fls_0lpT9Ncj7S9X + + :glossary: + :dp:`fls_kvQskrzE1y97` + For :dt:`division assignment`, see :t:`division assignment expression`. + +.. glossary-entry:: division assignment expression + :glossary-dp: fls_ccv27fji08ou + + :glossary: + :dp:`fls_lzuz5fkveikk` + A :dt:`division assignment expression` is a :t:`compound assignment expression` + that uses division. + + :dp:`fls_cdxt76aqwtkq` + See :s:`DivisionAssignmentExpression`. + :chapter: + :dp:`fls_pkzj0uigfcgm` + A :t:`division assignment expression` is a :t:`compound assignment expression` + that uses division. + +.. glossary-entry:: multiplication assignment + :glossary-dp: fls_lpSCLhnaxeCg + + :glossary: + :dp:`fls_llUb5VHKjwW4` + For :dt:`multiplication assignment`, see + :t:`multiplication assignment expression`. + +.. glossary-entry:: multiplication assignment expression + :glossary-dp: fls_yo4k6lk0tizn + + :glossary: + :dp:`fls_eo9gx05n5ru3` + A :dt:`multiplication assignment expression` is a + :t:`compound assignment expression` that uses multiplication. + + :dp:`fls_b0dc5lec1mdc` + See :s:`MultiplicationAssignmentExpression`. + :chapter: + :dp:`fls_ndlv3k9uclz2` + A :t:`multiplication assignment expression` is a + :t:`compound assignment expression` that uses multiplication. + +.. glossary-entry:: remainder assignment + :glossary-dp: fls_JnhUWipah0nO + + :glossary: + :dp:`fls_58eDC2XtQcaR` + For :dt:`remainder assignment`, see :t:`remainder assignment expression`. + +.. glossary-entry:: remainder assignment expression + :glossary-dp: fls_mio7pagghcks + + :glossary: + :dp:`fls_en7ytqvefw7j` + A :dt:`remainder assignment expression` is a + :t:`compound assignment expression` that uses remainder division. + + :dp:`fls_rkk80quk8uzc` + See :s:`RemainderAssignmentExpression`. + :chapter: + :dp:`fls_fbp5dojti27r` + A :t:`remainder assignment expression` is a :t:`compound assignment expression` + that uses remainder division. + +.. glossary-entry:: shift left assignment + :glossary-dp: fls_o8EVuKgr0Y98 + + :glossary: + :dp:`fls_6adWrtvab6Tw` + For :dt:`shift left assignment`, see :t:`shift left assignment expression`. + +.. glossary-entry:: shift left assignment expression + :glossary-dp: fls_29n0oe4d7lwa + + :glossary: + :dp:`fls_j15ke2p8cjfp` + A :dt:`shift left assignment expression` is a + :t:`compound assignment expression` that uses bit shift left arithmetic. + + :dp:`fls_ozu74fsakomn` + See :s:`ShiftLeftAssignmentExpression`. + :chapter: + :dp:`fls_oy9ur11k78t` + A :t:`shift left assignment expression` is a :t:`compound assignment expression` + that uses bit shift left arithmetic. + +.. glossary-entry:: shift right assignment + :glossary-dp: fls_V5LMAe8ijiMQ + + :glossary: + :dp:`fls_XuwcHjwHdyA8` + For :dt:`shift right assignment`, see :t:`shift right assignment expression`. + +.. glossary-entry:: shift right assignment expression + :glossary-dp: fls_cqfzbsasnd1t + + :glossary: + :dp:`fls_1jpnp7hatlmu` + A :dt:`shift right assignment expression` is a + :t:`compound assignment expression` that uses bit shift right arithmetic. + + :dp:`fls_naqzlebew1uf` + See :s:`ShiftRightAssignmentExpression`. + :chapter: + :dp:`fls_s7rey2bndfei` + A :t:`shift right assignment expression` is a + :t:`compound assignment expression` that uses bit shift right arithmetic. + +.. glossary-entry:: subtraction assignment + :glossary-dp: fls_0hf1gNf90qKr + + :glossary: + :dp:`fls_75Eyk2YXO2j4` + For :dt:`subtraction assignment`, see :t:`subtraction assignment`. + +.. glossary-entry:: subtraction assignment expression + :glossary-dp: fls_a4iu72zn4h0 + + :glossary: + :dp:`fls_4pb85nl4r7vs` + A :dt:`subtraction assignment expression` is a + :t:`compound assignment expression` that uses subtraction. + + :dp:`fls_mye9yj5tc8hr` + See :s:`SubtractionAssignmentExpression`. + :chapter: + :dp:`fls_7l7v7vigw3fu` + A :t:`subtraction assignment expression` is a + :t:`compound assignment expression` that uses subtraction. + +.. glossary-entry:: assigned operand + :glossary-dp: fls_l78iam7w8w38 + + :glossary: + :dp:`fls_g714mnh7s7fx` + An :dt:`assigned operand` is the target :t:`operand` of a + :t:`compound assignment expression`. + + :dp:`fls_z0amfuj9vsqe` + See :s:`AssignedOperand`. + :chapter: + :dp:`fls_dvy201zd6oym` + An :t:`assigned operand` is the target :t:`operand` of a + :t:`compound assignment expression`. + +.. glossary-entry:: modifying operand + :glossary-dp: fls_5hoe1v960xfi + + :glossary: + :dp:`fls_9wt2l5gg06pb` + A :dt:`modifying operand` is an :t:`operand` that supplies the :t:`value` that + is used in the calculation of a :t:`compound assignment expression`. + + :dp:`fls_qnwbrwdnv7n0` + See :s:`ModifyingOperand`. + :chapter: + :dp:`fls_9v09ayi2azpe` + A :t:`modifying operand` is an :t:`operand` that supplies the :t:`value` that + is used in the calculation of a :t:`compound assignment expression`. + +.. glossary-entry:: mutable assignee expression + :glossary-dp: fls_TEVPHHiCMByO + + :glossary: + :dp:`fls_0RSlFbwrB3gp` + A :dt:`mutable assignee expression` is an :t:`assignee expression` whose + :t:`value` can be modified. :dp:`fls_row7saf53vwd` An :t:`assigned operand` shall denote a :t:`mutable assignee expression`. @@ -2773,9 +3765,20 @@ Underscore Expressions .. rubric:: Legality Rules -:dp:`fls_pydmv629vfuu` -An :t:`underscore expression` is an :t:`expression` that acts as a placeholder -in a :t:`destructuring assignment`. +.. glossary-entry:: underscore expression + :glossary-dp: fls_57kis2vnt3cv + + :glossary: + :dp:`fls_ukl1sefb99gj` + An :dt:`underscore expression` is an :t:`expression` that acts as a placeholder + in a :t:`destructuring assignment`. + + :dp:`fls_qbo267kdjcgs` + See :s:`UnderscoreExpression`. + :chapter: + :dp:`fls_pydmv629vfuu` + An :t:`underscore expression` is an :t:`expression` that acts as a placeholder + in a :t:`destructuring assignment`. :dp:`fls_wms3dbwjwyu4` An :t:`underscore expression` shall appear in the :t:`assigned operand` of a @@ -2803,9 +3806,20 @@ Parenthesized Expressions .. rubric:: Legality Rules -:dp:`fls_jhazc75w5vj` -A :t:`parenthesized expression` is an :t:`expression` that groups other -:t:`[expression]s`. +.. glossary-entry:: parenthesized expression + :glossary-dp: fls_fl56jfxbj0f + + :glossary: + :dp:`fls_yu1x2rr7cewa` + A :dt:`parenthesized expression` is an :t:`expression` that groups other + expressions. + + :dp:`fls_p9exa6fpplfu` + See :s:`ParenthesizedExpression`. + :chapter: + :dp:`fls_jhazc75w5vj` + A :t:`parenthesized expression` is an :t:`expression` that groups other + :t:`[expression]s`. :dp:`fls_5d66h7naoup6` The :t:`type` of a :t:`parenthesized expression` is the :t:`type` of its @@ -2857,24 +3871,86 @@ Array Expressions .. rubric:: Legality Rules -:dp:`fls_ya9res33oxt6` -An :t:`array expression` is an :t:`expression` that constructs an :t:`array`. - -:dp:`fls_fwtd3b10veiw` -An :t:`array element constructor` is an :t:`array expression` that lists all -elements of the :t:`array` being constructed. - -:dp:`fls_81jf78m5uga4` -An :t:`array repetition constructor` is an :t:`array expression` that specifies -how many times an element is repeated in the :t:`array` being constructed. - -:dp:`fls_3y69y9ga4at7` -A :t:`repeat operand` is an :t:`operand` that specifies the element being -repeated in an :t:`array repetition constructor`. - -:dp:`fls_2l9objtb23zn` -A :t:`size operand` is an :t:`operand` that specifies the size of an :t:`array` -or an :t:`array type`. +.. glossary-entry:: array + :glossary-dp: fls_bn1regeucxqi + + :glossary: + :dp:`fls_metry7a5prpt` + An :dt:`array` is a :t:`value` of an :t:`array type`. + +.. glossary-entry:: array expression + :glossary-dp: fls_yvzpqb192pci + + :glossary: + :dp:`fls_pyjkjbvqarto` + An :dt:`array expression` is an :t:`expression` that constructs an :t:`array`. + + :dp:`fls_vua1xy4y9irp` + See :s:`ArrayExpression`. + :chapter: + :dp:`fls_ya9res33oxt6` + An :t:`array expression` is an :t:`expression` that constructs an :t:`array`. + +.. glossary-entry:: array element constructor + :glossary-dp: fls_2d9fee2o9 + + :glossary: + :dp:`fls_cmx9ls5zoazp` + An :dt:`array element constructor` is an :t:`array expression` that lists all + elements of the :t:`array` being constructed. + + :dp:`fls_9bwte7cmszl1` + See :s:`ArrayElementConstructor`. + :chapter: + :dp:`fls_fwtd3b10veiw` + An :t:`array element constructor` is an :t:`array expression` that lists all + elements of the :t:`array` being constructed. + +.. glossary-entry:: array repetition constructor + :glossary-dp: fls_6jkgj61m49vg + + :glossary: + :dp:`fls_st1kw8mor2zk` + An :dt:`array repetition constructor` is an :t:`array expression` that + specifies how many times an element is repeated in the :t:`array` being + constructed. + + :dp:`fls_1zr997qwsal2` + See :s:`ArrayRepetitionConstructor`. + :chapter: + :dp:`fls_81jf78m5uga4` + An :t:`array repetition constructor` is an :t:`array expression` that specifies + how many times an element is repeated in the :t:`array` being constructed. + +.. glossary-entry:: repeat operand + :glossary-dp: fls_b35oy3nnzixm + + :glossary: + :dp:`fls_ol2y1og2jwss` + A :dt:`repeat operand` is an :t:`operand` that specifies the element being + repeated in an :t:`array repetition constructor`. + + :dp:`fls_r4acyux78txu` + See :s:`RepeatOperand`. + :chapter: + :dp:`fls_3y69y9ga4at7` + A :t:`repeat operand` is an :t:`operand` that specifies the element being + repeated in an :t:`array repetition constructor`. + +.. glossary-entry:: size operand + :glossary-dp: fls_2y5oyon3y1za + + :glossary: + :dp:`fls_srajsqi5i3py` + A :dt:`size operand` is an :t:`operand` that specifies the size of an + :t:`array` or an :t:`array type`. + + :dp:`fls_228ioayvdguv` + See :s:`SizeOperand`. + :chapter: + :dp:`fls_2l9objtb23zn` + A :t:`size operand` is an :t:`operand` that specifies the size of an :t:`array` + or an :t:`array type`. :dp:`fls_9gmnjvs83d8o` The :t:`size operand` shall be a :t:`constant expression`. @@ -2969,21 +4045,63 @@ Indexing Expressions .. rubric:: Legality Rules -:dp:`fls_X9kdEAPTqsAe` -An :t:`indexable type` is a :t:`type` that implements the -:std:`core::ops::Index` :t:`trait`. - -:dp:`fls_42ijvuqqqlvh` -An :t:`index expression` is an :t:`expression` that indexes into a :t:`value` -of an :t:`indexable type`. - -:dp:`fls_pc0c22asgzvw` -An :t:`indexed operand` is an :t:`operand` which indicates the :t:`value` -being indexed into by an :t:`index expression`. - -:dp:`fls_ff3sgpldn52o` -An :t:`indexing operand` is an :t:`operand` which specifies the index of an -:t:`index expression`. +.. glossary-entry:: indexable type + :glossary-dp: fls_S0pnJKPJPU0i + + :glossary: + :dp:`fls_AdVGyKZFvvUS` + A :dt:`indexable type` is a :t:`type` that implements the + :std:`core::ops::Index` :t:`trait`. + :chapter: + :dp:`fls_X9kdEAPTqsAe` + An :t:`indexable type` is a :t:`type` that implements the + :std:`core::ops::Index` :t:`trait`. + +.. glossary-entry:: index expression + :glossary-dp: fls_6tysvlg2ifr3 + + :glossary: + :dp:`fls_1f7e9q8n431n` + An :dt:`index expression` is an :t:`expression` that indexes into a :t:`value` + of a :t:`type`. + + :dp:`fls_xm2er7vuo07g` + See :s:`IndexExpression`. + :chapter: + :dp:`fls_42ijvuqqqlvh` + An :t:`index expression` is an :t:`expression` that indexes into a :t:`value` + of an :t:`indexable type`. + +.. glossary-entry:: indexed operand + :glossary-dp: fls_irp9ive4e66r + + :glossary: + :dp:`fls_dvmm47wnl33e` + An :dt:`indexed operand` is an :t:`operand` which indicates the :t:`value` of a + :t:`type` implementing :std:`core::ops::Index` being indexed into by an + :t:`index expression`. + + :dp:`fls_je8eh3a02riq` + See :s:`IndexedOperand`. + :chapter: + :dp:`fls_pc0c22asgzvw` + An :t:`indexed operand` is an :t:`operand` which indicates the :t:`value` + being indexed into by an :t:`index expression`. + +.. glossary-entry:: indexing operand + :glossary-dp: fls_a350zwl1or4g + + :glossary: + :dp:`fls_ipw4tfrserbu` + An :dt:`indexing operand` is an :t:`operand` which specifies the index for the + :t:`indexed operand` being indexed into by an :t:`index expression`. + + :dp:`fls_t2j8vzlrlvb0` + See :s:`IndexingOperand`. + :chapter: + :dp:`fls_ff3sgpldn52o` + An :t:`indexing operand` is an :t:`operand` which specifies the index of an + :t:`index expression`. :dp:`fls_w96p9oyv5mqt` An :t:`index expression` is a :t:`constant expression` if the @@ -3069,12 +4187,30 @@ Tuple Expressions .. rubric:: Legality Rules -:dp:`fls_87rp1hfwvjel` -A :t:`tuple expression` is an :t:`expression` that constructs a :t:`tuple`. - -:dp:`fls_581y6jq1eyn8` -A :t:`tuple initializer` is an :t:`operand` that provides the :t:`value` of a -:t:`tuple field` in a :t:`tuple expression`. +.. glossary-entry:: tuple expression + :glossary-dp: fls_udl6ujjg1jae + + :glossary: + :dp:`fls_x7m4u1dx4eli` + A :dt:`tuple expression` is an :t:`expression` that constructs a :t:`tuple`. + + :dp:`fls_qawnvcddgyxx` + See :s:`TupleExpression`. + :chapter: + :dp:`fls_87rp1hfwvjel` + A :t:`tuple expression` is an :t:`expression` that constructs a :t:`tuple`. + +.. glossary-entry:: tuple initializer + :glossary-dp: fls_zfvvbf7ncrhj + + :glossary: + :dp:`fls_94hg6re11zl5` + A :dt:`tuple initializer` is an :t:`operand` that provides the :t:`value` of a + :t:`tuple field` in a :t:`tuple expression`. + :chapter: + :dp:`fls_581y6jq1eyn8` + A :t:`tuple initializer` is an :t:`operand` that provides the :t:`value` of a + :t:`tuple field` in a :t:`tuple expression`. :dp:`fls_ljz3sxmfzflm` The :t:`type` of a :t:`tuple expression` is ``(T1, T2, ..., TN)``, where ``T1`` @@ -3143,27 +4279,69 @@ Struct Expressions .. rubric:: Legality Rules -:dp:`fls_ij8rebvupb85` -A :t:`struct expression` is an :t:`expression` that constructs an -:t:`enum value`, a :t:`struct value`, or a :t:`union value`. - -:dp:`fls_4z91ymz3ciup` -A :t:`constructee` indicates the :t:`enum variant`, :t:`struct`, or :t:`union` -whose value is being constructed by a :t:`struct expression`. - -:dp:`fls_uib1ml41mfrn` -A :t:`base initializer` is a :t:`construct` that specifies an :t:`enum value`, or -a :t:`struct value` to be used as a base for -construction in a :t:`struct expression`. +.. glossary-entry:: struct expression + :glossary-dp: fls_dxfyejkbiz3p + + :glossary: + :dp:`fls_m8n9e0sxyb95` + A :dt:`struct expression` is an :t:`expression` that constructs an + :t:`enum value`, a :t:`struct value`, or a :t:`union value`. + + :dp:`fls_odm68rhu2j1` + See :s:`StructExpression`. + :chapter: + :dp:`fls_ij8rebvupb85` + A :t:`struct expression` is an :t:`expression` that constructs an + :t:`enum value`, a :t:`struct value`, or a :t:`union value`. + +.. glossary-entry:: constructee + :glossary-dp: fls_fBGjoTVhYvUe + + :glossary: + :dp:`fls_Twbu94uGW4Cb` + A :dt:`constructee` indicates the :t:`enum variant`, :t:`struct` or :t:`union` + whose value is being constructed by a :t:`struct expression`. + :chapter: + :dp:`fls_4z91ymz3ciup` + A :t:`constructee` indicates the :t:`enum variant`, :t:`struct`, or :t:`union` + whose value is being constructed by a :t:`struct expression`. + +.. glossary-entry:: base initializer + :glossary-dp: fls_a8tavqxuvaju + + :glossary: + :dp:`fls_dnuwn2tnvtgy` + A :dt:`base initializer` is a :t:`construct` that specifies an :t:`enum value`, + a :t:`struct value`, or a :t:`union value` to be used as a base for + construction in a :t:`struct expression`. + + :dp:`fls_mprzem71zlhy` + See :s:`BaseInitializer`. + :chapter: + :dp:`fls_uib1ml41mfrn` + A :t:`base initializer` is a :t:`construct` that specifies an :t:`enum value`, or + a :t:`struct value` to be used as a base for + construction in a :t:`struct expression`. :dp:`fls_gfu267bpl9ql` The :t:`type` of a :t:`base initializer` is the :t:`type` of its :t:`operand`. The :t:`type` of a :t:`base initializer` shall be the same as the :t:`type` of the :t:`constructee`. -:dp:`fls_ph7fsphbpbv4` -An :t:`indexed initializer` is a :t:`construct` that specifies the index and -initial :t:`value` of a :t:`field` in a :t:`struct expression`. +.. glossary-entry:: indexed initializer + :glossary-dp: fls_rua2ni3p9qz2 + + :glossary: + :dp:`fls_oonqolgqyrq1` + An :dt:`indexed initializer` is a :t:`construct` that specifies the index and + initial :t:`value` of a :t:`field` in a :t:`struct expression`. + + :dp:`fls_werlw98l3ra0` + See :s:`IndexedInitializer`. + :chapter: + :dp:`fls_ph7fsphbpbv4` + An :t:`indexed initializer` is a :t:`construct` that specifies the index and + initial :t:`value` of a :t:`field` in a :t:`struct expression`. :dp:`fls_y3p6rtm7ek3l` An :t:`indexed initializer` matches a :t:`field` of the :t:`constructee` @@ -3179,9 +4357,20 @@ The :t:`type` of the :t:`operand` of an :t:`indexed initializer` and the The :t:`value` of an :t:`indexed initializer` is the :t:`value` of its :t:`operand`. -:dp:`fls_lwyq3vyc91rn` -A :t:`named initializer` is a :t:`construct` that specifies the name and -initial :t:`value` of a :t:`field` in a :t:`struct expression`. +.. glossary-entry:: named initializer + :glossary-dp: fls_kp0mbopkbjer + + :glossary: + :dp:`fls_xwvz8i4jim7a` + A :dt:`named initializer` is a :t:`construct` that specifies the name and + initial :t:`value` of a :t:`field` in a :t:`struct expression`. + + :dp:`fls_aueznbw3lohl` + See :s:`NamedInitializer`. + :chapter: + :dp:`fls_lwyq3vyc91rn` + A :t:`named initializer` is a :t:`construct` that specifies the name and + initial :t:`value` of a :t:`field` in a :t:`struct expression`. :dp:`fls_qed1pps827dv` A :t:`named initializer` matches a :t:`field` of the :t:`constructee` when @@ -3196,9 +4385,20 @@ The :t:`type` of a :t:`named initializer` and the :t:`type` of the matched The :t:`value` of a :t:`named initializer` is the :t:`value` of its :t:`expression`. -:dp:`fls_57t368kema7h` -A :t:`shorthand initializer` is a :t:`construct` that specifies the :t:`name` -of a :t:`field` in a :t:`struct expression`. +.. glossary-entry:: shorthand initializer + :glossary-dp: fls_oa4p10yles30 + + :glossary: + :dp:`fls_bgxxg48snck1` + A :dt:`shorthand initializer` is a :t:`construct` that specifies the :t:`name` + of a :t:`field` in a :t:`struct expression`. + + :dp:`fls_qc08ydgmqudi` + See :s:`ShorthandInitializer`. + :chapter: + :dp:`fls_57t368kema7h` + A :t:`shorthand initializer` is a :t:`construct` that specifies the :t:`name` + of a :t:`field` in a :t:`struct expression`. :dp:`fls_sm2hx8sh4agb` A :t:`shorthand initializer` is equivalent to a :t:`named initializer` where @@ -3361,29 +4561,94 @@ Call Expressions .. rubric:: Legality Rules -:dp:`fls_fvgfx17ossd9` -A :t:`call expression` is an :t:`expression` that invokes a :t:`function` or -constructs a :t:`tuple enum variant value` or a :t:`tuple struct value`. - -:dp:`fls_jvz5z3eqxb39` -An :t:`argument operand` is an :t:`operand` which is used as an argument in a -:t:`call expression` or a :t:`method call expression`. - -:dp:`fls_7ql1c71eidg8` -A :t:`call operand` is the :t:`function` being invoked or the -:t:`tuple enum variant value` or the :t:`tuple struct value` being constructed -by a :t:`call expression`. - -:dp:`fls_QpBu34U6hXn9` -A :t:`tuple struct call expression` is a :t:`call expression` where the -:t:`call operand` resolves to a :t:`tuple struct`. - -:dp:`fls_4t6imtiw6kzt` -A :t:`callee type` is either a :t:`function item type`, a -:t:`function pointer type`, a :t:`tuple enum variant`, a -:t:`tuple struct type`, or a :t:`type` that implements any of the -:std:`core::ops::Fn`, :std:`core::ops::FnMut`, or :std:`core::ops::FnOnce` -:t:`[trait]s`. +.. glossary-entry:: call expression + :glossary-dp: fls_xeo59ol6uh5i + + :glossary: + :dp:`fls_a9ap0tyk2eou` + A :dt:`call expression` is an :t:`expression` that invokes a :t:`function` or + constructs a :t:`tuple struct value` or :t:`tuple enum variant value`. + + :dp:`fls_aibti9uqrmmd` + See :s:`CallExpression`. + :chapter: + :dp:`fls_fvgfx17ossd9` + A :t:`call expression` is an :t:`expression` that invokes a :t:`function` or + constructs a :t:`tuple enum variant value` or a :t:`tuple struct value`. + +.. glossary-entry:: argument operand + :glossary-dp: fls_dd008npswhij + + :glossary: + :dp:`fls_ljuwr88k92vp` + An :dt:`argument operand` is an :t:`operand` which is used as an argument in a + :t:`call expression` or a :t:`method call expression`. + :chapter: + :dp:`fls_jvz5z3eqxb39` + An :t:`argument operand` is an :t:`operand` which is used as an argument in a + :t:`call expression` or a :t:`method call expression`. + +.. glossary-entry:: call operand + :glossary-dp: fls_ezk9xkst7gfj + + :glossary: + :dp:`fls_cqnko94y4xbs` + A :dt:`call operand` is the :t:`function` being invoked or the + :t:`tuple struct value` or :t:`tuple enum variant value` being constructed by a + :t:`call expression`. + + :dp:`fls_w6wu4wi6srjj` + See :s:`CallOperand`. + :chapter: + :dp:`fls_7ql1c71eidg8` + A :t:`call operand` is the :t:`function` being invoked or the + :t:`tuple enum variant value` or the :t:`tuple struct value` being constructed + by a :t:`call expression`. + +.. glossary-entry:: Call conformance + :glossary-dp: fls_Egfa8tdbqllA + + :glossary: + :dp:`fls_Jr1gUX7Ju4Oh` + :dt:`Call conformance` measures the compatibility between a set of + :t:`[argument operand]s` and a set if :t:`[function parameter]s` or + :t:`[field]s`. + +.. glossary-entry:: adjusted call operand + :glossary-dp: fls_wbdlbe61de3t + + :glossary: + :dp:`fls_mchqbc64iu0u` + An :dt:`adjusted call operand` is a :t:`call operand` adjusted with inserted :t:`[borrow expression]s` and :t:`[dereference expression]s`. + +.. glossary-entry:: tuple struct call expression + :glossary-dp: fls_UYCpeq4Z87My + + :glossary: + :dp:`fls_DQaCUkskfXzk` + A :dt:`tuple struct call expression` is a :t:`call expression` where the + :t:`call operand` resolves to a :t:`tuple struct` or a :t:`tuple enum variant`. + :chapter: + :dp:`fls_QpBu34U6hXn9` + A :t:`tuple struct call expression` is a :t:`call expression` where the + :t:`call operand` resolves to a :t:`tuple struct`. + +.. glossary-entry:: callee type + :glossary-dp: fls_luuc01g4ffog + + :glossary: + :dp:`fls_o21myf6wnnn6` + A :dt:`callee type` is either a :t:`function item type`, a + :t:`function pointer type`, a :t:`tuple struct type`, a :t:`tuple enum variant` + or a :t:`type` that implements any of the :std:`core::ops::Fn`, + :std:`core::ops::FnMut`, or :std:`core::ops::FnOnce` :t:`[trait]s`. + :chapter: + :dp:`fls_4t6imtiw6kzt` + A :t:`callee type` is either a :t:`function item type`, a + :t:`function pointer type`, a :t:`tuple enum variant`, a + :t:`tuple struct type`, or a :t:`type` that implements any of the + :std:`core::ops::Fn`, :std:`core::ops::FnMut`, or :std:`core::ops::FnOnce` + :t:`[trait]s`. :dp:`fls_bu6i3mcvnbin` The :t:`type` of a :t:`call expression` is the :t:`return type` of the invoked @@ -3502,17 +4767,50 @@ Method Call Expressions .. rubric:: Legality Rules -:dp:`fls_b7i26954j1hc` -A :t:`method call expression` is an :t:`expression` that invokes a :t:`method` -of a :t:`variable`. - -:dp:`fls_jx3ryre0xs88` -A :t:`receiver operand` is an :t:`operand` that denotes the :t:`value` whose -:t:`method` is being invoked by a :t:`method call expression`. - -:dp:`fls_3AQUOBo7akXu` -A :t:`method operand` is an :t:`operand` that denotes the :t:`method` being -invoked by a :t:`method call expression`. +.. glossary-entry:: method call expression + :glossary-dp: fls_l4wel2551cw9 + + :glossary: + :dp:`fls_367sod24edts` + A :dt:`method call expression` is an :t:`expression` that invokes a :t:`method` + of a :t:`variable`. + + :dp:`fls_ohhcvxcaqv11` + See :s:`MethodCallExpression`. + :chapter: + :dp:`fls_b7i26954j1hc` + A :t:`method call expression` is an :t:`expression` that invokes a :t:`method` + of a :t:`variable`. + +.. glossary-entry:: receiver operand + :glossary-dp: fls_nfb3ciarl50w + + :glossary: + :dp:`fls_odbg4bizvqxq` + A :dt:`receiver operand` is an :t:`operand` that denotes the :t:`value` whose + :t:`method` is being invoked by a :t:`method call expression`. + + :dp:`fls_4rme1x6romeg` + See :s:`ReceiverOperand`. + :chapter: + :dp:`fls_jx3ryre0xs88` + A :t:`receiver operand` is an :t:`operand` that denotes the :t:`value` whose + :t:`method` is being invoked by a :t:`method call expression`. + +.. glossary-entry:: method operand + :glossary-dp: fls_l6eJxvmplLqQ + + :glossary: + :dp:`fls_VLLAFjAxCfkE` + A :dt:`method operand` is an :t:`operand` that denotes the :t:`method` being + invoked by a :t:`method call expression`. + + :dp:`fls_Pkgr4fJQZpJ6` + See :s:`MethodOperand`. + :chapter: + :dp:`fls_3AQUOBo7akXu` + A :t:`method operand` is an :t:`operand` that denotes the :t:`method` being + invoked by a :t:`method call expression`. :dp:`fls_11glzggtbgb3` The :t:`type` of a :t:`method call expression` is the :t:`return type` of the @@ -3609,21 +4907,85 @@ Field Access Expressions .. rubric:: Legality Rules -:dp:`fls_hr8qvwlhd9ts` -A :t:`field access expression` is an :t:`expression` that accesses a :t:`field` -of a :t:`value`. - -:dp:`fls_s2vpn4ihenpe` -A :t:`container operand` is an :t:`operand` that indicates the :t:`value` whose -:t:`field` is selected in a :t:`field access expression`. - -:dp:`fls_yeuayil6uxzx` -A :t:`field selector` is a :t:`construct` that selects the :t:`field` to be -accessed in a :t:`field access expression`. - -:dp:`fls_qqrconpa92i3` -A :t:`selected field` is a :t:`field` that is selected by a -:t:`field access expression`. +.. glossary-entry:: field access expression + :glossary-dp: fls_yipl7ajrbs6y + + :glossary: + :dp:`fls_gdl348a04d15` + A :dt:`field access expression` is an :t:`expression` that accesses a + :t:`field` of a :t:`value`. + + :dp:`fls_luetyuwu54d6` + See :s:`FieldAccessExpression`. + :chapter: + :dp:`fls_hr8qvwlhd9ts` + A :t:`field access expression` is an :t:`expression` that accesses a :t:`field` + of a :t:`value`. + +.. glossary-entry:: container operand + :glossary-dp: fls_39s6od9hj4g6 + + :glossary: + :dp:`fls_stjmobac6wyd` + A :dt:`container operand` is an :t:`operand` that indicates the :t:`value` + whose :t:`field` is selected in a :t:`field access expression`. + + :dp:`fls_hgm1ssicc8j4` + See :s:`ContainerOperand`. + :chapter: + :dp:`fls_s2vpn4ihenpe` + A :t:`container operand` is an :t:`operand` that indicates the :t:`value` whose + :t:`field` is selected in a :t:`field access expression`. + +.. glossary-entry:: field selector + :glossary-dp: fls_kqbata8slp1y + + :glossary: + :dp:`fls_aq1yg9cp1uof` + A :dt:`field selector` is a :t:`construct` that selects the :t:`field` to be + accessed in a :t:`field access expression`. + + :dp:`fls_x8swot8e1j32` + See :s:`FieldSelector`. + :chapter: + :dp:`fls_yeuayil6uxzx` + A :t:`field selector` is a :t:`construct` that selects the :t:`field` to be + accessed in a :t:`field access expression`. + +.. glossary-entry:: indexed field selector + :glossary-dp: fls_bu46dg60o8us + + :glossary: + :dp:`fls_u6mh5yediub` + An :dt:`indexed field selector` is a :t:`field selector` where the selected + :t:`field` is indicated by an index. + + :dp:`fls_wbbyf2szc8a7` + See :s:`IndexedFieldSelector`. + +.. glossary-entry:: field index + :glossary-dp: fls_6uwwat9j4x7y + + :glossary: + :dp:`fls_6061r871qgbj` + A :dt:`field index` is the position of a :t:`field` within a + :t:`tuple struct type` or :t:`tuple enum variant`. The first :t:`field` has a + :t:`field index` of zero, the Nth :t:`field` has a :t:`field index` of N-1. + + :dp:`fls_IDYKXUIL845x` + See :s:`FieldIndex`. + +.. glossary-entry:: selected field + :glossary-dp: fls_rfk06mm3pdxg + + :glossary: + :dp:`fls_8otlvwlqrd4e` + A :dt:`selected field` is a :t:`field` that is selected by a + :t:`field access expression`. + :chapter: + :dp:`fls_qqrconpa92i3` + A :t:`selected field` is a :t:`field` that is selected by a + :t:`field access expression`. :dp:`fls_fovs9il2h9xg` The :t:`type` of a :t:`field access expression` is the :t:`type` of the @@ -3713,12 +5075,41 @@ Closure Expressions .. rubric:: Legality Rules -:dp:`fls_2d141c9a0yui` -A :t:`closure expression` is an :t:`expression` that defines a -:t:`closure type` and constructs a value of that :t:`type`. - -:dp:`fls_My6pMgpeFCFg` -An :t:`async closure expression` is a :t:`closure expression` subject to keyword ``async`` that defines an :t:`async closure type` and constructs a value of that :t:`type`. +.. glossary-entry:: closure expression + :glossary-dp: fls_mrwle2ediywb + + :glossary: + :dp:`fls_x87rhn9ikz00` + A :dt:`closure expression` is an :t:`expression` that defines a + :t:`closure type` and constructs a value of that :t:`type`. + + :dp:`fls_psd18dkzplf6` + See :s:`ClosureExpression`. + :chapter: + :dp:`fls_2d141c9a0yui` + A :t:`closure expression` is an :t:`expression` that defines a + :t:`closure type` and constructs a value of that :t:`type`. + +.. glossary-entry:: async closure expression + :glossary-dp: fls_oUdQnbW1MAFW + + :glossary: + :dp:`fls_SxydbQPPX9Jw` + An :dt:`async closure expression` is a :t:`closure expression` subject to keyword ``async`` that defines an :t:`async closure type` and constructs a value of that :t:`type`. + + :dp:`fls_JZsDFMg85a3u` + See :s:`ClosureExpression`. + :chapter: + :dp:`fls_My6pMgpeFCFg` + An :t:`async closure expression` is a :t:`closure expression` subject to keyword ``async`` that defines an :t:`async closure type` and constructs a value of that :t:`type`. + +.. glossary-entry:: async closure type + :glossary-dp: fls_Pq4ohvrMOi5p + + :glossary: + :dp:`fls_IT28HJaF8rnm` + An :dt:`async closure type` is a unique anonymous :t:`function type` that encapsulates + all :t:`[capture target]s` of a :t:`closure expression` producing a :std:`core::future::Future`. :dp:`fls_UgJgur0z6d4a` The :t:`return type` of a :t:`closure type` is determined as follows: @@ -3732,9 +5123,20 @@ The :t:`return type` of a :t:`closure type` is determined as follows: :dp:`fls_DSy7bPKGzyov` The :t:`return type` of an :t:`async closure type` is an :t:`anonymous return type` with a :std:`core::future::Future` :t:`trait bound` and a :t:`binding argument` for the ``Output`` :t:`associated type alias` with the actual :t:`return type` of the corresponding :t:`closure type`. -:dp:`fls_srbl7ptknjyk` -A :t:`closure body` is a :t:`construct` that represents the executable portion -of a :t:`closure expression`. +.. glossary-entry:: closure body + :glossary-dp: fls_5vm5cijnucsr + + :glossary: + :dp:`fls_vgnycw6dykwo` + A :dt:`closure body` is a :t:`construct` that represents the executable portion + of a :t:`closure expression`. + + :dp:`fls_zefhg4auut8d` + See :s:`ClosureBody`, :s:`ClosureBodyWithReturnType`. + :chapter: + :dp:`fls_srbl7ptknjyk` + A :t:`closure body` is a :t:`construct` that represents the executable portion + of a :t:`closure expression`. :dp:`fls_oey0ivaiu1l` A :t:`closure body` denotes a new :t:`control flow boundary`. @@ -3742,10 +5144,22 @@ A :t:`closure body` denotes a new :t:`control flow boundary`. :dp:`fls_fg8lx0yyt6oq` A :t:`closure body` is subject to :t:`capturing`. -:dp:`fls_c3rzwUxjmBMY` -A :t:`closure parameter` is a :t:`construct` that yields a set of -:t:`[binding]s` that bind matched input :t:`[value]s` to :t:`[name]s` at the -site of a :t:`call expression` or a :t:`method call expression`. +.. glossary-entry:: closure parameter + :glossary-dp: fls_f5RBXj9g5iab + + :glossary: + :dp:`fls_yQBZHBLhPswn` + A :dt:`closure parameter` is a :t:`construct` that yields a set of + :t:`[binding]s` that bind matched input :t:`[value]s` to :t:`[name]s` at the + site of a :t:`call expression` or a :t:`method call expression`. + + :dp:`fls_Dus3fBU3TwR4` + See :s:`ClosureParameter`. + :chapter: + :dp:`fls_c3rzwUxjmBMY` + A :t:`closure parameter` is a :t:`construct` that yields a set of + :t:`[binding]s` that bind matched input :t:`[value]s` to :t:`[name]s` at the + site of a :t:`call expression` or a :t:`method call expression`. :dp:`fls_81KOEXwps2HS` The :t:`type` of a :t:`closure parameter` is determined as follows: @@ -3821,28 +5235,79 @@ Loop Expressions .. rubric:: Legality Rules -:dp:`fls_y1d8kd1bdlmx` -A :t:`loop expression` is an :t:`expression` that evaluates a :t:`block -expression` continuously as long as some criterion holds true. - -:dp:`fls_BjZjuiFnPtFd` -A :t:`loop body` is the :t:`block expression` of a :t:`loop expression`. +.. glossary-entry:: loop + :glossary-dp: fls_kdqa8zs8tk6g + + :glossary: + :dp:`fls_omjnvxva07z2` + For :dt:`loop`, see :t:`loop expression`. + +.. glossary-entry:: loop expression + :glossary-dp: fls_an1s2hnapd59 + + :glossary: + :dp:`fls_2yypq3m1kquj` + A :dt:`loop expression` is an :t:`expression` that evaluates a + :t:`block expression` continuously as long as some criterion holds true. + + :dp:`fls_o2dyznhq7rez` + See :s:`LoopExpression`. + :chapter: + :dp:`fls_y1d8kd1bdlmx` + A :t:`loop expression` is an :t:`expression` that evaluates a :t:`block + expression` continuously as long as some criterion holds true. + +.. glossary-entry:: loop body + :glossary-dp: fls_5vt0Ph5BfDnU + + :glossary: + :dp:`fls_fRWcWPeKgx9g` + A :dt:`loop body` is the :t:`block expression` of a :t:`loop expression`. + + :dp:`fls_vWuR2TET712r` + See :s:`LoopBody`. + :chapter: + :dp:`fls_BjZjuiFnPtFd` + A :t:`loop body` is the :t:`block expression` of a :t:`loop expression`. :dp:`fls_XEc0cIkpkyzJ` The :t:`type` of the :t:`loop body` shall be the :t:`unit type`. -:dp:`fls_eg93m93gvwal` -An :t:`anonymous loop expression` is a :t:`loop expression` without a -:t:`label`. - -:dp:`fls_phpoq9ho8f1v` -A :t:`named loop expression` is a :t:`loop expression` with a :t:`label`. - -.. rubric:: Dynamic Semantics - -:dp:`fls_aw6qczl4zpko` -A :t:`loop expression` is :t:`terminated` when its :t:`block expression` is no -longer evaluated. +.. glossary-entry:: anonymous loop expression + :glossary-dp: fls_du8uevac5q7j + + :glossary: + :dp:`fls_csss2a8yk52k` + An :dt:`anonymous loop expression` is a :t:`loop expression` without a + :t:`label`. + :chapter: + :dp:`fls_eg93m93gvwal` + An :t:`anonymous loop expression` is a :t:`loop expression` without a + :t:`label`. + +.. glossary-entry:: named loop expression + :glossary-dp: fls_biwn3hxza37n + + :glossary: + :dp:`fls_440dr5qix3ns` + A :dt:`named loop expression` is a :t:`loop expression` with a :t:`label`. + :chapter: + :dp:`fls_phpoq9ho8f1v` + A :t:`named loop expression` is a :t:`loop expression` with a :t:`label`. + + .. rubric:: Dynamic Semantics + +.. glossary-entry:: terminated + :glossary-dp: fls_ihv02usuziw8 + + :glossary: + :dp:`fls_med1l8vheb83` + A :t:`loop expression` is :dt:`terminated` when its :t:`block expression` is no + longer evaluated. + :chapter: + :dp:`fls_aw6qczl4zpko` + A :t:`loop expression` is :t:`terminated` when its :t:`block expression` is no + longer evaluated. .. _fls_onfyolkcbeh3: @@ -3858,9 +5323,28 @@ For Loops .. rubric:: Legality Rules -:dp:`fls_1bh2alh37frz` -A :t:`for loop expression` is a :t:`loop expression` that continues to evaluate -its :t:`loop body` as long as its :t:`subject expression` yields a :t:`value`. +.. glossary-entry:: for loop + :glossary-dp: fls_dwnvkq8n94h1 + + :glossary: + :dp:`fls_gmhh56arsbw8` + For :dt:`for loop`, see :t:`for loop expression`. + +.. glossary-entry:: for loop expression + :glossary-dp: fls_vfkqbovqbw86 + + :glossary: + :dp:`fls_f0gp7qxoc4o4` + A :dt:`for loop expression` is a :t:`loop expression` that continues to + evaluate its :t:`loop body` as long as its :t:`subject expression` yields a + :t:`value`. + + :dp:`fls_yn4d35pvmn87` + See :s:`ForLoopExpression`. + :chapter: + :dp:`fls_1bh2alh37frz` + A :t:`for loop expression` is a :t:`loop expression` that continues to evaluate + its :t:`loop body` as long as its :t:`subject expression` yields a :t:`value`. :dp:`fls_fkgbin6ydkm4` The :t:`type` of a :t:`subject expression` shall implement the @@ -3933,9 +5417,27 @@ Infinite Loops .. rubric:: Legality Rules -:dp:`fls_p11qw6mtxlda` -An :t:`infinite loop expression` is a :t:`loop expression` that continues to -evaluate its :t:`loop body` indefinitely. +.. glossary-entry:: infinite loop + :glossary-dp: fls_kg9aeyrw822m + + :glossary: + :dp:`fls_xpm53i3rkuu0` + For :dt:`infinite loop`, see :t:`infinite loop expression`. + +.. glossary-entry:: infinite loop expression + :glossary-dp: fls_o2eei5aqgds6 + + :glossary: + :dp:`fls_mvplpa4t1f2p` + An :dt:`infinite loop expression` is a :t:`loop expression` that continues to + evaluate its :t:`loop body` indefinitely. + + :dp:`fls_2gipk6b62hme` + See :s:`InfiniteLoopExpression`. + :chapter: + :dp:`fls_p11qw6mtxlda` + An :t:`infinite loop expression` is a :t:`loop expression` that continues to + evaluate its :t:`loop body` indefinitely. :dp:`fls_b314wjbv0zwe` The :t:`type` of an :t:`infinite loop expression` is determined as follows: @@ -3985,6 +5487,13 @@ The :t:`evaluation` of an :t:`infinite loop expression` proceeds as follows: While Loops ~~~~~~~~~~~ +.. glossary-entry:: while loop + :glossary-dp: fls_od59yim9kasi + + :glossary: + :dp:`fls_ug9cxoml9ged` + For :dt:`while loop`, see :t:`while loop expression`. + .. rubric:: Syntax .. syntax:: @@ -3997,14 +5506,37 @@ While Loops .. rubric:: Legality Rules -:dp:`fls_ajby242tnu7c` -A :t:`while loop expression` is a :t:`loop expression` that continues to -evaluate its :t:`loop body` as long as its :t:`iteration expression` holds -true. - -:dp:`fls_13hmhzqz82v6` -An :t:`iteration expression` is an :t:`expression` that provides the criterion -of a :t:`while loop expression`. +.. glossary-entry:: while loop expression + :glossary-dp: fls_1qxi3h3qmgso + + :glossary: + :dp:`fls_fq0zyup4djyh` + A :dt:`while loop expression` is a :t:`loop expression` that continues to + evaluate its :t:`loop body` as long as its :t:`iteration expression` holds + true. + + :dp:`fls_7htwpbmyq83u` + See :s:`WhileLoopExpression`. + :chapter: + :dp:`fls_ajby242tnu7c` + A :t:`while loop expression` is a :t:`loop expression` that continues to + evaluate its :t:`loop body` as long as its :t:`iteration expression` holds + true. + +.. glossary-entry:: iteration expression + :glossary-dp: fls_orde7iunolyx + + :glossary: + :dp:`fls_suz163n1x1xm` + An :dt:`iteration expression` is an :t:`expression` that provides the criterion + of a :t:`while loop expression`. + + :dp:`fls_jw5lj2hgjl8v` + See :s:`IterationExpression`. + :chapter: + :dp:`fls_13hmhzqz82v6` + An :t:`iteration expression` is an :t:`expression` that provides the criterion + of a :t:`while loop expression`. :dp:`fls_d7ofrq3777kq` The :t:`type` of an :t:`iteration expression` shall be :t:`type` :c:`bool`. @@ -4048,6 +5580,13 @@ The :t:`evaluation` of a :t:`while loop expression` proceeds as follows: While Let Loops ~~~~~~~~~~~~~~~ +.. glossary-entry:: while let loop + :glossary-dp: fls_8hcsablipi17 + + :glossary: + :dp:`fls_ovutw52qtx71` + For :dt:`while let loop`, see :t:`while let loop expression`. + .. rubric:: Syntax .. syntax:: @@ -4057,10 +5596,22 @@ While Let Loops .. rubric:: Legality Rules -:dp:`fls_fmdlyp9r9zl7` -A :t:`while let loop expression` is a :t:`loop expression` that continues to -evaluate its :t:`loop body` as long as its :t:`subject let expression` yields -a :t:`value` that can be matched against its :t:`pattern`. +.. glossary-entry:: while let loop expression + :glossary-dp: fls_gme4odk59x6d + + :glossary: + :dp:`fls_g35gn7n88acp` + A :dt:`while let loop expression` is a :t:`loop expression` that continues to + evaluate its :t:`loop body` as long as its :t:`subject let expression` yields a + :t:`value` that can be matched against its :t:`pattern`. + + :dp:`fls_q3jcb4nodqba` + See :s:`WhileLetLoopExpression`. + :chapter: + :dp:`fls_fmdlyp9r9zl7` + A :t:`while let loop expression` is a :t:`loop expression` that continues to + evaluate its :t:`loop body` as long as its :t:`subject let expression` yields + a :t:`value` that can be matched against its :t:`pattern`. :dp:`fls_bC60ZSC9yUOI` The :t:`expected type` of the :t:`pattern` is the :t:`type` of the :t:`subject let expression`. @@ -4118,8 +5669,28 @@ Loop Labels .. rubric:: Legality Rules -:dp:`fls_tx5u743391h7` -A :t:`label indication` is a :t:`construct` that indicates a :t:`label`. +.. glossary-entry:: label + :glossary-dp: fls_uVUoHmNtPRtS + + :glossary: + :dp:`fls_iAAf2rLmgmGQ` + A :dt:`label` is the :t:`name` of a :t:`loop expression`. + + :dp:`fls_HicurdHIiLX2` + See :s:`Label`. + +.. glossary-entry:: label indication + :glossary-dp: fls_dw5s7jhk4v8s + + :glossary: + :dp:`fls_sso322p7adt0` + A :dt:`label indication` is a :t:`construct` that indicates a :t:`label`. + + :dp:`fls_g6iqfqooz8th` + See :s:`LabelIndication`. + :chapter: + :dp:`fls_tx5u743391h7` + A :t:`label indication` is a :t:`construct` that indicates a :t:`label`. :dp:`fls_7hc8yboeaho0` A :t:`label indication` shall indicate a :t:`label` of an enclosing @@ -4141,9 +5712,20 @@ Break Expressions .. rubric:: Legality Rules -:dp:`fls_i5ko1t2wbgxe` -A :t:`break expression` is an :t:`expression` that terminates a -:t:`loop expression` or a :t:`named block expression`. +.. glossary-entry:: break expression + :glossary-dp: fls_xki2cerozblt + + :glossary: + :dp:`fls_8ys8hlqgizoa` + A :dt:`break expression` is an :t:`expression` that terminates a + :t:`loop expression` or a :t:`named block expression`. + + :dp:`fls_fd1xpst5fki2` + See :s:`BreakExpression`. + :chapter: + :dp:`fls_i5ko1t2wbgxe` + A :t:`break expression` is an :t:`expression` that terminates a + :t:`loop expression` or a :t:`named block expression`. :dp:`fls_jiykbp51909f` A :t:`break expression` shall appear within a :t:`loop body` or a @@ -4175,8 +5757,16 @@ with an :t:`infinite loop`. :dp:`fls_dnnq1zym8ii0` The :t:`type` of a :t:`break expression` is the :t:`never type`. -:dp:`fls_1wdybpfldj7q` -:t:`Break type` is the :t:`type` of the :t:`operand` of a :t:`break expression`. +.. glossary-entry:: break type + :glossary-dp: fls_ff2zt3ww2yw3 + + :glossary: + :dp:`fls_jvm1vsqmslxn` + :dt:`Break type` is the :t:`type` of the :t:`operand` of a + :t:`break expression`. + :chapter: + :dp:`fls_1wdybpfldj7q` + :t:`Break type` is the :t:`type` of the :t:`operand` of a :t:`break expression`. :dp:`fls_8yore99adr22` The :t:`break type` is determined as follows: @@ -4189,9 +5779,17 @@ The :t:`break type` is determined as follows: If the :t:`break expression` has an :t:`operand`, then the :t:`break type` is the :t:`type` of its :t:`operand`. -:dp:`fls_bgd7d5q69q0g` -:t:`Break value` is the :t:`value` of the :t:`operand` of a -:t:`break expression`. +.. glossary-entry:: break value + :glossary-dp: fls_owtptuvleeb + + :glossary: + :dp:`fls_kpka4jf2qr5l` + :dt:`Break value` is the :t:`value` of the :t:`operand` of a + :t:`break expression`. + :chapter: + :dp:`fls_bgd7d5q69q0g` + :t:`Break value` is the :t:`value` of the :t:`operand` of a + :t:`break expression`. :dp:`fls_yb8jv4mkmki0` The :t:`break value` is determined as follows: @@ -4253,6 +5851,17 @@ Continue Expressions ContinueExpression ::= $$continue$$ LabelIndication? +.. glossary-entry:: continue expression + :glossary-dp: fls_doazu99vos8x + + :glossary: + :dp:`fls_waxam3m9plfj` + A :dt:`continue expression` is an :t:`expression` that first terminates and + then restarts a :t:`loop expression`. + + :dp:`fls_smwcz2xw9o1f` + See :s:`ContinueExpression`. + .. rubric:: Legality Rules :dp:`fls_wzs6kz9ffqzt` @@ -4340,24 +5949,75 @@ Range Expressions .. rubric:: Legality Rules -:dp:`fls_bi82rusji8g0` -A :t:`range expression` is an :t:`expression` that constructs a range. - -:dp:`fls_msyv4oyk5zp9` -A :t:`range expression low bound` is an :t:`operand` that specifies the start of -a range. - -:dp:`fls_f648uuxxh4vk` -A :t:`range expression high bound` is an :t:`operand` that specifies the end of -a range. +.. glossary-entry:: range expression + :glossary-dp: fls_tbvugpuvcluj + + :glossary: + :dp:`fls_bffrbucfwu7` + A :dt:`range expression` is an :t:`expression` that constructs a range. + + :dp:`fls_1jk43yvxa8ks` + See :s:`RangeExpression`. + :chapter: + :dp:`fls_bi82rusji8g0` + A :t:`range expression` is an :t:`expression` that constructs a range. + +.. glossary-entry:: full range expression + :glossary-dp: fls_tWp1PLe8m83K + + :glossary: + :dp:`fls_NIb9UOIRjMqa` + A :dt:`full range expression` is a :t:`range expression` that covers the full + range of a :t:`type`. + +.. glossary-entry:: range expression low bound + :glossary-dp: fls_smvgd160eynr + + :glossary: + :dp:`fls_t10o1p950u00` + A :dt:`range expression low bound` is an :t:`operand` that specifies the start + of a range. + + :dp:`fls_vmb2z7oh6gzm` + See :s:`RangeExpressionLowBound`. + :chapter: + :dp:`fls_msyv4oyk5zp9` + A :t:`range expression low bound` is an :t:`operand` that specifies the start of + a range. + +.. glossary-entry:: range expression high bound + :glossary-dp: fls_mdvdxr6u13fw + + :glossary: + :dp:`fls_c70pj8w15nmc` + A :dt:`range expression high bound` is an :t:`operand` that specifies the end + of a range. + + :dp:`fls_yxem0ckicxav` + See :s:`RangeExpressionHighBound`. + :chapter: + :dp:`fls_f648uuxxh4vk` + A :t:`range expression high bound` is an :t:`operand` that specifies the end of + a range. :dp:`fls_9pl4629t54yq` If a :t:`range expression` has two :t:`[operand]s`, then the :t:`[type]s` of the :t:`[operand]s` shall be :t:`unifiable`. -:dp:`fls_xaumwogwbv3g` -A :t:`range-from expression` is a :t:`range expression` that specifies an -included :t:`range expression low bound`. +.. glossary-entry:: range-from expression + :glossary-dp: fls_iqpxlg7w3cvf + + :glossary: + :dp:`fls_6enyv2oa4abq` + A :dt:`range-from expression` is a :t:`range expression` that specifies an + included :t:`range expression low bound`. + + :dp:`fls_e1smn0b478ik` + See :s:`RangeFromExpression`. + :chapter: + :dp:`fls_xaumwogwbv3g` + A :t:`range-from expression` is a :t:`range expression` that specifies an + included :t:`range expression low bound`. :dp:`fls_exa2ufugnpgc` The :t:`type` of a :t:`range-from expression` is :std:`core::ops::RangeFrom`. @@ -4366,10 +6026,22 @@ The :t:`type` of a :t:`range-from expression` is :std:`core::ops::RangeFrom`. The :t:`value` of a :t:`range-from expression` is ``core::ops::RangeFrom { start: range_expression_low_bound }``. -:dp:`fls_ppustuqdji7b` -A :t:`range-from-to expression` is a :t:`range expression` that specifies an -included :t:`range expression low bound` and an excluded -:t:`range expression high bound`. +.. glossary-entry:: range-from-to expression + :glossary-dp: fls_125h4p4zt86q + + :glossary: + :dp:`fls_nzf6y64jz83f` + A :dt:`range-from-to expression` is a :t:`range expression` that specifies an + included :t:`range expression low bound` and an excluded + :t:`range expression high bound`. + + :dp:`fls_mjbxfjulryt` + See :s:`RangeFromToExpression`. + :chapter: + :dp:`fls_ppustuqdji7b` + A :t:`range-from-to expression` is a :t:`range expression` that specifies an + included :t:`range expression low bound` and an excluded + :t:`range expression high bound`. :dp:`fls_ke2fpgodq84u` The :t:`type` of a :t:`range-from-to expression` is :std:`core::ops::Range`. @@ -4378,9 +6050,20 @@ The :t:`type` of a :t:`range-from-to expression` is :std:`core::ops::Range`. The :t:`value` of a :t:`range-from-to expression` is ``core::ops::Range { start: range_expression_low_bound, end: range_expression_high_bound }``. -:dp:`fls_x67xo25n0qlz` -A :t:`range-full expression` is a :t:`range expression` that covers the whole -range of a :t:`type`. +.. glossary-entry:: range-full expression + :glossary-dp: fls_8z8nrblarxrv + + :glossary: + :dp:`fls_6mchm7kb7i41` + A :dt:`range-full expression` is a :t:`range expression` that covers the whole + range of a :t:`type`. + + :dp:`fls_u7kd8w5g2icd` + See :s:`RangeFullExpression`. + :chapter: + :dp:`fls_x67xo25n0qlz` + A :t:`range-full expression` is a :t:`range expression` that covers the whole + range of a :t:`type`. :dp:`fls_m6n0gvg3ct1b` The :t:`type` of a :t:`range-full expression` is :std:`core::ops::RangeFull`. @@ -4388,10 +6071,22 @@ The :t:`type` of a :t:`range-full expression` is :std:`core::ops::RangeFull`. :dp:`fls_yvh5cdgzevni` The :t:`value` of a :t:`range-full expression` is ``core::ops::RangeFull {}``. -:dp:`fls_lh9my7g8oflq` -A :t:`range-inclusive expression` is a :t:`range expression` that specifies an -included :t:`range expression low bound` and an included -:t:`range expression high bound`. +.. glossary-entry:: range-inclusive expression + :glossary-dp: fls_tie80ejz8s19 + + :glossary: + :dp:`fls_9vja0wev84a7` + A :dt:`range-inclusive expression` is a :t:`range expression` that specifies an + included :t:`range expression low bound` and an included + :t:`range expression high bound`. + + :dp:`fls_lpcsb8dtldk3` + See :s:`RangeInclusiveExpression`. + :chapter: + :dp:`fls_lh9my7g8oflq` + A :t:`range-inclusive expression` is a :t:`range expression` that specifies an + included :t:`range expression low bound` and an included + :t:`range expression high bound`. :dp:`fls_livflk52xaj9` The :t:`type` of a :t:`range-inclusive expression` is @@ -4401,9 +6096,20 @@ The :t:`type` of a :t:`range-inclusive expression` is The :t:`value` of a :t:`range-inclusive expression` is ``core::ops::RangeInclusive::new(range_expression_low_bound, range_expression_high_bound)``. -:dp:`fls_5a1uivj19kob` -A :t:`range-to expression` is a :t:`range expression` that specifies an excluded -:t:`range expression high bound`. +.. glossary-entry:: range-to expression + :glossary-dp: fls_etvgkb8zcfpd + + :glossary: + :dp:`fls_urnfp1j9d5v4` + A :dt:`range-to expression` is a :t:`range expression` that specifies an + excluded :t:`range expression high bound`. + + :dp:`fls_lft9cd7h8cfv` + See :s:`RangeToExpression`. + :chapter: + :dp:`fls_5a1uivj19kob` + A :t:`range-to expression` is a :t:`range expression` that specifies an excluded + :t:`range expression high bound`. :dp:`fls_k611yoc8hk0n` The :t:`type` of a :t:`range-to expression` is :std:`core::ops::RangeTo`. @@ -4412,9 +6118,20 @@ The :t:`type` of a :t:`range-to expression` is :std:`core::ops::RangeTo`. The :t:`value` of a :t:`range-to expression` is ``core::ops::RangeTo { end: range_expression_high_bound }``. -:dp:`fls_1gc436ee1nzm` -A :t:`range-to-inclusive expression` is a :t:`range expression` that specifies -an included :t:`range expression high bound`. +.. glossary-entry:: range-to-inclusive expression + :glossary-dp: fls_ap5754dfltt5 + + :glossary: + :dp:`fls_t4fjanjvkd69` + A :dt:`range-to-inclusive expression` is a :t:`range expression` that specifies + an included :t:`range expression high bound`. + + :dp:`fls_krei7lc6lo8q` + See :s:`RangeToInclusiveExpression`. + :chapter: + :dp:`fls_1gc436ee1nzm` + A :t:`range-to-inclusive expression` is a :t:`range expression` that specifies + an included :t:`range expression high bound`. :dp:`fls_8sfjw83irpre` The :t:`type` of a :t:`range-to-inclusive expression` is @@ -4462,14 +6179,37 @@ If Expressions .. rubric:: Legality Rules -:dp:`fls_2i4fbxbbvpf1` -An :t:`if expression` is an :t:`expression` that evaluates either a -:t:`block expression` or an :t:`else expression` depending on the :t:`value` of -its :t:`subject expression`. - -:dp:`fls_5azwlk7hav1k` -An :t:`else expression` is an :t:`expression` that represents either a -:t:`block expression`, an :t:`if expression`, or an :t:`if let expression`. +.. glossary-entry:: if expression + :glossary-dp: fls_al9gtcy5b5og + + :glossary: + :dp:`fls_rk0661mtdvsi` + An :dt:`if expression` is an :t:`expression` that evaluates either a + :t:`block expression` or an :t:`else expression` depending on the :t:`value` + of its :t:`subject expression`. + + :dp:`fls_gdsufx2ns8bl` + See :s:`IfExpression`. + :chapter: + :dp:`fls_2i4fbxbbvpf1` + An :t:`if expression` is an :t:`expression` that evaluates either a + :t:`block expression` or an :t:`else expression` depending on the :t:`value` of + its :t:`subject expression`. + +.. glossary-entry:: else expression + :glossary-dp: fls_ff5zp7m9d5ot + + :glossary: + :dp:`fls_inp7luoqkjc5` + An :dt:`else expression` is an :t:`expression` that represents either a + :t:`block expression`, an :t:`if expression`, or an :t:`if let expression`. + + :dp:`fls_2jniy6bkq1hn` + See :s:`ElseExpression`. + :chapter: + :dp:`fls_5azwlk7hav1k` + An :t:`else expression` is an :t:`expression` that represents either a + :t:`block expression`, an :t:`if expression`, or an :t:`if let expression`. :dp:`fls_r7gzxo16esri` The :t:`type` of the :t:`subject expression` of an :t:`if expression` shall be @@ -4545,10 +6285,22 @@ If Let Expressions .. rubric:: Legality Rules -:dp:`fls_dsrjup2umr9` -An :t:`if let expression` is an :t:`expression` that evaluates either a -:t:`block expression` or an :t:`else expression` depending on whether its -:t:`pattern` can be matched against its :t:`subject let expression`. +.. glossary-entry:: if let expression + :glossary-dp: fls_j9wb2wtqp5u8 + + :glossary: + :dp:`fls_ky6ng7jy1g6z` + An :dt:`if let expression` is an :t:`expression` that evaluates either a + :t:`block expression` or an :t:`else expression` depending on whether its + :t:`pattern` can be matched against its :t:`subject let expression`. + + :dp:`fls_kczg3c6n3psu` + See :s:`IfLetExpression`. + :chapter: + :dp:`fls_dsrjup2umr9` + An :t:`if let expression` is an :t:`expression` that evaluates either a + :t:`block expression` or an :t:`else expression` depending on whether its + :t:`pattern` can be matched against its :t:`subject let expression`. :dp:`fls_okVOYzTT6fBK` The :t:`expected type` of the :t:`pattern` is the :t:`type` of the :t:`subject let expression`. @@ -4650,35 +6402,105 @@ Match Expressions .. rubric:: Legality Rules -:dp:`fls_ei4pbeksd1v8` -A :t:`match expression` is an :t:`expression` that tries to match one of its -multiple :t:`[pattern]s` against its :t:`subject expression` and if it succeeds, -evaluates an :t:`operand`. - -:dp:`fls_l45i24ikfavm` -A :t:`match arm` is a :t:`construct` that consists of a :t:`match arm matcher` -and a :t:`match arm body`. - -:dp:`fls_d9gerg12hm2d` -An :t:`intermediate match arm` is any :t:`non-[final match arm]` of a -:t:`match expression`. - -:dp:`fls_oj8dg28xw5yp` -A :t:`final match arm` is the last :t:`match arm` of a :t:`match expression`. - -:dp:`fls_lrdrtedyz28i` -A :t:`match arm matcher` is a :t:`construct` that consists of a :t:`pattern` and -a :t:`match arm guard`. +.. glossary-entry:: match expression + :glossary-dp: fls_w15uouo0sjao + + :glossary: + :dp:`fls_2ohrphptjny6` + A :dt:`match expression` is an :t:`expression` that tries to match one of + its multiple :t:`[pattern]s` against its :t:`subject expression` and if it + succeeds, evaluates an :t:`operand`. + + :dp:`fls_wkalvzkmp95y` + See :s:`MatchExpression`. + :chapter: + :dp:`fls_ei4pbeksd1v8` + A :t:`match expression` is an :t:`expression` that tries to match one of its + multiple :t:`[pattern]s` against its :t:`subject expression` and if it succeeds, + evaluates an :t:`operand`. + +.. glossary-entry:: match arm + :glossary-dp: fls_fizf1byuspv2 + + :glossary: + :dp:`fls_z5qsy5z2zak3` + A :dt:`match arm` is a :t:`construct` that consists of a :t:`match arm matcher` + and a :t:`match arm body`. + :chapter: + :dp:`fls_l45i24ikfavm` + A :t:`match arm` is a :t:`construct` that consists of a :t:`match arm matcher` + and a :t:`match arm body`. + +.. glossary-entry:: intermediate match arm + :glossary-dp: fls_7rj914fhginh + + :glossary: + :dp:`fls_l6pemxmdllvl` + An :dt:`intermediate match arm` is any :t:`non-[final match arm]` of a + :t:`match expression`. + + :dp:`fls_8713j5lrwqvs` + See :s:`IntermediateMatchArm`. + :chapter: + :dp:`fls_d9gerg12hm2d` + An :t:`intermediate match arm` is any :t:`non-[final match arm]` of a + :t:`match expression`. + +.. glossary-entry:: final match arm + :glossary-dp: fls_mj9mmkar8c6f + + :glossary: + :dp:`fls_btoz8jioisx9` + A :dt:`final match arm` is the last :t:`match arm` of a :t:`match expression`. + + :dp:`fls_v7ockjwbeel1` + See :s:`FinalMatchArm`. + :chapter: + :dp:`fls_oj8dg28xw5yp` + A :t:`final match arm` is the last :t:`match arm` of a :t:`match expression`. + +.. glossary-entry:: match arm matcher + :glossary-dp: fls_i3omadaygum2 + + :glossary: + :dp:`fls_paz9358w4cpu` + A :dt:`match arm matcher` is a :t:`construct` that consists of a :t:`pattern` + and a :t:`match arm guard`. + + :dp:`fls_j7i2bjvzz1tx` + See :s:`MatchArmMatcher`. + :chapter: + :dp:`fls_lrdrtedyz28i` + A :t:`match arm matcher` is a :t:`construct` that consists of a :t:`pattern` and + a :t:`match arm guard`. :dp:`fls_zJQ4LecT1HYd` The :t:`expected type` of the :t:`pattern` of the :t:`match arm matcher` is the :t:`type` of the :t:`subject expression`. -:dp:`fls_8wjdichfxp0y` -A :t:`match arm body` is the :t:`operand` of a :t:`match arm`. - -:dp:`fls_hs1rr54hu18w` -A :t:`match arm guard` is a :t:`construct` that provides additional filtering to -a :t:`match arm matcher`. +.. glossary-entry:: match arm body + :glossary-dp: fls_q7lcdtxuy1ac + + :glossary: + :dp:`fls_33e7oefx0xqm` + A :dt:`match arm body` is the :t:`operand` of a :t:`match arm`. + :chapter: + :dp:`fls_8wjdichfxp0y` + A :t:`match arm body` is the :t:`operand` of a :t:`match arm`. + +.. glossary-entry:: match arm guard + :glossary-dp: fls_aa1x6ajl4zid + + :glossary: + :dp:`fls_uhn07jmvv9ea` + A :dt:`match arm guard` is a :t:`construct` that provides additional filtering + to a :t:`match arm matcher`. + + :dp:`fls_ykf70vbng54n` + See :s:`MatchArmGuard`. + :chapter: + :dp:`fls_hs1rr54hu18w` + A :t:`match arm guard` is a :t:`construct` that provides additional filtering to + a :t:`match arm matcher`. :dp:`fls_RPMOAaZ6lflI` :t:`[Binding]s` introduced in the :t:`pattern` of a :t:`match arm matcher` are @@ -4800,10 +6622,21 @@ Return Expressions .. rubric:: Legality Rules -:dp:`fls_u7jk4j8gkho` -A :t:`return expression` is an :t:`expression` that optionally yields a -:t:`value` and causes control flow to return to the end of the enclosing -:t:`control flow boundary`. +.. glossary-entry:: return expression + :glossary-dp: fls_7tl9qo8yj8xh + + :glossary: + :dp:`fls_vnupfc6s0s7b` + A :dt:`return expression` is an :t:`expression` that optionally yields a + :t:`value` and causes control flow to return to the caller. + + :dp:`fls_phd8zrsyuzu7` + See :s:`ReturnExpression`. + :chapter: + :dp:`fls_u7jk4j8gkho` + A :t:`return expression` is an :t:`expression` that optionally yields a + :t:`value` and causes control flow to return to the end of the enclosing + :t:`control flow boundary`. :dp:`fls_5v3j5ghhw8j8` A :t:`return expression` shall appear within a :t:`control flow boundary`. @@ -4872,13 +6705,35 @@ Await Expressions .. rubric:: Legality Rules -:dp:`fls_sjz5s71hwm7l` -An :t:`await expression` is an :t:`expression` that polls a :t:`future`, -suspending the :t:`execution` of the :t:`future` until the :t:`future` is ready. - -:dp:`fls_vhchgab59jvd` -A :t:`future operand` is an :t:`operand` whose :t:`future` is being awaited by -an :t:`await expression`. +.. glossary-entry:: await expression + :glossary-dp: fls_n4oo89apywk4 + + :glossary: + :dp:`fls_psbc3b8pec47` + An :dt:`await expression` is an :t:`expression` that polls a :t:`future`, + suspending the execution of the future until the future is ready. + + :dp:`fls_29gkp9bpo1hi` + See :s:`AwaitExpression`. + :chapter: + :dp:`fls_sjz5s71hwm7l` + An :t:`await expression` is an :t:`expression` that polls a :t:`future`, + suspending the :t:`execution` of the :t:`future` until the :t:`future` is ready. + +.. glossary-entry:: future operand + :glossary-dp: fls_dvk8ccb46abk + + :glossary: + :dp:`fls_fold1inh5jev` + A :dt:`future operand` is an :t:`operand` whose :t:`future` is being awaited by + an :t:`await expression`. + + :dp:`fls_tbfpowv90u5w` + See :s:`FutureOperand`. + :chapter: + :dp:`fls_vhchgab59jvd` + A :t:`future operand` is an :t:`operand` whose :t:`future` is being awaited by + an :t:`await expression`. :dp:`fls_k9pncajmhgk1` An :t:`await expression` shall appear within an @@ -4945,13 +6800,29 @@ Expression Precedence Certain :t:`[expression]s` are subject to :t:`precedence` and :t:`associativity`. -:dp:`fls_ya23jjg5wjl` -:t:`Precedence` is the order by which :t:`[expression]s` are evaluated in the -presence of other :t:`[expression]s`. - -:dp:`fls_bezkcuwp5qol` -:t:`Associativity` is the order by which :t:`[operand]s` are evaluated within a -single :t:`expression`. +.. glossary-entry:: precedence + :glossary-dp: fls_ukvdoqo68y5b + + :glossary: + :dp:`fls_sz93844rqc4r` + :dt:`Precedence` is the order by which :t:`[expression]s` are evaluated in the + presence of other expressions. + :chapter: + :dp:`fls_ya23jjg5wjl` + :t:`Precedence` is the order by which :t:`[expression]s` are evaluated in the + presence of other :t:`[expression]s`. + +.. glossary-entry:: associativity + :glossary-dp: fls_fczijre8123c + + :glossary: + :dp:`fls_7i7o23mi2i33` + :dt:`Associativity` is the order by which :t:`[operand]s` are evaluated within + a single :t:`expression`. + :chapter: + :dp:`fls_bezkcuwp5qol` + :t:`Associativity` is the order by which :t:`[operand]s` are evaluated within a + single :t:`expression`. :dp:`fls_48br7odx6nke` The :t:`precedence` and :t:`associativity` of qualifying :t:`[expression]s` are @@ -5093,21 +6964,53 @@ Capturing .. rubric:: Legality Rules -:dp:`fls_iamnzlm430ef` -A :t:`capturing expression` is either an :t:`async block expression` or a -:t:`closure expression`. - -:dp:`fls_eca6tl7j0afx` -A :t:`capture target` is either a :t:`variable` or a :t:`field` of a -:t:`variable`. - -:dp:`fls_e70ywb8191h` -The :t:`capturing environment` of a :t:`capturing expression` consists of the -:t:`[value]s` of all :t:`captured` :t:`[capture target]s`. - -:dp:`fls_1y2ttb466m9c` -:t:`Capturing` is the process of saving the :t:`[capture target]s` of a -:t:`[capturing expression]'s` :t:`capturing environment`. +.. glossary-entry:: capturing expression + :glossary-dp: fls_cl3lpsfgt5eb + + :glossary: + :dp:`fls_awtny282gtud` + A :dt:`capturing expression` is either an :t:`async block expression` or a + :t:`closure expression`. + :chapter: + :dp:`fls_iamnzlm430ef` + A :t:`capturing expression` is either an :t:`async block expression` or a + :t:`closure expression`. + +.. glossary-entry:: capture target + :glossary-dp: fls_c6qwfwsyizya + + :glossary: + :dp:`fls_xmhcp4x8wblz` + A :dt:`capture target` is either a :t:`binding` or a :t:`field` of a + :t:`binding`. + :chapter: + :dp:`fls_eca6tl7j0afx` + A :t:`capture target` is either a :t:`variable` or a :t:`field` of a + :t:`variable`. + +.. glossary-entry:: capturing environment + :glossary-dp: fls_yfk2xfifltxy + + :glossary: + :dp:`fls_7br4azaay3wu` + The :dt:`capturing environment` of a :t:`capturing expression` consists of all + :t:`[capture target]s` that are defined outside the :t:`capturing expression`. + :chapter: + :dp:`fls_e70ywb8191h` + The :t:`capturing environment` of a :t:`capturing expression` consists of the + :t:`[value]s` of all :t:`captured` :t:`[capture target]s`. + +.. glossary-entry:: capturing + :glossary-dp: fls_kvu447p6j61k + + :glossary: + :dp:`fls_4achbk2ewyyb` + :dt:`Capturing` is the process of saving the :t:`[capture target]s` of a + :t:`[capturing expression]'s` :t:`capturing environment`. + :chapter: + :dp:`fls_1y2ttb466m9c` + :t:`Capturing` is the process of saving the :t:`[capture target]s` of a + :t:`[capturing expression]'s` :t:`capturing environment`. :dp:`fls_ip81lt2mm940` A :t:`capture target` requires :t:`capturing` when it is used by @@ -5115,8 +7018,15 @@ the :t:`capturing expression` and it is defined outside of the :t:`capturing expression`. Such a :t:`capture target` is said to be :dt:`captured`. -:dp:`fls_y9n1i4hbq8sf` -:t:`Capture mode` is the mechanism by which a :t:`capture target` is captured. +.. glossary-entry:: capture mode + :glossary-dp: fls_s78gd8yxx2yv + + :glossary: + :dp:`fls_beer0d7wva1d` + :dt:`Capture mode` is the mechanism by which a :t:`capture target` is captured. + :chapter: + :dp:`fls_y9n1i4hbq8sf` + :t:`Capture mode` is the mechanism by which a :t:`capture target` is captured. :dp:`fls_O6WYL8AUyPje` A :t:`captured` :t:`capture target` with :t:`capture mode` :dt:`by value capture` @@ -5141,6 +7051,15 @@ A :t:`captured` :t:`capture target` with :t:`capture mode` :t:`unique immutable reference` to the :t:`capture target` and passes the :t:`mutable reference` into the :t:`capturing environment`. +.. glossary-entry:: unique immutable reference + :glossary-dp: fls_Is9hWLC6Q0g5 + + :glossary: + :dp:`fls_eXrivAmNxzmv` + A :dt:`unique immutable reference` is an :t:`immutable reference` produced by + :t:`capturing` what is asserted to be the only live :t:`reference` to a + :t:`value` while the :t:`reference` exists. + :dp:`fls_t695ps4lfh6z` The :t:`capture mode` is determined based on the use of the :t:`capture target` within the :t:`capturing expression`, as follows: @@ -5175,12 +7094,21 @@ the :t:`capture target`. Arithmetic Overflow ------------------- -:dp:`fls_oFIRXBPXu6Zv` -An :t:`arithmetic overflow` occurs when an :t:`operator expression` computes a -:t:`value` of a :t:`scalar type` that lies outside of the range of valid -:t:`[value]s` for the :t:`scalar type` or when one or more :t:`operand` of an -:t:`operator expression` lies outside of the range of valid :t:`[value]s` for -the operation. +.. glossary-entry:: arithmetic overflow + :glossary-dp: fls_vZ1H57x9OFSZ + + :glossary: + :dp:`fls_jbytOQvIddAl` + An :dt:`arithmetic overflow` occurs if an :t:`arithmetic expression` or a + :t:`negation expression` computes a :t:`value` of a :t:`scalar type` that lies + outside of the range of valid :t:`[value]s` for the :t:`scalar type`. + :chapter: + :dp:`fls_oFIRXBPXu6Zv` + An :t:`arithmetic overflow` occurs when an :t:`operator expression` computes a + :t:`value` of a :t:`scalar type` that lies outside of the range of valid + :t:`[value]s` for the :t:`scalar type` or when one or more :t:`operand` of an + :t:`operator expression` lies outside of the range of valid :t:`[value]s` for + the operation. .. rubric:: Dynamic Semantics diff --git a/src/ffi.rst b/src/ffi.rst index df6e8f12..7c991c2d 100644 --- a/src/ffi.rst +++ b/src/ffi.rst @@ -10,10 +10,26 @@ FFI .. rubric:: Legality Rules -:dp:`fls_djlglv2eaihl` -:t:`Foreign Function Interface` or :t:`FFI` employs :t:`ABI`, -:t:`[attribute]s`, :t:`[external block]s`, :t:`[external function]s`, linkage, -and :t:`type` :t:`layout` to interface a Rust program with foreign code. +.. glossary-entry:: FFI + :glossary-dp: fls_qi21fdknzez6 + + :glossary: + :dp:`fls_z363fu89mj1c` + For :dt:`FFI`, see :t:`Foreign Function Interface`. + +.. glossary-entry:: Foreign Function Interface + :glossary-dp: fls_fo7vyxs4l3yh + + :glossary: + :dp:`fls_240yj1kym1kh` + :dt:`Foreign Function Interface` employs :t:`ABI`, :t:`[attribute]s`, + :t:`external block`, :t:`[external function]s`, linkage, and :t:`type` + :t:`layout` to interface a Rust program with foreign code. + :chapter: + :dp:`fls_djlglv2eaihl` + :t:`Foreign Function Interface` or :t:`FFI` employs :t:`ABI`, + :t:`[attribute]s`, :t:`[external block]s`, :t:`[external function]s`, linkage, + and :t:`type` :t:`layout` to interface a Rust program with foreign code. :dp:`fls_k1hiwghzxtfa` The following :t:`[attribute]s` affect :t:`FFI`: @@ -51,12 +67,40 @@ ABI .. rubric:: Legality Rules -:dp:`fls_xangrq3tfze0` -:t:`Application Binary Interface` or :t:`ABI` is a set of conventions that -dictate how data and computation cross language boundaries. - -:dp:`fls_2w0xi6rxw3uz` -The :t:`ABI kind` indicates the :t:`ABI` of a :t:`construct`. +.. glossary-entry:: ABI + :glossary-dp: fls_m98yg554tj9s + + :glossary: + :dp:`fls_4ko8qcah0f9k` + For :dt:`ABI`, see :t:`Application Binary Interface`. + +.. glossary-entry:: Application Binary Interface + :glossary-dp: fls_pcum2wpmgskk + + :glossary: + :dp:`fls_ew4babc9467c` + :dt:`Application Binary Interface` is a set of conventions that dictate how + data and computation cross language boundaries. + + :dp:`fls_8dgmmsp34lgc` + See :s:`AbiSpecification`. + :chapter: + :dp:`fls_xangrq3tfze0` + :t:`Application Binary Interface` or :t:`ABI` is a set of conventions that + dictate how data and computation cross language boundaries. + +.. glossary-entry:: ABI kind + :glossary-dp: fls_g791aj7w5iz1 + + :glossary: + :dp:`fls_qo9itrt0n3h8` + The :dt:`ABI kind` indicates the :t:`ABI` of a :t:`construct`. + + :dp:`fls_rd4kpubxygie` + See :s:`AbiKind`. + :chapter: + :dp:`fls_2w0xi6rxw3uz` + The :t:`ABI kind` indicates the :t:`ABI` of a :t:`construct`. :dp:`fls_9zitf1fvvfk8` The following :t:`[ABI]s` are supported: @@ -176,12 +220,30 @@ External Blocks .. rubric:: Legality Rules -:dp:`fls_4dje9t5y2dia` -An :t:`external block` is a :t:`construct` that provides the declarations of -:t:`[external function]s` and :t:`[external static]s` as unchecked imports. - -:dp:`fls_8ltVLtAfvy0m` -An :t:`unsafe external block` is an :t:`external block` subject to keyword ``unsafe``. +.. glossary-entry:: external block + :glossary-dp: fls_9k6jcsljghab + + :glossary: + :dp:`fls_z2ebcp7kjpuy` + An :dt:`external block` is a :t:`construct` that provides the declarations of + foreign :t:`[function]s` as unchecked imports. + + :dp:`fls_dm2wz1th2haz` + See :s:`ExternalBlock`. + :chapter: + :dp:`fls_4dje9t5y2dia` + An :t:`external block` is a :t:`construct` that provides the declarations of + :t:`[external function]s` and :t:`[external static]s` as unchecked imports. + +.. glossary-entry:: unsafe external block + :glossary-dp: fls_pre02nas9dad + + :glossary: + :dp:`fls_pkfgas34msas` + An :dt:`unsafe external block` is an :t:`external block` subject to keyword ``unsafe``. + :chapter: + :dp:`fls_8ltVLtAfvy0m` + An :t:`unsafe external block` is an :t:`external block` subject to keyword ``unsafe``. :dp:`fls_Nz0l16hMxqTd` The :t:`ABI` of an :t:`external block` is determined as follows: @@ -214,8 +276,15 @@ External Functions .. rubric:: Legality Rules -:dp:`fls_v24ino4hix3m` -An :t:`external function` is an unchecked import of a foreign :t:`function`. +.. glossary-entry:: external function + :glossary-dp: fls_8ffbgzkbsf9r + + :glossary: + :dp:`fls_ngz5fqwrf86e` + An :dt:`external function` is an unchecked import of a foreign :t:`function`. + :chapter: + :dp:`fls_v24ino4hix3m` + An :t:`external function` is an unchecked import of a foreign :t:`function`. :dp:`fls_l88r9fj82650` An :t:`external function` shall be invoked from an :t:`unsafe context` unless it is defined in an :t:`unsafe external block` and subject to :s:`ItemSafety` with keyword ``safe``. @@ -249,8 +318,15 @@ External Statics .. rubric:: Legality Rules -:dp:`fls_8ddsytjr4il6` -An :t:`external static` is an import of a foreign :t:`variable`. +.. glossary-entry:: external static + :glossary-dp: fls_c89migfc2m6e + + :glossary: + :dp:`fls_bqq6cncstzeg` + An :dt:`external static` is an import of a foreign :t:`variable`. + :chapter: + :dp:`fls_8ddsytjr4il6` + An :t:`external static` is an import of a foreign :t:`variable`. :dp:`fls_H0cg9XMaGz0y` An :t:`external static` inherits the :t:`ABI` of its enclosing diff --git a/src/functions.rst b/src/functions.rst index 3a5e02c2..a491a2a3 100644 --- a/src/functions.rst +++ b/src/functions.rst @@ -48,28 +48,69 @@ Functions .. rubric:: Legality Rules -:dp:`fls_gn1ngtx2tp2s` -A :t:`function` is a :t:`value` of a :t:`function type` that models a behavior. +.. glossary-entry:: function + :glossary-dp: fls_yllg093syzdi + + :glossary: + :dp:`fls_ni14pcm4ap9l` + A :dt:`function` is a :t:`value` of a :t:`function type` that models a behavior. + + :dp:`fls_hn01vvw2fx9m` + See :s:`FunctionDeclaration`. + :chapter: + :dp:`fls_gn1ngtx2tp2s` + A :t:`function` is a :t:`value` of a :t:`function type` that models a behavior. :dp:`fls_bdx9gnnjxru3` A :t:`function` declares a unique :t:`function item type` for itself. -:dp:`fls_87jnkimc15gi` -A :t:`function qualifier` is a :t:`construct` that determines the role of -a :t:`function`. +.. glossary-entry:: function qualifier + :glossary-dp: fls_2uvom1x42dcs + + :glossary: + :dp:`fls_8cux22275v8r` + A :dt:`function qualifier` is a :t:`construct` that determines the role of + a :t:`function`. + + :dp:`fls_3td9tztnj2jq` + See :s:`FunctionQualifierList`. + :chapter: + :dp:`fls_87jnkimc15gi` + A :t:`function qualifier` is a :t:`construct` that determines the role of + a :t:`function`. :dp:`fls_nwywh1vjt6rr` A :t:`function` shall not be subject to both :t:`keyword` ``async`` and :t:`keyword` ``const``. -:dp:`fls_uwuthzfgslif` -A :t:`function parameter` is a :t:`construct` that yields a set of -:t:`[binding]s` that bind matched input :t:`[value]s` to :t:`[name]s` at the -site of a :t:`call expression` or a :t:`method call expression`. - -:dp:`fls_ymeo93t4mz4` -A :t:`self parameter` is a :t:`function parameter` expressed by :t:`keyword` -``self``. +.. glossary-entry:: function parameter + :glossary-dp: fls_xn800gcjnln1 + + :glossary: + :dp:`fls_2feq1ky9pla1` + A :dt:`function parameter` is a :t:`construct` that yields a set of + :t:`[binding]s` that bind matched input :t:`[value]s` to :t:`[name]s` at the + site of a :t:`call expression` or a :t:`method call expression`. + + :dp:`fls_4tf20svi3rjx` + See :s:`FunctionParameter`. + :chapter: + :dp:`fls_uwuthzfgslif` + A :t:`function parameter` is a :t:`construct` that yields a set of + :t:`[binding]s` that bind matched input :t:`[value]s` to :t:`[name]s` at the + site of a :t:`call expression` or a :t:`method call expression`. + +.. glossary-entry:: self parameter + :glossary-dp: fls_6wjlbzmlx9n4 + + :glossary: + :dp:`fls_ksne48eip15` + A :dt:`self parameter` is a :t:`function parameter` expressed by :t:`keyword` + ``self``. + :chapter: + :dp:`fls_ymeo93t4mz4` + A :t:`self parameter` is a :t:`function parameter` expressed by :t:`keyword` + ``self``. :dp:`fls_ijbt4tgnl95n` A :t:`function` shall not specify a :t:`self parameter` unless it is an @@ -137,8 +178,18 @@ A :t:`variadic function` shall specify one of the following :t:`[ABI]s`: * :dp:`fls_4B4B5FIqAes9` ``extern "win64-unwind"`` -:dp:`fls_vljy4mm0zca2` -A :t:`return type` is the :t:`type` of the result a :t:`function`, :t:`closure type` or :t:`function pointer type` returns. +.. glossary-entry:: return type + :glossary-dp: fls_b8dbm1bs65kw + + :glossary: + :dp:`fls_cwucgbmmhnnm` + A :dt:`return type` is the :t:`type` of the result a :t:`function` returns. + + :dp:`fls_utuprsem6n58` + See :s:`ReturnType`. + :chapter: + :dp:`fls_vljy4mm0zca2` + A :t:`return type` is the :t:`type` of the result a :t:`function`, :t:`closure type` or :t:`function pointer type` returns. :dp:`fls_EqJb3Jl3vK8K` The :t:`return type` of a :t:`function` is determined as follows: @@ -149,8 +200,18 @@ The :t:`return type` of a :t:`function` is determined as follows: * :dp:`fls_J8X8ahnJLrMo` Otherwise the :t:`return type` is the :t:`unit type`. -:dp:`fls_927nfm5mkbsp` -A :t:`function body` is the :t:`block expression` of a :t:`function`. +.. glossary-entry:: function body + :glossary-dp: fls_vjgkg8kfi93 + + :glossary: + :dp:`fls_y5ha4123alik` + A :dt:`function body` is the :t:`block expression` of a :t:`function`. + + :dp:`fls_r0g0i730x6x4` + See :s:`FunctionBody`. + :chapter: + :dp:`fls_927nfm5mkbsp` + A :t:`function body` is the :t:`block expression` of a :t:`function`. :dp:`fls_yfm0jh62oaxr` A :t:`function` shall have a :t:`function body` unless it is an @@ -159,18 +220,52 @@ A :t:`function` shall have a :t:`function body` unless it is an :dp:`fls_bHwy8FLzEUi3` A :t:`function body` denotes a :t:`control flow boundary`. +.. glossary-entry:: control flow boundary + :glossary-dp: fls_nC4Knv4tpenW + + :glossary: + :dp:`fls_SmipZJDp02ij` + A :dt:`control flow boundary` is a :t:`construct` that limits control flow from + returning beyond the :t:`construct`, and acts as the target of control flow + returning operations. + +.. glossary-entry:: async control flow boundary + :glossary-dp: fls_lYrTaCM1LcXU + + :glossary: + :dp:`fls_EXoGOkCRsfKK` + An :dt:`async control flow boundary` is a :t:`control flow boundary` that + additionally allows the suspension of execution via :t:`[await expression]s`. + :dp:`fls_5Q861wb08DU3` A :t:`function body` of an :t:`async function` denotes an :t:`async control flow boundary`. -:dp:`fls_owdlsaaygtho` -A :t:`function signature` is a unique identification of a :t:`function` -that encompasses of its :t:`[function qualifier]s`, :t:`name`, -:t:`[generic parameter]s`, :t:`[function parameter]s`, :t:`return type`, and -:t:`where clause`. - -:dp:`fls_2049qu3ji5x7` -A :t:`constant function` is a :t:`function` subject to :t:`keyword` ``const``. +.. glossary-entry:: function signature + :glossary-dp: fls_hz3zunp8lrfl + + :glossary: + :dp:`fls_ndld48kg6o8d` + A :dt:`function signature` is a unique identification of a :t:`function` + that encompasses of its :t:`[function qualifier]s`, :t:`name`, + :t:`[generic parameter]s`, :t:`[function parameter]s`, :t:`return type`, and + :t:`where clause`. + :chapter: + :dp:`fls_owdlsaaygtho` + A :t:`function signature` is a unique identification of a :t:`function` + that encompasses of its :t:`[function qualifier]s`, :t:`name`, + :t:`[generic parameter]s`, :t:`[function parameter]s`, :t:`return type`, and + :t:`where clause`. + +.. glossary-entry:: constant function + :glossary-dp: fls_6j1wluj8sku8 + + :glossary: + :dp:`fls_4glkwg11p5ml` + A :dt:`constant function` is a :t:`function` subject to :t:`keyword` ``const``. + :chapter: + :dp:`fls_2049qu3ji5x7` + A :t:`constant function` is a :t:`function` subject to :t:`keyword` ``const``. :dp:`fls_7mlanuh5mvpn` The :t:`function body` of a :t:`constant function` shall be a @@ -179,29 +274,43 @@ The :t:`function body` of a :t:`constant function` shall be a :dp:`fls_otr3hgp8lj1q` A :t:`constant function` shall be callable from a :t:`constant context`. -:dp:`fls_m3jiunibqj81` -An :t:`async function` is a :t:`function` subject to :t:`keyword` ``async``. An -:t:`async function` of the form - -.. code-block:: rust - - async fn async_fn(param: ¶m_type) -> return_type { - /* tail expression */ - } - -:dp:`fls_7vogmqyd87ey` -is equivalent to :t:`function` - -.. code-block:: rust - - fn async_fn<'a>(param: &'a param_type) -> impl Future + 'a { - async move { - /* tail expression */ - } - } - -:dp:`fls_7ucwmzqtittv` -An :t:`unsafe function` is a :t:`function` subject to an :s:`ItemSafety` with :t:`keyword` ``unsafe``. +.. glossary-entry:: async function + :glossary-dp: fls_nlafxy2z1moc + + :glossary: + :dp:`fls_gv9wl1cbaw1g` + An :dt:`async function` is a :t:`function` subject to :t:`keyword` ``async``. + :chapter: + :dp:`fls_m3jiunibqj81` + An :t:`async function` is a :t:`function` subject to :t:`keyword` ``async``. An + :t:`async function` of the form + + .. code-block:: rust + + async fn async_fn(param: ¶m_type) -> return_type { + /* tail expression */ + } + + :dp:`fls_7vogmqyd87ey` + is equivalent to :t:`function` + + .. code-block:: rust + + fn async_fn<'a>(param: &'a param_type) -> impl Future + 'a { + async move { + /* tail expression */ + } + } + +.. glossary-entry:: unsafe function + :glossary-dp: fls_ua64pv82skaw + + :glossary: + :dp:`fls_2ht13dgtxi1o` + An :dt:`unsafe function` is a :t:`function` subject to :t:`keyword` ``unsafe``. + :chapter: + :dp:`fls_7ucwmzqtittv` + An :t:`unsafe function` is a :t:`function` subject to an :s:`ItemSafety` with :t:`keyword` ``unsafe``. :dp:`fls_nUADhgcfvvGC` A :t:`function` shall only be subject to an :s:`ItemSafety` with :t:`keyword` ``safe`` if it is an :t:`external function` in an :t:`unsafe external block`. diff --git a/src/general.rst b/src/general.rst index 570af8e5..78359e0f 100644 --- a/src/general.rst +++ b/src/general.rst @@ -54,6 +54,13 @@ It documents the current understanding for the purposes of compiler validation. As such, given any doubt, it prefers documenting behavior of :t:`rustc` over claiming correctness as a specification. +.. glossary-entry:: rustc + :glossary-dp: fls_fki32ns69q4j + + :glossary: + :dp:`fls_zdgbeixirjfm` + :dt:`rustc` is a compiler that implements the FLS. + :dp:`fls_dv1qish8svc` This document is made available for contribution and review, and can be a place of shared understanding. It @@ -154,6 +161,14 @@ relevant to the topic: :dp:`fls_oxzjqxgejx9t` The syntax representation of a :t:`construct`. +.. glossary-entry:: construct + :glossary-dp: fls_4305i29nt5d6 + + :glossary: + :dp:`fls_10tvzeo8xex0` + A :dt:`construct` is a piece of program text that is an instance of a + :t:`syntactic category`. + .. rubric:: Legality Rules :dp:`fls_gmx688d6ek1o` @@ -252,6 +267,25 @@ both the effects of each construct and the composition rules for constructs. The context-free syntax of Rust is described using a simple variant of the Backus-Naur form. In particular: +.. glossary-entry:: syntactic category + :glossary-dp: fls_44djv0wocacs + + :glossary: + :dp:`fls_f981e3m7kq50` + A :dt:`syntactic category` is a nonterminal in the Backus-Naur Form grammar + definition of the Rust programming language. + +.. glossary-entry:: escaped character + :glossary-dp: fls_9hw559b548m0 + + :glossary: + :dp:`fls_7yvnbakmo7y5` + An :dt:`escaped character` is the textual representation for a character with + special meaning. An escaped character consists of character 0x5C (reverse + solidus), followed by the single character encoding of the special meaning + character. For example, ``\t`` is the escaped character for 0x09 (horizontal + tabulation). + * :dp:`fls_98fm7z04lq9` A ``monospaced`` font is used to denote Rust syntax. diff --git a/src/generics.rst b/src/generics.rst index 54df8103..33591136 100644 --- a/src/generics.rst +++ b/src/generics.rst @@ -46,43 +46,126 @@ Generic Parameters .. rubric:: Legality Rules -:dp:`fls_sye3d17l9bf5` -A :t:`generic parameter` is a placeholder for a :t:`constant`, a :t:`lifetime`, -or a :t:`type`, whose :t:`constant`, :t:`lifetime`, or :t:`type` is supplied -statically by a :t:`generic argument`. +.. glossary-entry:: generic parameter + :glossary-dp: fls_s2syghgn74e2 + + :glossary: + :dp:`fls_61e6br8jy1v2` + A :dt:`generic parameter` is a placeholder for a :t:`constant`, a + :t:`lifetime`, or a :t:`type` whose :t:`value` is supplied statically by a + :t:`generic argument`. + + :dp:`fls_jvxpoob39632` + See :s:`GenericParameterList`. + :chapter: + :dp:`fls_sye3d17l9bf5` + A :t:`generic parameter` is a placeholder for a :t:`constant`, a :t:`lifetime`, + or a :t:`type`, whose :t:`constant`, :t:`lifetime`, or :t:`type` is supplied + statically by a :t:`generic argument`. :dp:`fls_dalqke3rznrb` All :s:`[LifetimeParameter]s` in a :s:`GenericParameterList` shall precede all :s:`[ConstantParameter]s` and :s:`[TypeParameter]s`. -:dp:`fls_pi6eukz7kc99` -A :t:`generic enum` is an :t:`enum` with :t:`[generic parameter]s`. - -:dp:`fls_ixmgqupxvf73` -A :t:`generic function` is a :t:`function` with :t:`[generic parameter]s`. - -:dp:`fls_z311nxou9yi3` -A :t:`generic implementation` is an :t:`implementation` with -:t:`[generic parameter]s`. - -:dp:`fls_wmcp0n36jlbr` -A :t:`generic struct` is a :t:`struct` with :t:`[generic parameter]s`. - -:dp:`fls_h42kg56vsefx` -A :t:`generic trait` is a :t:`trait` with :t:`[generic parameter]s`. - -:dp:`fls_372h3oevejih` -A :t:`generic type alias` is a :t:`type alias` with :t:`[generic parameter]s`. - -:dp:`fls_u8mqct93yimd` -A :t:`generic union` is a :t:`union` with :t:`[generic parameter]s`. - -:dp:`fls_vpcqgec83ybt` -A :t:`constant parameter` is a :t:`generic parameter` for a :t:`constant`. - -:dp:`fls_3SjMBlc0b7qo` -A :t:`constant parameter initializer` is a :t:`construct` that provides the -default :t:`value` of its related :t:`constant parameter`. +.. glossary-entry:: generic enum + :glossary-dp: fls_3tj3i83eoi36 + + :glossary: + :dp:`fls_pnu8w26uexaq` + A :dt:`generic enum` is an :t:`enum` with :t:`[generic parameter]s`. + :chapter: + :dp:`fls_pi6eukz7kc99` + A :t:`generic enum` is an :t:`enum` with :t:`[generic parameter]s`. + +.. glossary-entry:: generic function + :glossary-dp: fls_votx8gvy5utg + + :glossary: + :dp:`fls_rfkbc967d48h` + A :dt:`generic function` is a :t:`function` with :t:`[generic parameter]s`. + :chapter: + :dp:`fls_ixmgqupxvf73` + A :t:`generic function` is a :t:`function` with :t:`[generic parameter]s`. + +.. glossary-entry:: generic implementation + :glossary-dp: fls_1xjbrp376niw + + :glossary: + :dp:`fls_jic937ujpnar` + A :dt:`generic implementation` is an :t:`implementation` with + :t:`[generic parameter]s`. + :chapter: + :dp:`fls_z311nxou9yi3` + A :t:`generic implementation` is an :t:`implementation` with + :t:`[generic parameter]s`. + +.. glossary-entry:: generic struct + :glossary-dp: fls_cgtu4v2vxvh + + :glossary: + :dp:`fls_mcb2mlklith8` + A :dt:`generic struct` is a :t:`struct` with :t:`[generic parameter]s`. + :chapter: + :dp:`fls_wmcp0n36jlbr` + A :t:`generic struct` is a :t:`struct` with :t:`[generic parameter]s`. + +.. glossary-entry:: generic trait + :glossary-dp: fls_hppo1v3ia4wu + + :glossary: + :dp:`fls_h515f11akr91` + A :dt:`generic trait` is a :t:`trait` with :t:`[generic parameter]s`. + :chapter: + :dp:`fls_h42kg56vsefx` + A :t:`generic trait` is a :t:`trait` with :t:`[generic parameter]s`. + +.. glossary-entry:: generic type alias + :glossary-dp: fls_18ow0q8at1pi + + :glossary: + :dp:`fls_zgxsqq4vu7e3` + A :dt:`generic type alias` is a :t:`type alias` with :t:`[generic parameter]s`. + :chapter: + :dp:`fls_372h3oevejih` + A :t:`generic type alias` is a :t:`type alias` with :t:`[generic parameter]s`. + +.. glossary-entry:: generic union + :glossary-dp: fls_xn9mla1vm6iv + + :glossary: + :dp:`fls_93rxr0yjx1e7` + A :dt:`generic union` is a :t:`union` with :t:`[generic parameter]s`. + :chapter: + :dp:`fls_u8mqct93yimd` + A :t:`generic union` is a :t:`union` with :t:`[generic parameter]s`. + +.. glossary-entry:: constant parameter + :glossary-dp: fls_pj0f0p4avbyw + + :glossary: + :dp:`fls_z7e491m3dx4u` + A :dt:`constant parameter` is a :t:`generic parameter` for a :t:`constant`. + + :dp:`fls_9093wziwxk1g` + See :s:`ConstantParameter`. + :chapter: + :dp:`fls_vpcqgec83ybt` + A :t:`constant parameter` is a :t:`generic parameter` for a :t:`constant`. + +.. glossary-entry:: constant parameter initializer + :glossary-dp: fls_sIvXMhYaZVjD + + :glossary: + :dp:`fls_OXD2YaOkfjcI` + A :dt:`constant parameter initializer` is a :t:`construct` that provides the + default `:t:`value` of its related :t:`constant parameter`. + + :dp:`fls_CMsyUCxGm8Xs` + See :s:`ConstantParameterInitializer`. + :chapter: + :dp:`fls_3SjMBlc0b7qo` + A :t:`constant parameter initializer` is a :t:`construct` that provides the + default :t:`value` of its related :t:`constant parameter`. :dp:`fls_p4yb8EAXlRU0` A :t:`constant parameter initializer` shall be a :t:`constant expression`. @@ -91,19 +174,50 @@ A :t:`constant parameter initializer` shall be a :t:`constant expression`. It is a static error to use a :t:`generic parameter` in the :t:`discriminant initializer` of an :t:`enum variant`. -:dp:`fls_s0nrjwqg2wox` -A :t:`lifetime parameter` is a :t:`generic parameter` for a :t:`lifetime`. +.. glossary-entry:: lifetime parameter + :glossary-dp: fls_md7ii59zobrc + + :glossary: + :dp:`fls_7g0iu68nrsd4` + A :dt:`lifetime parameter` is a :t:`generic parameter` for a :t:`lifetime`. + + :dp:`fls_z1wl2uiwip98` + See :s:`LifetimeParameter`. + :chapter: + :dp:`fls_s0nrjwqg2wox` + A :t:`lifetime parameter` is a :t:`generic parameter` for a :t:`lifetime`. :dp:`fls_2grtygcj8o3` A :t:`lifetime parameter` shall not be used within a :t:`constant context`, except for the ``'static`` :t:`lifetime`. -:dp:`fls_95eooah0vcqx` -A :t:`type parameter` is a :t:`generic parameter` for a :t:`type`. - -:dp:`fls_ahCqtkh0m5sR` -A :t:`type parameter initializer` is a :t:`construct` that provides the -default :t:`value` of its related :t:`type parameter`. +.. glossary-entry:: type parameter + :glossary-dp: fls_uv2damik654e + + :glossary: + :dp:`fls_5t6510wkb67x` + A :dt:`type parameter` is a :t:`generic parameter` for a :t:`type`. + + :dp:`fls_vquy0tsvd93x` + See :s:`TypeParameter`. + :chapter: + :dp:`fls_95eooah0vcqx` + A :t:`type parameter` is a :t:`generic parameter` for a :t:`type`. + +.. glossary-entry:: type parameter initializer + :glossary-dp: fls_Fq2zTHYRpK2V + + :glossary: + :dp:`fls_Xpz47JLNsOXI` + A :dt:`type parameter initializer` is a :t:`construct` that provides the + default :t:`value` of its related :t:`type parameter`. + + :dp:`fls_6Ap26AcSadP8` + See :s:`TypeParameterInitializer`. + :chapter: + :dp:`fls_ahCqtkh0m5sR` + A :t:`type parameter initializer` is a :t:`construct` that provides the + default :t:`value` of its related :t:`type parameter`. :dp:`fls_3qZRBp9j26w3` The :t:`type` of the :t:`type parameter initializer` of a :t:`type parameter` @@ -122,9 +236,17 @@ A :t:`generic struct` shall use all of its :t:`[type parameter]s` and A :t:`generic union` shall use all of its :t:`[type parameter]s` and :t:`[lifetime parameter]s` at least once in at least one of its :t:`[field]s`. -:dp:`fls_hyi2jnp38v1n` -A :t:`generic parameter` is said to constrain an :t:`implementation` if the -:t:`generic parameter` appears at least once in one of the following: +.. glossary-entry:: constrain + :glossary-dp: fls_x4niicvxxv9k + + :glossary: + :dp:`fls_fna0ch8ucyhv` + A :t:`generic parameter` is said to :dt:`constrain` an :t:`implementation` if + it makes the :t:`[implementation]'s` applicability more narrow. + :chapter: + :dp:`fls_hyi2jnp38v1n` + A :t:`generic parameter` is said to constrain an :t:`implementation` if the + :t:`generic parameter` appears at least once in one of the following: * :dp:`fls_sseo6u6pbcki` As a :t:`binding argument` in the :t:`[trait bound]s` of a :t:`type` that @@ -274,31 +396,84 @@ Where Clauses .. rubric:: Legality Rules -:dp:`fls_3nqb7p5ifvio` -A :t:`where clause` is a :t:`construct` that specifies :t:`[bound]s` on -:t:`[lifetime parameter]s` and :t:`[type]s` that have -to hold for the :t:`construct` subject to the :t:`where clause` to be valid. - -:dp:`fls_fhy4rsmmbvyy` -A :t:`where clause predicate` is either a :t:`lifetime bound predicate` or a -:t:`type bound predicate`. - -:dp:`fls_V4PKFqtCsAv6` -A :t:`lifetime bound predicate` is a :t:`construct` that specifies -:t:`[lifetime bound]s` on a :t:`lifetime parameter`. - -:dp:`fls_cslGPmVjujHD` -A :t:`type bound predicate` is a :t:`construct` that specifies -:t:`[lifetime bound]s` and :t:`[trait bound]s` on a :t:`type`. +.. glossary-entry:: where clause + :glossary-dp: fls_ew2gsg72rjxk + + :glossary: + :dp:`fls_prljyrhontzn` + A :dt:`where clause` is a :t:`construct` that specifies :t:`[bound]s` on + :t:`[lifetime parameter]s` and :t:`[type parameter]s`. + + :dp:`fls_k32hnug33eo9` + See :s:`WhereClause`. + :chapter: + :dp:`fls_3nqb7p5ifvio` + A :t:`where clause` is a :t:`construct` that specifies :t:`[bound]s` on + :t:`[lifetime parameter]s` and :t:`[type]s` that have + to hold for the :t:`construct` subject to the :t:`where clause` to be valid. + +.. glossary-entry:: where clause predicate + :glossary-dp: fls_myNeYCm4VI0R + + :glossary: + :dp:`fls_0LACQVmZpDQF` + A :dt:`where clause predicate` is either a :t:`lifetime bound predicate` or a + :t:`type bound predicate`. + + :dp:`fls_Jk7V1SOKE4Gm` + See :s:`WhereClausePredicate`. + :chapter: + :dp:`fls_fhy4rsmmbvyy` + A :t:`where clause predicate` is either a :t:`lifetime bound predicate` or a + :t:`type bound predicate`. + +.. glossary-entry:: lifetime bound predicate + :glossary-dp: fls_fV8sP0roRyBN + + :glossary: + :dp:`fls_AHftLKgSP9Xk` + A :dt:`lifetime bound predicate` is a :t:`construct` that specifies + :t:`[lifetime bound]s` on a :t:`lifetime parameter`. + + :dp:`fls_8WIod9Rm5IXa` + See :s:`LifetimeBoundPredicate`. + :chapter: + :dp:`fls_V4PKFqtCsAv6` + A :t:`lifetime bound predicate` is a :t:`construct` that specifies + :t:`[lifetime bound]s` on a :t:`lifetime parameter`. + +.. glossary-entry:: type bound predicate + :glossary-dp: fls_zDdXv5I4bW9H + + :glossary: + :dp:`fls_j6WKoybB4cep` + A :dt:`type bound predicate` is a :t:`construct` that specifies + :t:`[lifetime bound]s` and :t:`[trait bound]s` on a :t:`type`. + + :dp:`fls_oMlPNgoDjnoW` + See :s:`TypeBoundPredicate`. + :chapter: + :dp:`fls_cslGPmVjujHD` + A :t:`type bound predicate` is a :t:`construct` that specifies + :t:`[lifetime bound]s` and :t:`[trait bound]s` on a :t:`type`. :dp:`fls_ytk74dyxuy6d` A :t:`construct` is valid when all of its :t:`[where clause predicate]s` hold true for the supplied :t:`[generic argument]s`. -:dp:`fls_1xgw1dq60quz` -A :t:`trivial predicate` is a :t:`where clause predicate` that does not use -the :t:`[generic parameter]s` or :t:`[higher-ranked trait bound]s` of the related -:t:`construct`. +.. glossary-entry:: trivial predicate + :glossary-dp: fls_soqkluvirlsd + + :glossary: + :dp:`fls_db5njwrjolhs` + A :dt:`trivial predicate` is a :t:`where clause predicate` that does not use + the :t:`[generic parameter]s` or :t:`[higher-ranked trait bound]s` of the related + :t:`construct`. + :chapter: + :dp:`fls_1xgw1dq60quz` + A :t:`trivial predicate` is a :t:`where clause predicate` that does not use + the :t:`[generic parameter]s` or :t:`[higher-ranked trait bound]s` of the related + :t:`construct`. :dp:`fls_47s8i7pzb9gg` It is a static error to create a :t:`trivial predicate` that does not hold. @@ -349,9 +524,20 @@ Generic Arguments .. rubric:: Legality Rules -:dp:`fls_3x6qd8vt5uus` -A :t:`generic argument` supplies a static input for an -:t:`associated trait type` or a :t:`generic parameter`. +.. glossary-entry:: generic argument + :glossary-dp: fls_j1cyhud0h65t + + :glossary: + :dp:`fls_meimxi20p51a` + A :dt:`generic argument` supplies a static input for an + :t:`associated trait type` or a :t:`generic parameter`. + + :dp:`fls_8bvdmdgbu17l` + See :s:`GenericArgumentList`. + :chapter: + :dp:`fls_3x6qd8vt5uus` + A :t:`generic argument` supplies a static input for an + :t:`associated trait type` or a :t:`generic parameter`. :dp:`fls_ky39fb2vcom6` A :s:`BindingArgument` shall follow :s:`[ConstantArgument]s`, @@ -363,13 +549,29 @@ A :s:`LifetimeArgument` shall precede :s:`[BindingArgument]s`, :s:`[ConstantArgument]s`, and :s:`[TypeArgument]s` in a :s:`GenericArgumentList`. -:dp:`fls_9pda3ja0ihks` -A :t:`binding argument` is a :t:`generic argument` that supplies the :t:`type` -of an :t:`associated trait type`. - -:dp:`fls_mcUMWsYcxzmZ` -A :t:`binding bound argument` is a :t:`generic argument` that further imposes -:t:`[bound]s` on an :t:`associated trait type`. +.. glossary-entry:: binding argument + :glossary-dp: fls_glblhx8vzd3z + + :glossary: + :dp:`fls_9lzcasl4tw7k` + A :dt:`binding argument` is a :t:`generic argument` that supplies the :t:`type` + of an :t:`associated trait type`. + :chapter: + :dp:`fls_9pda3ja0ihks` + A :t:`binding argument` is a :t:`generic argument` that supplies the :t:`type` + of an :t:`associated trait type`. + +.. glossary-entry:: binding bound argument + :glossary-dp: fls_t2cit5QOte8U + + :glossary: + :dp:`fls_D3i3n4RIReCA` + A :dt:`binding bound argument` is a :t:`generic argument` that further imposes + :t:`[bound]s` on an :t:`associated trait type`. + :chapter: + :dp:`fls_mcUMWsYcxzmZ` + A :t:`binding bound argument` is a :t:`generic argument` that further imposes + :t:`[bound]s` on an :t:`associated trait type`. :dp:`fls_dxMfAI4EZVS5` A :t:`binding bound argument` shall only be used within the confines of a @@ -377,22 +579,55 @@ A :t:`binding bound argument` shall only be used within the confines of a :t:`[bound]s`, :t:`associated type`'s :t:`[bound]s` or :t:`trait`'s :t:`[supertrait]s`. -:dp:`fls_i3z9ueoe99zd` -A :t:`constant argument` is a :t:`generic argument` that supplies the -:t:`value` of a :t:`constant parameter`. +.. glossary-entry:: constant argument + :glossary-dp: fls_n7z4cl1fsk6l + + :glossary: + :dp:`fls_sz10vgh260xo` + A :dt:`constant argument` is a :t:`generic argument` that supplies the + :t:`value` of a :t:`constant parameter`. + + :dp:`fls_dz9x6gf3yzc6` + See :s:`ConstantArgument`. + :chapter: + :dp:`fls_i3z9ueoe99zd` + A :t:`constant argument` is a :t:`generic argument` that supplies the + :t:`value` of a :t:`constant parameter`. :dp:`fls_al4dhmqodvwc` A :t:`constant argument` may only appear as a single segment :t:`path expression`, optionally encapsulated in a :t:`block expression`, within an :t:`array repetition constructor` or a :t:`type`. -:dp:`fls_10k9gdxlpuls` -A :t:`lifetime argument` is a :t:`generic argument` that supplies the -:t:`lifetime` of a :t:`lifetime parameter`. - -:dp:`fls_d4vdvpihoeb1` -A :t:`type argument` is a :t:`generic argument` that supplies the :t:`type` of -a :t:`type parameter`. +.. glossary-entry:: lifetime argument + :glossary-dp: fls_d0s6bk7ljqrb + + :glossary: + :dp:`fls_oaf87yjb3xjs` + A :dt:`lifetime argument` is a :t:`generic argument` that supplies the + :t:`value` of a :t:`lifetime parameter`. + + :dp:`fls_la8lbv14zj28` + See :s:`LifetimeArgument`. + :chapter: + :dp:`fls_10k9gdxlpuls` + A :t:`lifetime argument` is a :t:`generic argument` that supplies the + :t:`lifetime` of a :t:`lifetime parameter`. + +.. glossary-entry:: type argument + :glossary-dp: fls_89ollsdjx3uy + + :glossary: + :dp:`fls_152lk7hrtd11` + A :dt:`type argument` is a :t:`generic argument` that supplies the :t:`value` + of a :t:`type parameter`. + + :dp:`fls_91tqk65qiygf` + See :s:`TypeArgument`. + :chapter: + :dp:`fls_d4vdvpihoeb1` + A :t:`type argument` is a :t:`generic argument` that supplies the :t:`type` of + a :t:`type parameter`. :dp:`fls_ukarc98ceesz` :t:`[Generic argument]s` are subject to :t:`generic conformance`. @@ -426,9 +661,17 @@ Generic Conformance .. rubric:: Legality Rules -:dp:`fls_CBWyxBJeYeb2` -:t:`Generic conformance` measures the compatibility between a set of -:t:`[generic parameter]s` and a set of :t:`[generic argument]s`. +.. glossary-entry:: generic conformance + :glossary-dp: fls_3uFg0NK5fYQ6 + + :glossary: + :dp:`fls_PfvELNsNySLT` + :dt:`Generic conformance` measures the compatibility between a set of + :t:`[generic parameter]s` and a set of :t:`[generic argument]s`. + :chapter: + :dp:`fls_CBWyxBJeYeb2` + :t:`Generic conformance` measures the compatibility between a set of + :t:`[generic parameter]s` and a set of :t:`[generic argument]s`. :dp:`fls_ltch5eivxgaa` A :t:`binding argument` is conformant with an :t:`associated type` when the diff --git a/src/glossary.prelude.rst.inc b/src/glossary.prelude.rst.inc new file mode 100644 index 00000000..06847332 --- /dev/null +++ b/src/glossary.prelude.rst.inc @@ -0,0 +1,12 @@ +.. SPDX-License-Identifier: MIT OR Apache-2.0 + SPDX-FileCopyrightText: The Ferrocene Developers + SPDX-FileCopyrightText: The Rust Project Contributors + +.. default-domain:: spec + +.. informational-page:: + +.. _fls_bc2qwbfibrcs: + +Glossary +======== diff --git a/src/glossary.rst b/src/glossary.rst index 50c7fcf4..12e9f0b3 100644 --- a/src/glossary.rst +++ b/src/glossary.rst @@ -6,7855 +6,5 @@ .. informational-page:: -.. _fls_bc2qwbfibrcs: - -Glossary -======== - -.. _fls_m98yg554tj9s: - -ABI -^^^ - -:dp:`fls_4ko8qcah0f9k` -For :dt:`ABI`, see :t:`Application Binary Interface`. - -.. _fls_zOdDwoObYHC0: - -ABI clobber -^^^^^^^^^^^ - -:dp:`fls_OVX4RFcWKfP9` -An :dt:`ABI clobber` is an argument to :t:`macro` :std:`core::arch::asm` which -indicates that the :t:`[value]s` of selected :t:`[register]s` might be -overwritten during the :t:`execution` of an :t:`assembly code block`. - -:dp:`fls_pMNTKjDMCHia` -See :s:`AbiClobber`. - -.. _fls_g791aj7w5iz1: - -ABI kind -^^^^^^^^ - -:dp:`fls_qo9itrt0n3h8` -The :dt:`ABI kind` indicates the :t:`ABI` of a :t:`construct`. - -:dp:`fls_rd4kpubxygie` -See :s:`AbiKind`. - -.. _fls_ymnz0mt7i4m8: - -abort -^^^^^ - -:dp:`fls_u4o7tda3ilv0` -:dt:`Abort` is the immediate termination of a program. - -.. _fls_g40une2uudez: - -abstract data type -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_64drmro2fcfo` -An :dt:`abstract data type` is a collection of other :t:`[type]s`. - -.. _fls_5fu0ncvnjyna: - -active attribute -^^^^^^^^^^^^^^^^ - -:dp:`fls_r8rzj8mtxtp1` -An :dt:`active attribute` is an :t:`attribute` that is removed from the -:t:`item` it decorates. - -.. _fls_xqZapSv9tM1F: - -addition assignment -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_FVgKeCXlmuPe` -For :dt:`addition assignment`, see :t:`addition assignment expression`. - -.. _fls_iw30dqjaeqle: - -addition assignment expression -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_w83tf9m7vu67` -An :dt:`addition assignment expression` is a -:t:`compound assignment expression` that uses addition. - -:dp:`fls_hihh97p0rnt8` -See :s:`AdditionAssignmentExpression`. - -.. _fls_mcabdigrqv21: - -addition expression -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_ylfdtuajmi0t` -An :dt:`addition expression` is an :t:`arithmetic expression` that uses -addition. - -:dp:`fls_5bgx5dyi817x` -See :s:`AdditionExpression`. - -.. _fls_wbdlbe61de3t: - -adjusted call operand -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_mchqbc64iu0u` -An :dt:`adjusted call operand` is a :t:`call operand` adjusted with inserted :t:`[borrow expression]s` and :t:`[dereference expression]s`. - -.. _fls_j775guurkgo4: - -alignment -^^^^^^^^^ - -:dp:`fls_c0hbatn5o8x3` -The :dt:`alignment` of a :t:`value` specifies which addresses are valid for -storing the value. - -.. _fls_jZKpckU1t2lR: - -all configuration predicate -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_IyMZWiTnkYPv` -An :dt:`all configuration predicate` is a :t:`configuration predicate` that -models existential quantifier ALL. - -:dp:`fls_0fEw9Bx8xX8q` -See :s:`ConfigurationPredicateAll`. - -.. _fls_du8uevac5q7j: - -anonymous loop expression -^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_csss2a8yk52k` -An :dt:`anonymous loop expression` is a :t:`loop expression` without a -:t:`label`. - -.. _fls_dgxkklxcrrl0: - -anonymous return type -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_z6t6lbwwztuf` -An :dt:`anonymous return type` is an :t:`impl trait type` ascribed to a -:t:`function` return type. - -.. _fls_8oepaq6ang93: - -anonymous type parameter -^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_brqaq0736o09` -An :dt:`anonymous type parameter` is an :t:`impl trait type` ascribed to a -:t:`function parameter`. - -.. _fls_jrzM6C5B6AMt: - -any configuration predicate -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_0nWHML8eoozG` -An :dt:`any configuration predicate` is a :t:`configuration predicate` that -models existential quantifier ANY. - -:dp:`fls_xhhXonDldWQY` -See :s:`ConfigurationPredicateAny`. - -.. _fls_pcum2wpmgskk: - -Application Binary Interface -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_ew4babc9467c` -:dt:`Application Binary Interface` is a set of conventions that dictate how -data and computation cross language boundaries. - -:dp:`fls_8dgmmsp34lgc` -See :s:`AbiSpecification`. - -.. _fls_dd008npswhij: - -argument operand -^^^^^^^^^^^^^^^^ - -:dp:`fls_ljuwr88k92vp` -An :dt:`argument operand` is an :t:`operand` which is used as an argument in a -:t:`call expression` or a :t:`method call expression`. - -.. _fls_kf81ozijral2: - -arithmetic expression -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_u3z2r1fw89xo` -An :dt:`arithmetic expression` is an :t:`expression` that computes a :t:`value` -from two :t:`[operand]s` using arithmetic. - -:dp:`fls_in59ccg4g3we` -See :s:`ArithmeticExpression`. - -.. _fls_kSuc3Gi7cdly: - -arithmetic operator -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_Qf7DckakqvRq` -An :dt:`arithmetic operator` is the operator of an :t:`arithmetic expression`. - -.. _fls_vZ1H57x9OFSZ: - -arithmetic overflow -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_jbytOQvIddAl` -An :dt:`arithmetic overflow` occurs if an :t:`arithmetic expression` or a -:t:`negation expression` computes a :t:`value` of a :t:`scalar type` that lies -outside of the range of valid :t:`[value]s` for the :t:`scalar type`. - -.. _fls_9aice4qbiqxf: - -arity -^^^^^ - -:dp:`fls_dl2gkip00bua` -An :dt:`arity` is the number of :t:`[tuple field]s` in a :t:`tuple type`. - -.. _fls_bn1regeucxqi: - -array -^^^^^ - -:dp:`fls_metry7a5prpt` -An :dt:`array` is a :t:`value` of an :t:`array type`. - -.. _fls_2d9fee2o9: - -array element constructor -^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_cmx9ls5zoazp` -An :dt:`array element constructor` is an :t:`array expression` that lists all -elements of the :t:`array` being constructed. - -:dp:`fls_9bwte7cmszl1` -See :s:`ArrayElementConstructor`. - -.. _fls_yvzpqb192pci: - -array expression -^^^^^^^^^^^^^^^^ - -:dp:`fls_pyjkjbvqarto` -An :dt:`array expression` is an :t:`expression` that constructs an :t:`array`. - -:dp:`fls_vua1xy4y9irp` -See :s:`ArrayExpression`. - -.. _fls_6jkgj61m49vg: - -array repetition constructor -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_st1kw8mor2zk` -An :dt:`array repetition constructor` is an :t:`array expression` that -specifies how many times an element is repeated in the :t:`array` being -constructed. - -:dp:`fls_1zr997qwsal2` -See :s:`ArrayRepetitionConstructor`. - -.. _fls_15gzlmwuu4pk: - -array type -^^^^^^^^^^ - -:dp:`fls_muddb5qxdc4k` -An :dt:`array type` is a :t:`sequence type` that represents a fixed sequence of -elements. - -:dp:`fls_wre34hexlv6s` -See :s:`ArrayTypeSpecification`. - -.. _fls_et0NKXAYyDmh: - -assembly code block -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_d1ojwFwKpvm3` -An :dt:`assembly code block` is a sequence of :t:`[assembly instruction]s`. - -:dp:`fls_gXVUuW6iyNhZ` -See :s:`AssemblyCodeBlock`. - -.. _fls_iUnmWXxcuzif: - -assembly directive -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_FP2KbO6c3cpq` -An :dt:`assembly directive` is a request to the assembler to perform a -particular action or change a setting. - -.. _fls_HliSgbSzPO2r: - -assembly instruction -^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_VLu28hOvCy2o` -An :dt:`assembly instruction` is a :t:`string literal` that represents a -low-level assembly operation or an :t:`assembly directive`. - -:dp:`fls_EYHuB5cCldbm` -See :s:`AssemblyInstruction`. - -.. _fls_1iVIUoVDsYph: - -assembly option -^^^^^^^^^^^^^^^ - -:dp:`fls_F5I3okDKIYnE` -An :dt:`assembly option` is used to specify a characteristic of or a restriction -on the related :t:`assembly code block`. - -:dp:`fls_31NQgPGb73Hy` -See :s:`AssemblyOption`. - -.. _fls_l78iam7w8w38: - -assigned operand -^^^^^^^^^^^^^^^^ - -:dp:`fls_g714mnh7s7fx` -An :dt:`assigned operand` is the target :t:`operand` of a -:t:`compound assignment expression`. - -:dp:`fls_z0amfuj9vsqe` -See :s:`AssignedOperand`. - -.. _fls_m1mim5qdzf2u: - -assignee expression -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_wpmcexvbynbu` -An :dt:`assignee expression` is an :t:`expression` that appears as the -:t:`left operand` of an :t:`assignment expression`. - -.. _fls_3hs9hqsthil1: - -assignee operand -^^^^^^^^^^^^^^^^ - -:dp:`fls_4tgf0wu2mr3l` -An :dt:`assignee operand` is the target :t:`operand` of an -:t:`assignment expression`. - -:dp:`fls_df0j0vnnq20a` -See :s:`AssigneeOperand`. - -.. _fls_f6ztsofr6xa9: - -assignment -^^^^^^^^^^ - -:dp:`fls_j9pyuucyplmi` -See :t:`assignment expression`. - -.. _fls_2d2elg5eukv4: - -assignment expression -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_6jkc6a6me3zr` -An :dt:`assignment expression` is an :t:`expression` that assigns the -:t:`value` of a :t:`value operand` to an :t:`assignee operand`. - -:dp:`fls_njw68i3bp9qq` -See :s:`AssignmentExpression`. - -.. _fls_pjb22ylz5swp: - -associated constant -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_hi9qa0k2nujb` -An :dt:`associated constant` is a :t:`constant` that appears as an -:t:`associated item`. - -.. _fls_vxiitesidcc2: - -associated function -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_zcy5pat39bq7` -An :dt:`associated function` is a :t:`function` that appears as an -:t:`associated item`. - -.. _fls_9mcx6h6irrlx: - -associated implementation constant -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_rfaxcrrrb5q9` -An :dt:`associated implementation constant` is an :t:`associated constant` that -appears within an :t:`implementation`. - -.. _fls_n85fwe75ku60: - -associated implementation function -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_7xbmvl3jrc27` -An :dt:`associated implementation function` is an :t:`associated function` that -appears within an :t:`implementation`. - -.. _fls_c0hekhwpznyq: - -associated implementation type -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_6g5t81gx9ayx` -An :dt:`associated implementation type` is an :t:`associated type` that appears -within an :t:`implementation`. - -.. _fls_f3ferow5ugp: - -associated item -^^^^^^^^^^^^^^^ - -:dp:`fls_o5ysjk7l91ni` -An :dt:`associated item` is an :t:`item` that appears within an -:t:`implementation` or a :t:`trait`. - -:dp:`fls_44vtqu7tvhi2` -See :s:`AssociatedItem`. - -.. _fls_8p8teeamua55: - -associated trait constant -^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_xhhsej8db74y` -An :dt:`associated trait constant` is an :t:`associated constant` that appears -within a :t:`trait`. - -.. _fls_4h7s8u1zumnq: - -associated trait function -^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_r927r0pdkb6h` -An :dt:`associated trait function` is an :t:`associated function` that appears -within a :t:`trait`. - -.. _fls_fufF4UmzLg5G: - -associated trait implementation function -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_bzdXloUGlVSC` -An :dt:`associated trait implementation function` is an :t:`associated function` -that appears within a :t:`trait implementation`. - -.. _fls_47xtji9Pk8Lw: - -associated trait implementation item -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_PaENehzTVgfB` -An :dt:`associated trait implementation item` is an :t:`associated item` that -appears within a :t:`trait implementation`. - -.. _fls_J946yIcmlAyV: - -associated trait item -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_IlRrVLm05GTf` -An :dt:`associated trait item` is an :t:`associated item` that appears -within a :t:`trait`. - -.. _fls_azz308k3ra99: - -associated trait type -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_dndsgkiq9r7i` -An :dt:`associated trait type` is an :t:`associated type` that appears within -a :t:`trait`. - -.. _fls_zfs68g3yk0uw: - -associated type -^^^^^^^^^^^^^^^ - -:dp:`fls_rs0n72c2d8f` -An :dt:`associated type` is a :t:`type alias` that appears as an -:t:`associated item`. - -.. _fls_zOe783MlE9i9: - -associated type projection -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_4moFUY6epk0v` -An :dt:`associated type projection` is a :t:`qualified type path` of the form -``::associated_type``, where ``type`` is a :t:`type`, ``trait`` -is a :t:`qualifying trait`, and ``associated type`` is an :t:`associated type`. - -.. _fls_fczijre8123c: - -associativity -^^^^^^^^^^^^^ - -:dp:`fls_7i7o23mi2i33` -:dt:`Associativity` is the order by which :t:`[operand]s` are evaluated within -a single :t:`expression`. - -.. _fls_9speqyus5ku3: - -async block -^^^^^^^^^^^ - -:dp:`fls_pf6lrmcjywoj` -For :dt:`async block`, see :t:`async block expression`. - -.. _fls_n5m58be9jnjj: - -async block expression -^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_p6nvfs7bfoxd` -An :dt:`async block expression` is a :t:`block expression` that is specified -with :t:`keyword` ``async`` and encapsulates behavior which is executed in -an asynchronous manner. - -:dp:`fls_je689rormhd6` -See :s:`AsyncBlockExpression`. - -.. _fls_oUdQnbW1MAFW: - -async closure expression -^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_SxydbQPPX9Jw` -An :dt:`async closure expression` is a :t:`closure expression` subject to keyword ``async`` that defines an :t:`async closure type` and constructs a value of that :t:`type`. - -:dp:`fls_JZsDFMg85a3u` -See :s:`ClosureExpression`. - -.. _fls_Pq4ohvrMOi5p: - -async closure type -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_IT28HJaF8rnm` -An :dt:`async closure type` is a unique anonymous :t:`function type` that encapsulates -all :t:`[capture target]s` of a :t:`closure expression` producing a :std:`core::future::Future`. - - -.. _fls_lYrTaCM1LcXU: - -async control flow boundary -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_EXoGOkCRsfKK` -An :dt:`async control flow boundary` is a :t:`control flow boundary` that -additionally allows the suspension of execution via :t:`[await expression]s`. - -.. _fls_nlafxy2z1moc: - -async function -^^^^^^^^^^^^^^ - -:dp:`fls_gv9wl1cbaw1g` -An :dt:`async function` is a :t:`function` subject to :t:`keyword` ``async``. - -.. _fls_yikjq8yn3nnh: - -atomic -^^^^^^ - -:dp:`fls_9xd3m2qvqzk` -See :t:`atomic type`. - -.. _fls_197vnaw2zbnc: - -atomic type -^^^^^^^^^^^ - -:dp:`fls_cycpv4fopgx2` -An :dt:`atomic type` is a :t:`type` defined in :t:`module` -:std:`core::sync::atomic`. - -.. _fls_w1plocebd7kg: - -attribute -^^^^^^^^^ - -:dp:`fls_o74rfpe6zo6a` -An :dt:`attribute` is a general, free-form metadatum that is interpreted based -on its name, convention, language, and tool. - -.. _fls_SsMRqkHLDAgG: - -attribute content -^^^^^^^^^^^^^^^^^ - -:dp:`fls_sn0GvVmM3o38` -An :dt:`attribute content` is a :t:`construct` that provides the content of -an :t:`attribute`. - -:dp:`fls_YwyrWC8fcmRm` -See :s:`AttributeContent`. - -.. _fls_x1fafbpo0mlu: - -attribute macro -^^^^^^^^^^^^^^^ - -:dp:`fls_mtqr4d817ikn` -An :dt:`attribute macro` is a :t:`procedural macro` that consumes two streams -of :t:`[token]s` to produce a stream of tokens, and defines a new -:t:`outer attribute` that can be attached to :t:`[item]s`. - -.. _fls_24iVIlHhvnVO: - -auto trait -^^^^^^^^^^ - -:dp:`fls_d84nTOR4pZq5` -An :dt:`auto trait` is a :t:`trait` that is implicitly and automatically -implemented by a :t:`type` when the types of its constituent :t:`[field]s` -implement the :t:`trait`. - -.. _fls_n4oo89apywk4: - -await expression -^^^^^^^^^^^^^^^^ - -:dp:`fls_psbc3b8pec47` -An :dt:`await expression` is an :t:`expression` that polls a :t:`future`, -suspending the execution of the future until the future is ready. - -:dp:`fls_29gkp9bpo1hi` -See :s:`AwaitExpression`. - -.. _fls_a8tavqxuvaju: - -base initializer -^^^^^^^^^^^^^^^^ - -:dp:`fls_dnuwn2tnvtgy` -A :dt:`base initializer` is a :t:`construct` that specifies an :t:`enum value`, -a :t:`struct value`, or a :t:`union value` to be used as a base for -construction in a :t:`struct expression`. - -:dp:`fls_mprzem71zlhy` -See :s:`BaseInitializer`. - -.. _fls_bii5eu1wznzk: - -basic assignment -^^^^^^^^^^^^^^^^ - -:dp:`fls_byq9e2jf8r22` -A :dt:`basic assignment` is an :t:`assignment expression` that is not a -:t:`destructuring assignment`. - -.. _fls_kahj3y4rvmvb: - -binary crate -^^^^^^^^^^^^ - -:dp:`fls_8gfe7hajxkd7` -A :dt:`binary crate` is a :t:`crate` whose :t:`crate type` is ``bin``. - -.. _fls_or4o65fyt28y: - -binary literal -^^^^^^^^^^^^^^ - -:dp:`fls_hy54uj6u3nqw` -A :dt:`binary literal` is an :t:`integer literal` in base 2. - -:dp:`fls_693r7vs2s7o7` -See :s:`BinaryLiteral`. - -.. _fls_xydujcfvvb8p: - -binary operator -^^^^^^^^^^^^^^^ - -:dp:`fls_v0he0zp9ph7a` -A :dt:`binary operator` is an operator that operates on two :t:`[operand]s`. - -.. _fls_jrelzibadg7b: - -binding -^^^^^^^ - -:dp:`fls_89qi3unjvwd7` -A :dt:`binding` of a :t:`binding pattern` binds a matched :t:`value` to a -:t:`name`. - -:dp:`fls_lujdci4bphek` -See :s:`Binding`. - -.. _fls_glblhx8vzd3z: - -binding argument -^^^^^^^^^^^^^^^^ - -:dp:`fls_9lzcasl4tw7k` -A :dt:`binding argument` is a :t:`generic argument` that supplies the :t:`type` -of an :t:`associated trait type`. - -.. _fls_t2cit5QOte8U: - -binding bound argument -^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_D3i3n4RIReCA` -A :dt:`binding bound argument` is a :t:`generic argument` that further imposes -:t:`[bound]s` on an :t:`associated trait type`. - -.. _fls_bv1k866tai6j: - -binding mode -^^^^^^^^^^^^ - -:dp:`fls_e3uvvvvyzq8h` -:dt:`Binding mode` is the mechanism by which a matched :t:`value` is bound to a -:t:`binding` of a :t:`pattern`. - -.. _fls_1nw19qc14zg6: - -binding pattern -^^^^^^^^^^^^^^^ - -:dp:`fls_ancqgz8pybbe` -A :dt:`binding pattern` is either an :t:`identifier pattern` or a -:t:`shorthand deconstructor`. - -.. _fls_5ep4xSGZwtoL: - -binding scope -^^^^^^^^^^^^^ - -:dp:`fls_6qPYH5NJ8usI` -A :dt:`binding scope` is a :t:`scope` for :t:`[binding]s`. - -.. _fls_clut5DWMQin8: - -bit and assignment -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_wIl0K7O6lTXJ` -For :dt:`bit and assignment`, see :t:`bit and assignment expression`. - -.. _fls_y72vyr2tmdyb: - -bit and assignment expression -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_dvqotpte0pc2` -A :dt:`bit and assignment expression` is a :t:`compound assignment expression` -that uses bit and arithmetic. - -:dp:`fls_ix9ecb5olcx` -See :s:`BitAndAssignmentExpression`. - -.. _fls_h6sh4im3gjys: - -bit and expression -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_c1g5gljnr9kz` -A :dt:`bit and expression` is a :t:`bit expression` that uses bit and -arithmetic. - -:dp:`fls_vbsvu0troqci` -See :s:`BitAndExpression`. - -.. _fls_ed6yltkt0gb1: - -bit expression -^^^^^^^^^^^^^^ - -:dp:`fls_b3p5xqsfolqo` -A :dt:`bit expression` is an :t:`expression` that computes a :t:`value` from -two :t:`[operand]s` using bit arithmetic. - -:dp:`fls_iw1k2cfwfjou` -See :s:`BitExpression`. - -.. _fls_90E3eiBYgicI: - -bit or assignment -^^^^^^^^^^^^^^^^^ - -:dp:`fls_21iFIDCu7Pk4` -For :dt:`bit or assignment`, see :t:`bit or assignment expression`. - -.. _fls_ehorb0lul906: - -bit or assignment expression -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_tu1owkfk0lu0` -A :dt:`bit or assignment expression` is a :t:`compound assignment expression` -that uses bit or arithmetic. - -:dp:`fls_utjcsfz8up88` -See :s:`BitOrAssignmentExpression`. - -.. _fls_m33m8nd2rnf8: - -bit or expression -^^^^^^^^^^^^^^^^^ - -:dp:`fls_183aem60of9o` -A :dt:`bit or expression` is a :t:`bit expression` that uses bit or arithmetic. - -:dp:`fls_ctqsjp653tbt` -See :s:`BitOrExpression`. - -.. _fls_jEnv7RjEUZvm: - -bit xor assignment -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_VJpCPVCuszs1` -For :dt:`bit xor assignment`, see :t:`bit xor assignment expression`. - -.. _fls_u3fcq7jjyxux: - -bit xor assignment expression -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_ma980ujltab2` -A :dt:`bit xor assignment expression` is a :t:`compound assignment expression` -that uses bit exclusive or arithmetic. - -:dp:`fls_lcrd0birf0un` -See :s:`BitXorAssignmentExpression`. - -.. _fls_ixw1601j8u39: - -bit xor expression -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_kccsvtzfhbp1` -A :dt:`bit xor expression` is a :t:`bit expression` that uses bit exclusive or -arithmetic. - -:dp:`fls_6qulwlo43w6m` -See :s:`BitXorExpression`. - -.. _fls_aa980vviqjue: - -block comment -^^^^^^^^^^^^^ - -:dp:`fls_a0ejcfs7y5uy` -A :dt:`block comment` is a :t:`comment` that spans one or more :t:`[line]s`. - -:dp:`fls_21r4tblk8awi` -See :s:`BlockComment`. - -.. _fls_c5qn7wjk0mnx: - -block expression -^^^^^^^^^^^^^^^^ - -:dp:`fls_gvjvzxi2xps4` -A :dt:`block expression` is an :t:`expression` that sequences expressions and -:t:`[statement]s`. - -:dp:`fls_h8j9t2xq2i1u` -See :s:`BlockExpression`. - -.. _fls_n485t6wcgx07: - -bool -^^^^ - -:dp:`fls_wtmaf5amvleh` -:dc:`bool` is a :t:`type` whose :t:`[value]s` denote the truth values of logic -and Boolean algebra. - -.. _fls_oz4tdyp3rvm4: - -boolean literal -^^^^^^^^^^^^^^^ - -:dp:`fls_5mrxdqh474vk` -A :dt:`boolean literal` is a :t:`literal` that denotes the truth :t:`[value]s` -of logic and Boolean algebra. - -:dp:`fls_i13qcchm9vkk` -See :s:`BooleanLiteral`. - -.. _fls_7ef4c6ss7m6i: - -borrow -^^^^^^ - -:dp:`fls_2tpbdddvrl2f` -A :dt:`borrow` is a :t:`reference` produced by :t:`borrowing`. - -.. _fls_u0hymkjwyur7: - -borrow expression -^^^^^^^^^^^^^^^^^ - -:dp:`fls_2f55piwg78ru` -A :dt:`borrow expression` is an :t:`expression` that borrows the :t:`value` -of its :t:`operand` and creates a :t:`reference` to the memory location of its -operand. - -:dp:`fls_c3hydbp2exok` -See :s:`BorrowExpression`. - -.. _fls_gl84828b074a: - -borrowed -^^^^^^^^ - -:dp:`fls_3gnps2s95ck4` -A memory location is :dt:`borrowed` when a :t:`reference` pointing to it is -:t:`active`. - -.. _fls_95c5cbc2jvpc: - -borrowing -^^^^^^^^^ - -:dp:`fls_2epblwd2slp8` -:dt:`Borrowing` is the process of temporarily associating a :t:`reference` with -a :t:`value` without transferring :t:`ownership` permanently. - -.. _fls_ehfvcdpo3l4a: - -bound -^^^^^ - -:dp:`fls_q6mxhn1fxjs6` -A :dt:`bound` imposes a constraint on a :t:`generic parameter` by limiting the -set of possible :t:`[generic substitution]s`. - -:dp:`fls_rxabhhigp5uy` -See :s:`TypeBound`. - -.. _fls_jlfqyn3enrsi: - -bound pattern -^^^^^^^^^^^^^ - -:dp:`fls_uusfbosjwyd1` -A :dt:`bound pattern` is a :t:`pattern` that imposes a constraint on a related -:t:`identifier pattern`. - -:dp:`fls_oszhit2crxzc` -See :s:`BoundPattern`. - -.. _fls_xki2cerozblt: - -break expression -^^^^^^^^^^^^^^^^ - -:dp:`fls_8ys8hlqgizoa` -A :dt:`break expression` is an :t:`expression` that terminates a -:t:`loop expression` or a :t:`named block expression`. - -:dp:`fls_fd1xpst5fki2` -See :s:`BreakExpression`. - -.. _fls_ff2zt3ww2yw3: - -break type -^^^^^^^^^^ - -:dp:`fls_jvm1vsqmslxn` -:dt:`Break type` is the :t:`type` of the :t:`operand` of a -:t:`break expression`. - -.. _fls_owtptuvleeb: - -break value -^^^^^^^^^^^ - -:dp:`fls_kpka4jf2qr5l` -:dt:`Break value` is the :t:`value` of the :t:`operand` of a -:t:`break expression`. - -.. _fls_82ev7wknxqmk: - -built-in attribute -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_a40rclur4orm` -A :dt:`built-in attribute` is a language-defined :t:`attribute`. - -:dp:`fls_ooq5g8zffyfb` -See :s:`InnerBuiltinAttribute`, :s:`OuterBuiltinAttribute`. - -.. _fls_QzAif2NyVJbk: - -built-in trait -^^^^^^^^^^^^^^ - -:dp:`fls_IgzD9l8o6R50` -A :dt:`built-in trait` is a language-defined :t:`trait`. - -.. _fls_e8rokiw23i9t: - -byte literal -^^^^^^^^^^^^ - -:dp:`fls_l67oo0u12zjb` -A :dt:`byte literal` is a :t:`literal` that denotes a fixed byte :t:`value`. - -:dp:`fls_iu9twvm648dx` -See :s:`ByteLiteral`. - -.. _fls_uwe7iomhvgtp: - -byte string literal -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_my4r1l3ilyt2` -A :dt:`byte string literal` is a :t:`literal` that consists of multiple -:s:`[AsciiCharacter]s`. - -:dp:`fls_4yhag19z61bl` -See :s:`ByteStringLiteral`. - -.. _fls_lfjgrkwra22i: - -C -^ - -:dp:`fls_d4q2ro4nsnop` -:dt:`C` is the programming language described in the ISO/IEC 9899:2018 -International Standard. - -.. _fls_wenn1wdsicfz: - -C representation -^^^^^^^^^^^^^^^^ - -:dp:`fls_g9pdb06m5fto` -:dt:`C representation` is a :t:`type representation` that lays out :t:`[type]s` -such that they are interoperable with the :t:`C` language. - -.. _fls_fls_J0xUy4Mcxoe6: - -C signed int type -^^^^^^^^^^^^^^^^^ - -:dp:`fls_8QIcvapJehqY` -:dt:`C signed int type` is the `signed int` :t:`type` of the :t:`C` language. - -.. _fls_roz4WXH5JZFj: - -c string literal -^^^^^^^^^^^^^^^^ - -:dp:`fls_g3NHtaOhTB7g` -A :dt:`c string literal` is a :t:`literal` that consists of multiple characters -with an implicit 0x00 byte appended to it. - -:dp:`fls_FZ6QSpjmVme5` -See :s:`CStringLiteral`. - -.. _fls_Egfa8tdbqllA: - -Call conformance -^^^^^^^^^^^^^^^^ - -:dp:`fls_Jr1gUX7Ju4Oh` -:dt:`Call conformance` measures the compatibility between a set of -:t:`[argument operand]s` and a set if :t:`[function parameter]s` or -:t:`[field]s`. - -.. _fls_xeo59ol6uh5i: - -call expression -^^^^^^^^^^^^^^^ - -:dp:`fls_a9ap0tyk2eou` -A :dt:`call expression` is an :t:`expression` that invokes a :t:`function` or -constructs a :t:`tuple struct value` or :t:`tuple enum variant value`. - -:dp:`fls_aibti9uqrmmd` -See :s:`CallExpression`. - -.. _fls_ezk9xkst7gfj: - -call operand -^^^^^^^^^^^^ - -:dp:`fls_cqnko94y4xbs` -A :dt:`call operand` is the :t:`function` being invoked or the -:t:`tuple struct value` or :t:`tuple enum variant value` being constructed by a -:t:`call expression`. - -:dp:`fls_w6wu4wi6srjj` -See :s:`CallOperand`. - -.. _fls_zSh4enFjxeaN: - -call resolution -^^^^^^^^^^^^^^^ - -:dp:`fls_fS1ZjGGypvbn` -:dt:`Call resolution` is a kind of :t:`resolution` that applies to a -:t:`call expression`. - - -.. _fls_AK8mL1LeftO0: - -call site hygiene -^^^^^^^^^^^^^^^^^ - -:dp:`fls_YTQmXotFOXWU` -:dt:`Call site hygiene` is a type of :t:`hygiene` which resolves to the -:s:`MacroInvocation` site. :t:`[Identifier]s` with :t:`call site hygiene` can -reference the environment of the :s:`MacroRulesDeclaration`, can reference the -environment of the :s:`MacroInvocation`, and are considered :t:`unhygienic`. - -.. _fls_luuc01g4ffog: - -callee type -^^^^^^^^^^^ - -:dp:`fls_o21myf6wnnn6` -A :dt:`callee type` is either a :t:`function item type`, a -:t:`function pointer type`, a :t:`tuple struct type`, a :t:`tuple enum variant` -or a :t:`type` that implements any of the :std:`core::ops::Fn`, -:std:`core::ops::FnMut`, or :std:`core::ops::FnOnce` :t:`[trait]s`. - -.. _fls_s78gd8yxx2yv: - -capture mode -^^^^^^^^^^^^ - -:dp:`fls_beer0d7wva1d` -:dt:`Capture mode` is the mechanism by which a :t:`capture target` is captured. - -.. _fls_c6qwfwsyizya: - -capture target -^^^^^^^^^^^^^^ - -:dp:`fls_xmhcp4x8wblz` -A :dt:`capture target` is either a :t:`binding` or a :t:`field` of a -:t:`binding`. - -.. _fls_kvu447p6j61k: - -capturing -^^^^^^^^^ - -:dp:`fls_4achbk2ewyyb` -:dt:`Capturing` is the process of saving the :t:`[capture target]s` of a -:t:`[capturing expression]'s` :t:`capturing environment`. - -.. _fls_yfk2xfifltxy: - -capturing environment -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_7br4azaay3wu` -The :dt:`capturing environment` of a :t:`capturing expression` consists of all -:t:`[capture target]s` that are defined outside the :t:`capturing expression`. - -.. _fls_cl3lpsfgt5eb: - -capturing expression -^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_awtny282gtud` -A :dt:`capturing expression` is either an :t:`async block expression` or a -:t:`closure expression`. - -.. _fls_pcaygpx7db24: - -cast -^^^^ - -:dp:`fls_e5hvszhcrtmj` -:dt:`Cast` or :dt:`casting` is the process of changing the :t:`type` of an -:t:`expression`. - -.. _fls_xl2zlpw070dy: - -char -^^^^ - -:dp:`fls_vx0dss1yplw1` -:dc:`char` is a :t:`type` whose :t:`[value]s` denote :t:`Unicode` characters. - -.. _fls_cfphqaml82ik: - -character literal -^^^^^^^^^^^^^^^^^ - -:dp:`fls_8oah1cf8p0lb` -A :dt:`character literal` is a :t:`literal` that denotes a fixed :t:`Unicode` -character. - -:dp:`fls_sup0h5mvibzs` -See :s:`CharacterLiteral`. - -.. _fls_5vm5cijnucsr: - -closure body -^^^^^^^^^^^^ - -:dp:`fls_vgnycw6dykwo` -A :dt:`closure body` is a :t:`construct` that represents the executable portion -of a :t:`closure expression`. - -:dp:`fls_zefhg4auut8d` -See :s:`ClosureBody`, :s:`ClosureBodyWithReturnType`. - -.. _fls_mrwle2ediywb: - -closure expression -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_x87rhn9ikz00` -A :dt:`closure expression` is an :t:`expression` that defines a -:t:`closure type` and constructs a value of that :t:`type`. - -:dp:`fls_psd18dkzplf6` -See :s:`ClosureExpression`. - -.. _fls_f5RBXj9g5iab: - -closure parameter -^^^^^^^^^^^^^^^^^ - -:dp:`fls_yQBZHBLhPswn` -A :dt:`closure parameter` is a :t:`construct` that yields a set of -:t:`[binding]s` that bind matched input :t:`[value]s` to :t:`[name]s` at the -site of a :t:`call expression` or a :t:`method call expression`. - -:dp:`fls_Dus3fBU3TwR4` -See :s:`ClosureParameter`. - -.. _fls_xjudl8ykbisi: - -closure type -^^^^^^^^^^^^ - -:dp:`fls_wp4kues3nbvn` -A :dt:`closure type` is a unique anonymous :t:`function type` that encapsulates -all :t:`[capture target]s` of a :t:`closure expression`. - -.. _fls_aqovhozevngd: - -code point -^^^^^^^^^^ - -:dp:`fls_6xw8jtiomc2n` -In :t:`Unicode`, a :dt:`code point` is a numeric :t:`value` that maps to a -character. - -.. _fls_2moavfyeit0m: - -comment -^^^^^^^ - -:dp:`fls_3xhoz9f7xy1t` -A :dt:`comment` is a :t:`lexical element` that acts as an annotation or an -explanation in program text. - -:dp:`fls_pi32rhfqghma` -See :s:`Comment`. - -.. _fls_hjxuoe1hwlhm: - -comparison expression -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_394p7gdruvk7` -A :dt:`comparison expression` is an :t:`expression` that compares the -:t:`[value]s` of two :t:`[operand]s`. - -:dp:`fls_1jk0s7389mt0` -See :s:`ComparisonExpression`. - -.. _fls_riwule1euzlj: - -compilation root -^^^^^^^^^^^^^^^^ - -:dp:`fls_stwsfyvov2fx` -A :dt:`compilation root` is an input to a compilation performed by a tool. - -.. _fls_pTMrfPXETibe: - -compound assignment -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_lGV9QvCmYGcH` -For :dt:`compound assignment`, see :t:`compound assignment expression`. - -.. _fls_iktiir89xbo2: - -compound assignment expression -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_mkxpk2jhe5s0` -A :dt:`compound assignment expression` is an expression that first computes -a :t:`value` from two :t:`[operand]s` and then assigns the value to an -:t:`assigned operand`. - -:dp:`fls_55abuw8symub` -See :s:`CompoundAssignmentExpression`. - -.. _fls_qyfn5u5cl5l1: - -concrete type -^^^^^^^^^^^^^ - -:dp:`fls_l0lr3ybgccjc` -A :dt:`concrete type` is a :t:`type` described by a :t:`type specification`. - -.. _fls_lmacvq89lj2j: - -conditional compilation -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_xymops69eer3` -:dt:`Conditional compilation` is the process of compiling -:t:`conditionally-compiled source code`. - -.. _fls_bqq013n2cy4t: - -conditionally-compiled source code -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_hs4lnrdxpj2g` -:dt:`Conditionally-compiled source code` is source code that may or may not be -considered a part of a Rust program depending on certain conditions. - -.. _fls_vRjPmHYEVVAf: - -configuration predicate -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_TyKIUQMxO9Si` -A :dt:`configuration predicate` is a :t:`construct` that evaluates statically -to either ``true`` or ``false``, and controls :t:`conditional compilation`. - -:dp:`fls_99ioki0M64fD` -See :s:`ConfigurationPredicate`. - -.. _fls_vuBjK3kdImTn: - -const block expression -^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_5ApoJzRSTZGH` -A :dt:`const block expression` is a :t:`block expression` that is specified -with :t:`keyword` ``const`` and encapsulates behavior which is evaluated -statically. - -.. _fls_yw57di94gwpf: - -constant -^^^^^^^^ - -:dp:`fls_p8rjw2qok85b` -A :dt:`constant` is an immutable :t:`value` whose uses are substituted by the -:t:`value`. - -:dp:`fls_hlouedpdg1zd` -See :s:`ConstantDeclaration`. - -.. _fls_n7z4cl1fsk6l: - -constant argument -^^^^^^^^^^^^^^^^^ - -:dp:`fls_sz10vgh260xo` -A :dt:`constant argument` is a :t:`generic argument` that supplies the -:t:`value` of a :t:`constant parameter`. - -:dp:`fls_dz9x6gf3yzc6` -See :s:`ConstantArgument`. - -.. _fls_mtbhv6e9izzm: - -constant context -^^^^^^^^^^^^^^^^ - -:dp:`fls_9j6mc4i1t73z` -A :dt:`constant context` is a :t:`construct` that requires a -:t:`constant expression`. - -.. _fls_iofbib2gavnv: - -constant expression -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_rmn8w4rh3juf` -A :dt:`constant expression` is an :t:`expression` that can be evaluated -statically. - -.. _fls_6j1wluj8sku8: - -constant function -^^^^^^^^^^^^^^^^^ - -:dp:`fls_4glkwg11p5ml` -A :dt:`constant function` is a :t:`function` subject to :t:`keyword` ``const``. - -.. _fls_mf022jo05ziu: - -constant initializer -^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_2ge48v1kmw8` -A :dt:`constant initializer` is a :t:`construct` that provides the :t:`value` -of its related :t:`constant`. - -:dp:`fls_h86eg26z19r2` -See :s:`ConstantInitializer`. - -.. _fls_pj0f0p4avbyw: - -constant parameter -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_z7e491m3dx4u` -A :dt:`constant parameter` is a :t:`generic parameter` for a :t:`constant`. - -:dp:`fls_9093wziwxk1g` -See :s:`ConstantParameter`. - -.. _fls_sIvXMhYaZVjD: - -constant parameter initializer -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_OXD2YaOkfjcI` -A :dt:`constant parameter initializer` is a :t:`construct` that provides the -default `:t:`value` of its related :t:`constant parameter`. - -:dp:`fls_CMsyUCxGm8Xs` -See :s:`ConstantParameterInitializer`. - -.. _fls_f95c9hrk7t2p: - -constant promotion -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_ku2md8lnei12` -:dt:`Constant promotion` is the process of converting a :t:`value expression` -into a :t:`constant`. - -.. _fls_x4niicvxxv9k: - -constrain -^^^^^^^^^ - -:dp:`fls_fna0ch8ucyhv` -A :t:`generic parameter` is said to :dt:`constrain` an :t:`implementation` if -it makes the :t:`[implementation]'s` applicability more narrow. - -.. _fls_4305i29nt5d6: - -construct -^^^^^^^^^ - -:dp:`fls_10tvzeo8xex0` -A :dt:`construct` is a piece of program text that is an instance of a -:t:`syntactic category`. - -.. _fls_fBGjoTVhYvUe: - -constructee -^^^^^^^^^^^ - -:dp:`fls_Twbu94uGW4Cb` -A :dt:`constructee` indicates the :t:`enum variant`, :t:`struct` or :t:`union` -whose value is being constructed by a :t:`struct expression`. - -.. _fls_39s6od9hj4g6: - -container operand -^^^^^^^^^^^^^^^^^ - -:dp:`fls_stjmobac6wyd` -A :dt:`container operand` is an :t:`operand` that indicates the :t:`value` -whose :t:`field` is selected in a :t:`field access expression`. - -:dp:`fls_hgm1ssicc8j4` -See :s:`ContainerOperand`. - -.. _fls_doazu99vos8x: - -continue expression -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_waxam3m9plfj` -A :dt:`continue expression` is an :t:`expression` that first terminates and -then restarts a :t:`loop expression`. - -:dp:`fls_smwcz2xw9o1f` -See :s:`ContinueExpression`. - -.. _fls_nC4Knv4tpenW: - -control flow boundary -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_SmipZJDp02ij` -A :dt:`control flow boundary` is a :t:`construct` that limits control flow from -returning beyond the :t:`construct`, and acts as the target of control flow -returning operations. - -.. _fls_lnwxm6ffy15w: - -copy type -^^^^^^^^^ - -:dp:`fls_j7r33ecacyh` -A :dt:`copy type` is a :t:`type` that implements the -:std:`core::marker::Copy` :t:`trait`. - -.. _fls_kf8yukhxudw8: - -crate -^^^^^ - -:dp:`fls_qplsjzb2uyim` -A :dt:`crate` is a unit of compilation and linking that contains a tree of -nested :t:`[module]s`. - -.. _fls_xwbmmcbbowtu: - -crate import -^^^^^^^^^^^^ - -:dp:`fls_y91ja1a87g7a` -A :dt:`crate import` specifies a dependency on an external :t:`crate`. - -:dp:`fls_nmdxagg39hz6` -See :s:`ExternalCrateImport`. - -.. _fls_CXvNvsO10pLL: - -crate indication -^^^^^^^^^^^^^^^^ - -:dp:`fls_XUSFUErxQRRA` -A :dt:`crate indication` is a :t:`construct` that indicates a :t:`crate`. - -:dp:`fls_s1eFklbzjLxQ` -See :s:`CrateIndication`. - -.. _fls_yf9yjzzhw0rn: - -crate public modifier -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_dj7fmrqhbhsv` -A :dt:`crate public modifier` is a :t:`visibility modifier` that grants a -:t:`name` :t:`public visibility` within the current :t:`crate` only. - -:dp:`fls_wjfupeyeczp0` -See :s:`CratePublicModifier`. - -.. _fls_hv9zyxb72soh: - -crate root -^^^^^^^^^^ - -:dp:`fls_yxcgiuybqqy8` -A :dt:`crate root` is an entry point into a :t:`crate`. - -.. _fls_iucxone5ta26: - -crate root module -^^^^^^^^^^^^^^^^^ - -:dp:`fls_oo4nmqv78wno` -A :dt:`crate root module` is the root of the nested :t:`module` tree of a -:t:`crate`. - -.. _fls_lVpE4uFDsXH4: - -crate type -^^^^^^^^^^ - -:dp:`fls_eaxsgPMFNH7f` -The :dt:`crate type` of a :t:`crate` is the value of the :t:`attribute` -``crate_type`` of a :t:`crate` or the value of ``--crate-type`` flag passed to -the tool compiling the :t:`crate`. - -.. _fls_76cj65bptdpn: - -dangling -^^^^^^^^ - -:dp:`fls_lq2urzh7bzxx` -A :t:`value` of an :t:`indirection type` is :dt:`dangling` if it is either -:c:`null` or not all of the bytes at the referred memory location are part of -the same allocation. - -.. _fls_9meaofgcpvx6: - -data race -^^^^^^^^^ - -:dp:`fls_v2s1b57e3r7n` -A :dt:`data race` is a scenario where two or more threads access a shared -memory location concurrently. - -.. _fls_128iunbbiuql: - -decimal literal -^^^^^^^^^^^^^^^ - -:dp:`fls_lwv823lih69m` -A :dt:`decimal literal` is an :t:`integer literal` in base 10. - -:dp:`fls_pxiba4se64y4` -See :s:`DecimalLiteral`. - -.. _fls_9qgy7x6w5ro5: - -declaration -^^^^^^^^^^^ - -:dp:`fls_kct7ducpli6k` -A :dt:`declaration` is a :t:`construct` that introduces a :t:`name` for an -:t:`entity`. - -.. _fls_5944xn0lz8e: - -declarative macro -^^^^^^^^^^^^^^^^^ - -:dp:`fls_pe12lfffaoqt` -A :dt:`declarative macro` is a :t:`macro` that associates a :t:`name` with a -set of syntactic transformation rules. - -:dp:`fls_1te2kfi9lt6c` -See :s:`MacroRulesDeclaration`. - -.. _fls_GAlaslkO8gLG: - -deconstructee -^^^^^^^^^^^^^ - -:dp:`fls_QsvWOdoFWtUO` -A :dt:`deconstructee` indicates the :t:`enum variant` or :t:`type` that is -being deconstructed by a :t:`struct pattern`. - -:dp:`fls_TkFjmV7AR7lp` -See :s:`Deconstructee`. - -.. _fls_g9v8ubx8m1sq: - -default representation -^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_e85fsp10acnh` -:dt:`Default representation` is a :t:`type representation` that does not make -any guarantees about :t:`layout`. - -.. _fls_FrfnICpg81sr: - -definition site hygiene -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_2Y1Dpw5ZEqT3` -:dt:`Definition site hygiene` is a type of :t:`hygiene` which resolves to the -:s:`MacroRulesDeclaration` site. :t:`[Identifier]s` with -:t:`definition site hygiene` cannot reference the environment of the -:s:`MacroRulesDeclaration`, cannot be referenced by the environment of a -:s:`MacroInvocation`, and are considered :t:`hygienic`. - -.. _fls_127n1n5ssk2b: - -dereference -^^^^^^^^^^^ - -:dp:`fls_hk97pb1qt04y` -A :dt:`dereference` is the memory location produced by evaluating a -:t:`dereference expression`. - -.. _fls_o588wfq878rm: - -dereference expression -^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_3cuyhbh2llei` -A :dt:`dereference expression` is an :t:`expression` that obtains the -pointed-to memory location of its :t:`operand`. - -:dp:`fls_hx0jwahdb1nf` -See :s:`DereferenceExpression`. - -.. _fls_xbN0GtcH8emc: - -dereference type -^^^^^^^^^^^^^^^^ - -:dp:`fls_HfuUQ7IaoI5j` -A :dt:`dereference type` is either a :t:`reference type` or a :t:`type` that -implements the :std:`core::ops::Deref` :t:`trait`. - -.. _fls_T380NdEsFxIp: - -dereference type chain -^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_kIzoAEf069HE` -A :dt:`dereference type chain` is a sequence of :t:`[dereference type]s`. - -.. _fls_7ipdj78o7ln: - -derive macro -^^^^^^^^^^^^ - -:dp:`fls_jrrjhl9hocrm` -A :dt:`derive macro` is a :t:`procedural macro` that consumes a stream of -:t:`[token]s` and produces a stream of tokens, and is invoked via attribute -:c:`derive`. - -.. _fls_7b3fsp356e9l: - -destruction -^^^^^^^^^^^ - -:dp:`fls_58i2nfhxze3j` -:dt:`Destruction` is the process of recovering resources associated with a -:t:`value` as it goes out of scope. - -.. _fls_kwxpy451gtc: - -destructor -^^^^^^^^^^ - -:dp:`fls_79pp7o1xooja` -A :dt:`destructor` is a :t:`function` that is invoked immediately before the -:t:`destruction` of a :t:`value` of a :t:`drop type`. - -.. _fls_2fuu3zr9rn2q: - -destructuring assignment -^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_7jienn9uzn5k` -A :dt:`destructuring assignment` is an :t:`assignment expression` where -the :t:`assignee operand` is either an :t:`array expression`, a -:t:`struct expression`, or a :t:`tuple expression`. - -.. _fls_ugIFZlAzDK6H: - -direction modifier -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_8DY7xPVX4nXx` -A :dt:`direction modifier` is a :t:`construct` that indicates whether a -:t:`register argument` initializes a :t:`register`, assigns the :t:`value` of a -:t:`register` to an :t:`expression`, or both. - -:dp:`fls_lRKEzY3fQ3B2` -See :s:`DirectionModifier`. - -.. _fls_7vg56eeo0zlg: - -discriminant -^^^^^^^^^^^^ - -:dp:`fls_dfegy9y6awx` -A :dt:`discriminant` is an opaque integer that identifies an :t:`enum variant`. - -.. _fls_xayj37ocbqjn: - -discriminant initializer -^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_o7hihgcqmnyc` -A :dt:`discriminant initializer` provides the :t:`value` of a :t:`discriminant`. - -:dp:`fls_g5obc23vigng` -See :s:`DiscriminantInitializer`. - -.. _fls_a0ezuPLtENme: - -discriminant type -^^^^^^^^^^^^^^^^^ - -:dp:`fls_kqdvWGi9cglm` -A :dt:`discriminant type` is the :t:`type` of a :t:`discriminant`. - -.. _fls_gDFsAj1Bvx7A: - -diverging expression -^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_fLlNzmB34cj9` -A :dt:`diverging expression` is an :t:`expression` whose :t:`evaluation` causes -program flow to diverge from the normal :t:`evaluation` order. - -.. _fls_9DuaIn6cRbXf: - -diverging type variable -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_sxyL7yOp3H9s` -A :dt:`diverging type variable` is a :t:`type variable` that can refer to any -:t:`type` and originates from a :t:`diverging expression`. - -.. _fls_0lpT9Ncj7S9X: - -division assignment -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_kvQskrzE1y97` -For :dt:`division assignment`, see :t:`division assignment expression`. - -.. _fls_ccv27fji08ou: - -division assignment expression -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_lzuz5fkveikk` -A :dt:`division assignment expression` is a :t:`compound assignment expression` -that uses division. - -:dp:`fls_cdxt76aqwtkq` -See :s:`DivisionAssignmentExpression`. - -.. _fls_vxd5q8nekkn0: - -division expression -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_du05yp205f4y` -A :dt:`division expression` is an :t:`arithmetic expression` that uses division. - -:dp:`fls_d3vwk4autyd` -See :s:`DivisionExpression`. - -.. _fls_4nm1r57ntecm: - -doc comment -^^^^^^^^^^^ - -:dp:`fls_wkc1w2xk7ebh` -A :dt:`doc comment` is a :t:`comment` class that includes -:t:`[inner block doc]s`, :t:`[inner line doc]s`, :t:`[outer block doc]s`, -and :t:`[outer line doc]s`. - -.. _fls_nw0qr4xy3zxq: - -drop construct -^^^^^^^^^^^^^^ - -:dp:`fls_odg2asgj28m` -A :dt:`drop construct` is a :t:`construct` that employs a :t:`drop scope`. - -.. _fls_j12e358828h: - -drop order -^^^^^^^^^^ - -:dp:`fls_qddkiabu6swt` -:dt:`Drop order` is the order by which :t:`[value]s` are :t:`dropped` when a -:t:`drop scope` is left. - -.. _fls_foszri7hdym0: - -drop scope -^^^^^^^^^^ - -:dp:`fls_6bu8x0g9q0er` -A :dt:`drop scope` is a region of program text that governs the :t:`dropping` -of :t:`[value]s`. - -.. _fls_qp3ksd2lxm8: - -drop scope extension -^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_pmdh8kkrwkd0` -:dt:`Drop scope extension` is the process of extending a :t:`drop scope` -associated with a :t:`temporary` to prevent the premature :t:`dropping` of the -:t:`temporary`. - -.. _fls_4v6vsuw4g89l: - -drop type -^^^^^^^^^ - -:dp:`fls_ot3e31kwixil` -A :dt:`drop type` is a :t:`type` that implements the :std:`core::ops::Drop` -:t:`trait` or contains a :t:`field` that has a :t:`destructor`. - -.. _fls_68cl4paduzx2: - -dropping -^^^^^^^^ - -:dp:`fls_k4mguykh8ey` -:dt:`Dropping` a :t:`value` is the act of invoking the :t:`destructor` of the -related :t:`type`. - -.. _fls_6uovyjjzh6km: - -dynamically sized type -^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_eeyxu730z2pw` -A :dt:`dynamically sized type` is a :t:`type` that does not implement the -:std:`core::marker::Sized` :t:`trait`. - -.. _fls_2sja3okj27ne: - -elaboration -^^^^^^^^^^^ - -:dp:`fls_xoahzmwu1std` -:dt:`Elaboration` is the process by which a :t:`declaration` achieves its -runtime effects. - -.. _fls_bxm4njfo2h58: - -element type -^^^^^^^^^^^^ - -:dp:`fls_3bndijf8g9os` -An :dt:`element type` is the :t:`type` of the elements of an :t:`array type` or -a :t:`slice type`. - -:dp:`fls_pvyl887dn016` -See :s:`ElementType`. - -.. _fls_vygjg858yxej: - -elided -^^^^^^ - -:dp:`fls_lo3c3n9wy6qz` -For :dt:`elided`, see :t:`elided lifetime`. - -.. _fls_l2181y5566ck: - -elided lifetime -^^^^^^^^^^^^^^^ - -:dp:`fls_9q28407ev0a6` -An :dt:`elided lifetime` is either an :t:`unnamed lifetime` or a :t:`lifetime` -that has been explicitly omitted from a :t:`function signature` or an -:t:`implementation`. - -.. _fls_ff5zp7m9d5ot: - -else expression -^^^^^^^^^^^^^^^ - -:dp:`fls_inp7luoqkjc5` -An :dt:`else expression` is an :t:`expression` that represents either a -:t:`block expression`, an :t:`if expression`, or an :t:`if let expression`. - -:dp:`fls_2jniy6bkq1hn` -See :s:`ElseExpression`. - -.. _fls_iwed9n4jz6b8: - -empty statement -^^^^^^^^^^^^^^^ - -:dp:`fls_irw5gwuvj3nn` -An :dt:`empty statement` is a :t:`statement` expressed as character 0x3B -(semicolon). - -.. _fls_1qu1t74ga8aa: - -entity -^^^^^^ - -:dp:`fls_mdbck557k8sy` -An :dt:`entity` is a :t:`construct` that can be referred to within program -text, usually via a :t:`field access expression` or a :t:`path`. - -.. _fls_xnhj9fqlfs2p: - -enum -^^^^ - -:dp:`fls_9o0ig19xh2f5` -An :dt:`enum` is an :t:`item` that declares an :t:`enum type`. - -.. _fls_zrRydWZgm03k: - -enum field -^^^^^^^^^^ - -:dp:`fls_J8udq05QGiEj` -An :dt:`enum field` is a :t:`field` of an :t:`enum variant`. - -.. _fls_grlluqa4ucp3: - -enum type -^^^^^^^^^ - -:dp:`fls_idwrgo87ub3i` -An :dt:`enum type` is an :t:`abstract data type` that contains -:t:`[enum variant]s`. - -:dp:`fls_o6ih6n1z1566` -See :s:`EnumDeclaration`. - -.. _fls_H6aUAUjNlx6z: - -enum value -^^^^^^^^^^ - -:dp:`fls_QdBTdVLB2xHk` -An :dt:`enum value` is a :t:`value` of an :t:`enum type`. - -.. _fls_klwlx5jixwud: - -enum variant -^^^^^^^^^^^^ - -:dp:`fls_9jq4keg9y94u` -An :dt:`enum variant` is a :t:`construct` that declares one of the -possible variations of an :t:`enum`. - -:dp:`fls_tj2s55onen6b` -See :s:`EnumVariant`. - -.. _fls_mKxBWCojhnWu: - -enum variant value -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_VQRqNPFFWmDp` -An :dt:`enum variant value` is the :t:`enum value` of the corresponding -:t:`enum` of the :t:`enum variant`. - -.. _fls_alifv570nx7q: - -equals expression -^^^^^^^^^^^^^^^^^ - -:dp:`fls_mn1g2hijtd6f` -An :dt:`equals expression` is a :t:`comparison expression` that tests equality. - -:dp:`fls_j32l4do0xw4d` -See :s:`EqualsExpression`. - -.. _fls_kz7tgpi8xkt4: - -error propagation expression -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_5kebgodxtqqt` -An :dt:`error propagation expression` is an :t:`expression` that either -evaluates to a :t:`value` of its :t:`operand` or returns a value to the next -control flow boundary. - -:dp:`fls_agyqvyda3rcj` -See :s:`ErrorPropagationExpression`. - -.. _fls_9hw559b548m0: - -escaped character -^^^^^^^^^^^^^^^^^ - -:dp:`fls_7yvnbakmo7y5` -An :dt:`escaped character` is the textual representation for a character with -special meaning. An escaped character consists of character 0x5C (reverse -solidus), followed by the single character encoding of the special meaning -character. For example, ``\t`` is the escaped character for 0x09 (horizontal -tabulation). - -.. _fls_pefe9ng1mm81: - -evaluated -^^^^^^^^^ - -:dp:`fls_769tm6hn9g5e` -See :t:`evaluation`. - -.. _fls_p3gre0895k2u: - -evaluation -^^^^^^^^^^ - -:dp:`fls_8zmtio6razl1` -:dt:`Evaluation` is the process by which an :t:`expression` achieves its -runtime effects. - -.. _fls_EJSzYb4IxvtR: - -exclusive range pattern -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_qxsV6ZxFfDHm` -An :dt:`exclusive range pattern` is a :t:`range pattern` with both a -:t:`range pattern low bound` and a :t:`range pattern high bound`. - -:dp:`fls_kHIWYUPhxikM` -See :s:`ExclusiveRangePattern`. - -.. _fls_nw0eg7gwayrg: - -executed -^^^^^^^^ - -:dp:`fls_kelmsc68lyf7` -See :t:`execution`. - -.. _fls_q0ur239s8uv: - -execution -^^^^^^^^^ - -:dp:`fls_e5jbii84hd5g` -:dt:`Execution` is the process by which a :t:`statement` achieves its runtime -effects. - -.. _fls_B1qkkSvc69J4: - -explicit register argument -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_2o6S1WGDrMh3` -An :dt:`explicit register argument` is a :t:`register argument` that uses an -:t:`explicit register name`. - -.. _fls_uc7PnSbVVd9X: - -explicit register name -^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_UcMk6RRLrkB5` -An :dt:`explicit register name` is a target-specific string that identifies -a :t:`register`. - -:dp:`fls_Z3WDh75VpSUU` -See :s:`ExplicitRegisterName`. - -.. _fls_lqxcnZqvwcsH: - -explicitly declared entity -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_shpNJ0JCSCwa` -An :dt:`explicitly declared entity` is an :t:`entity` that has a -:t:`declaration`. - -.. _fls_5oQllRM7Wjsg: - -exported function -^^^^^^^^^^^^^^^^^ - -:dp:`fls_QotMF1iaEYod` -An :dt:`exported function` is an export of a :t:`function`. - -.. _fls_zkq5ZkJwsyoD: - -exported static -^^^^^^^^^^^^^^^^^ - -:dp:`fls_aolCSvb349ZU` -An :dt:`exported static` is an export of a :t:`static`. - -.. _fls_q8ofwncggngd: - -expression -^^^^^^^^^^ - -:dp:`fls_f7iuwgbs1lql` -An :dt:`expression` is a :t:`construct` that produces a :t:`value`, and may -have side effects at run-time. - -:dp:`fls_8l9hru1x586q` -See :s:`Expression`. - -.. _fls_a1rorkjt3vpc: - -expression statement -^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_ds0pspiqk4am` -An :dt:`expression statement` is an :t:`expression` whose result is ignored. - -:dp:`fls_41jt1h3audzv` -See :s:`ExpressionStatement`. - -.. _fls_u6huewic8650: - -expression-with-block -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_ujlm50le5dnj` -An :dt:`expression-with-block` is an :t:`expression` whose structure involves a -:t:`block expression`. - -:dp:`fls_iwheys965ml3` -See :s:`ExpressionWithBlock`. - -.. _fls_378e2xhxzk26: - -expression-without-block -^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_xfh9xmsphzqb` -An :dt:`expression-without-block` is an :t:`expression` whose structure does -not involve a :t:`block expression`. - -:dp:`fls_miaphjnikd51` -See :s:`ExpressionWithoutBlock`. - -.. _fls_9k6jcsljghab: - -external block -^^^^^^^^^^^^^^ - -:dp:`fls_z2ebcp7kjpuy` -An :dt:`external block` is a :t:`construct` that provides the declarations of -foreign :t:`[function]s` as unchecked imports. - -:dp:`fls_dm2wz1th2haz` -See :s:`ExternalBlock`. - -.. _fls_8ffbgzkbsf9r: - -external function -^^^^^^^^^^^^^^^^^ - -:dp:`fls_ngz5fqwrf86e` -An :dt:`external function` is an unchecked import of a foreign :t:`function`. - -.. _fls_ug2kags0o6is: - -external function item type -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_dwlovqly44dj` -An :dt:`external function item type` is a :t:`function item type` where the -related :t:`function` is an :t:`external function`. - -.. _fls_c89migfc2m6e: - -external static -^^^^^^^^^^^^^^^ - -:dp:`fls_bqq6cncstzeg` -An :dt:`external static` is an import of a foreign :t:`variable`. - -.. _fls_4w6garmjhrd9: - -f32 -^^^ - -:dp:`fls_4w5rqj7zdemu` -:dc:`f32` is a :t:`floating-point type` equivalent to the IEEE 754-2008 -binary32 :t:`type`. - -.. _fls_pj450h99yo28: - -f64 -^^^ - -:dp:`fls_ly6p0i6lsibh` -:dc:`f64` is a :t:`floating-point type` equivalent to the IEEE 754-2008 -binary64 :t:`type`. - -.. _fls_nkf9z4pqg8x1: - -fat pointer -^^^^^^^^^^^ - -:dp:`fls_knbc2jv5c5ds` -A :dt:`fat pointer` is a :t:`value` of a :t:`fat pointer type`. - -.. _fls_trvkbidlsss8: - -fat pointer type -^^^^^^^^^^^^^^^^ - -:dp:`fls_l8ew6udd79hh` -A :dt:`fat pointer type` is an :t:`indirection type` whose contained :t:`type specification` is a :t:`dynamically sized type`. - -.. _fls_qi21fdknzez6: - -FFI -^^^ - -:dp:`fls_z363fu89mj1c` -For :dt:`FFI`, see :t:`Foreign Function Interface`. - -.. _fls_7gCAbHnGEIl6: - -field -^^^^^ - -:dp:`fls_uAkrgfFTK2YV` -A :dt:`field` is an element of an :t:`abstract data type`. - -.. _fls_yipl7ajrbs6y: - -field access expression -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_gdl348a04d15` -A :dt:`field access expression` is an :t:`expression` that accesses a -:t:`field` of a :t:`value`. - -:dp:`fls_luetyuwu54d6` -See :s:`FieldAccessExpression`. - -.. _fls_6uwwat9j4x7y: - -field index -^^^^^^^^^^^ - -:dp:`fls_6061r871qgbj` -A :dt:`field index` is the position of a :t:`field` within a -:t:`tuple struct type` or :t:`tuple enum variant`. The first :t:`field` has a -:t:`field index` of zero, the Nth :t:`field` has a :t:`field index` of N-1. - -:dp:`fls_IDYKXUIL845x` -See :s:`FieldIndex`. - -.. _fls_8qLL14WfXXNN: - -field list -^^^^^^^^^^ - -:dp:`fls_xMZsrxMc9Cni` -A :dt:`field list` is a :s:`RecordStructFieldList` or :s:`TupleStructFieldList`. - -.. _fls_BlZwxp6H62sS: - -field resolution -^^^^^^^^^^^^^^^^ - -:dp:`fls_nL8UuclgxfGL` -:dt:`Field resolution` is a form of :t:`resolution` that applies to a -:t:`field access expression`. - -.. _fls_kqbata8slp1y: - -field selector -^^^^^^^^^^^^^^ - -:dp:`fls_aq1yg9cp1uof` -A :dt:`field selector` is a :t:`construct` that selects the :t:`field` to be -accessed in a :t:`field access expression`. - -:dp:`fls_x8swot8e1j32` -See :s:`FieldSelector`. - -.. _fls_mj9mmkar8c6f: - -final match arm -^^^^^^^^^^^^^^^ - -:dp:`fls_btoz8jioisx9` -A :dt:`final match arm` is the last :t:`match arm` of a :t:`match expression`. - -:dp:`fls_v7ockjwbeel1` -See :s:`FinalMatchArm`. - -.. _fls_rljxa45tleq3: - -fixed sized type -^^^^^^^^^^^^^^^^ - -:dp:`fls_eadiywl20jo4` -A :dt:`fixed sized type` is a :t:`type` that implements the -:std:`core::marker::Sized` :t:`trait`. - -.. _fls_achdyw3nbme3: - -float literal -^^^^^^^^^^^^^ - -:dp:`fls_53o8dio9vpjh` -A :dt:`float literal` is a :t:`numeric literal` that denotes a fractional -number. - -:dp:`fls_hqeaakhsqxok` -See :s:`FloatLiteral`. - -.. _fls_wgylj1n4wrqe: - -float suffix -^^^^^^^^^^^^ - -:dp:`fls_vka2z7frq9j8` -A :dt:`float suffix` is a component of a :t:`float literal` that specifies an -explicit :t:`floating-point type`. - -:dp:`fls_2k1ddqhsgxqk` -See :s:`FloatSuffix`. - -.. _fls_k32g8cd9friu: - -floating-point type -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_1w5yjiffah1u` -A :dt:`floating-point type` is a :t:`numeric type` whose :t:`[value]s` denote -fractional numbers. - -.. _fls_8ih3gh6hoy78: - -floating-point type variable -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_ls41emhkrxdi` -A :dt:`floating-point type variable` is a :t:`type variable` that can refer -only to :t:`[floating-point type]s`. - -.. _fls_nE6SWuVH7X68: - -floating-point value -^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_rx8cvWPlvel5` -A :dt:`floating-point value` is a :t:`value` of a :t:`floating-point type`. - -.. _fls_dwnvkq8n94h1: - -for loop -^^^^^^^^ - -:dp:`fls_gmhh56arsbw8` -For :dt:`for loop`, see :t:`for loop expression`. - -.. _fls_vfkqbovqbw86: - -for loop expression -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_f0gp7qxoc4o4` -A :dt:`for loop expression` is a :t:`loop expression` that continues to -evaluate its :t:`loop body` as long as its :t:`subject expression` yields a -:t:`value`. - -:dp:`fls_yn4d35pvmn87` -See :s:`ForLoopExpression`. - -.. _fls_fo7vyxs4l3yh: - -Foreign Function Interface -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_240yj1kym1kh` -:dt:`Foreign Function Interface` employs :t:`ABI`, :t:`[attribute]s`, -:t:`external block`, :t:`[external function]s`, linkage, and :t:`type` -:t:`layout` to interface a Rust program with foreign code. - -.. _fls_pi7j0t7h1y86: - -fragment specifier -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_6lhwep7ulpr0` -A :dt:`fragment specifier` is a :t:`construct` that indicates the :t:`type` of -a :t:`metavariable`. - -:dp:`fls_drfn9yqrihgx` -See ``MacroFragmentSpecifier``. - -.. _fls_tWp1PLe8m83K: - -full range expression -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_NIb9UOIRjMqa` -A :dt:`full range expression` is a :t:`range expression` that covers the full -range of a :t:`type`. - -.. _fls_yllg093syzdi: - -function -^^^^^^^^ - -:dp:`fls_ni14pcm4ap9l` -A :dt:`function` is a :t:`value` of a :t:`function type` that models a behavior. - -:dp:`fls_hn01vvw2fx9m` -See :s:`FunctionDeclaration`. - -.. _fls_vjgkg8kfi93: - -function body -^^^^^^^^^^^^^ - -:dp:`fls_y5ha4123alik` -A :dt:`function body` is the :t:`block expression` of a :t:`function`. - -:dp:`fls_r0g0i730x6x4` -See :s:`FunctionBody`. - -.. _fls_ayuia853po0a: - -function item type -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_rfvfo8x42dh8` -A :dt:`function item type` is a unique anonymous :t:`function type` that -identifies a :t:`function`. - -.. _fls_WMaE58yv1joW: - -function lifetime elision -^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_tZMmRHua1S8K` -:dt:`Function lifetime elision` is a form of :t:`lifetime elision` that applies -to :t:`[function]s`, :t:`[function pointer type parameter]s` and :t:`[path]s` -resolving to one of the :std:`core::ops::Fn`, :std:`core::ops::FnMut`, and -:std:`core::ops::FnOnce` :t:`[trait]s`. - -.. _fls_xn800gcjnln1: - -function parameter -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_2feq1ky9pla1` -A :dt:`function parameter` is a :t:`construct` that yields a set of -:t:`[binding]s` that bind matched input :t:`[value]s` to :t:`[name]s` at the -site of a :t:`call expression` or a :t:`method call expression`. - -:dp:`fls_4tf20svi3rjx` -See :s:`FunctionParameter`. - -.. _fls_fqwzlg78k503: - -function pointer type -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_lcawg25xhblx` -A :dt:`function pointer type` is an :t:`indirection type` that refers to a -:t:`function`. - -:dp:`fls_t50umpk5abjy` -See :s:`FunctionPointerTypeSpecification`. - -.. _fls_v3V6K4S5UhIF: - -function pointer type parameter -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_nF1k90JJWq2K` -A :dt:`function pointer type parameter` is a :t:`function parameter` of a -:t:`function pointer type`. - -:dp:`fls_vvy6qogy0xnb` -See :s:`FunctionPointerTypeParameter`. - -.. _fls_2uvom1x42dcs: - -function qualifier -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_8cux22275v8r` -A :dt:`function qualifier` is a :t:`construct` that determines the role of -a :t:`function`. - -:dp:`fls_3td9tztnj2jq` -See :s:`FunctionQualifierList`. - -.. _fls_hz3zunp8lrfl: - -function signature -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_ndld48kg6o8d` -A :dt:`function signature` is a unique identification of a :t:`function` -that encompasses of its :t:`[function qualifier]s`, :t:`name`, -:t:`[generic parameter]s`, :t:`[function parameter]s`, :t:`return type`, and -:t:`where clause`. - -.. _fls_yo2x1llt9ejy: - -function type -^^^^^^^^^^^^^ - -:dp:`fls_4e19116glgtv` -A :dt:`function type` is either a :t:`closure type` or a -:t:`function item type`. - -.. _fls_gzybxk1gosm6: - -function-like macro -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_psnab9cuq4bu` -A :dt:`function-like macro` is a :t:`procedural macro` that consumes a stream -of :t:`[token]s` and produces a stream of tokens, and is invoked directly. - -.. _fls_OFMoUA3eFtuC: - -fundamental -^^^^^^^^^^^ - -:dp:`fls_e0dRD4NTE0UP` -A :t:`trait` or :t:`type` is :dt:`fundamental` when its -:t:`implementation coherence` rules are relaxed and the :t:`trait` or :t:`type` -is always treated as if it was a :t:`local trait` or a :t:`local type`. - -.. _fls_yxzpexco8ag3: - -future -^^^^^^ - -:dp:`fls_pvigospl4n3g` -A :dt:`future` represents a :t:`value` of a :t:`type` that implements the -:std:`core::future::Future` :t:`trait` which may not have finished computing -yet. - -.. _fls_dvk8ccb46abk: - -future operand -^^^^^^^^^^^^^^ - -:dp:`fls_fold1inh5jev` -A :dt:`future operand` is an :t:`operand` whose :t:`future` is being awaited by -an :t:`await expression`. - -:dp:`fls_tbfpowv90u5w` -See :s:`FutureOperand`. - -.. _fls_j1cyhud0h65t: - -generic argument -^^^^^^^^^^^^^^^^ - -:dp:`fls_meimxi20p51a` -A :dt:`generic argument` supplies a static input for an -:t:`associated trait type` or a :t:`generic parameter`. - -:dp:`fls_8bvdmdgbu17l` -See :s:`GenericArgumentList`. - -.. _fls_nooYIxMnV8Ps: - -generic associated type -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_O4wckPZPmree` -A :dt:`generic associated type` is an :t:`associated type` with -:t:`[generic parameter]s`. - -.. _fls_3uFg0NK5fYQ6: - -generic conformance -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_PfvELNsNySLT` -:dt:`Generic conformance` measures the compatibility between a set of -:t:`[generic parameter]s` and a set of :t:`[generic argument]s`. - -.. _fls_3tj3i83eoi36: - -generic enum -^^^^^^^^^^^^ - -:dp:`fls_pnu8w26uexaq` -A :dt:`generic enum` is an :t:`enum` with :t:`[generic parameter]s`. - -.. _fls_votx8gvy5utg: - -generic function -^^^^^^^^^^^^^^^^ - -:dp:`fls_rfkbc967d48h` -A :dt:`generic function` is a :t:`function` with :t:`[generic parameter]s`. - -.. _fls_1xjbrp376niw: - -generic implementation -^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_jic937ujpnar` -A :dt:`generic implementation` is an :t:`implementation` with -:t:`[generic parameter]s`. - -.. _fls_s2syghgn74e2: - -generic parameter -^^^^^^^^^^^^^^^^^ - -:dp:`fls_61e6br8jy1v2` -A :dt:`generic parameter` is a placeholder for a :t:`constant`, a -:t:`lifetime`, or a :t:`type` whose :t:`value` is supplied statically by a -:t:`generic argument`. - -:dp:`fls_jvxpoob39632` -See :s:`GenericParameterList`. - -.. _fls_CzudKdaYbfBF: - -generic parameter scope -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_e2tICijmLkj4` -A :dt:`generic parameter scope` is a :t:`scope` for :t:`[generic parameter]s`. - -.. _fls_cgtu4v2vxvh: - -generic struct -^^^^^^^^^^^^^^ - -:dp:`fls_mcb2mlklith8` -A :dt:`generic struct` is a :t:`struct` with :t:`[generic parameter]s`. - -.. _fls_VBEBshUrAOKE: - -generic substitution -^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_Led1Nxfcd70K` -A :dt:`generic substitution` is the replacement of a :t:`generic parameter` -with a :t:`generic argument`. - -.. _fls_hppo1v3ia4wu: - -generic trait -^^^^^^^^^^^^^ - -:dp:`fls_h515f11akr91` -A :dt:`generic trait` is a :t:`trait` with :t:`[generic parameter]s`. - -.. _fls_3Ss6jDgtF1of: - -generic type -^^^^^^^^^^^^ - -:dp:`fls_Zn2pIsMZoTry` -A :dt:`generic type` is a :t:`type` with a :t:`generic parameter`. - -.. _fls_18ow0q8at1pi: - -generic type alias -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_zgxsqq4vu7e3` -A :dt:`generic type alias` is a :t:`type alias` with :t:`[generic parameter]s`. - -.. _fls_xn9mla1vm6iv: - -generic union -^^^^^^^^^^^^^ - -:dp:`fls_93rxr0yjx1e7` -A :dt:`generic union` is a :t:`union` with :t:`[generic parameter]s`. - -.. _fls_euukteybsbi: - -glob import -^^^^^^^^^^^ - -:dp:`fls_90qsib7g8e9j` -A :dt:`glob import` is a :t:`use import` that brings all :t:`[name]s` with -:t:`public visibility` prefixed by its :t:`path` prefix into :t:`scope`. - -:dp:`fls_n4plc55cij0j` -See :s:`GlobImport`. - -.. _fls_g6g8c58bilen: - -global path -^^^^^^^^^^^ - -:dp:`fls_msg8jw9momfw` -A :dt:`global path` is a :t:`path` that starts with :t:`namespace qualifier` -``::``. - -.. _fls_hy1clqvaewnp: - -global type variable -^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_pvt4nayq006s` -A :dt:`global type variable` is a :t:`type variable` that can refer to any -:t:`type`. - -.. _fls_g4n20dy3utzy: - -greater-than expression -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_j7x5qii6rhwj` -A :dt:`greater-than expression` is a :t:`comparison expression` that tests for -a greater-than relationship. - -:dp:`fls_yni50ba3ufvs` -See :s:`GreaterThanExpression`. - -.. _fls_mxz589rq4hiy: - -greater-than-or-equals expression -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_wvspqc2otn6v` -A :dt:`greater-than-or-equals expression` is a :t:`comparison expression` that -tests for a greater-than-or-equals relationship. - -:dp:`fls_9azbvj9xux6y` -See :s:`GreaterThanOrEqualsExpression`. - -.. _fls_fquvoglio1jz: - -half-open range pattern -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_tymjispfgp7u` -A :dt:`half-open range pattern` is a :t:`range pattern` with only a -:t:`range pattern low bound`. - -:dp:`fls_evm3nxwswk00` -See :s:`HalfOpenRangePattern`. - -.. _fls_5uiij8eqln5g: - -hexadecimal literal -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_8b6njsi8g68i` -A :dt:`hexadecimal literal` is an :t:`integer literal` in base 16. - -:dp:`fls_vssa4z5wcgaa` -See :s:`HexadecimalLiteral`. - -.. _fls_h87i5nbeuxky: - -higher-ranked trait bound -^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_lpyc4omcthv` -A :dt:`higher-ranked trait bound` is a :t:`bound` that specifies an infinite -list of :t:`[bound]s` for all possible :t:`[lifetime]s`. - -:dp:`fls_m3nrsdvxxg6j` -See :s:`ForGenericParameterList`. - -.. _fls_GuMMjhEMMLvF: - -hygiene -^^^^^^^ - -:dp:`fls_AQg0MqAQZqkz` -:dt:`Hygiene` is a property of :t:`[macro]s` and :t:`[identifier]s`` that -appear within them, which aims to eliminate the syntactic interference between -a :t:`macro` and its environment. - -.. _fls_95h0aWZ7xx6U: - -hygienic -^^^^^^^^ - -:dp:`fls_hiDddAkNH5Ms` -An :t:`identifier` is :dt:`hygienic` when it has :t:`definition site hygiene`. - -.. _fls_obiv2a6ywfhh: - -i8 -^^ - -:dp:`fls_1y9ulxnz8qba` -:dc:`i8` is a :t:`signed integer type` whose :t:`[value]s` range from - (2\ -:sup:`7`) to 2\ :sup:`7` - 1, all inclusive. - -.. _fls_rvcjp656gzlm: - -i16 -^^^ - -:dp:`fls_ci9jl55wxwdg` -:dc:`i16` is a :t:`signed integer type` whose :t:`[value]s` range from - (2\ -:sup:`15`) to 2\ :sup:`15` - 1, all inclusive. - -.. _fls_l1h9g4ntf3c: - -i32 -^^^ - -:dp:`fls_yh8wzhhso4xc` -:dc:`i32` is a :t:`signed integer type` whose :t:`[value]s` range from - (2\ -:sup:`31`) to 2\ :sup:`31` - 1, all inclusive. - -.. _fls_tid10guzn9sq: - -i64 -^^^ - -:dp:`fls_4bpatxp8yelv` -:dc:`i64` is a :t:`signed integer type` whose :t:`[value]s` range from - (2\ -:sup:`63`) to 2\ :sup:`63` - 1, all inclusive. - -.. _fls_py2whbcrndmz: - -i128 -^^^^ - -:dp:`fls_p75kpbtonb8z` -:dc:`i128` is a :t:`signed integer type` whose :t:`[value]s` range from - (2\ -:sup:`127`) to 2\ :sup:`127` - 1, all inclusive. - -.. _fls_kpsyz8yopova: - -identifier -^^^^^^^^^^ - -:dp:`fls_14zc5bcm9d8o` -An :dt:`identifier` is a :t:`lexical element` that refers to a :t:`name`. - -:dp:`fls_oddu2wzhczvq` -See :s:`Identifier`. - -.. _fls_1g9xxx8s498u: - -identifier pattern -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_f2va67gvpqe0` -An :dt:`identifier pattern` is a :t:`pattern` that binds the :t:`value` it -matches to a :t:`binding`. - -:dp:`fls_nxa1gvqgitgk` -See :s:`IdentifierPattern`. - -.. _fls_al9gtcy5b5og: - -if expression -^^^^^^^^^^^^^ - -:dp:`fls_rk0661mtdvsi` -An :dt:`if expression` is an :t:`expression` that evaluates either a -:t:`block expression` or an :t:`else expression` depending on the :t:`value` -of its :t:`subject expression`. - -:dp:`fls_gdsufx2ns8bl` -See :s:`IfExpression`. - -.. _fls_j9wb2wtqp5u8: - -if let expression -^^^^^^^^^^^^^^^^^ - -:dp:`fls_ky6ng7jy1g6z` -An :dt:`if let expression` is an :t:`expression` that evaluates either a -:t:`block expression` or an :t:`else expression` depending on whether its -:t:`pattern` can be matched against its :t:`subject let expression`. - -:dp:`fls_kczg3c6n3psu` -See :s:`IfLetExpression`. - -.. _fls_xiocbknerufq: - -immutable -^^^^^^^^^ - -:dp:`fls_sttdfynyqr5h` -A :t:`value` is :dt:`immutable` when it cannot be modified. - -.. _fls_utucrvtzjhoc: - -immutable borrow -^^^^^^^^^^^^^^^^ - -:dp:`fls_p0abqkiuk7y9` -An :dt:`immutable borrow` is an :t:`immutable reference` produced by -:t:`borrowing`. - -.. _fls_pqunxp6io1n9: - -immutable borrow expression -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_dojod5pg4r7l` -An :dt:`immutable borrow expression` is a :t:`borrow expression` that lacks -:t:`keyword` ``mut``. - -.. _fls_TXQzFM77s4uj: - -immutable place expression -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_MXBEZjzBxw5Z` -An :dt:`immutable place expression` is a :t:`place expression` whose memory -location cannot be modified. - - -.. _fls_O0924m8mSfIa: - -immutable place expression context -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_UvrQ49dSoQGc` -An :dt:`immutable place expression context` is a :t:`place expression context` -whose memory location cannot be modified. - -.. _fls_RghQKP3lsXEb: - -immutable raw pointer type -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_2GzYItDXvMhB` -An :dt:`immutable raw pointer type` is a :t:`raw pointer type` subject to -:t:`keyword` ``const``. - -.. _fls_bhx0l676dmgc: - -immutable reference -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_u9kne5zfmhoe` -An :dt:`immutable reference` is a :t:`value` of a :t:`shared reference type`, -and prevents the mutation of its :t:`referent`. - -.. _fls_my7jjwi0ncen: - -immutable static -^^^^^^^^^^^^^^^^ - -:dp:`fls_eonlhz79ur3d` -An :dt:`immutable static` is a :t:`static` whose :t:`value` cannot be modified. - -.. _fls_8xrhfwgep3nk: - -immutable variable -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_sdg35i92taip` -An :dt:`immutable variable` is a :t:`variable` whose :t:`value` cannot be -modified. - -.. _fls_L9XTxPSujx4v: - -impl header lifetime elision -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_PvYGu85UAyFb` -:dt:`Impl header lifetime elision` is a form of :t:`lifetime elision` that -applies to the :t:`implementing type` and :t:`implemented trait` (if any) of an -:t:`implementation`. - -.. _fls_l20o3hutbfpf: - -impl trait type -^^^^^^^^^^^^^^^ - -:dp:`fls_rdctgmnfncnd` -An :dt:`impl trait type` is a :t:`type` that implements a :t:`trait`, where the -:t:`type` is known at compile time. - -:dp:`fls_704soar15v8v` -See :s:`ImplTraitTypeSpecification`, :s:`ImplTraitTypeSpecificationOneBound`. - -.. _fls_bj1u4k3akecp: - -implementation -^^^^^^^^^^^^^^ - -:dp:`fls_pjulppit1r6` -An :dt:`implementation` is an :t:`item` that supplements an -:t:`implementing type` by extending its functionality. - -:dp:`fls_z4ij5skptoay` -See :s:`Implementation`. - -.. _fls_vofxuHcXpt6X: - -implementation body -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_1iS30Nv9myEd` -An :dt:`implementation body` is a :t:`construct` that encapsulates the -:t:`[associated item]s`, :t:`[inner attribute]s`, and -:t:`[inner doc comment]s` of an :t:`implementation`. - -:dp:`fls_u75iHi53PnNP` -See :s:`ImplementationBody`. - -.. _fls_41GLrzVxcOV6: - -implementation coherence -^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_hAmKcuYT9hHi` -A :t:`trait implementation` exhibits :dt:`implementation coherence` when it is -valid and does not overlap with another :t:`trait implementation`. - -.. _fls_SBkTVa8bzGDx: - -implementation conformance -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_Gpq4EP1SsYJR` -:dt:`Implementation conformance` measures the compatibility between a -:t:`trait implementation` and the :t:`implemented trait`. - -.. _fls_c0xxvivt8t1u: - -implemented trait -^^^^^^^^^^^^^^^^^ - -:dp:`fls_7twlizi3v8cb` -An :dt:`implemented trait` is a :t:`trait` whose functionality has been -implemented by an :t:`implementing type`. - -:dp:`fls_2brvfx5wmvkf` -See :s:`ImplementedTrait`. - -.. _fls_ow4b5iqas115: - -implementing type -^^^^^^^^^^^^^^^^^ - -:dp:`fls_vs5ia3uupdcc` -An :dt:`implementing type` is the :t:`type` that the :t:`[associated item]s` of -an :t:`implementation` are associated with. - -:dp:`fls_9ixcwh6to74g` -See :s:`ImplementingType`. - -.. _fls_wa7t6cqgjksd: - -implicit borrow -^^^^^^^^^^^^^^^ - -:dp:`fls_q2v9ejpcvtwg` -An :dt:`implicit borrow` is a :t:`borrow` that is not present syntactically in -program text. - -.. _fls_i3iB9xP8h8Ci: - -implicitly declared entity -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_VQs1jd4Nx3qR` -An :dt:`implicitly declared entity` is an :t:`entity` that lacks an explicit -:t:`declaration`. - -.. _fls_43CCrG952l5i: - -implied bound -^^^^^^^^^^^^^ - -:dp:`fls_t77d8xwG1l9Q` -An :dt:`implied bound` is a :t:`bound` that is not expressed in syntax, but is the byproduct of relations between :t:`[lifetime parameter]s` and :t:`[function parameter]s`, between :t:`[lifetime parameter]s` and a :t:`return type`, and between :t:`[lifetime parameter]s` and :t:`[field]s`. - -.. _fls_3lo8ygoyxxyf: - -in scope -^^^^^^^^ - -:dp:`fls_sy380geqvf2l` -A :t:`name` is :dt:`in scope` when it can be referred to. - -.. _fls_nscfxu6huw6q: - -inclusive range pattern -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_olfeuvwkosse` -An :dt:`inclusive range pattern` is a :t:`range pattern` with both a -:t:`range pattern low bound` and a :t:`range pattern high bound`. - -:dp:`fls_9bdxsn6nasjr` -See :s:`InclusiveRangePattern`. - -.. _fls_j44ow2k5va3s: - -incomplete associated constant -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_bq48gl84bul0` -An :dt:`incomplete associated constant` is an :t:`associated constant` without -a :t:`constant initializer`. - -.. _fls_ga2n4nbm1pkk: - -incomplete associated function -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_iboondra204w` -An :dt:`incomplete associated function` is an :t:`associated function` without -a :t:`function body`. - -.. _fls_n99acc2tr9qm: - -incomplete associated type -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_tka0gth8rc9x` -An :dt:`incomplete associated type` is an :t:`associated type` without an -:t:`initialization type`. - -.. _fls_6tysvlg2ifr3: - -index expression -^^^^^^^^^^^^^^^^ - -:dp:`fls_1f7e9q8n431n` -An :dt:`index expression` is an :t:`expression` that indexes into a :t:`value` -of a :t:`type`. - -:dp:`fls_xm2er7vuo07g` -See :s:`IndexExpression`. - -.. _fls_S0pnJKPJPU0i: - -indexable type -^^^^^^^^^^^^^^ - -:dp:`fls_AdVGyKZFvvUS` -A :dt:`indexable type` is a :t:`type` that implements the -:std:`core::ops::Index` :t:`trait`. - -.. _fls_qs654p61ivpx: - -indexed deconstructor -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_q7eta38vw0ig` -An :dt:`indexed deconstructor` is a :t:`construct` that matches the position of -a :t:`tuple field`. - -:dp:`fls_gryv4audvann` -See :s:`IndexedDeconstructor`. - -.. _fls_bu46dg60o8us: - -indexed field selector -^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_u6mh5yediub` -An :dt:`indexed field selector` is a :t:`field selector` where the selected -:t:`field` is indicated by an index. - -:dp:`fls_wbbyf2szc8a7` -See :s:`IndexedFieldSelector`. - -.. _fls_rua2ni3p9qz2: - -indexed initializer -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_oonqolgqyrq1` -An :dt:`indexed initializer` is a :t:`construct` that specifies the index and -initial :t:`value` of a :t:`field` in a :t:`struct expression`. - -:dp:`fls_werlw98l3ra0` -See :s:`IndexedInitializer`. - -.. _fls_irp9ive4e66r: - -indexed operand -^^^^^^^^^^^^^^^ - -:dp:`fls_dvmm47wnl33e` -An :dt:`indexed operand` is an :t:`operand` which indicates the :t:`value` of a -:t:`type` implementing :std:`core::ops::Index` being indexed into by an -:t:`index expression`. - -:dp:`fls_je8eh3a02riq` -See :s:`IndexedOperand`. - -.. _fls_a350zwl1or4g: - -indexing operand -^^^^^^^^^^^^^^^^ - -:dp:`fls_ipw4tfrserbu` -An :dt:`indexing operand` is an :t:`operand` which specifies the index for the -:t:`indexed operand` being indexed into by an :t:`index expression`. - -:dp:`fls_t2j8vzlrlvb0` -See :s:`IndexingOperand`. - -.. _fls_k9kuxgte6vxn: - -indirection type -^^^^^^^^^^^^^^^^ - -:dp:`fls_8so1phpdjyk8` -An :dt:`indirection type` is a :t:`type` whose :t:`[value]s` refer to memory -locations. - -.. _fls_gccnknktzp7g: - -inert attribute -^^^^^^^^^^^^^^^ - -:dp:`fls_o4e3tyjz7l1h` -An :dt:`inert attribute` is an :t:`attribute` that remains with the :t:`item` -it decorates. - -.. _fls_z5593p7wfab: - -inferred type -^^^^^^^^^^^^^ - -:dp:`fls_9xgfexeqr4ed` -An :dt:`inferred type` is a placeholder for a :t:`type` deduced by -:t:`type inference`. - -:dp:`fls_z2p8378sd93z` -See :s:`InferredType`. - -.. _fls_kg9aeyrw822m: - -infinite loop -^^^^^^^^^^^^^ - -:dp:`fls_xpm53i3rkuu0` -For :dt:`infinite loop`, see :t:`infinite loop expression`. - -.. _fls_o2eei5aqgds6: - -infinite loop expression -^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_mvplpa4t1f2p` -An :dt:`infinite loop expression` is a :t:`loop expression` that continues to -evaluate its :t:`loop body` indefinitely. - -:dp:`fls_2gipk6b62hme` -See :s:`InfiniteLoopExpression`. - -.. _fls_o57p4yhjci61: - -inherent implementation -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_6fpicw8ss4h3` -An :dt:`inherent implementation` is an :t:`implementation` that adds direct -functionality. - -:dp:`fls_s8zjk7hms1o0` -See :s:`InherentImplementation`. - -.. _fls_c1wbumq0bumj: - -initialization -^^^^^^^^^^^^^^ - -:dp:`fls_xi07ycze6mo0` -:dt:`Initialization` is the act of supplying an initial :t:`value` to a -:t:`constant`, a :t:`static`, or a :t:`variable`. - -.. _fls_ctusGvpQvJue: - -initialization expression -^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_KUeiSByPUc4w` -An :dt:`initialization expression` is either a :t:`constant initializer` or a -:t:`static initializer`. - -.. _fls_pd30dl2envjn: - -initialization type -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_crn87nne7k38` -An :dt:`initialization type` is the :t:`type` a :t:`type alias` defines a -:t:`name` for. - -:dp:`fls_3r85y1lh1oxo` -See :s:`InitializationType`. - -.. _fls_lbL2b9wyg6es: - -inline assembly -^^^^^^^^^^^^^^^ - -:dp:`fls_1MtaLEA7YfSv` -:dt:`Inline assembly` is hand-written assembly code that is integrated into a -Rust program. - -.. _fls_c54lmkluwbwr: - -inline module -^^^^^^^^^^^^^ - -:dp:`fls_tbldwtisl9vc` -An :dt:`inline module` is a :t:`module` with an :s:`InlineModuleSpecification`. - -:dp:`fls_8bmjz8o3xu60` -See :s:`InlineModuleSpecification`. - -.. _fls_joxepyv84ajz: - -inner attribute -^^^^^^^^^^^^^^^ - -:dp:`fls_l7kxkav42l5d` -An :dt:`inner attribute` is an :t:`attribute` that applies to an enclosing -:t:`item`. - -:dp:`fls_umkk8xwktat1` -See :s:`InnerAttribute`. - -.. _fls_chbp2je32okc: - -inner block doc -^^^^^^^^^^^^^^^ - -:dp:`fls_f4nqkybpwj1a` -An :dt:`inner block doc` is a :t:`block comment` that applies to an enclosing -:t:`non-[comment]` :t:`construct`. - -:dp:`fls_lmpaznk198ga` -See :s:`InnerBlockDoc`. - -.. _fls_vR1ucGTBKjlH: - -inner doc comment -^^^^^^^^^^^^^^^^^ - -:dp:`fls_6KunKwZf9QaF` -An :dt:`inner doc comment` is either an :t:`inner block doc` or an -:t:`inner line doc`. - -.. _fls_xgm53126q9c4: - -inner line doc -^^^^^^^^^^^^^^ - -:dp:`fls_vtwavwjhgvlz` -An :dt:`inner line doc` is a :t:`line comment` that applies to an enclosing -:t:`non-[comment]` :t:`construct`. - -:dp:`fls_8cnikewkqs7` -See :s:`InnerLineDoc`. - -.. _fls_DTb5xegDqm9S: - -input register -^^^^^^^^^^^^^^ - -:dp:`fls_dTvdQaFpncCj` -An :dt:`input register` is a :t:`register` whose :t:`register name` is used in -a :t:`register argument` subject to :t:`direction modifier` ``in``, ``inout``, -or ``inlateout``. - -.. _fls_Tmju2kXErYhJ: - -input register expression -^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_rvbuHSgg2RHt` -An :dt:`input register expression` is an :t:`expression` that provides the -initial :t:`value` of a :t:`register`. - -:dp:`fls_NqjRr9khzpl2` -See :s:`InputRegisterExpression`. - -.. _fls_y9EOkstHPckB: - -input-output register expression -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_lLQw3EFl7x5z` -An :dt:`input-output register expression` is a :t:`construct` that specifies -both an :t:`input register expression` and an :t:`output register expression`. - -:dp:`fls_FnMGXi2nPgUH` -See :s:`InputOutputRegisterExpression`. - -.. _fls_e2kizieowvuh: - -integer literal -^^^^^^^^^^^^^^^ - -:dp:`fls_23a1fjpf15qv` -An :dt:`integer literal` is a :t:`numeric literal` that denotes a whole number. - -:dp:`fls_6qpj0nr0jpjr` -See :s:`IntegerLiteral`. - -.. _fls_bhvh8qwqy8ve: - -integer suffix -^^^^^^^^^^^^^^ - -:dp:`fls_qazh8f8rs528` -An :dt:`integer suffix` is a component of an :t:`integer literal` that -specifies an explicit :t:`integer type`. - -:dp:`fls_jqagv350kw2m` -See ``IntegerSuffix.`` - -.. _fls_nu1cnk2b9qx5: - -integer type -^^^^^^^^^^^^ - -:dp:`fls_nhfqdhf26ym3` -An :dt:`integer type` is a :t:`numeric type` whose :t:`[value]s` denote whole -numbers. - -.. _fls_ctuvilpb30gq: - -integer type variable -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_e3ed1tyrjsy4` -An :dt:`integer type variable` is a :t:`type variable` that can refer only to -:t:`[integer type]s`. - -.. _fls_mb3xnplwdw9l: - -interior mutability -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_e0173dd09znl` -:dt:`Interior mutability` is a property of :t:`[type]s` whose :t:`[value]s` can -be modified through :t:`[immutable reference]s`. - -.. _fls_7rj914fhginh: - -intermediate match arm -^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_l6pemxmdllvl` -An :dt:`intermediate match arm` is any :t:`non-[final match arm]` of a -:t:`match expression`. - -:dp:`fls_8713j5lrwqvs` -See :s:`IntermediateMatchArm`. - -.. _fls_fgmvmcw2kw5i: - -irrefutable constant -^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_hd02jah50qzl` -An :dt:`irrefutable constant` is a :t:`constant` of a :t:`type` that has at most -one :t:`value`. - - -.. _fls_ckz7pujdnuo5: - -irrefutable pattern -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_y421hdrbs6ak` -An :dt:`irrefutable pattern` is a :t:`pattern` that always matches the -:t:`value` it is being matched against. - -.. _fls_vt44bvhm4duk: - -isize -^^^^^ - -:dp:`fls_6x617i9zcj7o` -:dc:`isize` is a :t:`signed integer type` with the same number of bits as the -platform's :t:`pointer type`, and is at least 16-bits wide. - -.. _fls_yh2a7e3d3894: - -item -^^^^ - -:dp:`fls_2ghaujiqkhyy` -An :dt:`item` is the most basic semantic element in program text. An item -defines the compile- and run-time semantics of a program. - -:dp:`fls_xd997kd2i73a` -See :s:`Item`. - -.. _fls_wojJZZ4gYGfl: - -item scope -^^^^^^^^^^ - -:dp:`fls_mW7IwWGSjrl2` -An :dt:`item scope` is a :t:`scope` for :t:`[item]s`. - -.. _fls_yaurxo4ogfsh: - -item statement -^^^^^^^^^^^^^^ - -:dp:`fls_r0crucpuhtj` -An :dt:`item statement` is a :t:`statement` that is expressed as an :t:`item`. - -.. _fls_orde7iunolyx: - -iteration expression -^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_suz163n1x1xm` -An :dt:`iteration expression` is an :t:`expression` that provides the criterion -of a :t:`while loop expression`. - -:dp:`fls_jw5lj2hgjl8v` -See :s:`IterationExpression`. - -.. _fls_yjs58mp5fkxz: - -keyword -^^^^^^^ - -:dp:`fls_z3825koc9c1w` -A :dt:`keyword` is a word in program text that has special meaning. - -:dp:`fls_yvnf2mu4pr75` -See :s:`Keyword`. - -.. _fls_uVUoHmNtPRtS: - -label -^^^^^ - -:dp:`fls_iAAf2rLmgmGQ` -A :dt:`label` is the :t:`name` of a :t:`loop expression`. - -:dp:`fls_HicurdHIiLX2` -See :s:`Label`. - -.. _fls_dw5s7jhk4v8s: - -label indication -^^^^^^^^^^^^^^^^ - -:dp:`fls_sso322p7adt0` -A :dt:`label indication` is a :t:`construct` that indicates a :t:`label`. - -:dp:`fls_g6iqfqooz8th` -See :s:`LabelIndication`. - -.. _fls_P0on44EAB3cn: - -label scope -^^^^^^^^^^^ - -:dp:`fls_2H6HkQ102hVS` -A :dt:`label scope` is a :t:`scope` for :t:`[label]s`. - -.. _fls_w5gslebevlya: - -layout -^^^^^^ - -:dp:`fls_qk602dmhc0d6` -:dt:`Layout` specifies the :t:`alignment`, :t:`size`, and the relative offset -of :t:`[field]s` in a :t:`type`. - -.. _fls_bputdgkeezfs: - -lazy and expression -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_v2e6t73uk6nt` -A :dt:`lazy and expression` is a :t:`lazy boolean expression` that uses short -circuit and arithmetic. - -:dp:`fls_rkthjuvems6v` -See :s:`LazyAndExpression`. - -.. _fls_4a6yhxj783a1: - -lazy boolean expression -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_jpv7l86sdh6i` -A :dt:`lazy boolean expression` is an :t:`expression` that performs short -circuit Boolean arithmetic. - -:dp:`fls_9tu5x810ztbg` -See :s:`LazyBooleanExpression`. - -.. _fls_9mvrfhsegwp0: - -lazy or expression -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_aln8bbvx9kzm` -A :dt:`lazy or expression` is a :t:`lazy boolean expression` that uses short -circuit or arithmetic. - -:dp:`fls_jiv7e3mr86kf` -See :s:`LazyOrExpression`. - -.. _fls_x6vo9pysmex2: - -left operand -^^^^^^^^^^^^ - -:dp:`fls_m821x5195ac9` -A :dt:`left operand` is an :t:`operand` that appears on the left-hand side of a -:t:`binary operator`. - -:dp:`fls_ghlbsklg7wdb` -See :s:`LeftOperand`. - -.. _fls_ulmspewtlo57: - -less-than expression -^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_9ttxqxt9ui4t` -A :dt:`less-than expression` is a :t:`comparison expression` that tests for a -less-than relationship. - -:dp:`fls_rhnbdyo2l4kp` -See :s:`LessThanExpression`. - -.. _fls_es169x7ars9a: - -less-than-or-equals expression -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_8pya58ug180j` -A :dt:`less-than-or-equals expression` is a :t:`comparison expression` that -tests for a less-than-or-equals relationship. - -:dp:`fls_ft5aeo4ilgwc` -See :s:`LessThanOrEqualsExpression`. - - -.. _fls_DdZ1ZwjLZTeG: - -let binding -^^^^^^^^^^^ - -:dp:`fls_sw6HrsxsnG2y` -A :dt:`let binding` is the :t:`binding` introduced by a :t:`let statement`, an :t:`if let expression`, or a :t:`while let loop expression`. - -.. _fls_hqj80jHcxEBB: - -let initializer -^^^^^^^^^^^^^^^ - -:dp:`fls_jtTpBZ4ujZRc` -A :dt:`let initializer` is a :t:`construct` that provides the :t:`value` of -the :t:`[binding]s` of the :t:`let statement` using an :t:`expression`, or -alternatively executes a :t:`block expression`. - -:dp:`fls_GmHsJb6FICfA` -See :s:`LetInitializer`. - -.. _fls_39k0ebr7snb0: - -let statement -^^^^^^^^^^^^^ - -:dp:`fls_yh7hn6jjv3ur` -A :dt:`let statement` is a :t:`statement` that introduces new :t:`[variable]s` -given by the :t:`[binding]s` produced by its :t:`pattern-without-alternation` -that are optionally initialized to a :t:`value`. - -:dp:`fls_tsem3c6zqmh4` -See :s:`LetStatement`. - -.. _fls_h2tqtmm5686y: - -lexical element -^^^^^^^^^^^^^^^ - -:dp:`fls_nrxnbkatn63n` -A :dt:`lexical element` is the most basic syntactic element in program -text. - -.. _fls_r1sk7vdgckym: - -library crate -^^^^^^^^^^^^^ - -:dp:`fls_3m8lg4mdc2x0` -A :dt:`library crate` is a :t:`crate` whose :t:`crate type` is ``lib``, ``rlib``, -``staticlib``, ``dylib``, or ``cdylib``. - -.. _fls_vdhaa61g6kah: - -lifetime -^^^^^^^^ - -:dp:`fls_il3n0w4m084b` -A :dt:`lifetime` specifies the expected longevity of a :t:`reference`. - -:dp:`fls_2nywjifee7q` -See :s:`Lifetime`. - -.. _fls_d0s6bk7ljqrb: - -lifetime argument -^^^^^^^^^^^^^^^^^ - -:dp:`fls_oaf87yjb3xjs` -A :dt:`lifetime argument` is a :t:`generic argument` that supplies the -:t:`value` of a :t:`lifetime parameter`. - -:dp:`fls_la8lbv14zj28` -See :s:`LifetimeArgument`. - -.. _fls_ca9pu348r9jm: - -lifetime bound -^^^^^^^^^^^^^^ - -:dp:`fls_u6xfs8fg558` -A :dt:`lifetime bound` is a :t:`bound` that imposes a constraint on the -:t:`[lifetime]s` of :t:`[generic parameter]s`. - -:dp:`fls_ivcjmp54hdej` -See :s:`LifetimeIndication`. - -.. _fls_fV8sP0roRyBN: - -lifetime bound predicate -^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_AHftLKgSP9Xk` -A :dt:`lifetime bound predicate` is a :t:`construct` that specifies -:t:`[lifetime bound]s` on a :t:`lifetime parameter`. - -:dp:`fls_8WIod9Rm5IXa` -See :s:`LifetimeBoundPredicate`. - -.. _fls_al39r9uz2zmy: - -lifetime elision -^^^^^^^^^^^^^^^^ - -:dp:`fls_dq5wkd61ry3l` -:dt:`Lifetime elision` is a set of rules that automatically insert -:t:`[lifetime parameter]s` and/or :t:`[lifetime argument]s` when they are -elided in the source code. - -.. _fls_md7ii59zobrc: - -lifetime parameter -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_7g0iu68nrsd4` -A :dt:`lifetime parameter` is a :t:`generic parameter` for a :t:`lifetime`. - -:dp:`fls_z1wl2uiwip98` -See :s:`LifetimeParameter`. - -.. _fls_joDjnHu1L9Lp: - -lifetime variable -^^^^^^^^^^^^^^^^^ - -:dp:`fls_ucZnCBWxXl6n` -A :dt:`lifetime variable` is a placeholder used during :t:`type inference` to -stand in for an undetermined :t:`lifetime` of a :t:`type`. - - -.. _fls_8qputmx0i7ku: - -line -^^^^ - -:dp:`fls_oqf2439j3y7b` -A :dt:`line` is a sequence of zero or more characters followed by an end of -line. - -.. _fls_k5ycqijslkxh: - -line comment -^^^^^^^^^^^^ - -:dp:`fls_3e7asah7lkqj` -A :dt:`line comment` is a :t:`comment` that spans exactly one :t:`line`. - -:dp:`fls_8j5j777dv2jm` -See :s:`LineComment`. - -.. _fls_z850pyf9r1f4: - -literal -^^^^^^^ - -:dp:`fls_ckbyt11pku9j` -A :dt:`literal` is a fixed :t:`value` in program text. - -:dp:`fls_h1g46cevrqjv` -See :s:`Literal`. - -.. _fls_b57clq8jhw5w: - -literal expression -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_otaauusc24v5` -A :dt:`literal expression` is an :t:`expression` that denotes a :t:`literal`. - -:dp:`fls_7po7zobtlhzn` -See :s:`LiteralExpression`. - -.. _fls_bo2tv8ky1jc: - -literal pattern -^^^^^^^^^^^^^^^ - -:dp:`fls_5s9b4bza13xf` -A :dt:`literal pattern` is a :t:`pattern` that matches a :t:`literal`. - -:dp:`fls_o7q7wfjulc24` -See :s:`LiteralPattern`. - -.. _fls_bYpBl5zfTibF: - -local trait -^^^^^^^^^^^ - -:dp:`fls_H5vkbMFvzrFs` -A :dt:`local trait` is a :t:`trait` that is defined in the current :t:`crate`. - -.. _fls_cexgUIGUUKS4: - -local type -^^^^^^^^^^ - -:dp:`fls_HvGPB3CsN4Ah` -A :dt:`local type` is a :t:`type` that is defined in the current :t:`crate`. - -.. _fls_lkxiws55xhpq: - -local variable -^^^^^^^^^^^^^^ - -:dp:`fls_3inlcyi6444u` -For :dt:`local variable`, see :t:`variable`. - -.. _fls_kdqa8zs8tk6g: - -loop -^^^^ - -:dp:`fls_omjnvxva07z2` -For :dt:`loop`, see :t:`loop expression`. - -.. _fls_5vt0Ph5BfDnU: - -loop body -^^^^^^^^^ - -:dp:`fls_fRWcWPeKgx9g` -A :dt:`loop body` is the :t:`block expression` of a :t:`loop expression`. - -:dp:`fls_vWuR2TET712r` -See :s:`LoopBody`. - -.. _fls_an1s2hnapd59: - -loop expression -^^^^^^^^^^^^^^^ - -:dp:`fls_2yypq3m1kquj` -A :dt:`loop expression` is an :t:`expression` that evaluates a -:t:`block expression` continuously as long as some criterion holds true. - -:dp:`fls_o2dyznhq7rez` -See :s:`LoopExpression`. - -.. _fls_sdkcn1exc9da: - -macro -^^^^^ - -:dp:`fls_bt16qi8g2js5` -A :dt:`macro` is a custom definition that extends Rust by defining callable -syntactic transformations. - -.. _fls_td4jm76u9m03: - -macro expansion -^^^^^^^^^^^^^^^ - -:dp:`fls_t383uo1l4h8x` -:dt:`Macro expansion` is the process of statically executing a -:t:`macro invocation` and replacing it with the produced output of the -:t:`macro invocation`. - -.. _fls_o5jy1u64nyiy: - -macro implementation function -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_xy4t1suhrn46` -A :dt:`macro implementation function` is the :t:`function` that encapsulates -the syntactic transformations of a :t:`procedural macro`. - -.. _fls_20x9eqa7xeui: - -macro invocation -^^^^^^^^^^^^^^^^ - -:dp:`fls_5qtwcp5ns5vz` -A :dt:`macro invocation` is a call of a :t:`declarative macro` or -:t:`function-like macro` that is expanded statically and replaced with the -result of the :t:`macro`. - -:dp:`fls_IgzL0OJ9Ja7y` -See :s:`MacroInvocation`. - -.. _fls_boanb1ipzc9: - -macro match -^^^^^^^^^^^ - -:dp:`fls_q0ve6nd287ta` -A :dt:`macro match` is the most basic form of a satisfied :t:`macro matcher`. - -:dp:`fls_dww6sqbj2vin` -See :s:`MacroMatch`. - -.. _fls_4h4snjd4thsv: - -macro matcher -^^^^^^^^^^^^^ - -:dp:`fls_sqncf88chnsy` -A :dt:`macro matcher` is a :t:`construct` that describes a syntactic pattern -that a :t:`macro` must match. - -:dp:`fls_ioyegc6ggd7o` -See :s:`MacroMatcher`. - -.. _fls_ao7GhE0C8MQO: - -macro matching -^^^^^^^^^^^^^^ - -:dp:`fls_RrDmFXuZrhFT` -:dt:`Macro matching` is the process of performing :t:`rule matching` and -:t:`token matching`. - -.. _fls_kddW7EirSn0g: - -macro repetition -^^^^^^^^^^^^^^^^ - -:dp:`fls_sDomcFWIeUAT` -A :dt:`macro repetition` is either a :t:`macro repetition in matching` or a -:t:`macro repetition in transcription`. - -.. _fls_a5j2hztrjfv5: - -macro repetition in matching -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_wio0e9qzstjh` -A :dt:`macro repetition in matching` allows for a syntactic pattern to be -matched zero or multiple times during :t:`macro matching`. - -:dp:`fls_potk1y850zer` -See :s:`MacroRepetitionMatch`. - -.. _fls_sqv126lwdz23: - -macro repetition in transcription -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_ex9vd3w0t4wo` -A :dt:`macro repetition in transcription` allows for a syntactic pattern to be -transcribed zero or multiple times during :t:`macro transcription`. - -:dp:`fls_5wdiqbwgr9nt` -See :s:`MacroRepetitionTranscriber`. - -.. _fls_gw31cagmzx26: - -macro rule -^^^^^^^^^^ - -:dp:`fls_7gfdqggs33id` -A :dt:`macro rule` is a :t:`construct` that consists of a :t:`macro matcher` -and a :t:`macro transcriber`. - -:dp:`fls_qv68aj43mz5m` -See :s:`MacroRule`. - -.. _fls_i4yf4lt8qvkt: - -macro statement -^^^^^^^^^^^^^^^ - -:dp:`fls_yhh9k9epv3g6` -A :dt:`macro statement` is a :t:`statement` expressed as a -:t:`terminated macro invocation`. - -.. _fls_76o6rjh6lrqd: - -macro transcriber -^^^^^^^^^^^^^^^^^ - -:dp:`fls_ug79qf3p693h` -A :dt:`macro transcriber` is a :t:`construct` that describes the replacement -syntax of a :t:`macro`. - -:dp:`fls_myubuihvjl4s` -See :s:`MacroTranscriber`. - -.. _fls_vdq3cphhpxmg: - -macro transcription -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_nouiggbpipg` -:dt:`Macro transcription` is the process of producing the expansion of a -:t:`declarative macro`. - -.. _fls_MJ1YWiOpxAa8: - -main function signature -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_QijObGZEIykU` -A :dt:`main function signature` is a :t:`function signature` subject to specific -restrictions. - -.. _fls_fizf1byuspv2: - -match arm -^^^^^^^^^ - -:dp:`fls_z5qsy5z2zak3` -A :dt:`match arm` is a :t:`construct` that consists of a :t:`match arm matcher` -and a :t:`match arm body`. - -.. _fls_q7lcdtxuy1ac: - -match arm body -^^^^^^^^^^^^^^ - -:dp:`fls_33e7oefx0xqm` -A :dt:`match arm body` is the :t:`operand` of a :t:`match arm`. - -.. _fls_aa1x6ajl4zid: - -match arm guard -^^^^^^^^^^^^^^^ - -:dp:`fls_uhn07jmvv9ea` -A :dt:`match arm guard` is a :t:`construct` that provides additional filtering -to a :t:`match arm matcher`. - -:dp:`fls_ykf70vbng54n` -See :s:`MatchArmGuard`. - -.. _fls_i3omadaygum2: - -match arm matcher -^^^^^^^^^^^^^^^^^ - -:dp:`fls_paz9358w4cpu` -A :dt:`match arm matcher` is a :t:`construct` that consists of a :t:`pattern` -and a :t:`match arm guard`. - -:dp:`fls_j7i2bjvzz1tx` -See :s:`MatchArmMatcher`. - -.. _fls_w15uouo0sjao: - -match expression -^^^^^^^^^^^^^^^^ - -:dp:`fls_2ohrphptjny6` -A :dt:`match expression` is an :t:`expression` that tries to match one of -its multiple :t:`[pattern]s` against its :t:`subject expression` and if it -succeeds, evaluates an :t:`operand`. - -:dp:`fls_wkalvzkmp95y` -See :s:`MatchExpression`. - -.. _fls_xo9uyazcfuq3: - -metavariable -^^^^^^^^^^^^ - -:dp:`fls_fu1esz5i9mt` -A :dt:`metavariable` is a :t:`macro match` that describes a :t:`variable`. - -:dp:`fls_k4xaw93z8x33` -See :s:`MacroMetavariable`. - -.. _fls_5P2594jy7uDE: - -metavariable indication -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_r1FxbWffC9Wt` -A :dt:`metavariable indication` is a :t:`construct` that indicates a -:t:`metavariable`. - -:dp:`fls_bcMO2a0e0gXJ` -See :s:`MacroMetavariableIndication`. - -.. _fls_bi3g8xkk9ekf: - -method -^^^^^^ - -:dp:`fls_n4opbiofu9q6` -A :dt:`method` is an :t:`associated function` with a :t:`self parameter`. - -.. _fls_l4wel2551cw9: - -method call expression -^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_367sod24edts` -A :dt:`method call expression` is an :t:`expression` that invokes a :t:`method` -of a :t:`variable`. - -:dp:`fls_ohhcvxcaqv11` -See :s:`MethodCallExpression`. - -.. _fls_l6eJxvmplLqQ: - -method operand -^^^^^^^^^^^^^^ - -:dp:`fls_VLLAFjAxCfkE` -A :dt:`method operand` is an :t:`operand` that denotes the :t:`method` being -invoked by a :t:`method call expression`. - -:dp:`fls_Pkgr4fJQZpJ6` -See :s:`MethodOperand`. - -.. _fls_05yFh5Ud0YkW: - -method resolution -^^^^^^^^^^^^^^^^^ - -:dp:`fls_LbW4z6OTuD1l` -:dt:`Method resolution` is a kind of :t:`resolution` that applies to a -:t:`method call expression`. - -.. _fls_2FFRdj5cO0ks: - -mixed site hygiene -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_hjJpNmKiZxlT` -:dt:`Mixed site hygiene` is a type of :t:`hygiene` which resolves to the -:s:`MacroRulesDeclaration` site for :t:`[variable]s`, :t:`[label]s`, and the -``$crate`` :t:`metavariable`, and to the :s:`MacroInvocation` site otherwise, -and is considered :t:`partially hygienic`. - -.. _fls_5hoe1v960xfi: - -modifying operand -^^^^^^^^^^^^^^^^^ - -:dp:`fls_9wt2l5gg06pb` -A :dt:`modifying operand` is an :t:`operand` that supplies the :t:`value` that -is used in the calculation of a :t:`compound assignment expression`. - -:dp:`fls_qnwbrwdnv7n0` -See :s:`ModifyingOperand`. - -.. _fls_kbxk78vm564e: - -module -^^^^^^ - -:dp:`fls_ujlsg58bskl5` -A :dt:`module` is a container for zero or more :t:`[item]s`. - -:dp:`fls_os60q6vvm71c` -See :s:`ModuleDeclaration`. - -.. _fls_gnucgrytswa4: - -move type -^^^^^^^^^ - -:dp:`fls_ri37ez31gai8` -A :dt:`move type` is a :t:`type` that implements the :std:`core::marker::Sized` -:t:`trait` and that is not a :t:`copy type`. - -.. _fls_iw2vYgmLhlsg: - -multi segment path -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_T4Xd6W6EqPSb` -A :dt:`multi segment path` is a :t:`path` consisting of more than one -:t:`path segment`. - -.. _fls_lpSCLhnaxeCg: - -multiplication assignment -^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_llUb5VHKjwW4` -For :dt:`multiplication assignment`, see -:t:`multiplication assignment expression`. - -.. _fls_yo4k6lk0tizn: - -multiplication assignment expression -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_eo9gx05n5ru3` -A :dt:`multiplication assignment expression` is a -:t:`compound assignment expression` that uses multiplication. - -:dp:`fls_b0dc5lec1mdc` -See :s:`MultiplicationAssignmentExpression`. - -.. _fls_bgtznqqgtmd8: - -multiplication expression -^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_324qh8wz474b` -A :dt:`multiplication expression` is an :t:`arithmetic expression` that uses -multiplication. - -:dp:`fls_34bkl5i75q5` -See :s:`MultiplicationExpression`. - -.. _fls_yM11Bcxn4p7c: - -mutability -^^^^^^^^^^ - -:dp:`fls_lBrXj9lo4s6o` -:dt:`Mutability` determines whether a :t:`construct` can modify a :t:`value`. - -.. _fls_wvejcadmzt5p: - -mutable -^^^^^^^ - -:dp:`fls_dqm58deu1orn` -A :t:`value` is :dt:`mutable` when it can be modified. - -.. _fls_TEVPHHiCMByO: - -mutable assignee expression -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_0RSlFbwrB3gp` -A :dt:`mutable assignee expression` is an :t:`assignee expression` whose -:t:`value` can be modified. - -.. _fls_ntaA0NtJ9z5h: - -mutable binding -^^^^^^^^^^^^^^^ - -:dp:`fls_v2pGKVaQjtcl` -A :dt:`mutable binding` is a :t:`binding` whose :t:`value` can be modified. - -.. _fls_iku91jwdtdr1: - -mutable borrow -^^^^^^^^^^^^^^ - -:dp:`fls_5knwbyz4fd9z` -A :dt:`mutable borrow` is a :t:`mutable reference` produced by :t:`borrowing`. - -.. _fls_kw3oiotr98tt: - -mutable borrow expression -^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_80kcc4y21hu6` -A :dt:`mutable borrow expression` is a :t:`borrow expression` that has -:t:`keyword` ``mut``. - -.. _fls_7eyza445ew53: - -mutable place expression -^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_kq877s3vij70` -A :dt:`mutable place expression` is a :t:`place expression` whose memory -location can be modified. - -.. _fls_x5BKVLc4KDlK: - -mutable place expression context -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_2ixH8LWGHi3k` -A :dt:`mutable place expression context` is a :t:`place expression context` -that may evaluate its :t:`operand` as a mutable memory location. - -.. _fls_wOvlW47jKEWF: - -mutable raw pointer type -^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_86SFxSDRcC06` -A :dt:`mutable raw pointer type` is a :t:`raw pointer type` subject to -:t:`keyword` ``mut``. - -.. _fls_jtzj092hyjkz: - -mutable reference -^^^^^^^^^^^^^^^^^ - -:dp:`fls_wujjrhm1d338` -A :dt:`mutable reference` is a :t:`value` of a :t:`mutable reference type`, and -allows the mutation of its :t:`referent`. - -.. _fls_8iq0wcczl465: - -mutable reference type -^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_q06p9tclwaaw` -A :dt:`mutable reference type` is a :t:`reference type` subject to :t:`keyword` -``mut``. - -.. _fls_omgyj7yxwgua: - -mutable static -^^^^^^^^^^^^^^ - -:dp:`fls_3ss4bokujaby` -A :dt:`mutable static` is a :t:`static` whose :t:`value` can be modified. - -.. _fls_n7h4xr40xwgb: - -mutable variable -^^^^^^^^^^^^^^^^ - -:dp:`fls_kjjv9jvdpf2o` -A :dt:`mutable variable` is a :t:`variable` whose :t:`value` can be modified. - -.. _fls_kad7fzn94x4d: - -name -^^^^ - -:dp:`fls_jjpzrs38vs3y` -A :dt:`name` is an :t:`identifier` that refers to an :t:`entity`. - -:dp:`fls_yrzevg5kd4bi` -See :s:`Name`. - -.. _fls_CxzbzLu4pWPY: - -named block expression -^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_ivFb8uAMVY3Q` -A :dt:`named block expression` is a :t:`block expression` with a :t:`label`. - -.. _fls_dgs9y3nan69v: - -named deconstructor -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_g3k1hy3j4qn9` -A :dt:`named deconstructor` is a :t:`construct` that matches the :t:`name` of -a :t:`field`. - -:dp:`fls_ujreg07979g8` -See :s:`NamedDeconstructor`. - -.. _fls_cvxdoycoytc5: - -named field selector -^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_cczpgxqdyh1e` -A :dt:`named field selector` is a :t:`field selector` where the selected -:t:`field` is indicated by an :t:`identifier`. - -:dp:`fls_hpw0n89ez5nw` -See :s:`NamedFieldSelector`. - -.. _fls_kp0mbopkbjer: - -named initializer -^^^^^^^^^^^^^^^^^ - -:dp:`fls_xwvz8i4jim7a` -A :dt:`named initializer` is a :t:`construct` that specifies the name and -initial :t:`value` of a :t:`field` in a :t:`struct expression`. - -:dp:`fls_aueznbw3lohl` -See :s:`NamedInitializer`. - -.. _fls_biwn3hxza37n: - -named loop expression -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_440dr5qix3ns` -A :dt:`named loop expression` is a :t:`loop expression` with a :t:`label`. - -.. _fls_WT1ZdxTZwUUE: - -named register argument -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_QBWHppNO8FPk` -A :dt:`named register argument` is a :t:`register argument` whose configuration -is bound to an :t:`identifier`. - -.. _fls_GesmsWSVhv3f: - -namespace -^^^^^^^^^ - -:dp:`fls_er8lcvnEqxa5` -A :dt:`namespace` is a logical grouping of :t:`[name]s` such that the -occurrence of a :t:`name` in one :t:`namespace` does not conflict with an -occurrence of the same :t:`name` in another :t:`namespace`. - -.. _fls_z3lxbjF4gaqV: - -NaN-boxing -^^^^^^^^^^ - -:dp:`fls_s956sJGwOa6z` -:dt:`NaN-boxing` is a technique for encoding :t:`[value]s` using the low order -bits of the mantissa of a 64-bit IEEE floating-point ``NaN``. - -.. _fls_3sp4twvfvb32: - -negation expression -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_pmn6cjamdt0a` -A :dt:`negation expression` is an :t:`expression` that negates its :t:`operand`. - -:dp:`fls_o1f35ud4klvv` -See :s:`NegationExpression`. - -.. _fls_6rlvd0u4w6h2: - -nesting import -^^^^^^^^^^^^^^ - -:dp:`fls_nhkqkdqo32xs` -A :dt:`nesting import` is a :t:`use import` that provides a common :t:`path` -prefix for its nested :t:`[use import]s`. - -:dp:`fls_z4d611glen13` -See :s:`NestingImport`. - -.. _fls_cwcbtnzbqmq2: - -never type -^^^^^^^^^^ - -:dp:`fls_m9v5j6detob4` -The :dt:`never type` is a :t:`type` that represents the result of a computation -that never completes. - -:dp:`fls_k5z1vjxepnfj` -See :s:`NeverType`. - -.. _fls_3vhflvajgqzd: - -non-reference pattern -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_tejled5izyue` -A :dt:`non-reference pattern` is any :t:`pattern` except -:t:`non-[binding pattern]s`, :t:`[path pattern]s`, :t:`[reference pattern]s`, -and :t:`[underscore pattern]s`. - -.. _fls_5u8ihVDp4mdb: - -not configuration predicate -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_BVMlBterkFYq` -A :dt:`not configuration predicate` is a :t:`configuration predicate` that -negates the Boolean :t:`value` of its nested :t:`configuration predicate`. - -:dp:`fls_9j9AaNcv0VNA` -See :s:`ConfigurationPredicateNot`. - -.. _fls_shgatqvpdqkg: - -not-equals expression -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_2hmynl94uusk` -A :dt:`not-equals expression` is a :t:`comparison expression` that tests for -inequality. - -:dp:`fls_5d6vvr9m35n2` -See :s:`NotEqualsExpression`. - -.. _fls_gqw1bzwexxt0: - -null -^^^^ - -:dp:`fls_8sh17t37b2ml` -A :dc:`null` :t:`value` denotes the address ``0``. - -.. _fls_a0qsojiymgjy: - -numeric literal -^^^^^^^^^^^^^^^ - -:dp:`fls_978ndaqdv4r` -A :dt:`numeric literal` is a :t:`literal` that denotes a number. - -:dp:`fls_swue4tma9fmf` -See :s:`NumericLiteral`. - -.. _fls_CmvuNXmowCz8: - -numeric literal pattern -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_azqQ3JxD5Lt7` -A :dt:`numeric literal pattern` is a :t:`pattern` that matches a :t:`numeric -literal`. - -:dp:`fls_QYDZm7pKy1nW` -See :s:`LiteralPattern`. - -.. _fls_rayjriyofmpa: - -numeric type -^^^^^^^^^^^^ - -:dp:`fls_cpdsj94l57af` -A :dt:`numeric type` is a :t:`type` whose :t:`[value]s` denote numbers. - -.. _fls_a226qzrb4iq9: - -object safe -^^^^^^^^^^^ - -:dp:`fls_oa2jiklr5nl2` -A :t:`trait` is :dt:`object safe` when it can be used as a -:t:`trait object type`. - -.. _fls_vomlqv7i1fc4: - -object safety -^^^^^^^^^^^^^ - -:dp:`fls_vqmng1l9ab8a` -:dt:`Object safety` is the process of determining whether a :t:`trait` can be -used as a :t:`trait object type`. - -.. _fls_bo889w63y7oi: - -obsolete range pattern -^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_ave42vwb45zb` -An :dt:`obsolete range pattern` is a :t:`range pattern` that uses obsolete -syntax to express an :t:`inclusive range pattern`. - -:dp:`fls_ta0wa8ta9ol4` -See :s:`ObsoleteRangePattern`. - -.. _fls_q47u2zq6clon: - -octal literal -^^^^^^^^^^^^^ - -:dp:`fls_pf4341vnqiin` -An :dt:`octal literal` is an :t:`integer literal` in base 8. - -:dp:`fls_8u0n6xu0mizm` -See ``OctalLiteral.`` - -.. _fls_pv4lok5qcn8y: - -operand -^^^^^^^ - -:dp:`fls_3mnn1au9ob6q` -An :dt:`operand` is an :t:`expression` nested within an expression. - -:dp:`fls_8299xfhdsd1` -See :s:`Operand`. - -.. _fls_smk8mi72lt57: - -operator expression -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_6ev01xwcfow1` -An :dt:`operator expression` is an :t:`expression` that involves an operator. - -:dp:`fls_qdszbyeuo7w1` -See :s:`OperatorExpression`. - -.. _fls_C5DiCsvsaBsj: - -opt-out trait bound -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_wS4EzN0N1GDP` -An :dt:`opt-out trait bound` is a :t:`trait bound` with :s:`Punctuation` ``?`` -that nullifies an implicitly added :t:`trait bound`. - - -.. _fls_LnPDQW3bnNUw: - -or-pattern -^^^^^^^^^^ - -:dp:`fls_LnPDQW3bnNUw` -An :dt:`or-pattern` is a :t:`pattern` that matches on one of two or more :t:`[pattern-without-alternation]s` and or-s them using character 0x7C (vertical line, i.e. ``|``). - -:dp:`fls_urIJ5JNHLhm6` -See :s:`Pattern`. - -.. _fls_gllzixm9yt9w: - -outer attribute -^^^^^^^^^^^^^^^ - -:dp:`fls_gffxnbilsqly` -An :dt:`outer attribute` is an :t:`attribute` that applies to a subsequent -:t:`item`. - -:dp:`fls_ty6ihy6x3kf` -See :s:`OuterAttribute`. - -.. _fls_toncretg92qh: - -outer block doc -^^^^^^^^^^^^^^^ - -:dp:`fls_531ggn1f8f6u` -An :dt:`outer block doc` is a :t:`block comment` that applies to a subsequent -:t:`non-[comment]` :t:`construct`. - -:dp:`fls_ddy9a66tpytp` -See :s:`OuterBlockDoc`. - -.. _fls_PuTD100sWO5N: - -outer doc comment -^^^^^^^^^^^^^^^^^ - -:dp:`fls_mgSEUNUPcPBs` -An :dt:`outer doc comment` is either an :t:`outer block doc` or an -:t:`outer line doc`. - -.. _fls_eqjbv8sovvfl: - -outer line doc -^^^^^^^^^^^^^^ - -:dp:`fls_m3u30fu8uac3` -An :dt:`outer line doc` is a :t:`line comment` that applies to a subsequent -:t:`non-[comment]` :t:`construct`. - -:dp:`fls_1ppwidw7szk5` -See :s:`OuterLineDoc`. - -.. _fls_de935b1pzd28: - -outline module -^^^^^^^^^^^^^^ - -:dp:`fls_xhe5gmr0r9zn` -An :dt:`outline module` is a :t:`module` with an -:s:`OutlineModuleSpecification`. - -:dp:`fls_wu5wqylzx9ke` -See :s:`OutlineModuleSpecification`. - -.. _fls_5LhIr1kOIEO5: - -outlives bound -^^^^^^^^^^^^^^ - -:dp:`fls_J5dt34II7Pm6` -An :dt:`outlives bound` is a :t:`trait bound` which requires that a -:t:`generic parameter` outlives a :t:`lifetime parameter`. - -.. _fls_XsGnaA47Nen0: - -output register -^^^^^^^^^^^^^^^ - -:dp:`fls_4METI8qE9JiY` -An :dt:`output register` is a :t:`register` whose :t:`register name` is -used in a :t:`register argument` subject to :t:`direction modifier` ``out``, -``lateout``, ``inout``, or ``inlateout``. - -.. _fls_t79aKPilX8jk: - -output register expression -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_w95YRZ4JjBxl` -An :dt:`output register expression` is an :t:`expression` that is assigned the -:t:`value` of a :t:`register`. - -:dp:`fls_8B3ldFZVy7PA` -See :s:`OutputRegisterExpression`. - -.. _fls_nhamq7xtz384: - -overlap -^^^^^^^ - -:dp:`fls_itkz9y19923k` -Two :t:`[value]s` :dt:`overlap` when their memory locations overlap, or both -values are elements of the same :t:`array`. - -.. _fls_ke52l9lsvyu2: - -owner -^^^^^ - -:dp:`fls_7vwwhberexeb` -An :dt:`owner` is a :t:`variable` that holds a :t:`value`. - -.. _fls_1gmetz8qtr0l: - -ownership -^^^^^^^^^ - -:dp:`fls_tu4zt8twucsz` -:dt:`Ownership` is a property of :t:`[value]s` that is central to the resource -management model of Rust. - -.. _fls_wzpivxkhpln: - -panic -^^^^^ - -:dp:`fls_t3kpbnmohtp6` -A :dt:`panic` is an abnormal program state caused by invoking :t:`macro` -:std:`core::panic`. - -.. _fls_fl56jfxbj0f: - -parenthesized expression -^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_yu1x2rr7cewa` -A :dt:`parenthesized expression` is an :t:`expression` that groups other -expressions. - -:dp:`fls_p9exa6fpplfu` -See :s:`ParenthesizedExpression`. - -.. _fls_ww6nyinsw1lr: - -parenthesized pattern -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_7j12dwsx9ghg` -A :dt:`parenthesized pattern` is a :t:`pattern` that controls the precedence of -its :t:`[subpattern]s`. - -:dp:`fls_rwt31e8m694i` -See :s:`ParenthesizedPattern`. - -.. _fls_gilx8zikdq9k: - -parenthesized type -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_pamypc7t7l5n` -A :dt:`parenthesized type` is a :t:`type` that disambiguates the interpretation -of :t:`[lexical element]s`. - -:dp:`fls_lovkvqoni3xs` -See :s:`ParenthesizedTypeSpecification`. - -.. _fls_fULM1oCKSakS: - -partially hygienic -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_Qh8V0Y08dNoa` -An :t:`identifier` is :dt:`partially hygienic` when it has -:t:`mixed site hygiene`. - -.. _fls_wqbd5lxki2al: - -passing convention -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_eqgsg8j9btic` -A :dt:`passing convention` is the mechanism that defines how a :t:`value` is -transferred between :t:`[place]s`. - -.. _fls_9zl72vtkgkuo: - -path -^^^^ - -:dp:`fls_u3jyud6mhy1f` -A :dt:`path` is a sequence of :t:`[path segment]s` logically separated by -:dt:`namespace qualifier` ``::`` that resolves to an :t:`entity`. - -.. _fls_1xdj34py8zc3: - -path expression -^^^^^^^^^^^^^^^ - -:dp:`fls_4ik66nmvx5hn` -A :dt:`path expression` is a :t:`path` that acts as an :t:`expression`. - -:dp:`fls_3qjpjqm0legc` -See :s:`PathExpression`. - -.. _fls_EIFtIeLGZNy5: - -path expression resolution -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_WYcEVyc3SHuK` -:dt:`Path expression resolution` is a form of :t:`path resolution` that applies -to a :t:`path expression`. - -.. _fls_ptikwcw3b20l: - -path pattern -^^^^^^^^^^^^ - -:dp:`fls_vacvk3t26ctg` -A :dt:`path pattern` is a :t:`pattern` that matches a :t:`constant`, a -:t:`unit enum variant`, or a :t:`unit struct constant` indicated by a -:t:`path`. - -:dp:`fls_9fudbxoyq8k4` -See :s:`PathPattern`. - -.. _fls_J8kiBhcawvnj: - -path resolution -^^^^^^^^^^^^^^^ - -:dp:`fls_uy9Ai9vwTkjB` -:dt:`Path resolution` is a form of :t:`resolution` that applies to a :t:`path`. - -.. _fls_xb54s9cs7h08: - -path segment -^^^^^^^^^^^^ - -:dp:`fls_gsumebjc2bsp` -A :dt:`path segment` is a constituent of a :t:`path`. - -:dp:`fls_m067uq7fo66i` -See :s:`PathSegment`, :s:`SimplePathSegment`, :s:`TypePathSegment`. - -.. _fls_uj1o721im5lb: - -pattern -^^^^^^^ - -:dp:`fls_9wwt9k1xlm6n` -A :dt:`pattern` is a :t:`construct` that matches a :t:`value` which satisfies -all the criteria of the pattern. - -:dp:`fls_9va04w9jgdyp` -See :s:`Pattern`. - -.. _fls_48mv0zecb0un: - -pattern matching -^^^^^^^^^^^^^^^^ - -:dp:`fls_y3oputy9e0sz` -:t:`Pattern matching` is the process of matching a :t:`pattern` against a :t:`value`. - -.. _fls_cptagvgpgnze: - -pattern-without-alternation -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_brussjs3wo6r` -A :dt:`pattern-without-alternation` is a :t:`pattern` that cannot be alternated. - -:dp:`fls_fmysn3eezr54` -See :s:`PatternWithoutAlternation`. - -.. _fls_yeQOZKPoNzw3: - -pattern-without-range -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_LSEOvAwUM7g6` -A :dt:`pattern-without-range` is a :t:`pattern-without-alternation` that -excludes :t:`[range pattern]s`. - -:dp:`fls_Rj8ir4k0K811` -See :s:`PatternWithoutRange`. - -.. _fls_5zjHBZMsCqJZ: - -place -^^^^^ - -:dp:`fls_uCTiUBWHMPY9` -A :dt:`place` is a location where a :t:`value` resides. - -.. _fls_7x6jhh0sz2f: - -place expression -^^^^^^^^^^^^^^^^ - -:dp:`fls_z6mgu2mk142r` -A :dt:`place expression` is an :t:`expression` that represents a memory -location. - -.. _fls_tshbqttxdox1: - -place expression context -^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_fqcx8suiy5k` -A :dt:`place expression context` is a :t:`construct` that may evaluate its -operand as a memory location. - -.. _fls_dr6wbsqjd2qm: - -plane -^^^^^ - -:dp:`fls_x1wbguoqdsf9` -In :t:`Unicode`, a :dt:`plane` is a continuous group of 65,536 -:t:`[code point]s`. - -.. _fls_HnJEHyUiTpb1: - -pointer -^^^^^^^ - -:dp:`fls_DRjhMWo9mjoF` -A :dt:`pointer` is a :t:`value` of a :t:`pointer type`. - -.. _fls_o5o1ssqqD7Jg: - -pointer type -^^^^^^^^^^^^ - -:dp:`fls_F2dUxEa4nheL` -A :dt:`pointer type` is a :t:`type` whose values indicate memory locations. - -.. _fls_Q0r8JkqAP6Of: - -positional register argument -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_GJd6i52P3KM3` -A :dt:`positional register argument` is a :t:`register argument` whose -configuration is not bound to an :t:`identifier`. - -.. _fls_ukvdoqo68y5b: - -precedence -^^^^^^^^^^ - -:dp:`fls_sz93844rqc4r` -:dt:`Precedence` is the order by which :t:`[expression]s` are evaluated in the -presence of other expressions. - -.. _fls_8Gn72FJBarfb: - -prelude -^^^^^^^ - -:dp:`fls_D0PJioOZjKNN` -A :dt:`prelude` is a collection of :t:`entities ` that are -automatically brought :t:`in scope` of every :t:`module` in a :t:`crate`. - -.. _fls_AWySDxPgypiw: - -prelude entity -^^^^^^^^^^^^^^ - -:dp:`fls_2lU7RUjzFlsz` -A :dt:`prelude entity` is an :t:`entity` declared in a :t:`prelude`. - -.. _fls_FYn5JqPOhiIs: - -prelude name -^^^^^^^^^^^^ - -:dp:`fls_6Jk7fUAK122A` -A :dt:`prelude name` is a :t:`name` of a :t:`prelude entity`. - -.. _fls_fikexts17v7a: - -primitive representation -^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_bydly1rt63pf` -:dt:`Primitive representation` is the :t:`type representation` of -:t:`[integer type]s`. - -.. _fls_mk3sa7OvtJvB: - -principal trait -^^^^^^^^^^^^^^^ - -:dp:`fls_YtYOHoPaMPFX` -The :dt:`principal trait` of :t:`trait object type` is its first :t:`trait bound`. - -.. _fls_v1u1mevpj0kj: - -private visibility -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_duop22hyaweq` -:dt:`Private visibility` is a kind of :t:`visibility` that allows a :t:`name` -to be referred to only by the current :t:`module` of the :t:`entity`, and its -descendant :t:`[module]s`. - -.. _fls_kCA6SW8bUq5x: - -proc-macro crate -^^^^^^^^^^^^^^^^ - -.. _fls_AjjdLZWiL9Tq: - -:dp:`fls_DfTszT1PjV7o` -A :dt:`proc-macro crate` is a :t:`crate` whose :t:`crate type` is ``proc-macro``. - -.. _fls_sp5wdsxwmxf: - -procedural macro -^^^^^^^^^^^^^^^^ - -:dp:`fls_u4utpx4zgund` -A :dt:`procedural macro` is a :t:`macro` that encapsulates syntactic -transformations in a :t:`function`. - -.. _fls_SIFecOZqloyx: - -program entry point -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_9m37hN9zgEQf` -A :dt:`program entry point` is a :t:`function` that is invoked at the start of -a Rust program. - -.. _fls_v2rjlovqsdyr: - -public visibility -^^^^^^^^^^^^^^^^^ - -:dp:`fls_6cfxqtl921ko` -:dt:`Public visibility` is a kind of :t:`visibility` that allows a :t:`name` -to be referred to from arbitrary :t:`module` ``M`` as long as the ancestor -:t:`[module]s` of the related :t:`entity` can be referred to from ``M``. - -.. _fls_hdwmw3jbwefi: - -punctuator -^^^^^^^^^^ - -:dp:`fls_gwqgi0b7jxmu` -A :dt:`punctuator` is a character or a sequence of characters in category -:s:`Punctuation`. - -.. _fls_sgwvmnoio1ql: - -pure identifier -^^^^^^^^^^^^^^^ - -:dp:`fls_6pez8fyiew0k` -A :dt:`pure identifier` is an :t:`identifier` that does not include -:t:`[weak keyword]s`. - -.. _fls_O6CFtnpN3UEE: - -qualified path expression -^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_wKAS6FxqGmTf` -A :dt:`qualified path expression` is a :t:`path expression` that resolves -through a :t:`qualified type`. - -:dp:`fls_MXxJn64eJpC5` -See :s:`QualifiedPathExpression`. - -.. _fls_Qv0UvhSfwBuM: - -qualified type -^^^^^^^^^^^^^^ - -:dp:`fls_e7YyZXOFo6ei` -A :dt:`qualified type` is a :t:`type` that is restricted to a set of -:t:`[implementation]s` that exhibit :t:`implementation conformance` to a -:t:`qualifying trait`. - -:dp:`fls_a4heXjzO3jem` -See :s:`QualifiedType`. - -.. _fls_koVlQq8aPdPv: - -qualified type path -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_S0QT9ib38i8E` -A :dt:`qualified type path` is a :t:`type path` that resolves through a -:t:`qualified type`. - -:dp:`fls_RR8fFLD7Rxlt` -See :s:`QualifiedTypePath`. - -.. _fls_B0m82A8jIerQ: - -qualifying trait -^^^^^^^^^^^^^^^^ - -:dp:`fls_zKY1dWBMrqXZ` -A :dt:`qualifying trait` is a :t:`trait` that imposes a restriction on a -:t:`qualified type`. - -:dp:`fls_z6OeUWBnec90` -See :s:`QualifyingTrait`. - -.. _fls_tbvugpuvcluj: - -range expression -^^^^^^^^^^^^^^^^ - -:dp:`fls_bffrbucfwu7` -A :dt:`range expression` is an :t:`expression` that constructs a range. - -:dp:`fls_1jk43yvxa8ks` -See :s:`RangeExpression`. - -.. _fls_mdvdxr6u13fw: - -range expression high bound -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_c70pj8w15nmc` -A :dt:`range expression high bound` is an :t:`operand` that specifies the end -of a range. - -:dp:`fls_yxem0ckicxav` -See :s:`RangeExpressionHighBound`. - -.. _fls_smvgd160eynr: - -range expression low bound -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_t10o1p950u00` -A :dt:`range expression low bound` is an :t:`operand` that specifies the start -of a range. - -:dp:`fls_vmb2z7oh6gzm` -See :s:`RangeExpressionLowBound`. - -.. _fls_6pxg401r6juc: - -range pattern -^^^^^^^^^^^^^ - -:dp:`fls_vf42zdyq23lc` -A :dt:`range pattern` is a :t:`pattern` that matches :t:`[value]s` which fall -within a range. - -:dp:`fls_r36uf3y2denr` -See ``RangePattern``. - -.. _fls_3ls9xlgt8ei1: - -range pattern bound -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_l9xq96bjs4o2` -A :dt:`range pattern bound` is a constraint on the range of a -:t:`range pattern`. - -:dp:`fls_80736cs3axo4` -See :s:`RangePatternBound`. - -.. _fls_y4rv5cbowvwg: - -range pattern high bound -^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_arp7y7yme7yp` -A :dt:`range pattern high bound` is a :t:`range pattern bound` that specifies -the end of a range. - -:dp:`fls_dnwqcswftw71` -See :s:`RangePatternHighBound`. - -.. _fls_laev4lmmv0cw: - -range pattern low bound -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_rt7q0msh3op4` -A :dt:`range pattern low bound` is a :t:`range pattern bound` that specifies -the start of a range. - -:dp:`fls_j695o93wsu3i` -See :s:`RangePatternLowBound`. - -.. _fls_iqpxlg7w3cvf: - -range-from expression -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_6enyv2oa4abq` -A :dt:`range-from expression` is a :t:`range expression` that specifies an -included :t:`range expression low bound`. - -:dp:`fls_e1smn0b478ik` -See :s:`RangeFromExpression`. - -.. _fls_125h4p4zt86q: - -range-from-to expression -^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_nzf6y64jz83f` -A :dt:`range-from-to expression` is a :t:`range expression` that specifies an -included :t:`range expression low bound` and an excluded -:t:`range expression high bound`. - -:dp:`fls_mjbxfjulryt` -See :s:`RangeFromToExpression`. - -.. _fls_8z8nrblarxrv: - -range-full expression -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_6mchm7kb7i41` -A :dt:`range-full expression` is a :t:`range expression` that covers the whole -range of a :t:`type`. - -:dp:`fls_u7kd8w5g2icd` -See :s:`RangeFullExpression`. - -.. _fls_tie80ejz8s19: - -range-inclusive expression -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_9vja0wev84a7` -A :dt:`range-inclusive expression` is a :t:`range expression` that specifies an -included :t:`range expression low bound` and an included -:t:`range expression high bound`. - -:dp:`fls_lpcsb8dtldk3` -See :s:`RangeInclusiveExpression`. - -.. _fls_etvgkb8zcfpd: - -range-to expression -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_urnfp1j9d5v4` -A :dt:`range-to expression` is a :t:`range expression` that specifies an -excluded :t:`range expression high bound`. - -:dp:`fls_lft9cd7h8cfv` -See :s:`RangeToExpression`. - -.. _fls_ap5754dfltt5: - -range-to-inclusive expression -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_t4fjanjvkd69` -A :dt:`range-to-inclusive expression` is a :t:`range expression` that specifies -an included :t:`range expression high bound`. - -:dp:`fls_krei7lc6lo8q` -See :s:`RangeToInclusiveExpression`. - -.. _fls_YLhE2qpzYXRK: - -raw borrow expression -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_Fe39wLb0vvEg` -A :dt:`raw borrow expression` is an :t:`expression` that creates a :t:`raw pointer` to the memory location of its :t:`operand` without incurring a :t:`borrow`. - -:dp:`fls_I71jq8BGyLqi` -See :s:`RawBorrowExpression`. - -.. _fls_ipeh92kh17ze: - -raw byte string literal -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_8v5k3wemy4tl` -A :dt:`raw byte string literal` is a :t:`simple byte string literal` that does -not recognize :t:`[escaped character]s`. - -:dp:`fls_5x71i3ay3na2` -See :s:`RawByteStringLiteral`. - -.. _fls_yGGvg3e0nPOh: - -raw c string literal -^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_qhWBzqoYZL0e` -A :dt:`raw c string literal` is a :t:`simple c string literal` that does not -recognize :t:`[escaped character]s`. - -:dp:`fls_WpFJyq6q4k6E` -See :s:`RawCStringLiteral`. - -.. _fls_uv4dyt4gi32x: - -raw pointer -^^^^^^^^^^^ - -:dp:`fls_rbdilcmt2cns` -A :dt:`raw pointer` is a pointer of a :t:`raw pointer type`. - -.. _fls_9los8hwh60z0: - -raw pointer type -^^^^^^^^^^^^^^^^ - -:dp:`fls_wspawcoqxfbh` -A :dt:`raw pointer type` is an :t:`indirection type` without safety and -liveness guarantees. - -:dp:`fls_ctksliaxhzo9` -See :s:`RawPointerTypeSpecification`. - -.. _fls_echjohx6fjc: - -raw string literal -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_48t4v316951j` -A :dt:`raw string literal` is a :t:`simple string literal` that does not -recognize :t:`[escaped character]s`. - -:dp:`fls_26ol7lrnux94` -See :s:`RawStringLiteral`. - -.. _fls_sAe1HaaVSPvP: - -reachable control flow path -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_IxrvzuBg8j3E` -A :dt:`reachable control flow path` is a control flow path that can be -taken by the execution of a program between two given points in the program. - -.. _fls_nfb3ciarl50w: - -receiver operand -^^^^^^^^^^^^^^^^ - -:dp:`fls_odbg4bizvqxq` -A :dt:`receiver operand` is an :t:`operand` that denotes the :t:`value` whose -:t:`method` is being invoked by a :t:`method call expression`. - -:dp:`fls_4rme1x6romeg` -See :s:`ReceiverOperand`. - -.. _fls_Kpkm0J40xq5J: - -receiver type -^^^^^^^^^^^^^ - -:dp:`fls_vgQmMlpFas5t` -A :dt:`receiver type` is the :t:`type` of a :t:`receiver operand`. - -.. _fls_nG6ikjLsCW7m: - -record enum variant -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_NWyvPQmOIjo2` -A :dt:`record enum variant` is an :t:`enum variant` with a -:s:`RecordStructFieldList`. - -.. _fls_jdd6h8pdp30x: - -record struct -^^^^^^^^^^^^^ - -:dp:`fls_qyd7kqnpjs2` -A :dt:`record struct` is a :t:`struct` with a :s:`RecordStructFieldList`. - -:dp:`fls_rqs5rdnhkwnx` -See :s:`RecordStructDeclaration`. - -.. _fls_hzkwzbk5wp54: - -record struct field -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_lb0t10evec6z` -A :dt:`record struct field` is a :t:`field` of a :t:`record struct type`. - -:dp:`fls_bjwmhxf3ae14` -See :s:`RecordStructField`. - -.. _fls_at2caaqlpva1: - -record struct pattern -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_q7njznxhmmw` -A :dt:`record struct pattern` is a :t:`pattern` that matches a -:t:`enum variant value`, a :t:`struct value`, or a :t:`union value`. - -:dp:`fls_viwieu1p3hds` -See :s:`RecordStructPattern`. - -.. _fls_uthd12hz3h4v: - -record struct type -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_mgrz3o51gbis` -A :dt:`record struct type` is the :t:`type` of a :t:`record struct`. - -.. _fls_cPs5C1chWmce: - -record struct value -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_SMBIc0JMck1H` -A :dt:`record struct value` is a :t:`value` of a :t:`record struct type`. - -.. _fls_94fkxohlnq9i: - -recursive type -^^^^^^^^^^^^^^ - -:dp:`fls_2t8qom6dhcjb` -A :dt:`recursive type` is a :t:`type` that may define other types within its -:t:`type specification`. - -.. _fls_onv3cs5tckgo: - -reference -^^^^^^^^^ - -:dp:`fls_s82y4hsuytiq` -A :dt:`reference` is a :t:`value` of a :t:`reference type`. - -.. _fls_1XGsXRZIFnqL: - -reference identifier pattern -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_jQs6oJ4RFBPN` -A :dt:`reference identifier pattern` is an :t:`identifier pattern` with -:t:`keyword` ``ref``. - -.. _fls_kiy6b1wbn0a3: - -reference pattern -^^^^^^^^^^^^^^^^^ - -:dp:`fls_ebshqnhmwgow` -A :dt:`reference pattern` is a :t:`pattern` that dereferences a :t:`pointer` -that is being matched. - -:dp:`fls_rghv5drrqxs1` -See :s:`ReferencePattern`. - -.. _fls_uw32xmrfgzcd: - -reference type -^^^^^^^^^^^^^^ - -:dp:`fls_l3knopsdlyf2` -A :dt:`reference type` is an :t:`indirection type` with :t:`ownership`. - -:dp:`fls_jzjatdpxqt9u` -See :s:`ReferenceTypeSpecification`. - -.. _fls_h8x0u32wfz8v: - -referent -^^^^^^^^ - -:dp:`fls_78ipj8avpwzl` -A :dt:`referent` is the :t:`value` pointed-to by a :t:`reference`. - -.. _fls_bkwy183h9ygt: - -refutability -^^^^^^^^^^^^ - -:dp:`fls_gzjrfx19fg40` -:dt:`Refutability` is a property of :t:`[pattern]s` that expresses the ability -to match all possible :t:`[value]s` of a :t:`type`. - -.. _fls_v99joc4m6cup: - -refutable constant -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_mc6hsomq08uu` -A :dt:`refutable constant` is a :t:`constant` of a :t:`refutable type`. - -.. _fls_srdcx5oi4dcp: - -refutable pattern -^^^^^^^^^^^^^^^^^ - -:dp:`fls_re7qz78koman` -A :dt:`refutable pattern` is a :t:`pattern` that has a possibility of not -matching the :t:`value` it is being matched against. - -.. _fls_dkq1h6p9yaar: - -refutable type -^^^^^^^^^^^^^^ - -:dp:`fls_l2yz6jeehm52` -A :dt:`refutable type` is a :t:`type` that has more than one :t:`value`. - -.. _fls_T84qaJMZzMbb: - -register -^^^^^^^^ - -:dp:`fls_fVdSybu8DW8w` -A :dt:`register` is a hardware component capable of holding data that can be -read and written. - -.. _fls_ISWWmgKjfYwt: - -register argument -^^^^^^^^^^^^^^^^^ - -:dp:`fls_rNoFdCKbVmRC` -A :dt:`register argument` is a :t:`construct` that configures the input -and output of a :t:`register`, and optionally binds the configuration to an -:t:`identifier`. - -:dp:`fls_aof7O9XREo2S` -See :s:`RegisterArgument`. - -.. _fls_2qKUiHcfmZQ6: - -register class -^^^^^^^^^^^^^^ - -:dp:`fls_2H0OYS733VJl` -A :dt:`register class` represents a set of :t:`[register]s`. - -.. _fls_8gC17CgCS9n1: - -register class argument -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_ksLXAyPLx9IL` -A :dt:`register class argument` is a :t:`register argument` that uses a -:t:`register class name`. - -.. _fls_xZTkANlRsKRt: - -register class name -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_QsSFoL0UyRRB` -A :dt:`register class name` is a target-specific string that identifies a -:t:`register class`. - -:dp:`fls_Y1ZpiFAV2c1A` -See :s:`RegisterClassName`. - -.. _fls_7KIReJZLKdeK: - -register expression -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_2cVy6XfOQ4QG` -A :dt:`register expression` is either an :t:`input-output register expression` -or a :t:`simple register expression`. - -:dp:`fls_YEzo09cqWUUy` -See :s:`RegisterExpression`. - -.. _fls_kbBK666iBS2X: - -register name -^^^^^^^^^^^^^ - -:dp:`fls_U5r8Ypnjah5E` -A :dt:`register name` is either the :t:`explicit register name` of a -:t:`register`, or the :t:`register class name` of the :t:`register class` a -:t:`register` belongs to. - -:dp:`fls_WeyiFrnGgWPn` -See :s:`RegisterName`. - -.. _fls_foh6xELWBsY9: - -register parameter -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_JicHMIj5dlxJ` -A :dt:`register parameter` is a substring delimited by characters 0x7B (left -curly bracket) and 0x7D (right curly bracket) that is substituted with a -:t:`register argument` in an :t:`assembly instruction`. - -.. _fls_NDpKXnlmnN7M: - -register parameter modifier -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_8BdOnxHZS0Qi` -A :dt:`register parameter modifier` is a substring that starts with character -0x3A (colon), follows a :t:`register parameter`, and changes the formatting of -the related :t:`register parameter`. - -.. _fls_JnhUWipah0nO: - -remainder assignment -^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_58eDC2XtQcaR` -For :dt:`remainder assignment`, see :t:`remainder assignment expression`. - -.. _fls_mio7pagghcks: - -remainder assignment expression -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_en7ytqvefw7j` -A :dt:`remainder assignment expression` is a -:t:`compound assignment expression` that uses remainder division. - -:dp:`fls_rkk80quk8uzc` -See :s:`RemainderAssignmentExpression`. - -.. _fls_f15h4919ln3k: - -remainder expression -^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_l6muwnclm1do` -A :dt:`remainder expression` is an :t:`arithmetic expression` that uses -remainder division. - -:dp:`fls_h98qlby2uiru` -See :s:`RemainderExpression`. - -.. _fls_8ibsdx4dx6s7: - -renaming -^^^^^^^^ - -:dp:`fls_cp8u9kq44o8a` -A :dt:`renaming` provides an alternative :t:`name` for an existing name. - -:dp:`fls_8inznqig2ibr` -See :s:`Renaming`. - -.. _fls_b35oy3nnzixm: - -repeat operand -^^^^^^^^^^^^^^ - -:dp:`fls_ol2y1og2jwss` -A :dt:`repeat operand` is an :t:`operand` that specifies the element being -repeated in an :t:`array repetition constructor`. - -:dp:`fls_r4acyux78txu` -See :s:`RepeatOperand`. - -.. _fls_r2yjjhrvr9qi: - -repetition operator -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_67907pk7uogl` -A :dt:`repetition operator` is a :t:`construct` that indicates the number -of times a :t:`macro repetition in matching` or a -:t:`macro repetition in transcription` can be repeated. - -:dp:`fls_hiasmmpr2jks` -See :s:`MacroRepetitionOperator`. - -.. _fls_o34kkn5pi0sh: - -representation -^^^^^^^^^^^^^^ - -:dp:`fls_69j7pq2o1iu` -See :t:`type representation`. - -.. _fls_TSbBt6WzropN: - -representation modifier -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_BCvXL7HkXqdZ` -A :dt:`representation modifier` is a :t:`construct` that modifies the -:t:`alignment` of a :t:`type`. - -:dp:`fls_TAVyjj66UBUo` -See :s:`Alignment`. - -.. _fls_x7yd6o4akrrg: - -reserved keyword -^^^^^^^^^^^^^^^^ - -:dp:`fls_b67hj7fdbq4s` -A :dt:`reserved keyword` is a :t:`keyword` that is not yet in use. - -:dp:`fls_hp9iqdrkt0cg` -See :s:`ReservedKeyword`. - -.. _fls_O5iuGATZgyBu: - -resolution -^^^^^^^^^^ - -:dp:`fls_PQjEvLs5cE4y` -:dt:`Resolution` is the process of finding a unique interpretation for a -:t:`field access expression`, a :t:`method call expression`, or a :t:`path`. - -.. _fls_uuo1qvrz1i0k: - -rest pattern -^^^^^^^^^^^^ - -:dp:`fls_xngp3h1znw9o` -A :dt:`rest pattern` is a :t:`pattern` that matches zero or more elements that -have not already been matched. - -:dp:`fls_rnmhg04u0oga` -See :s:`RestPattern`. - -.. _fls_7tl9qo8yj8xh: - -return expression -^^^^^^^^^^^^^^^^^ - -:dp:`fls_vnupfc6s0s7b` -A :dt:`return expression` is an :t:`expression` that optionally yields a -:t:`value` and causes control flow to return to the caller. - -:dp:`fls_phd8zrsyuzu7` -See :s:`ReturnExpression`. - -.. _fls_b8dbm1bs65kw: - -return type -^^^^^^^^^^^ - -:dp:`fls_cwucgbmmhnnm` -A :dt:`return type` is the :t:`type` of the result a :t:`function` returns. - -:dp:`fls_utuprsem6n58` -See :s:`ReturnType`. - -.. _fls_76o7m8vny72n: - -right operand -^^^^^^^^^^^^^ - -:dp:`fls_e1j9s4odze9b` -A :dt:`right operand` is an :t:`operand` that appears on the right-hand side of -a :t:`binary operator`. - -:dp:`fls_hq7x1t5dmdlp` -See :s:`RightOperand`. - -.. _fls_9u67noriaxfe: - -rule matching -^^^^^^^^^^^^^ - -:dp:`fls_dux9js5oixjd` -:dt:`Rule matching` is the process of consuming a :s:`TokenTree` in an attempt -to fully satisfy the :t:`macro matcher` of a :t:`macro rule` that belongs to a -resolved :t:`declarative macro`. - -.. _fls_fki32ns69q4j: - -rustc -^^^^^ - -:dp:`fls_zdgbeixirjfm` -:dt:`rustc` is a compiler that implements the FLS. - -.. _fls_Q4MRIo7cWv5K: - -safety invariant -^^^^^^^^^^^^^^^^ - -:dp:`fls_wRZfAmTmMGTX` -A :dt:`safety invariant` is an invariant that when violated may result in -:t:`undefined behavior`. - -.. _fls_XeMNghZZOBqL: - -scalar type -^^^^^^^^^^^ - -:dp:`fls_GgBqFW2NywoA` -A :dt:`scalar type` is either a :c:`bool` :t:`type`, a :c:`char` :t:`type`, or -a :t:`numeric type`. - -.. _fls_fj8mdxi967px: - -scope -^^^^^ - -:dp:`fls_fachaj550cq1` -A :dt:`scope` is a region of program text where a :t:`name` can be referred to. - -.. _fls_xZUiNkBN5e00: - -scope hierarchy -^^^^^^^^^^^^^^^ - -:dp:`fls_Spcc3L9X939d` -The :dt:`scope hierarchy` reflects the nesting of :t:`[scope]s` as introduced -by :t:`[scoping construct]s`. - -.. _fls_rfk06mm3pdxg: - -selected field -^^^^^^^^^^^^^^ - -:dp:`fls_8otlvwlqrd4e` -A :dt:`selected field` is a :t:`field` that is selected by a -:t:`field access expression`. - -.. _fls_9o2hcy6t7dac: - -Self -^^^^ - -:dp:`fls_q6whqbfusswf` -:dc:`Self` is either an implicit :t:`type parameter` in :t:`[trait]s` or an -implicit :t:`type alias` in :t:`[implementation]s`. :c:`Self` refers to the -:t:`type` that implements a :t:`trait`. - -.. _fls_6wjlbzmlx9n4: - -self parameter -^^^^^^^^^^^^^^ - -:dp:`fls_ksne48eip15` -A :dt:`self parameter` is a :t:`function parameter` expressed by :t:`keyword` -``self``. - -.. _fls_jq213cesxhyp: - -self public modifier -^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_ln3bzqgctfym` -A :dt:`self public modifier` is a :t:`visibility modifier` that grants a -:t:`name` :t:`private visibility`. - -:dp:`fls_21cvbfjpckkt` -See :s:`SelfPublicModifier`. - -.. _fls_exMZlNMxQvP7: - -Self scope -^^^^^^^^^^ - -:dp:`fls_pSvqWGRmFmH0` -A :dt:`Self scope` is a :t:`scope` for :c:`Self`. - -.. _fls_8spw41g0dbqw: - -send type -^^^^^^^^^ - -:dp:`fls_qfkng98dw6yy` -A :dt:`send type` is a :t:`type` that implements the :std:`core::marker::Send` -:t:`trait`. - -.. _fls_at8q1svh3isg: - -separator -^^^^^^^^^ - -:dp:`fls_128xny4qfcj5` -A :dt:`separator` is a character or a string that separates adjacent -:t:`[lexical element]s`. - -.. _fls_rtgis2k7by2r: - -sequence type -^^^^^^^^^^^^^ - -:dp:`fls_lk1oslxh8h9p` -A :dt:`sequence type` represents a sequence of elements. - -.. _fls_HUklMSWzx8Mg: - -shadowing -^^^^^^^^^ - -:dp:`fls_li3NXOPEH9cL` -:dt:`Shadowing` is a property of :t:`[name]s`. A :t:`name` is said to be -:dt:`shadowed` when another :t:`name` with the same characters is introduced -in the same :t:`scope` within the same :t:`namespace`, effectively hiding it. - -.. _fls_c9xwhhg639u5: - -shared borrow -^^^^^^^^^^^^^ - -:dp:`fls_gmbskxin90zi` -A :dt:`shared borrow` is a :t:`borrow` produced by evaluating an -:t:`immutable borrow expression`. - -.. _fls_18xazs7sp4: - -shared reference -^^^^^^^^^^^^^^^^ - -:dp:`fls_cspa4c5mscnw` -A :dt:`shared reference` is a :t:`value` of a :t:`shared reference type`. - -.. _fls_antrblstppyf: - -shared reference type -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_8z9wb3eu5yp1` -A :dt:`shared reference type` is a :t:`reference type` not subject to -:t:`keyword` ``mut``. - -.. _fls_o8EVuKgr0Y98: - -shift left assignment -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_6adWrtvab6Tw` -For :dt:`shift left assignment`, see :t:`shift left assignment expression`. - -.. _fls_29n0oe4d7lwa: - -shift left assignment expression -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_j15ke2p8cjfp` -A :dt:`shift left assignment expression` is a -:t:`compound assignment expression` that uses bit shift left arithmetic. - -:dp:`fls_ozu74fsakomn` -See :s:`ShiftLeftAssignmentExpression`. - -.. _fls_sru4wi5jomoe: - -shift left expression -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_phiv6k4emauc` -A :dt:`shift left expression` is a :t:`bit expression` that uses bit shift left -arithmetic. - -:dp:`fls_56lu9kenzig9` -See :s:`ShiftLeftExpression`. - -.. _fls_V5LMAe8ijiMQ: - -shift right assignment -^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_XuwcHjwHdyA8` -For :dt:`shift right assignment`, see :t:`shift right assignment expression`. - -.. _fls_cqfzbsasnd1t: - -shift right assignment expression -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_1jpnp7hatlmu` -A :dt:`shift right assignment expression` is a -:t:`compound assignment expression` that uses bit shift right arithmetic. - -:dp:`fls_naqzlebew1uf` -See :s:`ShiftRightAssignmentExpression`. - -.. _fls_dj6epbraptqn: - -shift right expression -^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_j6itily0u0k9` -A :dt:`shift right expression` is a :t:`bit expression` that uses bit shift -right arithmetic. - -:dp:`fls_ex1mopil8w1p` -See :s:`ShiftRightExpression`. - -.. _fls_5sxhx0w3d63z: - -shorthand deconstructor -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_22yxrde244w8` -A :dt:`shorthand deconstructor` is a :t:`construct` that matches the :t:`name` -of a :t:`field` and binds the :t:`value` of the matched :t:`field` to a -:t:`binding`. - -:dp:`fls_rlo4237bgbwt` -See :s:`ShorthandDeconstructor`. - -.. _fls_oa4p10yles30: - -shorthand initializer -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_bgxxg48snck1` -A :dt:`shorthand initializer` is a :t:`construct` that specifies the :t:`name` -of a :t:`field` in a :t:`struct expression`. - -:dp:`fls_qc08ydgmqudi` -See :s:`ShorthandInitializer`. - -.. _fls_nmw95nc951iu: - -signed integer type -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_vcronf7l2bhy` -A :dt:`signed integer type` is an :t:`integer type` whose :t:`[value]s` denote -negative whole numbers, zero, and positive whole numbers. - -.. _fls_4GvXiDfcPlRD: - -simple byte string literal -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_XpbU4Up0Aza8` -A :dt:`simple byte string literal` is a :t:`byte string literal` that consists -of multiple :s:`[AsciiCharacter]s`. - -:dp:`fls_OfI70zK68TnQ` -See :s:`SimpleByteStringLiteral`. - -.. _fls_fx2hhB0HHSUG: - -simple c string literal -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_qoHXrmds9SgI` -A :dt:`simple c string literal` is any :t:`Unicode` character except characters -0x0D (carriage return), 0x22 (quotation mark), 0x5C (reverse solidus) and 0x00 -(null byte). - -:dp:`fls_ggm5FNUqg9EY` -See :s:`SimpleCStringLiteral`. - -.. _fls_6mcm7xdcyn40: - -simple import -^^^^^^^^^^^^^ - -:dp:`fls_jrlzpoauui9g` -A :dt:`simple import` is a :t:`use import` that binds a :t:`simple path` to a -local :t:`name` by using an optional :t:`renaming`. - -:dp:`fls_ta5t4h25unsw` -See :s:`SimpleImport`. - -.. _fls_o5kv9lrtz4fq: - -simple path -^^^^^^^^^^^ - -:dp:`fls_db91duoug4eb` -A :dt:`simple path` is a :t:`path` whose :t:`[path segment]s` consist of either -:t:`[identifier]s` or certain :t:`[keyword]s`. - -:dp:`fls_cm7ysyfrdwom` -See :s:`SimplePath`. - -.. _fls_23G6TAntJXqa: - -simple path prefix -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_ijc2yHQuIltY` -A :dt:`simple path prefix` is the leading :t:`simple path` of a -:t:`glob import` or a :t:`nesting import`. - -:dp:`fls_ImHceyHhK6OZ` -See :s:`SimplePathPrefix`. - -.. _fls_sgy9q06yt6cl: - -simple path public modifier -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_mby9r0jm6uyv` -A :dt:`simple path public modifier` is a :t:`visibility modifier` that grants a -:t:`name` :t:`public visibility` within the provided :t:`simple path` only. - -:dp:`fls_mud4hw74kuh6` -See :s:`SimplePathPublicModifier`. - -.. _fls_gT5rZ4qC3pHo: - -simple path resolution -^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_CQlepoN6PmKq` -:dt:`Simple path resolution` is a kind of :t:`path resolution` that applies to -a :t:`simple path`. - -.. _fls_k5uqt5oj7wvl: - -simple public modifier -^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_ce1ounn1g68` -A :dt:`simple public modifier` is a :t:`visibility modifier` that grants a -:t:`name` :t:`public visibility`. - -:dp:`fls_rd68vm2f2qy5` -See :s:`SelfPublicModifier`. - -.. _fls_JDB3eBO0DY4o: - -simple register expression -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_4Yp4R7gXucL2` -A :dt:`simple register expression` is either an :t:`expression` or an -:t:`underscore expression`. - -:dp:`fls_kKaqHDxPTTUC` -See :s:`SimpleRegisterExpression`. - -.. _fls_dpod2gc7a0u: - -simple string literal -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_p6qyyptz8w8w` -A :dt:`simple string literal` is a :t:`string literal` where the characters are -:t:`Unicode` characters. - -:dp:`fls_osj0c4dmr6e0` -See :s:`SimpleStringLiteral`. - -.. _fls_JS91BDzd03Qj: - -single segment path -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_Hun5BCZsqd6k` -A :dt:`single segment path` is a :t:`path` consisting of exactly one -:t:`path segment`. - -.. _fls_oy5xy5pm1enx: - -size -^^^^ - -:dp:`fls_3obnilqhkjux` -The :dt:`size` of a :t:`value` is the offset in bytes between successive -elements in an :t:`array type` with the same :t:`element type`, including any -padding for :t:`alignment`. - -.. _fls_2y5oyon3y1za: - -size operand -^^^^^^^^^^^^ - -:dp:`fls_srajsqi5i3py` -A :dt:`size operand` is an :t:`operand` that specifies the size of an -:t:`array` or an :t:`array type`. - -:dp:`fls_228ioayvdguv` -See :s:`SizeOperand`. - -.. _fls_oiaoWEQQDE7I: - -sized type -^^^^^^^^^^ - -:dp:`fls_pwcgsRCNSwKn` -A :dt:`sized type` is a :t:`type` with statically known size. - -.. _fls_srkftses9sxn: - -slice -^^^^^ - -:dp:`fls_p1sv01ml2ark` -A :dt:`slice` is a :t:`value` of a :t:`slice type`. - -.. _fls_1s3a31o9zx1a: - -slice pattern -^^^^^^^^^^^^^ - -:dp:`fls_7613qu4igwiw` -A :dt:`slice pattern` is a :t:`pattern` that matches :t:`[array]s` of fixed -size and :t:`[slice]s` of dynamic size. - -:dp:`fls_3qey00280x27` -See :s:`SlicePattern`. - -.. _fls_x3kr88m5gvwv: - -slice type -^^^^^^^^^^ - -:dp:`fls_bvpszep1w90g` -A :dt:`slice type` is a :t:`sequence type` that provides a view into a sequence -of elements. - -:dp:`fls_y7gscwf29htg` -See :s:`SliceTypeSpecification`. - -.. _fls_wlwwxzpnhk6i: - -source file -^^^^^^^^^^^ - -:dp:`fls_nh737q4mn27u` -A :dt:`source file` contains the program text of :t:`[inner attribute]s`, -:t:`[inner doc comment]s`, and :t:`[item]s`. - -:dp:`fls_zgh1m5357ex1` -See :s:`SourceFile`. - -.. _fls_e7cvo0usw86i: - -statement -^^^^^^^^^ - -:dp:`fls_faijgwg4lhp9` -A :dt:`statement` is a component of a block expression. - -:dp:`fls_th7edvxml3mn` -See :s:`Statement`. - -.. _fls_tpazbmuq9hag: - -static -^^^^^^ - -:dp:`fls_srx4v1e20yxa` -A :dt:`static` is a :t:`value` that is associated with a specific memory -location. - -:dp:`fls_1b7gpk8e98pw` -See :s:`StaticDeclaration`. - -.. _fls_x331kxllyzim: - -static initializer -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_6jjbfni87tax` -A :dt:`static initializer` is a :t:`construct` that provides the :t:`value` of -its related :t:`static`. - -:dp:`fls_igbl5uv0dlhl` -See :s:`StaticInitializer`. - -.. _fls_jCqiKgW9g8n5: - -static lifetime elision -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_NbVewjYRnQPF` -:dt:`Static lifetime elision` is a form of :t:`lifetime elision` that applies -to :t:`[constant]s` and :t:`[static]s`. - -.. _fls_1ricdj86o457: - -str -^^^ - -:dp:`fls_6977zxb0resa` -:dc:`str` is a :t:`sequence type` that represents a :t:`slice` of 8-bit -unsigned bytes. - -.. _fls_bzhaq3q378ay: - -strict keyword -^^^^^^^^^^^^^^ - -:dp:`fls_hza9spr6behn` -A :dt:`strict keyword` is a :t:`keyword` that always holds its special meaning. - -:dp:`fls_67pzayd9qzzs` -See :s:`StrictKeyword`. - -.. _fls_cck2tmyzmpja: - -string literal -^^^^^^^^^^^^^^ - -:dp:`fls_dphk5br0ag35` -A :dt:`string literal` is a :t:`literal` that consists of multiple characters. - -:dp:`fls_z0t3ae24h5h5` -See :s:`StringLiteral`. - -.. _fls_yphnf56fa58r: - -struct -^^^^^^ - -:dp:`fls_rufylj7qxs1w` -A :dt:`struct` is an :t:`item` that declares a :t:`struct type`. - -.. _fls_dxfyejkbiz3p: - -struct expression -^^^^^^^^^^^^^^^^^ - -:dp:`fls_m8n9e0sxyb95` -A :dt:`struct expression` is an :t:`expression` that constructs an -:t:`enum value`, a :t:`struct value`, or a :t:`union value`. - -:dp:`fls_odm68rhu2j1` -See :s:`StructExpression`. - -.. _fls_OT6dJ7CWkSTG: - -struct field -^^^^^^^^^^^^ - -:dp:`fls_8Z9YWMnrHXJS` -A :dt:`struct field` is a :t:`field` of a :t:`struct type`. - -.. _fls_ook43xes5t34: - -struct pattern -^^^^^^^^^^^^^^ - -:dp:`fls_xbtoiwegp8gu` -A :dt:`struct pattern` is a :t:`pattern` that matches an :t:`enum value`, a -:t:`struct value`, or a :t:`union value`. - -:dp:`fls_pn8e50ep2fln` -See :s:`StructPattern`. - -.. _fls_pzj88ust6qrq: - -struct type -^^^^^^^^^^^ - -:dp:`fls_7v4dhh3nl8h9` -A :dt:`struct type` is an :t:`abstract data type` that is a product of other -:t:`[type]s`. - -:dp:`fls_dhlww4yrnb2v` -See :s:`StructDeclaration`. - - -.. _fls_GOnQHAsYw1oi: - -struct value -^^^^^^^^^^^^ - -:dp:`fls_YmZfW9kWlbIX` -A :dt:`struct value` is a :t:`value` of a :t:`struct type`. - -.. _fls_P7920ALJisrH: - -structurally equal -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_glRZUKhmaWmP` -A :t:`type` is :dt:`structurally equal` when its :t:`[value]s` can be compared -for equality by structure. - -.. _fls_feZ3iDff05Cb: - -subexpression -^^^^^^^^^^^^^ - -:dp:`fls_bNSHwD4Kpfm0` -A :dt:`subexpression` is an :t:`expression` nested within another -:t:`expression`. - -.. _fls_wee9stfk0abp: - -subject expression -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_xisqke87ert` -A :dt:`subject expression` is an :t:`expression` that controls -:t:`[for loop]s`, :t:`[if expression]s`, and :t:`[match expression]s`. - -:dp:`fls_gph5doham4js` -See :s:`SubjectExpression`. - -.. _fls_dc5ibvnnhs7e: - -subject let expression -^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_b3ckv6zgnaeb` -A :dt:`subject let expression` is an :t:`expression` that controls -:t:`[if let expression]s` and :t:`[while let loop]s`. - -:dp:`fls_vnzaargh5yok` -See :s:`SubjectLetExpression`. - -.. _fls_k7ro8n23wtdc: - -subpattern -^^^^^^^^^^ - -:dp:`fls_942ulj9qsdes` -A :dt:`subpattern` is a :t:`pattern` nested within another :t:`pattern`. - -.. _fls_0hf1gNf90qKr: - -subtraction assignment -^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_75Eyk2YXO2j4` -For :dt:`subtraction assignment`, see :t:`subtraction assignment`. - -.. _fls_a4iu72zn4h0: - -subtraction assignment expression -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_4pb85nl4r7vs` -A :dt:`subtraction assignment expression` is a -:t:`compound assignment expression` that uses subtraction. - -:dp:`fls_mye9yj5tc8hr` -See :s:`SubtractionAssignmentExpression`. - -.. _fls_25ru96mfdcsn: - -subtraction expression -^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_caamjgpw59id` -A :dt:`subtraction expression` is an :t:`arithmetic expression` that uses -subtraction. - -:dp:`fls_mx3olnbntpye` -See :s:`SubtractionExpression`. - -.. _fls_qw3fn1116se9: - -subtrait -^^^^^^^^ - -:dp:`fls_wnj95vozis6n` -A :dt:`subtrait` is a :t:`trait` with a :t:`supertrait`. - -.. _fls_pu4zqJ1tGrfH: - -subtype -^^^^^^^ - -:dp:`fls_pmkjOWsieQog` -A :dt:`subtype` is a :t:`type` with additional constraints. - -.. _fls_f5dxz8pvs1kz: - -subtyping -^^^^^^^^^ - -:dp:`fls_bo5xzjsdd3lj` -:dt:`Subtyping` is a property of :t:`[type]s`, allowing one :t:`type` to be -used where another :t:`type` is expected. - -.. _fls_qar9v52smi9j: - -suffixed float -^^^^^^^^^^^^^^ - -:dp:`fls_7reb4jp0x1wf` -A :dt:`suffixed float` is a :t:`float literal` with a :t:`float suffix`. - -.. _fls_bmbu11ycjpor: - -suffixed integer -^^^^^^^^^^^^^^^^ - -:dp:`fls_ltzetxu3sq7k` -A :dt:`suffixed integer` is an :t:`integer literal` with an :t:`integer suffix`. - -.. _fls_12bluakt0jnj: - -super public modifier -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_vry5mhs3a5wv` -A :dt:`super public modifier` is a :t:`visibility modifier` that grants a -:t:`name` :t:`public visibility` within the parent :t:`module` only. - -:dp:`fls_4a1s9bcrk5oy` -See :s:`SuperPublicModifier`. - -.. _fls_1axcyv628aov: - -supertrait -^^^^^^^^^^ - -:dp:`fls_s4chur1wutwh` -A :dt:`supertrait` is a transitive :t:`trait` that a :t:`type` must -additionally implement. - -.. _fls_r4eoz3ohvpdi: - -sync type -^^^^^^^^^ - -:dp:`fls_rpc0c8qx3nbo` -A :dt:`sync type` is a :t:`type` that implements the :std:`core::marker::Sync` -:t:`trait`. - -.. _fls_44djv0wocacs: - -syntactic category -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_f981e3m7kq50` -A :dt:`syntactic category` is a nonterminal in the Backus-Naur Form grammar -definition of the Rust programming language. - -.. _fls_psd2ll10ixs: - -tail expression -^^^^^^^^^^^^^^^ - -:dp:`fls_6k873f1knasi` -A :dt:`tail expression` is the last :t:`expression` within a -:t:`block expression`. - -.. _fls_4omay4i65dwz: - -temporary -^^^^^^^^^ - -:dp:`fls_fathkxu9kxvw` -A :dt:`temporary` is an anonymous :t:`variable` produced by some intermediate -computation. - -.. _fls_ihv02usuziw8: - -terminated -^^^^^^^^^^ - -:dp:`fls_med1l8vheb83` -A :t:`loop expression` is :dt:`terminated` when its :t:`block expression` is no -longer evaluated. - -.. _fls_ef03n3ehz372: - -terminated macro invocation -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_542es82wfzco` -A :dt:`terminated macro invocation` is a :t:`macro invocation` that may be used -as a :t:`statement`. - -:dp:`fls_tcvfi2zgdm58` -See :s:`TerminatedMacroInvocation`. - -.. _fls_AVZGZPd6WXXO: - -textual macro scope -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_xyeYk6vrmlWp` -A :dt:`textual macro scope` is a :t:`scope` for :t:`[declarative macro]s`. - -.. _fls_mdcbhy96hrau: - -textual type -^^^^^^^^^^^^ - -:dp:`fls_lv1pdtzf6f58` -A :dt:`textual type` is a :t:`type` class that includes type :c:`char` and type -:c:`str`. - -.. _fls_lfsgf6u142yb: - -thin pointer -^^^^^^^^^^^^ - -:dp:`fls_i2j0u4v5o1bs` -A :dt:`thin pointer` is a :t:`value` of a :t:`thin pointer type`. - -.. _fls_7ksqpi9j8ba9: - -thin pointer type -^^^^^^^^^^^^^^^^^ - -:dp:`fls_33rka3kyxgrk` -A :dt:`thin pointer type` is an :t:`indirection type` that refers to a -:t:`fixed sized type`. - -.. _fls_tzoko74t5t6n: - -token matching -^^^^^^^^^^^^^^ - -:dp:`fls_a19q6lhvakcm` -:dt:`Token matching` is the process of consuming a :s:`TokenTree` in an attempt -to fully satisfy a :t:`macro match` of a selected :t:`macro matcher` that -belongs to a resolved :t:`declarative macro`. - -.. _fls_ma3vs7yoj285: - -tokens -^^^^^^ - -:dp:`fls_v23kqvyvscd7` -:dt:`[Token]s` are a subset of :t:`[lexical element]s` consumed by -:t:`[macro]s`. - -.. _fls_cad25qns4164: - -trait -^^^^^ - -:dp:`fls_mf4x9g70o5z6` -A :dt:`trait` is an :t:`item` that describes an interface a :t:`type` can -implement. - -:dp:`fls_ypjhwvuyrns` -See :s:`TraitDeclaration`. - -.. _fls_5hNydsQDrICq: - -trait body -^^^^^^^^^^ - -:dp:`fls_u221Me58aZmY` -A :dt:`trait body` is a :t:`construct` that encapsulates the -:t:`[associated item]s`, :t:`[inner attribute]s`, and -:t:`[inner doc comment]s` of a :t:`trait`. - -:dp:`fls_dITFx04TB4h0` -See :s:`TraitBody`. - -.. _fls_868cgnb1soeh: - -trait bound -^^^^^^^^^^^ - -:dp:`fls_95zx8unuxxpq` -A :dt:`trait bound` is a :t:`bound` that imposes a constraint on the -:t:`[trait]s` of :t:`[generic parameter]s`. - -:dp:`fls_bkbym8v4t6oh` -See :s:`TraitBound`. - -.. _fls_kflieu6uottg: - -trait implementation -^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_5v7kbg144pr8` -A :dt:`trait implementation` is an :t:`implementation` that adds functionality -specified by a :t:`trait`. - -:dp:`fls_rytylyyxh27f` -See :s:`TraitImplementation`. - -.. _fls_TCIzYoMeGtub: - -trait object lifetime elision -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_rALP9b6qjlp9` -:dt:`Trait object lifetime elision` is a form of :t:`lifetime elision` that -applies to :t:`[trait object type]s`. - -.. _fls_7qtbro7ipndr: - -trait object type -^^^^^^^^^^^^^^^^^ - -:dp:`fls_lo2fzzdwxy1l` -A :dt:`trait object type` is a :t:`type` that implements a :t:`trait`, where -the :t:`type` is not known at compile time. - -:dp:`fls_d632mc5c8qwt` -See :s:`TraitObjectTypeSpecification`, -:s:`TraitObjectTypeSpecificationOneBound`. - -.. _fls_nfdfeFVZRC5F: - -trait type -^^^^^^^^^^ - -:dp:`fls_JQsQnQ0dTHlS` -A :dt:`trait type` is either an :t:`impl trait type` or a -:t:`trait object type`. - -.. _fls_sl62718i1kkn: - -transparent representation -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_hb3e72rhzpnv` -:dt:`Transparent representation` is a :t:`type representation` that applies -only to an :t:`enum type` with a single :t:`enum variant` or a :t:`struct type` -where the :t:`struct type` or :t:`enum variant` has a single :t:`field` of -non-zero :t:`size` and any number of :t:`[field]s` of :t:`size` zero and -:t:`alignment` one. - -.. _fls_soqkluvirlsd: - -trivial predicate -^^^^^^^^^^^^^^^^^ - -:dp:`fls_db5njwrjolhs` -A :dt:`trivial predicate` is a :t:`where clause predicate` that does not use -the :t:`[generic parameter]s` or :t:`[higher-ranked trait bound]s` of the related -:t:`construct`. - -.. _fls_si70t19ox07e: - -tuple -^^^^^ - -:dp:`fls_yhcfqz6p0059` -A :dt:`tuple` is a :t:`value` of a :t:`tuple type`. - -.. _fls_1XEHpJOK9DKB: - -tuple enum variant -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_eduQhUYBEkVx` -A :dt:`tuple enum variant` is an :t:`enum variant` with a -:s:`TupleStructFieldList`. - -.. _fls_sP7uHoLxGfRO: - -tuple enum variant value -^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_ORURxipGqNrZ` -A :dt:`tuple enum variant value` is a :t:`value` of a :t:`tuple enum variant`. - -.. _fls_udl6ujjg1jae: - -tuple expression -^^^^^^^^^^^^^^^^ - -:dp:`fls_x7m4u1dx4eli` -A :dt:`tuple expression` is an :t:`expression` that constructs a :t:`tuple`. - -:dp:`fls_qawnvcddgyxx` -See :s:`TupleExpression`. - -.. _fls_bf1v4e1s5xj6: - -tuple field -^^^^^^^^^^^ - -:dp:`fls_8rq1gbzij5tk` -A :dt:`tuple field` is a :t:`field` of a :t:`tuple type`. - -.. _fls_zfvvbf7ncrhj: - -tuple initializer -^^^^^^^^^^^^^^^^^ - -:dp:`fls_94hg6re11zl5` -A :dt:`tuple initializer` is an :t:`operand` that provides the :t:`value` of a -:t:`tuple field` in a :t:`tuple expression`. - -.. _fls_7f2sx37kg4ca: - -tuple pattern -^^^^^^^^^^^^^ - -:dp:`fls_al2q3vh1rg6e` -A :dt:`tuple pattern` is a :t:`pattern` that matches a :t:`tuple` which -satisfies all criteria defined by its :t:`[subpattern]s`. - -:dp:`fls_bevmt5t0238j` -See :s:`TuplePattern`. - -.. _fls_245idp9hpqf6: - -tuple struct -^^^^^^^^^^^^ - -:dp:`fls_pdcpmapiq491` -A :dt:`tuple struct` is a :t:`struct` with a :s:`TupleStructFieldList`. - -:dp:`fls_1tj4p05m4wdf` -See :s:`TupleStructDeclaration`. - -.. _fls_UYCpeq4Z87My: - -tuple struct call expression -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_DQaCUkskfXzk` -A :dt:`tuple struct call expression` is a :t:`call expression` where the -:t:`call operand` resolves to a :t:`tuple struct` or a :t:`tuple enum variant`. - -.. _fls_xx4slbg8s63e: - -tuple struct field -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_ndeb1a2hm9d8` -A :dt:`tuple struct field` is a :t:`field` of a :t:`tuple struct type`. - -:dp:`fls_v4eq8xg608d5` -See :s:`TupleStructField`. - -.. _fls_u2j18nl1t12f: - -tuple struct pattern -^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_gu1mfurivnfz` -A :dt:`tuple struct pattern` is a :t:`pattern` that matches a -:t:`tuple enum variant value` or a :t:`tuple struct value`. - -:dp:`fls_3jx5683mdm10` -See :s:`TupleStructPattern`. - -.. _fls_qx8j2lvqigqk: - -tuple struct type -^^^^^^^^^^^^^^^^^ - -:dp:`fls_hhikx5ajx3bl` -A :dt:`tuple struct type` is the :t:`type` of a :t:`tuple struct`. - -.. _fls_x4ALCJKhVDZF: - -tuple struct value -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_xz1p4pss2Ocn` -A :dt:`tuple struct value` is a :t:`value` of a :t:`tuple struct type`. - -.. _fls_k4yz7i2pf9wp: - -tuple type -^^^^^^^^^^ - -:dp:`fls_q0ulqfvnxwni` -A :dt:`tuple type` is a :t:`sequence type` that represents a heterogeneous list -of other :t:`[type]s`. - -:dp:`fls_rkugxsau1w78` -See :s:`TupleTypeSpecification`. - -.. _fls_wzupssn435n: - -type -^^^^ - -:dp:`fls_nhlh7vvgsbwo` -A :dt:`type` defines a set of :t:`[value]s` and a set of operations that act on -those :t:`[value]s`. - -.. _fls_vaklivoy2ix2: - -type alias -^^^^^^^^^^ - -:dp:`fls_8pcsxodv1xp5` -A :dt:`type alias` is an :t:`item` that defines a :t:`name` for a :t:`type`. - -:dp:`fls_qfzskp1t3h5w` -See :s:`TypeAliasDeclaration`. - -.. _fls_89ollsdjx3uy: - -type argument -^^^^^^^^^^^^^ - -:dp:`fls_152lk7hrtd11` -A :dt:`type argument` is a :t:`generic argument` that supplies the :t:`value` -of a :t:`type parameter`. - -:dp:`fls_91tqk65qiygf` -See :s:`TypeArgument`. - -.. _fls_1n50v16et5e6: - -type ascription -^^^^^^^^^^^^^^^ - -:dp:`fls_pm5jytclqn7y` -A :dt:`type ascription` specifies the :t:`type` of a :t:`construct`. - -:dp:`fls_c3xtiputfxea` -See :s:`TypeAscription`. - -.. _fls_zDdXv5I4bW9H: - -type bound predicate -^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_j6WKoybB4cep` -A :dt:`type bound predicate` is a :t:`construct` that specifies -:t:`[lifetime bound]s` and :t:`[trait bound]s` on a :t:`type`. - -:dp:`fls_oMlPNgoDjnoW` -See :s:`TypeBoundPredicate`. - -.. _fls_k24jb967nu1q: - -type cast expression -^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_j6zo3rir1x76` -A :dt:`type cast expression` is an :t:`expression` that changes the :t:`type` -of an :t:`operand`. - -:dp:`fls_dvh1xy9w74ch` -See :s:`TypeCastExpression`. - -.. _fls_6j08yuafv0vl: - -type coercion -^^^^^^^^^^^^^ - -:dp:`fls_mt36qehtqova` -:dt:`Type coercion` is an implicit operation that changes the :t:`type` of -a :t:`value`. - -.. _fls_7fpvb2gvqng8: - -type inference -^^^^^^^^^^^^^^ - -:dp:`fls_ky8epvf9834e` -:dt:`Type inference` is the process of deducing the expected :t:`type` of an -arbitrary :t:`value`. - -.. _fls_0jri0m3F1fAT: - -type inference root -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_hLI7lCixs48z` -A :dt:`type inference root` is a :t:`construct` whose inner :t:`[expression]s` -and :t:`[pattern]s` are subject to :t:`type inference` independently of other -:t:`[type inference root]s`. - -.. _fls_uv2damik654e: - -type parameter -^^^^^^^^^^^^^^ - -:dp:`fls_5t6510wkb67x` -A :dt:`type parameter` is a :t:`generic parameter` for a :t:`type`. - -:dp:`fls_vquy0tsvd93x` -See :s:`TypeParameter`. - -.. _fls_Fq2zTHYRpK2V: - -type parameter initializer -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_Xpz47JLNsOXI` -A :dt:`type parameter initializer` is a :t:`construct` that provides the -default :t:`value` of its related :t:`type parameter`. - -:dp:`fls_6Ap26AcSadP8` -See :s:`TypeParameterInitializer`. - -.. _fls_HghjWqvyj5bN: - -type parameter type -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_EuHHxwHd0RHV` -A :dt:`type parameter type` is a placeholder :t:`type` of a :t:`type parameter` -to be substituted by :t:`generic substitution`. - -.. _fls_QDCiXh7uSj9r: - -type path -^^^^^^^^^ - -:dp:`fls_UBR5czHrMTrx` -A :dt:`type path` is a :t:`path` that acts as a :t:`type specification`. - -:dp:`fls_7CbNAZYSZayW` -See :s:`TypePath`. - -.. _fls_wa3biT0rQ102: - -type path resolution -^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_Xv6JbfdIyvA3` -:dt:`Type path resolution` is a form of :t:`path resolution` that applies to -a :t:`type path`. - -.. _fls_u1zkh2m8p92: - -type representation -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_rv80nyxwj2z8` -:dt:`Type representation` specifies the :t:`layout` of :t:`[field]s` of -:t:`[abstract data type]s`. - -.. _fls_ukua6gbye6ot: - -type specification -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_tdjhjg9zhnv5` -A :dt:`type specification` describes the structure of a :t:`type`. - -:dp:`fls_a3sqjp1l8po6` -See :s:`TypeSpecification`. - -.. _fls_qoehu9p00q56: - -type unification -^^^^^^^^^^^^^^^^ - -:dp:`fls_3vyodut341b5` -:dt:`Type unification` is the process by which :t:`type inference` propagates -known :t:`[type]s` across the :t:`type inference root` and assigns concrete -:t:`[type]s` to :t:`[type variable]s`, as well as a general mechanism to check -for compatibility between two :t:`[type]s` during :t:`method resolution`. - -.. _fls_6zhffgxtytku: - -type variable -^^^^^^^^^^^^^ - -:dp:`fls_j9eusnwze4rz` -A :dt:`type variable` is a placeholder used during :t:`type inference` to stand -in for an undetermined :t:`type` of an :t:`expression` or a :t:`pattern`. - -.. _fls_44uvj9l7q98z: - -u8 -^^ - -:dp:`fls_umf9zfeghy6` -:dc:`u8` is an :t:`unsigned integer type` whose :t:`[value]s` range from 0 to -2\ :sup:`8` - 1, all inclusive. - -.. _fls_eh24kdjdze5j: - -u16 -^^^ - -:dp:`fls_8vi7bm2895y0` -:dc:`u16` is an :t:`unsigned integer type` whose :t:`[value]s` range from 0 to -2\ :sup:`16` - 1, all inclusive. - -.. _fls_jybcgdujzpqy: - -u32 -^^^ - -:dp:`fls_pw90erui8vkk` -:dc:`u32` is an :t:`unsigned integer type` whose :t:`[value]s` range from 0 to -2\ :sup:`32` - 1, all inclusive. - -.. _fls_1z1e3chuejzz: - -u64 -^^^ - -:dp:`fls_pbcmhznqft9m` -:dc:`u64` is an :t:`unsigned integer type` whose :t:`[value]s` range from 0 to -2\ :sup:`64` - 1, all inclusive. - -.. _fls_5hn9e3ce1smp: - -u128 -^^^^ - -:dp:`fls_8yv891ur2av5` -:dc:`u128` is an :t:`unsigned integer type` whose :t:`[value]s` range from 0 to -2\ :sup:`128` - 1, all inclusive. - -.. _fls_p032easjag3d: - -unary operator -^^^^^^^^^^^^^^ - -:dp:`fls_p6mk2zrwgwem` -A :dt:`unary operator` operates on one :t:`operand`. - -.. _fls_WuLL4SvSKavZ: - -undefined behavior -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_WpwmltUMQGZa` -:dt:`Undefined behavior` is a situation that results in an unbounded error. - -.. _fls_X6XjWwYeTnVR: - -under resolution -^^^^^^^^^^^^^^^^ - -:dp:`fls_BppwXSVUWtEu` -A :t:`construct` that is being resolved is said to be :dt:`under resolution`. - -.. _fls_57kis2vnt3cv: - -underscore expression -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_ukl1sefb99gj` -An :dt:`underscore expression` is an :t:`expression` that acts as a placeholder -in a :t:`destructuring assignment`. - -:dp:`fls_qbo267kdjcgs` -See :s:`UnderscoreExpression`. - -.. _fls_fhwqe6afup2o: - -underscore pattern -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_f6yroesif1q4` -An :dt:`underscore pattern` is a :t:`pattern` that matches any single -:t:`value`. - -:dp:`fls_bktuchv7o4dd` -See :s:`UnderscorePattern`. - -.. _fls_HpUSWMvNS5f4: - -unhygienic -^^^^^^^^^^ - -:dp:`fls_0t4lFZLkNieR` -An :t:`identifier` is :dt:`unhygienic` when it has :t:`call site hygiene`. - -.. _fls_kafgmevvzl5t: - -Unicode -^^^^^^^ - -:dp:`fls_y7gwku7pe1f4` -:dt:`Unicode` is the universal character encoding standard for written -characters and text described in the Unicode® Standard by the Unicode -Consortium. - -.. _fls_y7m6AentM6Ik: - -unifiable -^^^^^^^^^ - -:dp:`fls_01BNTCL4u8Gn` -For :dt:`unifiable`, see :t:`unify`. - -.. _fls_u03p4rvz1jhs: - -unifiable types -^^^^^^^^^^^^^^^ - -:dp:`fls_jsbggfitv9xk` -Two :t:`[type]s` that :t:`unify` are said to be :dt:`[unifiable type]s`. - -.. _fls_9RfuDiI6qrzZ: - -unified type -^^^^^^^^^^^^ - -:dp:`fls_tqRwIe6z3a4j` -A :dt:`unified type` is a :t:`type` produced by :t:`type unification`. - -.. _fls_da6ssnmmsevo: - -unify -^^^^^ - -:dp:`fls_mango4gffb9e` -A :t:`type` is said to :dt:`unify` with another type when the domains, ranges, -and structures of both :t:`[type]s` are compatible. - -.. _fls_8qljy9e1jjcb: - -union -^^^^^ - -:dp:`fls_x3oibk39dvem` -A :dt:`union` is an :t:`item` that declares a :t:`union type`. - -.. _fls_71xvazpwi8p0: - -union field -^^^^^^^^^^^ - -:dp:`fls_6t2fbnlndz8y` -A :dt:`union field` is a :t:`field` of a :t:`union type`. - -.. _fls_nrgyga1rztb3: - -union type -^^^^^^^^^^ - -:dp:`fls_af2sscrep7mc` -A :dt:`union type` is an :t:`abstract data type` similar to a :t:`C`-like union. - -:dp:`fls_fgvjogfz8ink` -See :s:`UnionDeclaration`. - -.. _fls_2QRQMeA3OSVl: - -union value -^^^^^^^^^^^ - -:dp:`fls_9BPrxky3a4nE` -A :dt:`union value` is a :t:`value` of a :t:`union type`. - -.. _fls_Is9hWLC6Q0g5: - -unique immutable reference -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_eXrivAmNxzmv` -A :dt:`unique immutable reference` is an :t:`immutable reference` produced by -:t:`capturing` what is asserted to be the only live :t:`reference` to a -:t:`value` while the :t:`reference` exists. - -.. _fls_Rwtgq904NoaL: - -unit enum variant -^^^^^^^^^^^^^^^^^ - -:dp:`fls_y6fI5L3Tghie` -A :dt:`unit enum variant` is an :t:`enum variant` without a :t:`field list`. - -.. _fls_f3hmx9qya258: - -unit struct -^^^^^^^^^^^ - -:dp:`fls_9t7fu8fcak6k` -A :dt:`unit struct` is a :t:`struct` without a :t:`field list`. - -:dp:`fls_mSuiysAVczPx` -See :s:`UnitStructDeclaration`. - -.. _fls_jdvEnl8F7I8R: - -unit struct constant -^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_lLGn4JqddeAg`: -A :dt:`unit struct constant` is a :t:`constant` implicitly created by a -:t:`unit struct`. - -.. _fls_6j2wnOmBILJa: - -unit struct type -^^^^^^^^^^^^^^^^ - -:dp:`fls_oIzmvACNeQpE` -A :dt:`unit struct type` is the :t:`type` of a :t:`unit struct`. - -.. _fls_CXp8fgPrBVUe: - -unit struct value -^^^^^^^^^^^^^^^^^ - -:dp:`fls_Kr9nGIjx3N4R` -A :dt:`unit struct value` is a :t:`value` of a :t:`unit struct type`. - -.. _fls_wmn9mcqae88q: - -unit tuple -^^^^^^^^^^ - -:dp:`fls_vo1jw6rmu4yy` -A :dt:`unit tuple` is a :t:`value` of the :t:`unit type`. - -.. _fls_t32yfzmpid5a: - -unit type -^^^^^^^^^ - -:dp:`fls_jtdtv3q2ls05` -The :dt:`unit type` is a :t:`tuple type` of zero :t:`arity`. - -.. _fls_vxt0ifseehv9: - -unit value -^^^^^^^^^^ - -:dp:`fls_ycdv4nvsdyx` -The :dt:`unit value` is the :t:`value` of a :t:`unit type`. - -.. _fls_u78ng1tleh0w: - -unnamed constant -^^^^^^^^^^^^^^^^ - -:dp:`fls_ufj01cxxsv1w` -An :dt:`unnamed constant` is a :t:`constant` declared with character 0x5F (low -line). - -.. _fls_r8567aozbyxl: - -unnamed lifetime -^^^^^^^^^^^^^^^^ - -:dp:`fls_4iy6zpq66mit` -An :dt:`unnamed lifetime` is a :t:`lifetime` declared with character 0x5F (low -line). - -.. _fls_cDVmvrVhUBmr: - -unqualified path expression -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_9xKgP8uVsOaR` -An :dt:`unqualified path expression` is a :t:`path expression` without a :t:`qualified type`. - -.. _fls_6349nvapfj9d: - -unsafe block -^^^^^^^^^^^^ - -:dp:`fls_8tkolhmd6xfp` -For :dt:`unsafe block`, see :t:`unsafe block expression`. - -.. _fls_u8sdp2fxz9pn: - -unsafe block expression -^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_et2h89jyivhs` -An :dt:`unsafe block expression` is a :t:`block expression` that is specified -with :t:`keyword` ``unsafe``. - -:dp:`fls_c94rudunhp5b` -See :s:`UnsafeBlockExpression`. - -.. _fls_5m85wlr2qw78: - -unsafe context -^^^^^^^^^^^^^^ - -:dp:`fls_qn1s845ejbu0` -An :dt:`unsafe context` is either an :t:`unsafe block` or an -:t:`unsafe function`. - -.. _fls_pre02nas9dad: - -unsafe external block -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_pkfgas34msas` -An :dt:`unsafe external block` is an :t:`external block` subject to keyword ``unsafe``. - -.. _fls_ua64pv82skaw: - -unsafe function -^^^^^^^^^^^^^^^ - -:dp:`fls_2ht13dgtxi1o` -An :dt:`unsafe function` is a :t:`function` subject to :t:`keyword` ``unsafe``. - -.. _fls_y1iruf62p856: - -unsafe function item type -^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_r91tuwi55nu7` -An :dt:`unsafe function item type` is a :t:`function item type` where the -related :t:`function` is an :t:`unsafe function`. - -.. _fls_bokqlokua059: - -unsafe function pointer type -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_tiluwa2v4l6d` -An :dt:`unsafe function pointer type` is a function pointer type subject to -:t:`keyword` ``unsafe``. - -.. _fls_e2wyfbem6vwn: - -unsafe operation -^^^^^^^^^^^^^^^^ - -:dp:`fls_34h60ubicgsj` -An :dt:`unsafe operation` is an operation that may result in -:t:`undefined behavior` that is not diagnosed as a static error. -:t:`[Unsafe operation]s` are referred to as :t:`unsafe Rust`. - -.. _fls_4f6mppoenj3b: - -unsafe Rust -^^^^^^^^^^^ - -:dp:`fls_30asi010yf1a` -For :dt:`unsafe Rust`, see :t:`[unsafe operation]s`. - -.. _fls_38ae1t48h9cb: - -unsafe trait -^^^^^^^^^^^^ - -:dp:`fls_w6zlsf2ye457` -An :dt:`unsafe trait` is a :t:`trait` subject to :t:`keyword` ``unsafe`` - -.. _fls_h62dfjfyqcbn: - -unsafe trait implementation -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_kqwcv076dzie` -An :dt:`unsafe trait implementation` is a :t:`trait implementation` subject to -:t:`keyword` ``unsafe``. - -.. _fls_pst7yov6vnr9: - -unsafety -^^^^^^^^ - -:dp:`fls_742ycx5181n` -:dt:`Unsafety` is the presence of :t:`[unsafe operation]s` in program text. - -.. _fls_4jc74lz245z3: - -unsigned integer type -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_dxnf79qemlg6` -An :dt:`unsigned integer type` is an :t:`integer type` whose :t:`[value]s` -denote zero and positive whole numbers. - -.. _fls_pjup0piqlxe3: - -unsized coercion -^^^^^^^^^^^^^^^^ - -:dp:`fls_olt5qhyvhmtq` -An :dt:`unsized coercion` is a :t:`type coercion` that converts a -:t:`sized type` into an :t:`unsized type`. - -.. _fls_KiVgO7I3UUhh: - -unsized type -^^^^^^^^^^^^ - -:dp:`fls_M9NpzBH8Wf4z` -An :dt:`unsized type` is a :t:`type` with statically unknown size. - -.. _fls_4ph9cact2scc: - -unsuffixed float -^^^^^^^^^^^^^^^^ - -:dp:`fls_7wp6y0xeqqve` -An :dt:`unsuffixed float` is a :t:`float literal` without a :t:`float suffix`. - -.. _fls_d18nctsj8wu5: - -unsuffixed integer -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_t419z3zder0q` -An :dt:`unsuffixed integer` is an :t:`integer literal` without an -:t:`integer suffix`. - -.. _fls_Z8qvOkP4Zfj5: - -use capture -^^^^^^^^^^^ - -:dp:`fls_eZyPXG27Zwcg` -An :dt:`use capture` is a :t:`generic parameter` referenced via keyword $$use$$ within an :t:`anonymous return type`. - -:dp:`fls_Z8qvOkP4Zfj5` -See :s:`UseCaptures`. - -.. _fls_fow1bnvduafi: - -use import -^^^^^^^^^^ - -:dp:`fls_uccv9zthh5vt` -A :dt:`use import` brings :t:`entities ` :t:`in scope` within the -:t:`block expression` of an :t:`expression-with-block` or :t:`module` where the -:t:`use import` resides. - -:dp:`fls_ib5wf62j4uhr` -See :s:`UseImport`. - -.. _fls_gvjm5mms9ahz: - -usize -^^^^^ - -:dp:`fls_r22k1l8799k6` -:dc:`usize` is an :t:`unsigned integer type` with the same number of bits as -the platform's :t:`pointer type`, and is at least 16-bits wide. - -.. _fls_A5K8aOBsI3BG: - -validity invariant -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_3ebC3l839ajF` -A :dt:`validity invariant` is an invariant that when violated results in -immediate :t:`undefined behavior`. - -.. _fls_tg866bc926ms: - -value -^^^^^ - -:dp:`fls_h8jn338b51yu` -A :dt:`value` is either a :t:`literal` or the result of a computation, that may -be stored in a memory location, and interpreted based on some :t:`type`. - -.. _fls_h03noz6jzpyl: - -value expression -^^^^^^^^^^^^^^^^ - -:dp:`fls_mn6tcuz5j3p` -A :dt:`value expression` is an :t:`expression` that represents a :t:`value`. - -.. _fls_7xiaXXSwy4GP: - -value expression context -^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_NGGZEbmoLRbD` -A :dt:`value expression context` is an expression context that is not a -:t:`place expression context`. - -.. _fls_a5xof9jlpc2e: - -value operand -^^^^^^^^^^^^^ - -:dp:`fls_x4seemjknk2z` -A :dt:`value operand` is an :t:`operand` that supplies the :t:`value` that is -assigned to an :t:`assignee operand` by an :t:`assignment expression`. - -:dp:`fls_cl4fakfkpscp` -See :s:`ValueOperand`. - -.. _fls_donq6w1906lw: - -variable -^^^^^^^^ - -:dp:`fls_9ab12k4vwsio` -A :dt:`variable` is a placeholder for a :t:`value` that is allocated on the -stack. - -.. _fls_RIe80XOF8VlA: - -variadic part -^^^^^^^^^^^^^ - -:dp:`fls_ePnTyLoqJ1i7` -A :dt:`variadic part` indicates the presence of :t:`C`-like optional -parameters. - -:dp:`fls_z9D86gBFbKB5` -See :s:`VariadicPart`. - -.. _fls_q0xplb4tbzpq: - -variance -^^^^^^^^ - -:dp:`fls_il0krrsf09f8` -:dt:`Variance` is a property of :t:`[lifetime parameter]s` and -:t:`[type parameter]s` that describes the circumstances under which a -:t:`generic type` is a :t:`subtype` of an instantiation of itself with -different :t:`[generic argument]s`. - -.. _fls_svx87y4p8fdx: - -visibility -^^^^^^^^^^ - -:dp:`fls_sadmsqhptlho` -:dt:`Visibility` is a property of :t:`[field]s` and :t:`[item]s` that determines -which :t:`[module]s` can refer to the :t:`name` of the :t:`field` or :t:`item`. - -.. _fls_xqjk8avt7t51: - -visibility modifier -^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_ze7befho4jhs` -A :dt:`visibility modifier` sets the :t:`visibility` of the :t:`name` of an -:t:`item`. - -.. _fls_dLlUt8PrXAls: - -visible emptiness -^^^^^^^^^^^^^^^^^ - -:dp:`fls_shXDYqnUy2Pb` -:dt:`Visible emptiness ` is a property of :t:`[type]s` and :t:`[enum variant]s` that have no :t:`[value]s` that are fully observable. - -.. _fls_EnT5zRuwviWM: - -visible empty enum variant -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_MQiPWNwdk95I` -A :dt:`visible empty enum variant` is an :t:`enum variant` subject to :t:`visible emptiness`. - -.. _fls_HYWQ0lJS3TET: - -visible empty type -^^^^^^^^^^^^^^^^^^ - -:dp:`fls_OLVD0u9w68Gl` -A :dt:`visible empty type` is a :t:`type` subject to :t:`visible emptiness`. - -.. _fls_iplp3gvfbcpw: - -weak keyword -^^^^^^^^^^^^ - -:dp:`fls_4hiznltf5wlu` -A :dt:`weak keyword` is a :t:`keyword` whose special meaning depends on the -context. - -:dp:`fls_psah573fsrig` -See :s:`WeakKeyword`. - -.. _fls_ew2gsg72rjxk: - -where clause -^^^^^^^^^^^^ - -:dp:`fls_prljyrhontzn` -A :dt:`where clause` is a :t:`construct` that specifies :t:`[bound]s` on -:t:`[lifetime parameter]s` and :t:`[type parameter]s`. - -:dp:`fls_k32hnug33eo9` -See :s:`WhereClause`. - -.. _fls_myNeYCm4VI0R: - -where clause predicate -^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_0LACQVmZpDQF` -A :dt:`where clause predicate` is either a :t:`lifetime bound predicate` or a -:t:`type bound predicate`. - -:dp:`fls_Jk7V1SOKE4Gm` -See :s:`WhereClausePredicate`. - -.. _fls_8hcsablipi17: - -while let loop -^^^^^^^^^^^^^^ - -:dp:`fls_ovutw52qtx71` -For :dt:`while let loop`, see :t:`while let loop expression`. - -.. _fls_gme4odk59x6d: - -while let loop expression -^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_g35gn7n88acp` -A :dt:`while let loop expression` is a :t:`loop expression` that continues to -evaluate its :t:`loop body` as long as its :t:`subject let expression` yields a -:t:`value` that can be matched against its :t:`pattern`. - -:dp:`fls_q3jcb4nodqba` -See :s:`WhileLetLoopExpression`. - -.. _fls_od59yim9kasi: - -while loop -^^^^^^^^^^ - -:dp:`fls_ug9cxoml9ged` -For :dt:`while loop`, see :t:`while loop expression`. - -.. _fls_1qxi3h3qmgso: - -while loop expression -^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_fq0zyup4djyh` -A :dt:`while loop expression` is a :t:`loop expression` that continues to -evaluate its :t:`loop body` as long as its :t:`iteration expression` holds -true. - -:dp:`fls_7htwpbmyq83u` -See :s:`WhileLoopExpression`. - -.. _fls_cxm8nw6qiryr: - -whitespace string -^^^^^^^^^^^^^^^^^ - -:dp:`fls_nljkmadklwdp` -A :dt:`whitespace string` is a string that consists of one or more -:t:`[whitespace character]s`. - -.. _fls_a5lrxgucl3be: - -zero-sized type -^^^^^^^^^^^^^^^ - -:dp:`fls_rmd6pearrhr8` -A :dt:`zero-sized type` is a :t:`fixed sized type` with :t:`size` zero. - -.. _fls_pix563lfbpm: - -zero-variant enum type -^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_84gqz3vwi5mj` -A :dt:`zero-variant enum type` is an :t:`enum type` without any -:t:`[enum variant]s`. +.. glossary-include:: ../build/generated.glossary.rst + :start-after: .. informational-page:: diff --git a/src/implementations.rst b/src/implementations.rst index a0dbc818..15d4a693 100644 --- a/src/implementations.rst +++ b/src/implementations.rst @@ -36,42 +36,117 @@ Implementations .. rubric:: Legality Rules -:dp:`fls_ivxpoxggy7s6` -An :t:`implementation` is an :t:`item` that supplements an -:t:`implementing type` by extending its functionality. - -:dp:`fls_yopmjbnw8tbl` -An :t:`implementing type` is the :t:`type` that the :t:`[associated item]s` of -an :t:`implementation` are associated with. +.. glossary-entry:: implementation + :glossary-dp: fls_bj1u4k3akecp + + :glossary: + :dp:`fls_pjulppit1r6` + An :dt:`implementation` is an :t:`item` that supplements an + :t:`implementing type` by extending its functionality. + + :dp:`fls_z4ij5skptoay` + See :s:`Implementation`. + :chapter: + :dp:`fls_ivxpoxggy7s6` + An :t:`implementation` is an :t:`item` that supplements an + :t:`implementing type` by extending its functionality. + +.. glossary-entry:: implementing type + :glossary-dp: fls_ow4b5iqas115 + + :glossary: + :dp:`fls_vs5ia3uupdcc` + An :dt:`implementing type` is the :t:`type` that the :t:`[associated item]s` of + an :t:`implementation` are associated with. + + :dp:`fls_9ixcwh6to74g` + See :s:`ImplementingType`. + :chapter: + :dp:`fls_yopmjbnw8tbl` + An :t:`implementing type` is the :t:`type` that the :t:`[associated item]s` of + an :t:`implementation` are associated with. :dp:`fls_eIHc8Y9fBtr0` Within an :t:`implementation`, the :t:`type` :c:`Self` acts as a :t:`type alias` for the :t:`implementing type`. -:dp:`fls_Mcpdzzcw43M7` -An :t:`implementation body` is a :t:`construct` that encapsulates the -:t:`[associated item]s`, :t:`[inner attribute]s`, and -:t:`[inner doc comment]s` of an :t:`implementation`. - -:dp:`fls_v0n0bna40dqr` -An :t:`inherent implementation` is an :t:`implementation` that adds direct -functionality. +.. glossary-entry:: implementation body + :glossary-dp: fls_vofxuHcXpt6X + + :glossary: + :dp:`fls_1iS30Nv9myEd` + An :dt:`implementation body` is a :t:`construct` that encapsulates the + :t:`[associated item]s`, :t:`[inner attribute]s`, and + :t:`[inner doc comment]s` of an :t:`implementation`. + + :dp:`fls_u75iHi53PnNP` + See :s:`ImplementationBody`. + :chapter: + :dp:`fls_Mcpdzzcw43M7` + An :t:`implementation body` is a :t:`construct` that encapsulates the + :t:`[associated item]s`, :t:`[inner attribute]s`, and + :t:`[inner doc comment]s` of an :t:`implementation`. + +.. glossary-entry:: inherent implementation + :glossary-dp: fls_o57p4yhjci61 + + :glossary: + :dp:`fls_6fpicw8ss4h3` + An :dt:`inherent implementation` is an :t:`implementation` that adds direct + functionality. + + :dp:`fls_s8zjk7hms1o0` + See :s:`InherentImplementation`. + :chapter: + :dp:`fls_v0n0bna40dqr` + An :t:`inherent implementation` is an :t:`implementation` that adds direct + functionality. :dp:`fls_797etpdk5dyb` :t:`[Inherent implementation]s` of the same :t:`implementing type` shall be defined within the same :t:`crate`. -:dp:`fls_ry3an0mwb63g` -A :t:`trait implementation` is an :t:`implementation` that adds functionality -specified by a :t:`trait`. - -:dp:`fls_8pwr7ibvhmhu` -An :t:`unsafe trait implementation` is a :t:`trait implementation` subject to -:t:`keyword` ``unsafe``. - -:dp:`fls_47x0ep8of8wr` -An :t:`implemented trait` is a :t:`trait` whose functionality has been -implemented by an :t:`implementing type`. +.. glossary-entry:: trait implementation + :glossary-dp: fls_kflieu6uottg + + :glossary: + :dp:`fls_5v7kbg144pr8` + A :dt:`trait implementation` is an :t:`implementation` that adds functionality + specified by a :t:`trait`. + + :dp:`fls_rytylyyxh27f` + See :s:`TraitImplementation`. + :chapter: + :dp:`fls_ry3an0mwb63g` + A :t:`trait implementation` is an :t:`implementation` that adds functionality + specified by a :t:`trait`. + +.. glossary-entry:: unsafe trait implementation + :glossary-dp: fls_h62dfjfyqcbn + + :glossary: + :dp:`fls_kqwcv076dzie` + An :dt:`unsafe trait implementation` is a :t:`trait implementation` subject to + :t:`keyword` ``unsafe``. + :chapter: + :dp:`fls_8pwr7ibvhmhu` + An :t:`unsafe trait implementation` is a :t:`trait implementation` subject to + :t:`keyword` ``unsafe``. + +.. glossary-entry:: implemented trait + :glossary-dp: fls_c0xxvivt8t1u + + :glossary: + :dp:`fls_7twlizi3v8cb` + An :dt:`implemented trait` is a :t:`trait` whose functionality has been + implemented by an :t:`implementing type`. + + :dp:`fls_2brvfx5wmvkf` + See :s:`ImplementedTrait`. + :chapter: + :dp:`fls_47x0ep8of8wr` + An :t:`implemented trait` is a :t:`trait` whose functionality has been + implemented by an :t:`implementing type`. :dp:`fls_agitlryvyc16` The :t:`type path` of a :t:`trait implementation` shall resolve to a :t:`trait`. @@ -135,9 +210,17 @@ Implementation Coherence .. rubric:: Legality Rules -:dp:`fls_fv1l4yjuut7p` -A :t:`trait implementation` exhibits :t:`implementation coherence` when it is -valid and does not overlap with another :t:`trait implementation`. +.. glossary-entry:: implementation coherence + :glossary-dp: fls_41GLrzVxcOV6 + + :glossary: + :dp:`fls_hAmKcuYT9hHi` + A :t:`trait implementation` exhibits :dt:`implementation coherence` when it is + valid and does not overlap with another :t:`trait implementation`. + :chapter: + :dp:`fls_fv1l4yjuut7p` + A :t:`trait implementation` exhibits :t:`implementation coherence` when it is + valid and does not overlap with another :t:`trait implementation`. :dp:`fls_swdusjwzgksx` Two :t:`[trait implementation]s` of the same :t:`implemented trait` overlap when @@ -163,10 +246,19 @@ Given :t:`trait implementation` :t:`type` may appear in the :t:`non-[local type]s` and :t:`non-[fundamental]` :t:`[type]s` of ``T0, T1, .., TN``. -:dp:`fls_UkQhjEWSJpDq` -A :t:`trait` or :t:`type` is :t:`fundamental` when its -:t:`implementation coherence` rules are relaxed and the :t:`trait` or :t:`type` -is always treated as if it was a :t:`local trait` or a :t:`local type`. +.. glossary-entry:: fundamental + :glossary-dp: fls_OFMoUA3eFtuC + + :glossary: + :dp:`fls_e0dRD4NTE0UP` + A :t:`trait` or :t:`type` is :dt:`fundamental` when its + :t:`implementation coherence` rules are relaxed and the :t:`trait` or :t:`type` + is always treated as if it was a :t:`local trait` or a :t:`local type`. + :chapter: + :dp:`fls_UkQhjEWSJpDq` + A :t:`trait` or :t:`type` is :t:`fundamental` when its + :t:`implementation coherence` rules are relaxed and the :t:`trait` or :t:`type` + is always treated as if it was a :t:`local trait` or a :t:`local type`. :dp:`fls_fSybUG40hA5r` The following :t:`[type]s` are :t:`fundamental`: @@ -205,9 +297,17 @@ Implementation Conformance .. rubric:: Legality Rules -:dp:`fls_YyUSuAYG4lX6` -A :t:`trait implementation` exhibits :t:`implementation conformance` when it -satisfies the constraints of its :t:`implemented trait`. +.. glossary-entry:: implementation conformance + :glossary-dp: fls_SBkTVa8bzGDx + + :glossary: + :dp:`fls_Gpq4EP1SsYJR` + :dt:`Implementation conformance` measures the compatibility between a + :t:`trait implementation` and the :t:`implemented trait`. + :chapter: + :dp:`fls_YyUSuAYG4lX6` + A :t:`trait implementation` exhibits :t:`implementation conformance` when it + satisfies the constraints of its :t:`implemented trait`. :dp:`fls_v31idwjau90d` An :t:`associated trait constant` is conformant with an :t:`associated constant` @@ -267,4 +367,3 @@ A :t:`trait implementation` is conformant with an :t:`implemented trait` when: :dp:`fls_8yq1g7nzv9px` A :t:`trait implementation` shall be conformant. - diff --git a/src/inline-assembly.rst b/src/inline-assembly.rst index b54cb9c0..ddf4c4f5 100644 --- a/src/inline-assembly.rst +++ b/src/inline-assembly.rst @@ -12,9 +12,17 @@ Inline Assembly .. rubric:: Legality Rules -:dp:`fls_leamdp1r3hez` -:t:`Inline assembly` is hand-written assembly code that is integrated into a -Rust program. +.. glossary-entry:: inline assembly + :glossary-dp: fls_lbL2b9wyg6es + + :glossary: + :dp:`fls_1MtaLEA7YfSv` + :dt:`Inline assembly` is hand-written assembly code that is integrated into a + Rust program. + :chapter: + :dp:`fls_leamdp1r3hez` + :t:`Inline assembly` is hand-written assembly code that is integrated into a + Rust program. :dp:`fls_3fg60jblx0xb` :t:`Inline assembly` is written as an :t:`assembly code block` that is @@ -100,33 +108,82 @@ Registers .. rubric:: Legality Rules -:dp:`fls_w5a6rybvptn6` -A :t:`register` is a hardware component capable of holding data that can be -read and written. - -:dp:`fls_rr8rsy7oilf0` -An :t:`input register` is a :t:`register` whose :t:`register name` is used in -a :t:`register argument` subject to :t:`direction modifier` ``in``, ``inout``, -or ``inlateout``. - -:dp:`fls_5ruu8n6r9mvp` -An :t:`output register` is a :t:`register` whose :t:`register name` is -used in a :t:`register argument` subject to :t:`direction modifier` ``out``, -``lateout``, ``inout``, or ``inlateout``. +.. glossary-entry:: register + :glossary-dp: fls_T84qaJMZzMbb + + :glossary: + :dp:`fls_fVdSybu8DW8w` + A :dt:`register` is a hardware component capable of holding data that can be + read and written. + :chapter: + :dp:`fls_w5a6rybvptn6` + A :t:`register` is a hardware component capable of holding data that can be + read and written. + +.. glossary-entry:: input register + :glossary-dp: fls_DTb5xegDqm9S + + :glossary: + :dp:`fls_dTvdQaFpncCj` + An :dt:`input register` is a :t:`register` whose :t:`register name` is used in + a :t:`register argument` subject to :t:`direction modifier` ``in``, ``inout``, + or ``inlateout``. + :chapter: + :dp:`fls_rr8rsy7oilf0` + An :t:`input register` is a :t:`register` whose :t:`register name` is used in + a :t:`register argument` subject to :t:`direction modifier` ``in``, ``inout``, + or ``inlateout``. + +.. glossary-entry:: output register + :glossary-dp: fls_XsGnaA47Nen0 + + :glossary: + :dp:`fls_4METI8qE9JiY` + An :dt:`output register` is a :t:`register` whose :t:`register name` is + used in a :t:`register argument` subject to :t:`direction modifier` ``out``, + ``lateout``, ``inout``, or ``inlateout``. + :chapter: + :dp:`fls_5ruu8n6r9mvp` + An :t:`output register` is a :t:`register` whose :t:`register name` is + used in a :t:`register argument` subject to :t:`direction modifier` ``out``, + ``lateout``, ``inout``, or ``inlateout``. :dp:`fls_HV3Y1A2xn0zr` A :t:`register` that is not specified as an :t:`output register` shall have the same :t:`value` upon exit from an :t:`assembly code block` as it did upon entry into the :t:`assembly code block`. -:dp:`fls_vesfzh8h6qzu` -A :t:`register name` is either the :t:`explicit register name` of a -:t:`register`, or the :t:`register class name` of the :t:`register class` a -:t:`register` belongs to. - -:dp:`fls_ffwqxlh60i5w` -An :t:`explicit register name` is a target-specific string that identifies -a :t:`register`. +.. glossary-entry:: register name + :glossary-dp: fls_kbBK666iBS2X + + :glossary: + :dp:`fls_U5r8Ypnjah5E` + A :dt:`register name` is either the :t:`explicit register name` of a + :t:`register`, or the :t:`register class name` of the :t:`register class` a + :t:`register` belongs to. + + :dp:`fls_WeyiFrnGgWPn` + See :s:`RegisterName`. + :chapter: + :dp:`fls_vesfzh8h6qzu` + A :t:`register name` is either the :t:`explicit register name` of a + :t:`register`, or the :t:`register class name` of the :t:`register class` a + :t:`register` belongs to. + +.. glossary-entry:: explicit register name + :glossary-dp: fls_uc7PnSbVVd9X + + :glossary: + :dp:`fls_UcMk6RRLrkB5` + An :dt:`explicit register name` is a target-specific string that identifies + a :t:`register`. + + :dp:`fls_Z3WDh75VpSUU` + See :s:`ExplicitRegisterName`. + :chapter: + :dp:`fls_ffwqxlh60i5w` + An :t:`explicit register name` is a target-specific string that identifies + a :t:`register`. :dp:`fls_3p8akc7gcsnx` An :t:`explicit register name` may be aliased as follows: @@ -442,12 +499,30 @@ Register Classes .. rubric:: Legality Rules -:dp:`fls_7gxb7ztpuofj` -A :t:`register class` represents a set of :t:`[register]s`. - -:dp:`fls_on0i2cpk254y` -A :t:`register class name` is a target-specific string that identifies a -:t:`register class`. +.. glossary-entry:: register class + :glossary-dp: fls_2qKUiHcfmZQ6 + + :glossary: + :dp:`fls_2H0OYS733VJl` + A :dt:`register class` represents a set of :t:`[register]s`. + :chapter: + :dp:`fls_7gxb7ztpuofj` + A :t:`register class` represents a set of :t:`[register]s`. + +.. glossary-entry:: register class name + :glossary-dp: fls_xZTkANlRsKRt + + :glossary: + :dp:`fls_QsSFoL0UyRRB` + A :dt:`register class name` is a target-specific string that identifies a + :t:`register class`. + + :dp:`fls_Y1ZpiFAV2c1A` + See :s:`RegisterClassName`. + :chapter: + :dp:`fls_on0i2cpk254y` + A :t:`register class name` is a target-specific string that identifies a + :t:`register class`. :dp:`fls_40ksem5g5xx9` :t:`[Register]s` are organized into :t:`[register class]es` as follows: @@ -591,6 +666,14 @@ then * :dp:`fls_7dii7lee457t` Otherwise, for an :t:`output register`, the upper bits are ignored. +.. glossary-entry:: NaN-boxing + :glossary-dp: fls_z3lxbjF4gaqV + + :glossary: + :dp:`fls_s956sJGwOa6z` + :dt:`NaN-boxing` is a technique for encoding :t:`[value]s` using the low order + bits of the mantissa of a 64-bit IEEE floating-point ``NaN``. + :dp:`fls_ujhjocg1361b` If a :t:`register argument` has :t:`direction modifier` ``inout`` and an :t:`input-output register expression`, then the :t:`input register expression` @@ -643,68 +726,179 @@ Register Arguments .. rubric:: Legality Rules -:dp:`fls_455dmnp4cxqv` -A :t:`register argument` is a :t:`construct` that configures the input -and output of a :t:`register`, and optionally binds the configuration to an -:t:`identifier`. +.. glossary-entry:: register argument + :glossary-dp: fls_ISWWmgKjfYwt + + :glossary: + :dp:`fls_rNoFdCKbVmRC` + A :dt:`register argument` is a :t:`construct` that configures the input + and output of a :t:`register`, and optionally binds the configuration to an + :t:`identifier`. + + :dp:`fls_aof7O9XREo2S` + See :s:`RegisterArgument`. + :chapter: + :dp:`fls_455dmnp4cxqv` + A :t:`register argument` is a :t:`construct` that configures the input + and output of a :t:`register`, and optionally binds the configuration to an + :t:`identifier`. :dp:`fls_6bv3s8be5xif` A :t:`register argument` shall be used within an :t:`assembly instruction`. -:dp:`fls_uddjvkz4g899` -A :t:`named register argument` is a :t:`register argument` whose configuration -is bound to an :t:`identifier`. - -:dp:`fls_sqs5to20p0te` -A :t:`positional register argument` is a :t:`register argument` whose -configuration is not bound to an :t:`identifier`. +.. glossary-entry:: named register argument + :glossary-dp: fls_WT1ZdxTZwUUE + + :glossary: + :dp:`fls_QBWHppNO8FPk` + A :dt:`named register argument` is a :t:`register argument` whose configuration + is bound to an :t:`identifier`. + :chapter: + :dp:`fls_uddjvkz4g899` + A :t:`named register argument` is a :t:`register argument` whose configuration + is bound to an :t:`identifier`. + +.. glossary-entry:: positional register argument + :glossary-dp: fls_Q0r8JkqAP6Of + + :glossary: + :dp:`fls_GJd6i52P3KM3` + A :dt:`positional register argument` is a :t:`register argument` whose + configuration is not bound to an :t:`identifier`. + :chapter: + :dp:`fls_sqs5to20p0te` + A :t:`positional register argument` is a :t:`register argument` whose + configuration is not bound to an :t:`identifier`. :dp:`fls_dzlycyk24euk` A :t:`named register argument` shall appear after a :t:`positional register argument`. -:dp:`fls_ics6gdzww1p` -An :t:`explicit register argument` is a :t:`register argument` that uses an -:t:`explicit register name`. +.. glossary-entry:: explicit register argument + :glossary-dp: fls_B1qkkSvc69J4 + + :glossary: + :dp:`fls_2o6S1WGDrMh3` + An :dt:`explicit register argument` is a :t:`register argument` that uses an + :t:`explicit register name`. + :chapter: + :dp:`fls_ics6gdzww1p` + An :t:`explicit register argument` is a :t:`register argument` that uses an + :t:`explicit register name`. :dp:`fls_mmc1w8jjr55r` An :t:`explicit register argument` shall appear after a :t:`named register argument`. -:dp:`fls_9hhtcey2d4t6` -A :t:`register class argument` is a :t:`register argument` that uses a -:t:`register class name`. - -:dp:`fls_8aynifgq02gt` -A :t:`register class argument` causes an assembler to select a suitable -:t:`register` from the related :t:`register class`. - -:dp:`fls_5a3vfresnv5z` -A :t:`direction modifier` is a :t:`construct` that indicates whether a -:t:`register argument` initializes a :t:`register`, assigns the :t:`value` of a -:t:`register` to an :t:`expression`, or both. - -:dp:`fls_fta1gb5tzi3a` -An :t:`input register expression` is an :t:`expression` that provides the -initial :t:`value` of a :t:`register`. - -:dp:`fls_sopiivuae0x7` -An :t:`output register expression` is an :t:`expression` that is assigned the -:t:`value` of a :t:`register`. +.. glossary-entry:: register class argument + :glossary-dp: fls_8gC17CgCS9n1 + + :glossary: + :dp:`fls_ksLXAyPLx9IL` + A :dt:`register class argument` is a :t:`register argument` that uses a + :t:`register class name`. + :chapter: + :dp:`fls_9hhtcey2d4t6` + A :t:`register class argument` is a :t:`register argument` that uses a + :t:`register class name`. + + :dp:`fls_8aynifgq02gt` + A :t:`register class argument` causes an assembler to select a suitable + :t:`register` from the related :t:`register class`. + +.. glossary-entry:: direction modifier + :glossary-dp: fls_ugIFZlAzDK6H + + :glossary: + :dp:`fls_8DY7xPVX4nXx` + A :dt:`direction modifier` is a :t:`construct` that indicates whether a + :t:`register argument` initializes a :t:`register`, assigns the :t:`value` of a + :t:`register` to an :t:`expression`, or both. + + :dp:`fls_lRKEzY3fQ3B2` + See :s:`DirectionModifier`. + :chapter: + :dp:`fls_5a3vfresnv5z` + A :t:`direction modifier` is a :t:`construct` that indicates whether a + :t:`register argument` initializes a :t:`register`, assigns the :t:`value` of a + :t:`register` to an :t:`expression`, or both. + +.. glossary-entry:: input register expression + :glossary-dp: fls_Tmju2kXErYhJ + + :glossary: + :dp:`fls_rvbuHSgg2RHt` + An :dt:`input register expression` is an :t:`expression` that provides the + initial :t:`value` of a :t:`register`. + + :dp:`fls_NqjRr9khzpl2` + See :s:`InputRegisterExpression`. + :chapter: + :dp:`fls_fta1gb5tzi3a` + An :t:`input register expression` is an :t:`expression` that provides the + initial :t:`value` of a :t:`register`. + +.. glossary-entry:: output register expression + :glossary-dp: fls_t79aKPilX8jk + + :glossary: + :dp:`fls_w95YRZ4JjBxl` + An :dt:`output register expression` is an :t:`expression` that is assigned the + :t:`value` of a :t:`register`. + + :dp:`fls_8B3ldFZVy7PA` + See :s:`OutputRegisterExpression`. + :chapter: + :dp:`fls_sopiivuae0x7` + An :t:`output register expression` is an :t:`expression` that is assigned the + :t:`value` of a :t:`register`. :dp:`fls_81Ju1TEqJ48K` A :dt:`const register expression` is an :t:`expression` that is evaluated at compile-time. -:dp:`fls_kkrcyk96w8x1` -An :t:`input-output register expression` is a :t:`construct` that specifies -both an :t:`input register expression` and an :t:`output register expression`. - -:dp:`fls_aniw4ehsn2kb` -A :t:`simple register expression` is either an :t:`expression` or an -:t:`underscore expression`. - -:dp:`fls_j9XOoXDmN5Dq` -A :t:`register expression` is either an :t:`input-output register expression`, a :t:`simple register expression` or a :t:`const register expression`. +.. glossary-entry:: input-output register expression + :glossary-dp: fls_y9EOkstHPckB + + :glossary: + :dp:`fls_lLQw3EFl7x5z` + An :dt:`input-output register expression` is a :t:`construct` that specifies + both an :t:`input register expression` and an :t:`output register expression`. + + :dp:`fls_FnMGXi2nPgUH` + See :s:`InputOutputRegisterExpression`. + :chapter: + :dp:`fls_kkrcyk96w8x1` + An :t:`input-output register expression` is a :t:`construct` that specifies + both an :t:`input register expression` and an :t:`output register expression`. + +.. glossary-entry:: simple register expression + :glossary-dp: fls_JDB3eBO0DY4o + + :glossary: + :dp:`fls_4Yp4R7gXucL2` + A :dt:`simple register expression` is either an :t:`expression` or an + :t:`underscore expression`. + + :dp:`fls_kKaqHDxPTTUC` + See :s:`SimpleRegisterExpression`. + :chapter: + :dp:`fls_aniw4ehsn2kb` + A :t:`simple register expression` is either an :t:`expression` or an + :t:`underscore expression`. + +.. glossary-entry:: register expression + :glossary-dp: fls_7KIReJZLKdeK + + :glossary: + :dp:`fls_2cVy6XfOQ4QG` + A :dt:`register expression` is either an :t:`input-output register expression` + or a :t:`simple register expression`. + + :dp:`fls_YEzo09cqWUUy` + See :s:`RegisterExpression`. + :chapter: + :dp:`fls_j9XOoXDmN5Dq` + A :t:`register expression` is either an :t:`input-output register expression`, a :t:`simple register expression` or a :t:`const register expression`. :dp:`fls_jU8zg4k8dFsY` The :t:`type` of a :t:`const register expression` shall be an :t:`integer type`. @@ -970,17 +1164,38 @@ Assembly Instructions .. rubric:: Legality Rules -:dp:`fls_4jr7eg6e0g4w` -An :t:`assembly instruction` is a :t:`string literal` that represents a -low-level assembly operation or an :t:`assembly directive`. +.. glossary-entry:: assembly instruction + :glossary-dp: fls_HliSgbSzPO2r + + :glossary: + :dp:`fls_VLu28hOvCy2o` + An :dt:`assembly instruction` is a :t:`string literal` that represents a + low-level assembly operation or an :t:`assembly directive`. + + :dp:`fls_EYHuB5cCldbm` + See :s:`AssemblyInstruction`. + :chapter: + :dp:`fls_4jr7eg6e0g4w` + An :t:`assembly instruction` is a :t:`string literal` that represents a + low-level assembly operation or an :t:`assembly directive`. :dp:`fls_ihjhpy4osl53` An :t:`assembly instruction` shall use the syntax of format strings as defined in :t:`module` :std:`std::fmt`, and contain zero or more :t:`[register parameter]s`. -:dp:`fls_2d05gcixjrzt` -An :t:`assembly code block` is a sequence of :t:`[assembly instruction]s`. +.. glossary-entry:: assembly code block + :glossary-dp: fls_et0NKXAYyDmh + + :glossary: + :dp:`fls_d1ojwFwKpvm3` + An :dt:`assembly code block` is a sequence of :t:`[assembly instruction]s`. + + :dp:`fls_gXVUuW6iyNhZ` + See :s:`AssemblyCodeBlock`. + :chapter: + :dp:`fls_2d05gcixjrzt` + An :t:`assembly code block` is a sequence of :t:`[assembly instruction]s`. :dp:`fls_z64f094aivp6` When an :t:`assembly code block` contains multiple :t:`[assembly instruction]s`, @@ -1001,10 +1216,19 @@ A tool is not required to guarantee that two :t:`[assembly code block]s` appear in the same declarative order in the final assembly output, or appear contiguously in successive addresses. -:dp:`fls_xugsn2ghh73c` -A :t:`register parameter` is a substring delimited by characters 0x7B (left -curly bracket) and 0x7D (right curly bracket) that is substituted with a -:t:`register argument` in an :t:`assembly instruction`. +.. glossary-entry:: register parameter + :glossary-dp: fls_foh6xELWBsY9 + + :glossary: + :dp:`fls_JicHMIj5dlxJ` + A :dt:`register parameter` is a substring delimited by characters 0x7B (left + curly bracket) and 0x7D (right curly bracket) that is substituted with a + :t:`register argument` in an :t:`assembly instruction`. + :chapter: + :dp:`fls_xugsn2ghh73c` + A :t:`register parameter` is a substring delimited by characters 0x7B (left + curly bracket) and 0x7D (right curly bracket) that is substituted with a + :t:`register argument` in an :t:`assembly instruction`. :dp:`fls_opnxq5kyw9jo` On x86 architectures, direction flag ``DF`` in :t:`register` ``EFLAGS`` shall @@ -1029,10 +1253,19 @@ Register Parameter Modifiers .. rubric:: Legality Rules -:dp:`fls_2xilifichdqu` -A :t:`register parameter modifier` is a substring that starts with character -0x3A (colon), follows a :t:`register parameter`, and changes the formatting of -the related :t:`register parameter`. +.. glossary-entry:: register parameter modifier + :glossary-dp: fls_NDpKXnlmnN7M + + :glossary: + :dp:`fls_8BdOnxHZS0Qi` + A :dt:`register parameter modifier` is a substring that starts with character + 0x3A (colon), follows a :t:`register parameter`, and changes the formatting of + the related :t:`register parameter`. + :chapter: + :dp:`fls_2xilifichdqu` + A :t:`register parameter modifier` is a substring that starts with character + 0x3A (colon), follows a :t:`register parameter`, and changes the formatting of + the related :t:`register parameter`. :dp:`fls_o3fx9397ib74` The effects of a :t:`register parameter modifier` depends on the architecture @@ -1233,9 +1466,17 @@ Directive Support .. rubric:: Legality Rules -:dp:`fls_4tfod2vgz2m6` -An :t:`assembly directive` is a request to the assembler to perform a -particular action or change a setting. +.. glossary-entry:: assembly directive + :glossary-dp: fls_iUnmWXxcuzif + + :glossary: + :dp:`fls_FP2KbO6c3cpq` + An :dt:`assembly directive` is a request to the assembler to perform a + particular action or change a setting. + :chapter: + :dp:`fls_4tfod2vgz2m6` + An :t:`assembly directive` is a request to the assembler to perform a + particular action or change a setting. :dp:`fls_3b0ab1nlo641` If an :t:`assembly code block` contains stateful :t:`[assembly directive]s` @@ -1395,10 +1636,22 @@ ABI Clobbers .. rubric:: Legality Rules -:dp:`fls_xa11ggykg0sh` -An :t:`ABI clobber` is an argument to :t:`macro` :std:`core::arch::asm` which -indicates that the :t:`[value]s` of selected :t:`[register]s` might be -overwritten during the :t:`execution` of an :t:`assembly code block`. +.. glossary-entry:: ABI clobber + :glossary-dp: fls_zOdDwoObYHC0 + + :glossary: + :dp:`fls_OVX4RFcWKfP9` + An :dt:`ABI clobber` is an argument to :t:`macro` :std:`core::arch::asm` which + indicates that the :t:`[value]s` of selected :t:`[register]s` might be + overwritten during the :t:`execution` of an :t:`assembly code block`. + + :dp:`fls_pMNTKjDMCHia` + See :s:`AbiClobber`. + :chapter: + :dp:`fls_xa11ggykg0sh` + An :t:`ABI clobber` is an argument to :t:`macro` :std:`core::arch::asm` which + indicates that the :t:`[value]s` of selected :t:`[register]s` might be + overwritten during the :t:`execution` of an :t:`assembly code block`. :dp:`fls_e43sj9inlsym` Multiple :t:`[ABI clobber]s` may be specified for an :t:`assembly code block`. @@ -1489,9 +1742,20 @@ Assembly Options .. rubric:: Legality Rules -:dp:`fls_i21l6t3vn95t` -An :t:`assembly option` is used to specify a characteristic of or a restriction -on the related :t:`assembly code block`. +.. glossary-entry:: assembly option + :glossary-dp: fls_1iVIUoVDsYph + + :glossary: + :dp:`fls_F5I3okDKIYnE` + An :dt:`assembly option` is used to specify a characteristic of or a restriction + on the related :t:`assembly code block`. + + :dp:`fls_31NQgPGb73Hy` + See :s:`AssemblyOption`. + :chapter: + :dp:`fls_i21l6t3vn95t` + An :t:`assembly option` is used to specify a characteristic of or a restriction + on the related :t:`assembly code block`. :dp:`fls_g09kmp2a04g9` :t:`Assembly option` :dc:`att_syntax` is applicable only to x86 architectures diff --git a/src/items.rst b/src/items.rst index 0bd9c6db..6f4879f7 100644 --- a/src/items.rst +++ b/src/items.rst @@ -40,6 +40,17 @@ Items $$unsafe$$ | $$safe$$ +.. glossary-entry:: item + :glossary-dp: fls_yh2a7e3d3894 + + :glossary: + :dp:`fls_2ghaujiqkhyy` + An :dt:`item` is the most basic semantic element in program text. An item + defines the compile- and run-time semantics of a program. + + :dp:`fls_xd997kd2i73a` + See :s:`Item`. + .. rubric:: Legality Rules :dp:`fls_s3b1cba9lfj5` @@ -52,4 +63,3 @@ an :t:`item`. :dp:`fls_hil5f7y4xdhe` :t:`Elaboration` is the process by which a :t:`declaration` achieves its runtime effects. - diff --git a/src/lexical-elements.rst b/src/lexical-elements.rst index 750a1ff2..27224a95 100644 --- a/src/lexical-elements.rst +++ b/src/lexical-elements.rst @@ -25,6 +25,15 @@ Character Set The program text of a Rust program is written using the :t:`Unicode` character set. +.. glossary-entry:: Unicode + :glossary-dp: fls_kafgmevvzl5t + + :glossary: + :dp:`fls_y7gwku7pe1f4` + :dt:`Unicode` is the universal character encoding standard for written + characters and text described in the Unicode® Standard by the Unicode + Consortium. + .. rubric:: Syntax :dp:`fls_vfx8byq5zo8t` @@ -32,6 +41,22 @@ A character is defined by this document for each cell in the coding space described by :t:`Unicode`, regardless of whether or not :t:`Unicode` allocates a character to that cell. +.. glossary-entry:: code point + :glossary-dp: fls_aqovhozevngd + + :glossary: + :dp:`fls_6xw8jtiomc2n` + In :t:`Unicode`, a :dt:`code point` is a numeric :t:`value` that maps to a + character. + +.. glossary-entry:: plane + :glossary-dp: fls_dr6wbsqjd2qm + + :glossary: + :dp:`fls_x1wbguoqdsf9` + In :t:`Unicode`, a :dt:`plane` is a continuous group of 65,536 + :t:`[code point]s`. + :dp:`fls_pvslhm3chtlb` A :dt:`whitespace character` is one of the following characters: @@ -68,9 +93,17 @@ A :dt:`whitespace character` is one of the following characters: * :dp:`fls_zfs15iel08y0` 0x2029 (paragraph separator) -:dp:`fls_7eifv4ksunu1` -A :t:`whitespace string` is a string that consists of one or more -:t:`[whitespace character]s`. +.. glossary-entry:: whitespace string + :glossary-dp: fls_cxm8nw6qiryr + + :glossary: + :dp:`fls_nljkmadklwdp` + A :dt:`whitespace string` is a string that consists of one or more + :t:`[whitespace character]s`. + :chapter: + :dp:`fls_7eifv4ksunu1` + A :t:`whitespace string` is a string that consists of one or more + :t:`[whitespace character]s`. :dp:`fls_PIDKEm8GiLNL` An :ds:`AsciiCharacter` is any :t:`Unicode` character in the range 0x00 - 0x7F, both inclusive. @@ -159,22 +192,54 @@ The text of a :t:`source file` is a sequence of separate :t:`[lexical element]s`. The meaning of a program depends only on the particular sequence of :t:`[lexical element]s`, excluding :t:`non-[doc comment]s`. -:dp:`fls_a1zylpqha73x` -A :t:`lexical element` is the most basic syntactic element in program text. +.. glossary-entry:: lexical element + :glossary-dp: fls_h2tqtmm5686y + + :glossary: + :dp:`fls_nrxnbkatn63n` + A :dt:`lexical element` is the most basic syntactic element in program + text. + :chapter: + :dp:`fls_a1zylpqha73x` + A :t:`lexical element` is the most basic syntactic element in program text. :dp:`fls_jy6wifn5r2bu` The text of a :t:`source file` is divided into :t:`[line]s`. -:dp:`fls_efdfq9nhpmp5` -A :t:`line` is a sequence of zero or more characters followed by an end of -line. +.. glossary-entry:: line + :glossary-dp: fls_8qputmx0i7ku + + :glossary: + :dp:`fls_oqf2439j3y7b` + A :dt:`line` is a sequence of zero or more characters followed by an end of + line. + :chapter: + :dp:`fls_efdfq9nhpmp5` + A :t:`line` is a sequence of zero or more characters followed by an end of + line. :dp:`fls_go25sisi5fdp` The representation of an end of line is tool-defined. -:dp:`fls_a6t53o8h1vdk` -A :t:`separator` is a character or a string that separates adjacent :t:`[lexical -element]s`. A :t:`whitespace string` is a :t:`separator`. +.. glossary-entry:: separator + :glossary-dp: fls_at8q1svh3isg + + :glossary: + :dp:`fls_128xny4qfcj5` + A :dt:`separator` is a character or a string that separates adjacent + :t:`[lexical element]s`. + :chapter: + :dp:`fls_a6t53o8h1vdk` + A :t:`separator` is a character or a string that separates adjacent :t:`[lexical + element]s`. A :t:`whitespace string` is a :t:`separator`. + +.. glossary-entry:: punctuator + :glossary-dp: fls_hdwmw3jbwefi + + :glossary: + :dp:`fls_gwqgi0b7jxmu` + A :dt:`punctuator` is a character or a sequence of characters in category + :s:`Punctuation`. :dp:`fls_8fv63w6f4udl` A :dt:`simple punctuator` is one of the following special characters: @@ -467,12 +532,30 @@ except ``crate``, ``self``, ``Self``, and ``super``. .. rubric:: Legality Rules -:dp:`fls_xsdmun5uqy4c` -An :t:`identifier` is a :t:`lexical element` that refers to a :t:`name`. - -:dp:`fls_ktnf6zkrdy45` -A :t:`pure identifier` is an :t:`identifier` that does not include :t:`[weak -keyword]s`. +.. glossary-entry:: identifier + :glossary-dp: fls_kpsyz8yopova + + :glossary: + :dp:`fls_14zc5bcm9d8o` + An :dt:`identifier` is a :t:`lexical element` that refers to a :t:`name`. + + :dp:`fls_oddu2wzhczvq` + See :s:`Identifier`. + :chapter: + :dp:`fls_xsdmun5uqy4c` + An :t:`identifier` is a :t:`lexical element` that refers to a :t:`name`. + +.. glossary-entry:: pure identifier + :glossary-dp: fls_sgwvmnoio1ql + + :glossary: + :dp:`fls_6pez8fyiew0k` + A :dt:`pure identifier` is an :t:`identifier` that does not include + :t:`[weak keyword]s`. + :chapter: + :dp:`fls_ktnf6zkrdy45` + A :t:`pure identifier` is an :t:`identifier` that does not include :t:`[weak + keyword]s`. :dp:`fls_jpecw46eh061` A :t:`pure identifier` shall follow the specification in Unicode Standard Annex @@ -554,8 +637,18 @@ Literals .. rubric:: Legality Rules -:dp:`fls_s76un78zyd0j` -A :t:`literal` is a fixed :t:`value` in program text. +.. glossary-entry:: literal + :glossary-dp: fls_z850pyf9r1f4 + + :glossary: + :dp:`fls_ckbyt11pku9j` + A :dt:`literal` is a fixed :t:`value` in program text. + + :dp:`fls_h1g46cevrqjv` + See :s:`Literal`. + :chapter: + :dp:`fls_s76un78zyd0j` + A :t:`literal` is a fixed :t:`value` in program text. .. _fls_2ifjqwnw03ms: @@ -590,8 +683,18 @@ return), 0x27 (apostrophe), and 0x5C (reverse solidus). .. rubric:: Legality Rules -:dp:`fls_q0qwr83frszx` -A :t:`byte literal` is a :t:`literal` that denotes a fixed byte :t:`value`. +.. glossary-entry:: byte literal + :glossary-dp: fls_e8rokiw23i9t + + :glossary: + :dp:`fls_l67oo0u12zjb` + A :dt:`byte literal` is a :t:`literal` that denotes a fixed byte :t:`value`. + + :dp:`fls_iu9twvm648dx` + See :s:`ByteLiteral`. + :chapter: + :dp:`fls_q0qwr83frszx` + A :t:`byte literal` is a :t:`literal` that denotes a fixed byte :t:`value`. :dp:`fls_fggytrv5jvw0` The :t:`type` of a :t:`byte literal` is :c:`u8`. @@ -619,9 +722,20 @@ Byte String Literals .. rubric:: Legality Rules -:dp:`fls_t63zfv5JdUhj` -A :t:`byte string literal` is a :t:`literal` that consists of multiple -:s:`[AsciiCharacter]s`. +.. glossary-entry:: byte string literal + :glossary-dp: fls_uwe7iomhvgtp + + :glossary: + :dp:`fls_my4r1l3ilyt2` + A :dt:`byte string literal` is a :t:`literal` that consists of multiple + :s:`[AsciiCharacter]s`. + + :dp:`fls_4yhag19z61bl` + See :s:`ByteStringLiteral`. + :chapter: + :dp:`fls_t63zfv5JdUhj` + A :t:`byte string literal` is a :t:`literal` that consists of multiple + :s:`[AsciiCharacter]s`. :dp:`fls_Xd6LnfzMb7t7` The character sequence 0x0D 0x0A (carriage return, new line) is replaced by 0x0A @@ -651,9 +765,20 @@ except characters 0x0D (carriage return), 0x22 (quotation mark), and 0x5C .. rubric:: Legality Rules -:dp:`fls_moe3zfx39ox2` -A :t:`simple byte string literal` is a :t:`byte string literal` that consists of multiple -:s:`[AsciiCharacter]s`. +.. glossary-entry:: simple byte string literal + :glossary-dp: fls_4GvXiDfcPlRD + + :glossary: + :dp:`fls_XpbU4Up0Aza8` + A :dt:`simple byte string literal` is a :t:`byte string literal` that consists + of multiple :s:`[AsciiCharacter]s`. + + :dp:`fls_OfI70zK68TnQ` + See :s:`SimpleByteStringLiteral`. + :chapter: + :dp:`fls_moe3zfx39ox2` + A :t:`simple byte string literal` is a :t:`byte string literal` that consists of multiple + :s:`[AsciiCharacter]s`. :dp:`fls_vffxb6arj9jf` The :t:`type` of a :t:`simple byte string literal` of size ``N`` is ``&'static [u8; @@ -689,9 +814,20 @@ Raw Byte String Literals .. rubric:: Legality Rules -:dp:`fls_yyw7nv651580` -A :t:`raw byte string literal` is a :t:`simple byte string literal` that does not -recognize :t:`[escaped character]s`. +.. glossary-entry:: raw byte string literal + :glossary-dp: fls_ipeh92kh17ze + + :glossary: + :dp:`fls_8v5k3wemy4tl` + A :dt:`raw byte string literal` is a :t:`simple byte string literal` that does + not recognize :t:`[escaped character]s`. + + :dp:`fls_5x71i3ay3na2` + See :s:`RawByteStringLiteral`. + :chapter: + :dp:`fls_yyw7nv651580` + A :t:`raw byte string literal` is a :t:`simple byte string literal` that does not + recognize :t:`[escaped character]s`. :dp:`fls_5ybq0euwya42` The :t:`type` of a :t:`raw byte string literal` of size ``N`` is ``&'static @@ -720,9 +856,20 @@ C String Literals .. rubric:: Legality Rules -:dp:`fls_VKCW830CzhhN` -A :t:`c string literal` is a :t:`literal` that consists of multiple characters -with an implicit 0x00 byte appended to it. +.. glossary-entry:: c string literal + :glossary-dp: fls_roz4WXH5JZFj + + :glossary: + :dp:`fls_g3NHtaOhTB7g` + A :dt:`c string literal` is a :t:`literal` that consists of multiple characters + with an implicit 0x00 byte appended to it. + + :dp:`fls_FZ6QSpjmVme5` + See :s:`CStringLiteral`. + :chapter: + :dp:`fls_VKCW830CzhhN` + A :t:`c string literal` is a :t:`literal` that consists of multiple characters + with an implicit 0x00 byte appended to it. :dp:`fls_XJprzaEn82Xs` The character sequence 0x0D 0x0A (carriage return, new line) is replaced by 0x0A @@ -746,10 +893,22 @@ Simple C String Literals | StringContinuation | UnicodeEscape -:dp:`fls_fnwQHo7twAom` -A :t:`simple c string literal` is any :t:`Unicode` character except characters -0x0D (carriage return), 0x22 (quotation mark), 0x5C (reverse solidus) and 0x00 -(null byte). +.. glossary-entry:: simple c string literal + :glossary-dp: fls_fx2hhB0HHSUG + + :glossary: + :dp:`fls_qoHXrmds9SgI` + A :dt:`simple c string literal` is any :t:`Unicode` character except characters + 0x0D (carriage return), 0x22 (quotation mark), 0x5C (reverse solidus) and 0x00 + (null byte). + + :dp:`fls_ggm5FNUqg9EY` + See :s:`SimpleCStringLiteral`. + :chapter: + :dp:`fls_fnwQHo7twAom` + A :t:`simple c string literal` is any :t:`Unicode` character except characters + 0x0D (carriage return), 0x22 (quotation mark), 0x5C (reverse solidus) and 0x00 + (null byte). .. rubric:: Legality Rules @@ -796,9 +955,20 @@ Raw C String Literals .. rubric:: Legality Rules -:dp:`fls_gLrei65i8Uzq` -A :t:`raw c string literal` is a :t:`simple c string literal` that does not -recognize :t:`[escaped character]s`. +.. glossary-entry:: raw c string literal + :glossary-dp: fls_yGGvg3e0nPOh + + :glossary: + :dp:`fls_qhWBzqoYZL0e` + A :dt:`raw c string literal` is a :t:`simple c string literal` that does not + recognize :t:`[escaped character]s`. + + :dp:`fls_WpFJyq6q4k6E` + See :s:`RawCStringLiteral`. + :chapter: + :dp:`fls_gLrei65i8Uzq` + A :t:`raw c string literal` is a :t:`simple c string literal` that does not + recognize :t:`[escaped character]s`. :dp:`fls_9nJHsg9dCi66` The :t:`type` of a :t:`simple string literal` is :std:`&'static @@ -827,8 +997,18 @@ Numeric Literals .. rubric:: Legality Rules -:dp:`fls_fqpqnku27v99` -A :t:`numeric literal` is a :t:`literal` that denotes a number. +.. glossary-entry:: numeric literal + :glossary-dp: fls_a0qsojiymgjy + + :glossary: + :dp:`fls_978ndaqdv4r` + A :dt:`numeric literal` is a :t:`literal` that denotes a number. + + :dp:`fls_swue4tma9fmf` + See :s:`NumericLiteral`. + :chapter: + :dp:`fls_fqpqnku27v99` + A :t:`numeric literal` is a :t:`literal` that denotes a number. .. _fls_2ed4axpsy9u0: @@ -910,31 +1090,107 @@ Integer Literals .. rubric:: Legality Rules -:dp:`fls_vkk2krfn93ry` -An :t:`integer literal` is a :t:`numeric literal` that denotes a whole number. - -:dp:`fls_nxqncu5yq4eu` -A :t:`binary literal` is an :t:`integer literal` in base 2. - -:dp:`fls_rn8xfd66yvst` -A :t:`decimal literal` is an :t:`integer literal` in base 10. - -:dp:`fls_2268lchxkzjp` -A :t:`hexadecimal literal` is an :t:`integer literal` in base 16. - -:dp:`fls_4v7awnutbpoe` -An :t:`octal literal` is an :t:`integer literal` in base 8. - -:dp:`fls_f1e29aj0sqvl` -An :t:`integer suffix` is a component of an :t:`integer literal` that specifies -an explicit :t:`integer type`. - -:dp:`fls_u83mffscqm6` -A :t:`suffixed integer` is an :t:`integer literal` with an :t:`integer suffix`. - -:dp:`fls_g10nuv14q4jn` -An :t:`unsuffixed integer` is an :t:`integer literal` without an :t:`integer -suffix`. +.. glossary-entry:: integer literal + :glossary-dp: fls_e2kizieowvuh + + :glossary: + :dp:`fls_23a1fjpf15qv` + An :dt:`integer literal` is a :t:`numeric literal` that denotes a whole number. + + :dp:`fls_6qpj0nr0jpjr` + See :s:`IntegerLiteral`. + :chapter: + :dp:`fls_vkk2krfn93ry` + An :t:`integer literal` is a :t:`numeric literal` that denotes a whole number. + +.. glossary-entry:: binary literal + :glossary-dp: fls_or4o65fyt28y + + :glossary: + :dp:`fls_hy54uj6u3nqw` + A :dt:`binary literal` is an :t:`integer literal` in base 2. + + :dp:`fls_693r7vs2s7o7` + See :s:`BinaryLiteral`. + :chapter: + :dp:`fls_nxqncu5yq4eu` + A :t:`binary literal` is an :t:`integer literal` in base 2. + +.. glossary-entry:: decimal literal + :glossary-dp: fls_128iunbbiuql + + :glossary: + :dp:`fls_lwv823lih69m` + A :dt:`decimal literal` is an :t:`integer literal` in base 10. + + :dp:`fls_pxiba4se64y4` + See :s:`DecimalLiteral`. + :chapter: + :dp:`fls_rn8xfd66yvst` + A :t:`decimal literal` is an :t:`integer literal` in base 10. + +.. glossary-entry:: hexadecimal literal + :glossary-dp: fls_5uiij8eqln5g + + :glossary: + :dp:`fls_8b6njsi8g68i` + A :dt:`hexadecimal literal` is an :t:`integer literal` in base 16. + + :dp:`fls_vssa4z5wcgaa` + See :s:`HexadecimalLiteral`. + :chapter: + :dp:`fls_2268lchxkzjp` + A :t:`hexadecimal literal` is an :t:`integer literal` in base 16. + +.. glossary-entry:: octal literal + :glossary-dp: fls_q47u2zq6clon + + :glossary: + :dp:`fls_pf4341vnqiin` + An :dt:`octal literal` is an :t:`integer literal` in base 8. + + :dp:`fls_8u0n6xu0mizm` + See ``OctalLiteral.`` + :chapter: + :dp:`fls_4v7awnutbpoe` + An :t:`octal literal` is an :t:`integer literal` in base 8. + +.. glossary-entry:: integer suffix + :glossary-dp: fls_bhvh8qwqy8ve + + :glossary: + :dp:`fls_qazh8f8rs528` + An :dt:`integer suffix` is a component of an :t:`integer literal` that + specifies an explicit :t:`integer type`. + + :dp:`fls_jqagv350kw2m` + See ``IntegerSuffix.`` + :chapter: + :dp:`fls_f1e29aj0sqvl` + An :t:`integer suffix` is a component of an :t:`integer literal` that specifies + an explicit :t:`integer type`. + +.. glossary-entry:: suffixed integer + :glossary-dp: fls_bmbu11ycjpor + + :glossary: + :dp:`fls_ltzetxu3sq7k` + A :dt:`suffixed integer` is an :t:`integer literal` with an :t:`integer suffix`. + :chapter: + :dp:`fls_u83mffscqm6` + A :t:`suffixed integer` is an :t:`integer literal` with an :t:`integer suffix`. + +.. glossary-entry:: unsuffixed integer + :glossary-dp: fls_d18nctsj8wu5 + + :glossary: + :dp:`fls_t419z3zder0q` + An :dt:`unsuffixed integer` is an :t:`integer literal` without an + :t:`integer suffix`. + :chapter: + :dp:`fls_g10nuv14q4jn` + An :t:`unsuffixed integer` is an :t:`integer literal` without an :t:`integer + suffix`. :dp:`fls_hpkkvuj1z1ez` The :t:`type` of a :t:`suffixed integer` is determined by its :t:`integer @@ -1036,18 +1292,54 @@ Float Literals .. rubric:: Legality Rules -:dp:`fls_rzi7oeqokd6e` -A :t:`float literal` is a :t:`numeric literal` that denotes a fractional number. - -:dp:`fls_2ru1zyrykd37` -A :t:`float suffix` is a component of a :t:`float literal` that specifies an -explicit :t:`floating-point type`. - -:dp:`fls_21mhnhplzam7` -A :t:`suffixed float` is a :t:`float literal` with a :t:`float suffix`. - -:dp:`fls_drqh80k0sfkb` -An :t:`unsuffixed float` is a :t:`float literal` without a :t:`float suffix`. +.. glossary-entry:: float literal + :glossary-dp: fls_achdyw3nbme3 + + :glossary: + :dp:`fls_53o8dio9vpjh` + A :dt:`float literal` is a :t:`numeric literal` that denotes a fractional + number. + + :dp:`fls_hqeaakhsqxok` + See :s:`FloatLiteral`. + :chapter: + :dp:`fls_rzi7oeqokd6e` + A :t:`float literal` is a :t:`numeric literal` that denotes a fractional number. + +.. glossary-entry:: float suffix + :glossary-dp: fls_wgylj1n4wrqe + + :glossary: + :dp:`fls_vka2z7frq9j8` + A :dt:`float suffix` is a component of a :t:`float literal` that specifies an + explicit :t:`floating-point type`. + + :dp:`fls_2k1ddqhsgxqk` + See :s:`FloatSuffix`. + :chapter: + :dp:`fls_2ru1zyrykd37` + A :t:`float suffix` is a component of a :t:`float literal` that specifies an + explicit :t:`floating-point type`. + +.. glossary-entry:: suffixed float + :glossary-dp: fls_qar9v52smi9j + + :glossary: + :dp:`fls_7reb4jp0x1wf` + A :dt:`suffixed float` is a :t:`float literal` with a :t:`float suffix`. + :chapter: + :dp:`fls_21mhnhplzam7` + A :t:`suffixed float` is a :t:`float literal` with a :t:`float suffix`. + +.. glossary-entry:: unsuffixed float + :glossary-dp: fls_4ph9cact2scc + + :glossary: + :dp:`fls_7wp6y0xeqqve` + An :dt:`unsuffixed float` is a :t:`float literal` without a :t:`float suffix`. + :chapter: + :dp:`fls_drqh80k0sfkb` + An :t:`unsuffixed float` is a :t:`float literal` without a :t:`float suffix`. :dp:`fls_cbs7j9pjpusw` The :t:`type` of a :t:`suffixed float` is determined by the :t:`float suffix` @@ -1125,9 +1417,20 @@ the range of U+D800 and U+DFFF, inclusive. .. rubric:: Legality Rules -:dp:`fls_vag2oy4q7d4n` -A :t:`character literal` is a :t:`literal` that denotes a fixed :t:`Unicode` -character. +.. glossary-entry:: character literal + :glossary-dp: fls_cfphqaml82ik + + :glossary: + :dp:`fls_8oah1cf8p0lb` + A :dt:`character literal` is a :t:`literal` that denotes a fixed :t:`Unicode` + character. + + :dp:`fls_sup0h5mvibzs` + See :s:`CharacterLiteral`. + :chapter: + :dp:`fls_vag2oy4q7d4n` + A :t:`character literal` is a :t:`literal` that denotes a fixed :t:`Unicode` + character. :dp:`fls_n8z6p6g564r2` The :t:`type` of a :t:`character literal` is :c:`char`. @@ -1156,8 +1459,18 @@ String Literals .. rubric:: Legality Rules -:dp:`fls_7fuctvtvdi7x` -A :t:`string literal` is a :t:`literal` that consists of multiple characters. +.. glossary-entry:: string literal + :glossary-dp: fls_cck2tmyzmpja + + :glossary: + :dp:`fls_dphk5br0ag35` + A :dt:`string literal` is a :t:`literal` that consists of multiple characters. + + :dp:`fls_z0t3ae24h5h5` + See :s:`StringLiteral`. + :chapter: + :dp:`fls_7fuctvtvdi7x` + A :t:`string literal` is a :t:`literal` that consists of multiple characters. :dp:`fls_NyiCpU2tzJlQ` The character sequence 0x0D 0x0A (carriage return, new line) is replaced by 0x0A @@ -1191,9 +1504,20 @@ new line). .. rubric:: Legality Rules -:dp:`fls_ycy5ee6orjx` -A :t:`simple string literal` is a :t:`string literal` where the characters are -:t:`Unicode` characters. +.. glossary-entry:: simple string literal + :glossary-dp: fls_dpod2gc7a0u + + :glossary: + :dp:`fls_p6qyyptz8w8w` + A :dt:`simple string literal` is a :t:`string literal` where the characters are + :t:`Unicode` characters. + + :dp:`fls_osj0c4dmr6e0` + See :s:`SimpleStringLiteral`. + :chapter: + :dp:`fls_ycy5ee6orjx` + A :t:`simple string literal` is a :t:`string literal` where the characters are + :t:`Unicode` characters. :dp:`fls_6nt5kls21xes` The :t:`type` of a :t:`simple string literal` is ``&'static str``. @@ -1233,9 +1557,20 @@ Raw String Literals .. rubric:: Legality Rules -:dp:`fls_36suwhbwmq1t` -A :t:`raw string literal` is a :t:`simple string literal` that does not -recognize :t:`[escaped character]s`. +.. glossary-entry:: raw string literal + :glossary-dp: fls_echjohx6fjc + + :glossary: + :dp:`fls_48t4v316951j` + A :dt:`raw string literal` is a :t:`simple string literal` that does not + recognize :t:`[escaped character]s`. + + :dp:`fls_26ol7lrnux94` + See :s:`RawStringLiteral`. + :chapter: + :dp:`fls_36suwhbwmq1t` + A :t:`raw string literal` is a :t:`simple string literal` that does not + recognize :t:`[escaped character]s`. :dp:`fls_ms43w1towz40` The :t:`type` of a :t:`raw string literal` is ``&'static str``. @@ -1263,9 +1598,20 @@ Boolean Literals .. rubric:: Legality Rules -:dp:`fls_1lll64ftupjd` -A :t:`boolean literal` is a :t:`literal` that denotes the truth :t:`[value]s` of -logic and Boolean algebra. +.. glossary-entry:: boolean literal + :glossary-dp: fls_oz4tdyp3rvm4 + + :glossary: + :dp:`fls_5mrxdqh474vk` + A :dt:`boolean literal` is a :t:`literal` that denotes the truth :t:`[value]s` + of logic and Boolean algebra. + + :dp:`fls_i13qcchm9vkk` + See :s:`BooleanLiteral`. + :chapter: + :dp:`fls_1lll64ftupjd` + A :t:`boolean literal` is a :t:`literal` that denotes the truth :t:`[value]s` of + logic and Boolean algebra. :dp:`fls_pgngble3ilyx` The :t:`type` of a :t:`boolean literal` is :c:`bool`. @@ -1322,44 +1668,144 @@ Comments .. rubric:: Legality Rules -:dp:`fls_8obn3dtzpe5f` -A :t:`comment` is a :t:`lexical element` that acts as an annotation or an -explanation in program text. - -:dp:`fls_qsbnl11be35s` -A :t:`block comment` is a :t:`comment` that spans one or more :t:`[line]s`. - -:dp:`fls_nayisy85kyq2` -A :t:`line comment` is a :t:`comment` that spans exactly one :t:`line`. - -:dp:`fls_k3hj30hjkdhw` -An :t:`inner block doc` is a :t:`block comment` that applies to an enclosing -:t:`non-[comment]` :t:`construct`. - -:dp:`fls_tspijl68lduc` -An :t:`inner line doc` is a :t:`line comment` that applies to an enclosing -:t:`non-[comment]` :t:`construct`. - -:dp:`fls_KZp0yiFLTqxb` -An :t:`inner doc comment` is either an :t:`inner block doc` or an -:t:`inner line doc`. - -:dp:`fls_63gzofa9ktic` -An :t:`outer block doc` is a :t:`block comment` that applies to a subsequent -:t:`non-[comment]` :t:`construct`. - -:dp:`fls_scko7crha0um` -An :t:`outer line doc` is a :t:`line comment` that applies to a subsequent -:t:`non-[comment]` :t:`construct`. - -:dp:`fls_RYVL9KgaxKvl` -An :t:`outer doc comment` is either an :t:`outer block doc` or an -:t:`outer line doc`. - -:dp:`fls_7n6d3jx61ose` -A :t:`doc comment` is a :t:`comment` class that includes :t:`[inner block -doc]s`, :t:`[inner line doc]s`, :t:`[outer block doc]s`, and :t:`[outer line -doc]s`. +.. glossary-entry:: comment + :glossary-dp: fls_2moavfyeit0m + + :glossary: + :dp:`fls_3xhoz9f7xy1t` + A :dt:`comment` is a :t:`lexical element` that acts as an annotation or an + explanation in program text. + + :dp:`fls_pi32rhfqghma` + See :s:`Comment`. + :chapter: + :dp:`fls_8obn3dtzpe5f` + A :t:`comment` is a :t:`lexical element` that acts as an annotation or an + explanation in program text. + +.. glossary-entry:: block comment + :glossary-dp: fls_aa980vviqjue + + :glossary: + :dp:`fls_a0ejcfs7y5uy` + A :dt:`block comment` is a :t:`comment` that spans one or more :t:`[line]s`. + + :dp:`fls_21r4tblk8awi` + See :s:`BlockComment`. + :chapter: + :dp:`fls_qsbnl11be35s` + A :t:`block comment` is a :t:`comment` that spans one or more :t:`[line]s`. + +.. glossary-entry:: line comment + :glossary-dp: fls_k5ycqijslkxh + + :glossary: + :dp:`fls_3e7asah7lkqj` + A :dt:`line comment` is a :t:`comment` that spans exactly one :t:`line`. + + :dp:`fls_8j5j777dv2jm` + See :s:`LineComment`. + :chapter: + :dp:`fls_nayisy85kyq2` + A :t:`line comment` is a :t:`comment` that spans exactly one :t:`line`. + +.. glossary-entry:: inner block doc + :glossary-dp: fls_chbp2je32okc + + :glossary: + :dp:`fls_f4nqkybpwj1a` + An :dt:`inner block doc` is a :t:`block comment` that applies to an enclosing + :t:`non-[comment]` :t:`construct`. + + :dp:`fls_lmpaznk198ga` + See :s:`InnerBlockDoc`. + :chapter: + :dp:`fls_k3hj30hjkdhw` + An :t:`inner block doc` is a :t:`block comment` that applies to an enclosing + :t:`non-[comment]` :t:`construct`. + +.. glossary-entry:: inner line doc + :glossary-dp: fls_xgm53126q9c4 + + :glossary: + :dp:`fls_vtwavwjhgvlz` + An :dt:`inner line doc` is a :t:`line comment` that applies to an enclosing + :t:`non-[comment]` :t:`construct`. + + :dp:`fls_8cnikewkqs7` + See :s:`InnerLineDoc`. + :chapter: + :dp:`fls_tspijl68lduc` + An :t:`inner line doc` is a :t:`line comment` that applies to an enclosing + :t:`non-[comment]` :t:`construct`. + +.. glossary-entry:: inner doc comment + :glossary-dp: fls_vR1ucGTBKjlH + + :glossary: + :dp:`fls_6KunKwZf9QaF` + An :dt:`inner doc comment` is either an :t:`inner block doc` or an + :t:`inner line doc`. + :chapter: + :dp:`fls_KZp0yiFLTqxb` + An :t:`inner doc comment` is either an :t:`inner block doc` or an + :t:`inner line doc`. + +.. glossary-entry:: outer block doc + :glossary-dp: fls_toncretg92qh + + :glossary: + :dp:`fls_531ggn1f8f6u` + An :dt:`outer block doc` is a :t:`block comment` that applies to a subsequent + :t:`non-[comment]` :t:`construct`. + + :dp:`fls_ddy9a66tpytp` + See :s:`OuterBlockDoc`. + :chapter: + :dp:`fls_63gzofa9ktic` + An :t:`outer block doc` is a :t:`block comment` that applies to a subsequent + :t:`non-[comment]` :t:`construct`. + +.. glossary-entry:: outer line doc + :glossary-dp: fls_eqjbv8sovvfl + + :glossary: + :dp:`fls_m3u30fu8uac3` + An :dt:`outer line doc` is a :t:`line comment` that applies to a subsequent + :t:`non-[comment]` :t:`construct`. + + :dp:`fls_1ppwidw7szk5` + See :s:`OuterLineDoc`. + :chapter: + :dp:`fls_scko7crha0um` + An :t:`outer line doc` is a :t:`line comment` that applies to a subsequent + :t:`non-[comment]` :t:`construct`. + +.. glossary-entry:: outer doc comment + :glossary-dp: fls_PuTD100sWO5N + + :glossary: + :dp:`fls_mgSEUNUPcPBs` + An :dt:`outer doc comment` is either an :t:`outer block doc` or an + :t:`outer line doc`. + :chapter: + :dp:`fls_RYVL9KgaxKvl` + An :t:`outer doc comment` is either an :t:`outer block doc` or an + :t:`outer line doc`. + +.. glossary-entry:: doc comment + :glossary-dp: fls_4nm1r57ntecm + + :glossary: + :dp:`fls_wkc1w2xk7ebh` + A :dt:`doc comment` is a :t:`comment` class that includes + :t:`[inner block doc]s`, :t:`[inner line doc]s`, :t:`[outer block doc]s`, + and :t:`[outer line doc]s`. + :chapter: + :dp:`fls_7n6d3jx61ose` + A :t:`doc comment` is a :t:`comment` class that includes :t:`[inner block + doc]s`, :t:`[inner line doc]s`, :t:`[outer block doc]s`, and :t:`[outer line + doc]s`. :dp:`fls_6fxcs17n4kw` Character 0x0D (carriage return) shall not appear in a :t:`comment`. @@ -1436,8 +1882,18 @@ Keywords .. rubric:: Legality Rules -:dp:`fls_dti0uu7rz81w` -A :t:`keyword` is a word in program text that has special meaning. +.. glossary-entry:: keyword + :glossary-dp: fls_yjs58mp5fkxz + + :glossary: + :dp:`fls_z3825koc9c1w` + A :dt:`keyword` is a word in program text that has special meaning. + + :dp:`fls_yvnf2mu4pr75` + See :s:`Keyword`. + :chapter: + :dp:`fls_dti0uu7rz81w` + A :t:`keyword` is a word in program text that has special meaning. :dp:`fls_sxg1o4oxql51` :t:`[Keyword]s` are case sensitive. @@ -1493,8 +1949,18 @@ Strict Keywords .. rubric:: Legality Rules -:dp:`fls_bsh7qsyvox21` -A :t:`strict keyword` is a :t:`keyword` that always holds its special meaning. +.. glossary-entry:: strict keyword + :glossary-dp: fls_bzhaq3q378ay + + :glossary: + :dp:`fls_hza9spr6behn` + A :dt:`strict keyword` is a :t:`keyword` that always holds its special meaning. + + :dp:`fls_67pzayd9qzzs` + See :s:`StrictKeyword`. + :chapter: + :dp:`fls_bsh7qsyvox21` + A :t:`strict keyword` is a :t:`keyword` that always holds its special meaning. .. _fls_cbsgp6k0qa82: @@ -1522,8 +1988,18 @@ Reserved Keywords .. rubric:: Legality Rules -:dp:`fls_w4b97ewwnql` -A :t:`reserved keyword` is a :t:`keyword` that is not yet in use. +.. glossary-entry:: reserved keyword + :glossary-dp: fls_x7yd6o4akrrg + + :glossary: + :dp:`fls_b67hj7fdbq4s` + A :dt:`reserved keyword` is a :t:`keyword` that is not yet in use. + + :dp:`fls_hp9iqdrkt0cg` + See :s:`ReservedKeyword`. + :chapter: + :dp:`fls_w4b97ewwnql` + A :t:`reserved keyword` is a :t:`keyword` that is not yet in use. .. _fls_9kjpxri0axvg: @@ -1542,9 +2018,20 @@ Weak Keywords .. rubric:: Legality Rules -:dp:`fls_bv87t1gvj7bz` -A :t:`weak keyword` is a :t:`keyword` whose special meaning depends on the -context. +.. glossary-entry:: weak keyword + :glossary-dp: fls_iplp3gvfbcpw + + :glossary: + :dp:`fls_4hiznltf5wlu` + A :dt:`weak keyword` is a :t:`keyword` whose special meaning depends on the + context. + + :dp:`fls_psah573fsrig` + See :s:`WeakKeyword`. + :chapter: + :dp:`fls_bv87t1gvj7bz` + A :t:`weak keyword` is a :t:`keyword` whose special meaning depends on the + context. :dp:`fls_bl55g03jmayf` Word ``macro_rules`` acts as a :t:`keyword` only when used in the context of a @@ -1560,4 +2047,3 @@ Word ``union`` acts as a :t:`keyword` only when used in the context of a :dp:`fls_g0JEluWqBpNc` Word ``safe`` acts as a :t:`keyword` only when used as a qualifier of :s:`FunctionDeclaration` or :s:`StaticDeclaration` in the context of a :s:`ExternalBlock`. - diff --git a/src/macros.rst b/src/macros.rst index b5bcd3cd..a15954e2 100644 --- a/src/macros.rst +++ b/src/macros.rst @@ -10,22 +10,38 @@ Macros .. rubric:: Legality Rules -:dp:`fls_j1jc83erljo0` -A :t:`macro` is a custom definition that extends Rust by defining callable -syntactic transformations. The effects of a :t:`macro` are realized through -:t:`[macro invocation]s` or :t:`attribute` use. :t:`[Macro]s` come in two -distinct forms: - -* :dp:`fls_23eapx3ckymf` - :t:`[Declarative macro]s` define rules for recognizing syntactic patterns and - generating direct syntax. - -* :dp:`fls_a5uemz2hnbi8` - :t:`[Procedural macro]s` define augmented :t:`[function]s` that operate on and - return a stream of :t:`[lexical element]s`. - -:dp:`fls_rnty1c8l5495` -:t:`[Token]s` are a subset of :t:`[lexical element]s` consumed by :t:`[macro]s`. +.. glossary-entry:: macro + :glossary-dp: fls_sdkcn1exc9da + + :glossary: + :dp:`fls_bt16qi8g2js5` + A :dt:`macro` is a custom definition that extends Rust by defining callable + syntactic transformations. + :chapter: + :dp:`fls_j1jc83erljo0` + A :t:`macro` is a custom definition that extends Rust by defining callable + syntactic transformations. The effects of a :t:`macro` are realized through + :t:`[macro invocation]s` or :t:`attribute` use. :t:`[Macro]s` come in two + distinct forms: + + * :dp:`fls_23eapx3ckymf` + :t:`[Declarative macro]s` define rules for recognizing syntactic patterns and + generating direct syntax. + + * :dp:`fls_a5uemz2hnbi8` + :t:`[Procedural macro]s` define augmented :t:`[function]s` that operate on and + return a stream of :t:`[lexical element]s`. + +.. glossary-entry:: tokens + :glossary-dp: fls_ma3vs7yoj285 + + :glossary: + :dp:`fls_v23kqvyvscd7` + :dt:`[Token]s` are a subset of :t:`[lexical element]s` consumed by + :t:`[macro]s`. + :chapter: + :dp:`fls_rnty1c8l5495` + :t:`[Token]s` are a subset of :t:`[lexical element]s` consumed by :t:`[macro]s`. .. _fls_xa7lp0zg1ol2: @@ -70,24 +86,78 @@ A :ds:`MacroMatchToken` is any :t:`lexical element` in category .. rubric:: Legality Rules -:dp:`fls_w44hav7mw3ao` -A :t:`declarative macro` is a :t:`macro` that associates a :t:`name` with a set -of syntactic transformation :t:`[macro rule]s`. - -:dp:`fls_dw1nq4r9ghhd` -A :t:`macro rule` is a :t:`construct` that consists of a :t:`macro matcher` and -a :t:`macro transcriber`. - -:dp:`fls_oq4xn8guos8f` -A :t:`macro matcher` is a :t:`construct` that describes a syntactic pattern that -a :t:`macro` must match. - -:dp:`fls_cdaf8viwmdfe` -A :t:`macro match` is the most basic form of a satisfied :t:`macro matcher`. - -:dp:`fls_ljavs0w61z3j` -A :t:`macro transcriber` is a :t:`construct` that describes the replacement -syntax of a :t:`macro`. +.. glossary-entry:: declarative macro + :glossary-dp: fls_5944xn0lz8e + + :glossary: + :dp:`fls_pe12lfffaoqt` + A :dt:`declarative macro` is a :t:`macro` that associates a :t:`name` with a + set of syntactic transformation rules. + + :dp:`fls_1te2kfi9lt6c` + See :s:`MacroRulesDeclaration`. + :chapter: + :dp:`fls_w44hav7mw3ao` + A :t:`declarative macro` is a :t:`macro` that associates a :t:`name` with a set + of syntactic transformation :t:`[macro rule]s`. + +.. glossary-entry:: macro rule + :glossary-dp: fls_gw31cagmzx26 + + :glossary: + :dp:`fls_7gfdqggs33id` + A :dt:`macro rule` is a :t:`construct` that consists of a :t:`macro matcher` + and a :t:`macro transcriber`. + + :dp:`fls_qv68aj43mz5m` + See :s:`MacroRule`. + :chapter: + :dp:`fls_dw1nq4r9ghhd` + A :t:`macro rule` is a :t:`construct` that consists of a :t:`macro matcher` and + a :t:`macro transcriber`. + +.. glossary-entry:: macro matcher + :glossary-dp: fls_4h4snjd4thsv + + :glossary: + :dp:`fls_sqncf88chnsy` + A :dt:`macro matcher` is a :t:`construct` that describes a syntactic pattern + that a :t:`macro` must match. + + :dp:`fls_ioyegc6ggd7o` + See :s:`MacroMatcher`. + :chapter: + :dp:`fls_oq4xn8guos8f` + A :t:`macro matcher` is a :t:`construct` that describes a syntactic pattern that + a :t:`macro` must match. + +.. glossary-entry:: macro match + :glossary-dp: fls_boanb1ipzc9 + + :glossary: + :dp:`fls_q0ve6nd287ta` + A :dt:`macro match` is the most basic form of a satisfied :t:`macro matcher`. + + :dp:`fls_dww6sqbj2vin` + See :s:`MacroMatch`. + :chapter: + :dp:`fls_cdaf8viwmdfe` + A :t:`macro match` is the most basic form of a satisfied :t:`macro matcher`. + +.. glossary-entry:: macro transcriber + :glossary-dp: fls_76o6rjh6lrqd + + :glossary: + :dp:`fls_ug79qf3p693h` + A :dt:`macro transcriber` is a :t:`construct` that describes the replacement + syntax of a :t:`macro`. + + :dp:`fls_myubuihvjl4s` + See :s:`MacroTranscriber`. + :chapter: + :dp:`fls_ljavs0w61z3j` + A :t:`macro transcriber` is a :t:`construct` that describes the replacement + syntax of a :t:`macro`. :dp:`fls_3jspk8obv7sd` A :t:`declarative macro` is invoked using a :t:`macro invocation`. @@ -143,16 +213,37 @@ Metavariables a particular kind and bind its :t:`value` to a name for use during :t:`macro transcription`. -:dp:`fls_4zdait30exvn` -A :t:`metavariable` is a :t:`macro match` that describes a :t:`variable`. +.. glossary-entry:: metavariable + :glossary-dp: fls_xo9uyazcfuq3 + + :glossary: + :dp:`fls_fu1esz5i9mt` + A :dt:`metavariable` is a :t:`macro match` that describes a :t:`variable`. + + :dp:`fls_k4xaw93z8x33` + See :s:`MacroMetavariable`. + :chapter: + :dp:`fls_4zdait30exvn` + A :t:`metavariable` is a :t:`macro match` that describes a :t:`variable`. :dp:`fls_2HguXbL7DjKH` A :t:`metavariable` is visible in the :t:`macro transcriber` of the :t:`macro rule` of the :t:`macro matcher` it is declared in. -:dp:`fls_8zypylq60zba` -A :t:`fragment specifier` is a :t:`construct` that indicates the :t:`type` of -a :t:`metavariable`. +.. glossary-entry:: fragment specifier + :glossary-dp: fls_pi7j0t7h1y86 + + :glossary: + :dp:`fls_6lhwep7ulpr0` + A :dt:`fragment specifier` is a :t:`construct` that indicates the :t:`type` of + a :t:`metavariable`. + + :dp:`fls_drfn9yqrihgx` + See ``MacroFragmentSpecifier``. + :chapter: + :dp:`fls_8zypylq60zba` + A :t:`fragment specifier` is a :t:`construct` that indicates the :t:`type` of + a :t:`metavariable`. :dp:`fls_8o9mcV2KrKac` :t:`Fragment specifier` kinds impose the following @@ -191,9 +282,20 @@ a :t:`metavariable`. * :dp:`fls_lZ8F1zUJju33` Any other kind may be followed by any token. -:dp:`fls_ephlmLsGTMgw` -A :t:`metavariable indication` is a :t:`construct` that indicates a -:t:`metavariable`. +.. glossary-entry:: metavariable indication + :glossary-dp: fls_5P2594jy7uDE + + :glossary: + :dp:`fls_r1FxbWffC9Wt` + A :dt:`metavariable indication` is a :t:`construct` that indicates a + :t:`metavariable`. + + :dp:`fls_bcMO2a0e0gXJ` + See :s:`MacroMetavariableIndication`. + :chapter: + :dp:`fls_ephlmLsGTMgw` + A :t:`metavariable indication` is a :t:`construct` that indicates a + :t:`metavariable`. .. rubric:: Examples @@ -233,22 +335,64 @@ A :ds:`MacroRepetitionSeparator` is any :t:`lexical element` in category .. rubric:: Legality Rules -:dp:`fls_8byjmlgum2f3` -A :t:`macro repetition in matching` allows for a syntactic pattern to be matched -zero or multiple times during :t:`macro matching`. - -:dp:`fls_ltdp3zs60dzr` -A :t:`macro repetition in transcription` allows for a syntactic pattern to be -transcribed zero or multiple times during :t:`macro transcription`. - -:dp:`fls_V1WRuzZUWUGj` -A :t:`macro repetition` is either a :t:`macro repetition in matching` or a -:t:`macro repetition in transcription`. - -:dp:`fls_u86j0zm2jshf` -A :t:`repetition operator` is a :t:`construct` that indicates the number -of times a :t:`macro repetition in matching` or a -:t:`macro repetition in transcription` can be repeated. +.. glossary-entry:: macro repetition in matching + :glossary-dp: fls_a5j2hztrjfv5 + + :glossary: + :dp:`fls_wio0e9qzstjh` + A :dt:`macro repetition in matching` allows for a syntactic pattern to be + matched zero or multiple times during :t:`macro matching`. + + :dp:`fls_potk1y850zer` + See :s:`MacroRepetitionMatch`. + :chapter: + :dp:`fls_8byjmlgum2f3` + A :t:`macro repetition in matching` allows for a syntactic pattern to be matched + zero or multiple times during :t:`macro matching`. + +.. glossary-entry:: macro repetition in transcription + :glossary-dp: fls_sqv126lwdz23 + + :glossary: + :dp:`fls_ex9vd3w0t4wo` + A :dt:`macro repetition in transcription` allows for a syntactic pattern to be + transcribed zero or multiple times during :t:`macro transcription`. + + :dp:`fls_5wdiqbwgr9nt` + See :s:`MacroRepetitionTranscriber`. + :chapter: + :dp:`fls_ltdp3zs60dzr` + A :t:`macro repetition in transcription` allows for a syntactic pattern to be + transcribed zero or multiple times during :t:`macro transcription`. + +.. glossary-entry:: macro repetition + :glossary-dp: fls_kddW7EirSn0g + + :glossary: + :dp:`fls_sDomcFWIeUAT` + A :dt:`macro repetition` is either a :t:`macro repetition in matching` or a + :t:`macro repetition in transcription`. + :chapter: + :dp:`fls_V1WRuzZUWUGj` + A :t:`macro repetition` is either a :t:`macro repetition in matching` or a + :t:`macro repetition in transcription`. + +.. glossary-entry:: repetition operator + :glossary-dp: fls_r2yjjhrvr9qi + + :glossary: + :dp:`fls_67907pk7uogl` + A :dt:`repetition operator` is a :t:`construct` that indicates the number + of times a :t:`macro repetition in matching` or a + :t:`macro repetition in transcription` can be repeated. + + :dp:`fls_hiasmmpr2jks` + See :s:`MacroRepetitionOperator`. + :chapter: + :dp:`fls_u86j0zm2jshf` + A :t:`repetition operator` is a :t:`construct` that indicates the number + of times a :t:`macro repetition in matching` or a + :t:`macro repetition in transcription` can be repeated. :dp:`fls_h5f8x4jdnvbu` The effects of a :t:`repetition operator` are as follows: @@ -307,18 +451,34 @@ Procedural Macros .. rubric:: Legality Rules -:dp:`fls_ejbddhggstd2` -A :t:`procedural macro` is a :t:`macro` that encapsulates syntactic -transformations in a :t:`function`. :t:`[Procedural macro]s` consume one or more -streams of :t:`[token]s` and produce a stream of :t:`[token]s`. +.. glossary-entry:: procedural macro + :glossary-dp: fls_sp5wdsxwmxf + + :glossary: + :dp:`fls_u4utpx4zgund` + A :dt:`procedural macro` is a :t:`macro` that encapsulates syntactic + transformations in a :t:`function`. + :chapter: + :dp:`fls_ejbddhggstd2` + A :t:`procedural macro` is a :t:`macro` that encapsulates syntactic + transformations in a :t:`function`. :t:`[Procedural macro]s` consume one or more + streams of :t:`[token]s` and produce a stream of :t:`[token]s`. :dp:`fls_pcce9gmjpxba` :t:`[Procedural macro]s` shall be defined in a :t:`crate` subject to :t:`attribute` :c:`crate_type` where the type is ``proc-macro``. -:dp:`fls_vtzuplb1p3s` -A :t:`macro implementation function` is the :t:`function` that encapsulates the -syntactic transformations of a :t:`procedural macro`. +.. glossary-entry:: macro implementation function + :glossary-dp: fls_o5jy1u64nyiy + + :glossary: + :dp:`fls_xy4t1suhrn46` + A :dt:`macro implementation function` is the :t:`function` that encapsulates + the syntactic transformations of a :t:`procedural macro`. + :chapter: + :dp:`fls_vtzuplb1p3s` + A :t:`macro implementation function` is the :t:`function` that encapsulates the + syntactic transformations of a :t:`procedural macro`. :dp:`fls_mewfehvgm16r` A :t:`macro implementation function` enters the :t:`name` of the @@ -331,9 +491,17 @@ Function-like Macros .. rubric:: Legality Rules -:dp:`fls_utd3zqczix` -A :t:`function-like macro` is a :t:`procedural macro` that consumes a stream of -:t:`[token]s` and produces a stream of :t:`[token]s`. +.. glossary-entry:: function-like macro + :glossary-dp: fls_gzybxk1gosm6 + + :glossary: + :dp:`fls_psnab9cuq4bu` + A :dt:`function-like macro` is a :t:`procedural macro` that consumes a stream + of :t:`[token]s` and produces a stream of tokens, and is invoked directly. + :chapter: + :dp:`fls_utd3zqczix` + A :t:`function-like macro` is a :t:`procedural macro` that consumes a stream of + :t:`[token]s` and produces a stream of :t:`[token]s`. :dp:`fls_ojr30lf6jfx0` The :t:`macro implementation function` of a :t:`function-like macro` shall be @@ -383,10 +551,19 @@ Derive Macros .. rubric:: Legality Rules -:dp:`fls_e5x92q2rq8a0` -A :t:`derive macro` is a :t:`procedural macro` that consumes a stream of -:t:`[token]s` and produces a stream of :t:`[token]s`. :t:`[Derive macro]s` are -used to construct new syntax for :t:`[abstract data type]s`. +.. glossary-entry:: derive macro + :glossary-dp: fls_7ipdj78o7ln + + :glossary: + :dp:`fls_jrrjhl9hocrm` + A :dt:`derive macro` is a :t:`procedural macro` that consumes a stream of + :t:`[token]s` and produces a stream of tokens, and is invoked via attribute + :c:`derive`. + :chapter: + :dp:`fls_e5x92q2rq8a0` + A :t:`derive macro` is a :t:`procedural macro` that consumes a stream of + :t:`[token]s` and produces a stream of :t:`[token]s`. :t:`[Derive macro]s` are + used to construct new syntax for :t:`[abstract data type]s`. :dp:`fls_ldw75sy5uj7p` The :t:`macro implementation function` of a :t:`derive macro` shall be subject @@ -445,12 +622,21 @@ Attribute Macros .. rubric:: Legality Rules -:dp:`fls_l3epi1dqpi8o` -An :t:`attribute macro` is a :t:`procedural macro` that consumes two streams -of :t:`[token]s` to produce a single stream of :t:`[token]s`, and defines a -new :t:`outer attribute` that can be attached to :t:`[item]s`. -:t:`[Attribute macro]s` are used to replace :t:`[item]s` with other -:t:`[item]s`. +.. glossary-entry:: attribute macro + :glossary-dp: fls_x1fafbpo0mlu + + :glossary: + :dp:`fls_mtqr4d817ikn` + An :dt:`attribute macro` is a :t:`procedural macro` that consumes two streams + of :t:`[token]s` to produce a stream of tokens, and defines a new + :t:`outer attribute` that can be attached to :t:`[item]s`. + :chapter: + :dp:`fls_l3epi1dqpi8o` + An :t:`attribute macro` is a :t:`procedural macro` that consumes two streams + of :t:`[token]s` to produce a single stream of :t:`[token]s`, and defines a + new :t:`outer attribute` that can be attached to :t:`[item]s`. + :t:`[Attribute macro]s` are used to replace :t:`[item]s` with other + :t:`[item]s`. :dp:`fls_3sublbi9bz7k` The :t:`macro implementation function` of an :t:`attribute macro` shall be @@ -542,14 +728,37 @@ A :ds:`NonDelimitedToken` is any :t:`lexical element` in category .. rubric:: Legality Rules -:dp:`fls_snpxxcqhtjfv` -A :t:`macro invocation` is a call of a :t:`declarative macro` or -:t:`function-like macro` that is expanded statically and replaced with the -result of the :t:`macro`. - -:dp:`fls_6v06zvi1ctub` -A :t:`terminated macro invocation` is a :t:`macro invocation` that may be used -as a :t:`statement`. +.. glossary-entry:: macro invocation + :glossary-dp: fls_20x9eqa7xeui + + :glossary: + :dp:`fls_5qtwcp5ns5vz` + A :dt:`macro invocation` is a call of a :t:`declarative macro` or + :t:`function-like macro` that is expanded statically and replaced with the + result of the :t:`macro`. + + :dp:`fls_IgzL0OJ9Ja7y` + See :s:`MacroInvocation`. + :chapter: + :dp:`fls_snpxxcqhtjfv` + A :t:`macro invocation` is a call of a :t:`declarative macro` or + :t:`function-like macro` that is expanded statically and replaced with the + result of the :t:`macro`. + +.. glossary-entry:: terminated macro invocation + :glossary-dp: fls_ef03n3ehz372 + + :glossary: + :dp:`fls_542es82wfzco` + A :dt:`terminated macro invocation` is a :t:`macro invocation` that may be used + as a :t:`statement`. + + :dp:`fls_tcvfi2zgdm58` + See :s:`TerminatedMacroInvocation`. + :chapter: + :dp:`fls_6v06zvi1ctub` + A :t:`terminated macro invocation` is a :t:`macro invocation` that may be used + as a :t:`statement`. .. rubric:: Examples @@ -606,10 +815,19 @@ Macro Expansion .. rubric:: Legality Rules -:dp:`fls_xscdaxvs4wx4` -:t:`Macro expansion` is the process of statically executing a -:t:`macro invocation` and replacing it with the produced output of the -:t:`macro invocation`. +.. glossary-entry:: macro expansion + :glossary-dp: fls_td4jm76u9m03 + + :glossary: + :dp:`fls_t383uo1l4h8x` + :dt:`Macro expansion` is the process of statically executing a + :t:`macro invocation` and replacing it with the produced output of the + :t:`macro invocation`. + :chapter: + :dp:`fls_xscdaxvs4wx4` + :t:`Macro expansion` is the process of statically executing a + :t:`macro invocation` and replacing it with the produced output of the + :t:`macro invocation`. :dp:`fls_nz5stwcc41gk` :t:`Macro expansion` of :t:`[declarative macro]s` proceeds as follows: @@ -777,9 +995,17 @@ Macro Matching .. rubric:: Legality Rules -:dp:`fls_ZmQZ8HQWv77L` -:t:`Macro matching` is the process of performing :t:`rule matching` and -:t:`token matching`. +.. glossary-entry:: macro matching + :glossary-dp: fls_ao7GhE0C8MQO + + :glossary: + :dp:`fls_RrDmFXuZrhFT` + :dt:`Macro matching` is the process of performing :t:`rule matching` and + :t:`token matching`. + :chapter: + :dp:`fls_ZmQZ8HQWv77L` + :t:`Macro matching` is the process of performing :t:`rule matching` and + :t:`token matching`. .. _fls_n3ktmjqf87qb: @@ -788,10 +1014,19 @@ Rule Matching .. rubric:: Legality Rules -:dp:`fls_77ucvwu6idms` -:t:`Rule matching` is the process of consuming a :s:`TokenTree` in an attempt -to fully satisfy the :t:`macro matcher` of a :t:`macro rule` that belongs to a -resolved :t:`declarative macro`. +.. glossary-entry:: rule matching + :glossary-dp: fls_9u67noriaxfe + + :glossary: + :dp:`fls_dux9js5oixjd` + :dt:`Rule matching` is the process of consuming a :s:`TokenTree` in an attempt + to fully satisfy the :t:`macro matcher` of a :t:`macro rule` that belongs to a + resolved :t:`declarative macro`. + :chapter: + :dp:`fls_77ucvwu6idms` + :t:`Rule matching` is the process of consuming a :s:`TokenTree` in an attempt + to fully satisfy the :t:`macro matcher` of a :t:`macro rule` that belongs to a + resolved :t:`declarative macro`. :dp:`fls_6h1jqhxzku5v` :t:`Rule matching` proceeds as follows: @@ -821,10 +1056,19 @@ Token Matching .. rubric:: Legality Rules -:dp:`fls_k6a24sbon5v9` -:t:`Token matching` is the process of consuming a :s:`TokenTree` in an attempt -to fully satisfy a :t:`macro match` of a selected :t:`macro matcher` that -belongs to a resolved :t:`declarative macro`. +.. glossary-entry:: token matching + :glossary-dp: fls_tzoko74t5t6n + + :glossary: + :dp:`fls_a19q6lhvakcm` + :dt:`Token matching` is the process of consuming a :s:`TokenTree` in an attempt + to fully satisfy a :t:`macro match` of a selected :t:`macro matcher` that + belongs to a resolved :t:`declarative macro`. + :chapter: + :dp:`fls_k6a24sbon5v9` + :t:`Token matching` is the process of consuming a :s:`TokenTree` in an attempt + to fully satisfy a :t:`macro match` of a selected :t:`macro matcher` that + belongs to a resolved :t:`declarative macro`. :dp:`fls_6uuxv91xgmfz` :t:`Token matching` proceeds as follows: @@ -946,9 +1190,17 @@ Macro Transcription .. rubric:: Legality Rules -:dp:`fls_y21i8062mft0` -:t:`Macro transcription` is the process of producing the expansion of a -:t:`declarative macro`. +.. glossary-entry:: macro transcription + :glossary-dp: fls_vdq3cphhpxmg + + :glossary: + :dp:`fls_nouiggbpipg` + :dt:`Macro transcription` is the process of producing the expansion of a + :t:`declarative macro`. + :chapter: + :dp:`fls_y21i8062mft0` + :t:`Macro transcription` is the process of producing the expansion of a + :t:`declarative macro`. :dp:`fls_n2dx4ug5nd5w` :t:`Macro transcription` proceeds as follows: @@ -1078,9 +1330,63 @@ within them, which aims to eliminate the syntactic interference between a .. rubric:: Legality Rules +.. glossary-entry:: hygiene + :glossary-dp: fls_GuMMjhEMMLvF + + :glossary: + :dp:`fls_AQg0MqAQZqkz` + :dt:`Hygiene` is a property of :t:`[macro]s` and :t:`[identifier]s`` that + appear within them, which aims to eliminate the syntactic interference between + a :t:`macro` and its environment. + +.. glossary-entry:: hygienic + :glossary-dp: fls_95h0aWZ7xx6U + + :glossary: + :dp:`fls_hiDddAkNH5Ms` + An :t:`identifier` is :dt:`hygienic` when it has :t:`definition site hygiene`. + +.. glossary-entry:: unhygienic + :glossary-dp: fls_HpUSWMvNS5f4 + + :glossary: + :dp:`fls_0t4lFZLkNieR` + An :t:`identifier` is :dt:`unhygienic` when it has :t:`call site hygiene`. + :dp:`fls_3axjf28xb1nt` :t:`Hygiene` is categorized as follows: +.. glossary-entry:: definition site hygiene + :glossary-dp: fls_FrfnICpg81sr + + :glossary: + :dp:`fls_2Y1Dpw5ZEqT3` + :dt:`Definition site hygiene` is a type of :t:`hygiene` which resolves to the + :s:`MacroRulesDeclaration` site. :t:`[Identifier]s` with + :t:`definition site hygiene` cannot reference the environment of the + :s:`MacroRulesDeclaration`, cannot be referenced by the environment of a + :s:`MacroInvocation`, and are considered :t:`hygienic`. + +.. glossary-entry:: call site hygiene + :glossary-dp: fls_AK8mL1LeftO0 + + :glossary: + :dp:`fls_YTQmXotFOXWU` + :dt:`Call site hygiene` is a type of :t:`hygiene` which resolves to the + :s:`MacroInvocation` site. :t:`[Identifier]s` with :t:`call site hygiene` can + reference the environment of the :s:`MacroRulesDeclaration`, can reference the + environment of the :s:`MacroInvocation`, and are considered :t:`unhygienic`. + +.. glossary-entry:: mixed site hygiene + :glossary-dp: fls_2FFRdj5cO0ks + + :glossary: + :dp:`fls_hjJpNmKiZxlT` + :dt:`Mixed site hygiene` is a type of :t:`hygiene` which resolves to the + :s:`MacroRulesDeclaration` site for :t:`[variable]s`, :t:`[label]s`, and the + ``$crate`` :t:`metavariable`, and to the :s:`MacroInvocation` site otherwise, + and is considered :t:`partially hygienic`. + * :dp:`fls_dz2mvodl818d` :t:`Definition site hygiene`, which resolves to a :s:`MacroRulesDeclaration` site. :t:`[Identifier]s` with :t:`definition site hygiene` cannot reference @@ -1099,6 +1405,14 @@ within them, which aims to eliminate the syntactic interference between a :t:`metavariable`, and to the :s:`MacroInvocation` site otherwise, and is considered :dt:`partially hygienic`. +.. glossary-entry:: partially hygienic + :glossary-dp: fls_fULM1oCKSakS + + :glossary: + :dp:`fls_Qh8V0Y08dNoa` + An :t:`identifier` is :dt:`partially hygienic` when it has + :t:`mixed site hygiene`. + :dp:`fls_yxqcr19dig18` Every :t:`macro` has associated :t:`hygiene` that depends on its kind: @@ -1113,4 +1427,3 @@ Every :t:`macro` has associated :t:`hygiene` that depends on its kind: :dp:`fls_7eqqk2cj0clr` The :t:`metavariable` ``$crate`` in a :t:`declarative macro`'s expansion refers to the crate the :t:`declarative macro` was declared in. - diff --git a/src/ownership-and-deconstruction.rst b/src/ownership-and-deconstruction.rst index c77ca103..f4b0abb3 100644 --- a/src/ownership-and-deconstruction.rst +++ b/src/ownership-and-deconstruction.rst @@ -15,12 +15,27 @@ Ownership .. rubric:: Legality Rules -:dp:`fls_wt81sbsecmu0` -:t:`Ownership` is a property of :t:`[value]s` that is central to the resource -management model of Rust. - -:dp:`fls_ckcnkbb6y3cq` -An :t:`owner` is a :t:`variable` that holds a :t:`value`. +.. glossary-entry:: ownership + :glossary-dp: fls_1gmetz8qtr0l + + :glossary: + :dp:`fls_tu4zt8twucsz` + :dt:`Ownership` is a property of :t:`[value]s` that is central to the resource + management model of Rust. + :chapter: + :dp:`fls_wt81sbsecmu0` + :t:`Ownership` is a property of :t:`[value]s` that is central to the resource + management model of Rust. + +.. glossary-entry:: owner + :glossary-dp: fls_ke52l9lsvyu2 + + :glossary: + :dp:`fls_7vwwhberexeb` + An :dt:`owner` is a :t:`variable` that holds a :t:`value`. + :chapter: + :dp:`fls_ckcnkbb6y3cq` + An :t:`owner` is a :t:`variable` that holds a :t:`value`. :dp:`fls_ze0u9gfylmhn` A :t:`value` shall have only one :t:`owner`. @@ -89,13 +104,27 @@ References .. rubric:: Legality Rules -:dp:`fls_7x9pi2o7pee7` -A :t:`reference` is a :t:`value` of a :t:`reference type`. A :t:`reference` -can be obtained explicitly by using a :t:`borrow expression` or implicitly in -certain scenarios. - -:dp:`fls_tsqvr3fmcel` -A :t:`referent` is the :t:`value` pointed-to by a :t:`reference`. +.. glossary-entry:: reference + :glossary-dp: fls_onv3cs5tckgo + + :glossary: + :dp:`fls_s82y4hsuytiq` + A :dt:`reference` is a :t:`value` of a :t:`reference type`. + :chapter: + :dp:`fls_7x9pi2o7pee7` + A :t:`reference` is a :t:`value` of a :t:`reference type`. A :t:`reference` + can be obtained explicitly by using a :t:`borrow expression` or implicitly in + certain scenarios. + +.. glossary-entry:: referent + :glossary-dp: fls_h8x0u32wfz8v + + :glossary: + :dp:`fls_78ipj8avpwzl` + A :dt:`referent` is the :t:`value` pointed-to by a :t:`reference`. + :chapter: + :dp:`fls_tsqvr3fmcel` + A :t:`referent` is the :t:`value` pointed-to by a :t:`reference`. :dp:`fls_ev4a82fdhwr8` A :t:`reference` shall point to an :t:`initialized` :t:`referent`. @@ -117,13 +146,29 @@ a :t:`reference` to it is :t:`active`. A :t:`referent` shall not be modified while a :t:`reference` to it is :t:`active`. -:dp:`fls_wcf5mxrzbujn` -An :t:`immutable reference` is a :t:`value` of a :t:`shared reference type`, and -prevents the mutation of its :t:`referent`. - -:dp:`fls_fckoj1jh5mrc` -A :t:`mutable reference` is a :t:`value` of a :t:`mutable reference type`, and -allows the mutation of its :t:`referent`. +.. glossary-entry:: immutable reference + :glossary-dp: fls_bhx0l676dmgc + + :glossary: + :dp:`fls_u9kne5zfmhoe` + An :dt:`immutable reference` is a :t:`value` of a :t:`shared reference type`, + and prevents the mutation of its :t:`referent`. + :chapter: + :dp:`fls_wcf5mxrzbujn` + An :t:`immutable reference` is a :t:`value` of a :t:`shared reference type`, and + prevents the mutation of its :t:`referent`. + +.. glossary-entry:: mutable reference + :glossary-dp: fls_jtzj092hyjkz + + :glossary: + :dp:`fls_wujjrhm1d338` + A :dt:`mutable reference` is a :t:`value` of a :t:`mutable reference type`, and + allows the mutation of its :t:`referent`. + :chapter: + :dp:`fls_fckoj1jh5mrc` + A :t:`mutable reference` is a :t:`value` of a :t:`mutable reference type`, and + allows the mutation of its :t:`referent`. :dp:`fls_hqxsuyn285he` The :t:`referent` of an :t:`immutable reference` shall be mutated only when the @@ -154,16 +199,39 @@ Borrowing .. rubric:: Legality Rules -:dp:`fls_c02flohk54pc` -:t:`Borrowing` is the process of temporarily associating a :t:`reference` with a -:t:`value` without transferring :t:`ownership` permanently. - -:dp:`fls_j9kof0px3l7s` -A :t:`borrow` is a :t:`reference` produced by :t:`borrowing`. - -:dp:`fls_zepwytjwy049` -An :t:`implicit borrow` is a :t:`borrow` that is not present syntactically in -program text. An :t:`implicit borrow` occurs in the following contexts: +.. glossary-entry:: borrowing + :glossary-dp: fls_95c5cbc2jvpc + + :glossary: + :dp:`fls_2epblwd2slp8` + :dt:`Borrowing` is the process of temporarily associating a :t:`reference` with + a :t:`value` without transferring :t:`ownership` permanently. + :chapter: + :dp:`fls_c02flohk54pc` + :t:`Borrowing` is the process of temporarily associating a :t:`reference` with a + :t:`value` without transferring :t:`ownership` permanently. + +.. glossary-entry:: borrow + :glossary-dp: fls_7ef4c6ss7m6i + + :glossary: + :dp:`fls_2tpbdddvrl2f` + A :dt:`borrow` is a :t:`reference` produced by :t:`borrowing`. + :chapter: + :dp:`fls_j9kof0px3l7s` + A :t:`borrow` is a :t:`reference` produced by :t:`borrowing`. + +.. glossary-entry:: implicit borrow + :glossary-dp: fls_wa7t6cqgjksd + + :glossary: + :dp:`fls_q2v9ejpcvtwg` + An :dt:`implicit borrow` is a :t:`borrow` that is not present syntactically in + program text. + :chapter: + :dp:`fls_zepwytjwy049` + An :t:`implicit borrow` is a :t:`borrow` that is not present syntactically in + program text. An :t:`implicit borrow` occurs in the following contexts: * :dp:`fls_nordokzfy36d` The :t:`call operand` of a :t:`call expression`, @@ -190,12 +258,27 @@ program text. An :t:`implicit borrow` occurs in the following contexts: An :t:`implicit borrow` may be an :t:`immutable borrow` or a :t:`mutable borrow` if required. -:dp:`fls_hyl4bdjbuzbw` -An :t:`immutable borrow` is an :t:`immutable reference` produced by -:t:`borrowing`. - -:dp:`fls_pu19i4sj6yg0` -A :t:`mutable borrow` is a :t:`mutable reference` produced by :t:`borrowing`. +.. glossary-entry:: immutable borrow + :glossary-dp: fls_utucrvtzjhoc + + :glossary: + :dp:`fls_p0abqkiuk7y9` + An :dt:`immutable borrow` is an :t:`immutable reference` produced by + :t:`borrowing`. + :chapter: + :dp:`fls_hyl4bdjbuzbw` + An :t:`immutable borrow` is an :t:`immutable reference` produced by + :t:`borrowing`. + +.. glossary-entry:: mutable borrow + :glossary-dp: fls_iku91jwdtdr1 + + :glossary: + :dp:`fls_5knwbyz4fd9z` + A :dt:`mutable borrow` is a :t:`mutable reference` produced by :t:`borrowing`. + :chapter: + :dp:`fls_pu19i4sj6yg0` + A :t:`mutable borrow` is a :t:`mutable reference` produced by :t:`borrowing`. :dp:`fls_kxws4zmaahj6` :t:`Borrowing` a :t:`field` of a :t:`union type` borrows all remaining @@ -259,22 +342,46 @@ Passing Conventions .. rubric:: Legality Rules -:dp:`fls_fvwx2ufeyzcs` -A :t:`passing convention` is the mechanism that defines how a :t:`value` is -transferred between :t:`[place]s`. - -:dp:`fls_h2pgsij1rbms` -A :t:`copy type` is a :t:`type` that implements the :std:`core::marker::Copy` -:t:`trait`. +.. glossary-entry:: passing convention + :glossary-dp: fls_wqbd5lxki2al + + :glossary: + :dp:`fls_eqgsg8j9btic` + A :dt:`passing convention` is the mechanism that defines how a :t:`value` is + transferred between :t:`[place]s`. + :chapter: + :dp:`fls_fvwx2ufeyzcs` + A :t:`passing convention` is the mechanism that defines how a :t:`value` is + transferred between :t:`[place]s`. + +.. glossary-entry:: copy type + :glossary-dp: fls_lnwxm6ffy15w + + :glossary: + :dp:`fls_j7r33ecacyh` + A :dt:`copy type` is a :t:`type` that implements the + :std:`core::marker::Copy` :t:`trait`. + :chapter: + :dp:`fls_h2pgsij1rbms` + A :t:`copy type` is a :t:`type` that implements the :std:`core::marker::Copy` + :t:`trait`. :dp:`fls_yx2knbby70fy` A :t:`value` of a :t:`copy type` is :t:`passed ` :dt:`by copy`. Passing :t:`by copy` does not change the :t:`owner` of the :t:`value`. -:dp:`fls_6ul3f6v0foma` -A :t:`move type` is a :t:`type` that implements the :std:`core::marker::Sized` -:t:`trait` and is not a :t:`copy type`. +.. glossary-entry:: move type + :glossary-dp: fls_gnucgrytswa4 + + :glossary: + :dp:`fls_ri37ez31gai8` + A :dt:`move type` is a :t:`type` that implements the :std:`core::marker::Sized` + :t:`trait` and that is not a :t:`copy type`. + :chapter: + :dp:`fls_6ul3f6v0foma` + A :t:`move type` is a :t:`type` that implements the :std:`core::marker::Sized` + :t:`trait` and is not a :t:`copy type`. :dp:`fls_3ztdz02efeoc` A :t:`value` of a :t:`move type` is :t:`passed ` @@ -355,9 +462,17 @@ Destruction .. rubric:: Legality Rules -:dp:`fls_e7ucq87s806d` -:t:`Destruction` is the process of recovering resources associated with a -:t:`value` as it goes out of scope. +.. glossary-entry:: destruction + :glossary-dp: fls_7b3fsp356e9l + + :glossary: + :dp:`fls_58i2nfhxze3j` + :dt:`Destruction` is the process of recovering resources associated with a + :t:`value` as it goes out of scope. + :chapter: + :dp:`fls_e7ucq87s806d` + :t:`Destruction` is the process of recovering resources associated with a + :t:`value` as it goes out of scope. .. _fls_u2mzjgiwbkz0: @@ -366,13 +481,29 @@ Destructors .. rubric:: Legality Rules -:dp:`fls_9m0gszdle0qb` -A :t:`drop type` is a :t:`type` that implements the :std:`core::ops::Drop` -:t:`trait` or contains a :t:`field` that has a :t:`drop type`. - -:dp:`fls_4nkzidytpi6` -A :t:`destructor` is a :t:`function` that is invoked immediately before the -:t:`destruction` of a :t:`value` of a :t:`drop type`. +.. glossary-entry:: drop type + :glossary-dp: fls_4v6vsuw4g89l + + :glossary: + :dp:`fls_ot3e31kwixil` + A :dt:`drop type` is a :t:`type` that implements the :std:`core::ops::Drop` + :t:`trait` or contains a :t:`field` that has a :t:`destructor`. + :chapter: + :dp:`fls_9m0gszdle0qb` + A :t:`drop type` is a :t:`type` that implements the :std:`core::ops::Drop` + :t:`trait` or contains a :t:`field` that has a :t:`drop type`. + +.. glossary-entry:: destructor + :glossary-dp: fls_kwxpy451gtc + + :glossary: + :dp:`fls_79pp7o1xooja` + A :dt:`destructor` is a :t:`function` that is invoked immediately before the + :t:`destruction` of a :t:`value` of a :t:`drop type`. + :chapter: + :dp:`fls_4nkzidytpi6` + A :t:`destructor` is a :t:`function` that is invoked immediately before the + :t:`destruction` of a :t:`value` of a :t:`drop type`. :dp:`fls_wzuwapjqtyyy` :t:`Dropping` a :t:`value` is the act of invoking the :t:`destructor` of the @@ -422,6 +553,14 @@ An :t:`uninitialized` :t:`variable` is not :t:`dropped`. #. :dp:`fls_ag249y74jg6c` Otherwise, :t:`dropping` has no effect. +.. glossary-entry:: dropping + :glossary-dp: fls_68cl4paduzx2 + + :glossary: + :dp:`fls_k4mguykh8ey` + :dt:`Dropping` a :t:`value` is the act of invoking the :t:`destructor` of the + related :t:`type`. + .. rubric:: Examples .. code-block:: rust @@ -457,15 +596,30 @@ Drop Scopes .. rubric:: Legality Rules -:dp:`fls_7uav7vkcv4pz` -A :t:`drop scope` is a region of program text that governs the :t:`dropping` of -:t:`[value]s`. When control flow leaves a :t:`drop scope`, all :t:`[value]s` -associated with that :t:`drop scope` are :t:`dropped` based on a -:t:`drop order`. - -:dp:`fls_txvxrn6wbyql` -A :t:`drop construct` is a :t:`construct` that employs a :t:`drop scope`. The -following :t:`[construct]s` are :t:`[drop construct]s`: +.. glossary-entry:: drop scope + :glossary-dp: fls_foszri7hdym0 + + :glossary: + :dp:`fls_6bu8x0g9q0er` + A :dt:`drop scope` is a region of program text that governs the :t:`dropping` + of :t:`[value]s`. + :chapter: + :dp:`fls_7uav7vkcv4pz` + A :t:`drop scope` is a region of program text that governs the :t:`dropping` of + :t:`[value]s`. When control flow leaves a :t:`drop scope`, all :t:`[value]s` + associated with that :t:`drop scope` are :t:`dropped` based on a + :t:`drop order`. + +.. glossary-entry:: drop construct + :glossary-dp: fls_nw0qr4xy3zxq + + :glossary: + :dp:`fls_odg2asgj28m` + A :dt:`drop construct` is a :t:`construct` that employs a :t:`drop scope`. + :chapter: + :dp:`fls_txvxrn6wbyql` + A :t:`drop construct` is a :t:`construct` that employs a :t:`drop scope`. The + following :t:`[construct]s` are :t:`[drop construct]s`: * :dp:`fls_n6y6brm6pghr` :t:`[Expression]s`, @@ -588,10 +742,19 @@ Drop Scope Extension .. rubric:: Legality Rules -:dp:`fls_kflqez2mtbit` -:t:`Drop scope extension` is the process of extending a :t:`drop scope` -associated with a :t:`temporary` to prevent the premature :t:`dropping` of the -:t:`temporary`. +.. glossary-entry:: drop scope extension + :glossary-dp: fls_qp3ksd2lxm8 + + :glossary: + :dp:`fls_pmdh8kkrwkd0` + :dt:`Drop scope extension` is the process of extending a :t:`drop scope` + associated with a :t:`temporary` to prevent the premature :t:`dropping` of the + :t:`temporary`. + :chapter: + :dp:`fls_kflqez2mtbit` + :t:`Drop scope extension` is the process of extending a :t:`drop scope` + associated with a :t:`temporary` to prevent the premature :t:`dropping` of the + :t:`temporary`. :dp:`fls_xjw82bujm148` An :dt:`extending pattern` is either @@ -686,9 +849,17 @@ Drop Order .. rubric:: Legality Rules -:dp:`fls_n6o1xzjiz8cv` -:t:`Drop order` is the order by which :t:`[value]s` are :t:`dropped` when a -:t:`drop scope` is left. +.. glossary-entry:: drop order + :glossary-dp: fls_j12e358828h + + :glossary: + :dp:`fls_qddkiabu6swt` + :dt:`Drop order` is the order by which :t:`[value]s` are :t:`dropped` when a + :t:`drop scope` is left. + :chapter: + :dp:`fls_n6o1xzjiz8cv` + :t:`Drop order` is the order by which :t:`[value]s` are :t:`dropped` when a + :t:`drop scope` is left. :dp:`fls_jwofws3022ar` When a :t:`drop scope` is left, all :t:`[value]s` associated with that diff --git a/src/patterns.rst b/src/patterns.rst index 6d2de0b6..585a88af 100644 --- a/src/patterns.rst +++ b/src/patterns.rst @@ -37,22 +37,71 @@ Patterns .. rubric:: Legality Rules -:dp:`fls_imegtsi224ts` -A :t:`pattern` is a :t:`construct` that matches a :t:`value` which satisfies all -the criteria of the :t:`pattern`. - -:dp:`fls_VQMmveZUfNTn` -An :t:`or-pattern` is a :t:`pattern` that matches on one of two or more :t:`[pattern-without-alternation]s` and or-s them using character 0x7C (vertical line). - -:dp:`fls_mp6i4blzexnu` -A :t:`pattern-without-alternation` is a :t:`pattern` that cannot be alternated. - -:dp:`fls_JJ1fJa1SsaWh` -A :t:`pattern-without-range` is a :t:`pattern-without-alternation` that -excludes :t:`[range pattern]s`. - -:dp:`fls_6xx34zr069bj` -A :t:`subpattern` is a :t:`pattern` nested within another pattern. +.. glossary-entry:: pattern + :glossary-dp: fls_uj1o721im5lb + + :glossary: + :dp:`fls_9wwt9k1xlm6n` + A :dt:`pattern` is a :t:`construct` that matches a :t:`value` which satisfies + all the criteria of the pattern. + + :dp:`fls_9va04w9jgdyp` + See :s:`Pattern`. + :chapter: + :dp:`fls_imegtsi224ts` + A :t:`pattern` is a :t:`construct` that matches a :t:`value` which satisfies all + the criteria of the :t:`pattern`. + +.. glossary-entry:: or-pattern + :glossary-dp: fls_LnPDQW3bnNUw + + :glossary: + :dp:`fls_LnPDQW3bnNUw` + An :dt:`or-pattern` is a :t:`pattern` that matches on one of two or more :t:`[pattern-without-alternation]s` and or-s them using character 0x7C (vertical line, i.e. ``|``). + + :dp:`fls_urIJ5JNHLhm6` + See :s:`Pattern`. + :chapter: + :dp:`fls_VQMmveZUfNTn` + An :t:`or-pattern` is a :t:`pattern` that matches on one of two or more :t:`[pattern-without-alternation]s` and or-s them using character 0x7C (vertical line). + +.. glossary-entry:: pattern-without-alternation + :glossary-dp: fls_cptagvgpgnze + + :glossary: + :dp:`fls_brussjs3wo6r` + A :dt:`pattern-without-alternation` is a :t:`pattern` that cannot be alternated. + + :dp:`fls_fmysn3eezr54` + See :s:`PatternWithoutAlternation`. + :chapter: + :dp:`fls_mp6i4blzexnu` + A :t:`pattern-without-alternation` is a :t:`pattern` that cannot be alternated. + +.. glossary-entry:: pattern-without-range + :glossary-dp: fls_yeQOZKPoNzw3 + + :glossary: + :dp:`fls_LSEOvAwUM7g6` + A :dt:`pattern-without-range` is a :t:`pattern-without-alternation` that + excludes :t:`[range pattern]s`. + + :dp:`fls_Rj8ir4k0K811` + See :s:`PatternWithoutRange`. + :chapter: + :dp:`fls_JJ1fJa1SsaWh` + A :t:`pattern-without-range` is a :t:`pattern-without-alternation` that + excludes :t:`[range pattern]s`. + +.. glossary-entry:: subpattern + :glossary-dp: fls_k7ro8n23wtdc + + :glossary: + :dp:`fls_942ulj9qsdes` + A :dt:`subpattern` is a :t:`pattern` nested within another :t:`pattern`. + :chapter: + :dp:`fls_6xx34zr069bj` + A :t:`subpattern` is a :t:`pattern` nested within another pattern. :dp:`fls_8xzjb0yzftkd` A :t:`pattern` has a :t:`type`, with the exception of the :t:`rest pattern` if @@ -101,23 +150,69 @@ Refutability :t:`Refutability` is a property of :t:`[pattern]s` that expresses the ability to match all possible values of a :t:`type`. -:dp:`fls_9fjspnefoyvz` -An :t:`irrefutable pattern` is a :t:`pattern` that always matches any :t:`value` of its :t:`type`. - -:dp:`fls_uq7ftuuq1sig` -A :t:`refutable pattern` is a :t:`pattern` that has a possibility of not -matching a :t:`value` of its :t:`type` - -:dp:`fls_mnbyt7jfYAZ9` -A :t:`pattern` that is not an :t:`irrefutable pattern` is a -:t:`refutable pattern`. - -:dp:`fls_l76ycteulo8e` -An :t:`irrefutable constant` is a :t:`constant` of a :t:`type` that has at most -one :t:`value`. - -:dp:`fls_lh0d85tl4qvy` -A :t:`refutable constant` is a :t:`constant` of a :t:`refutable type`. +.. glossary-entry:: irrefutable pattern + :glossary-dp: fls_ckz7pujdnuo5 + + :glossary: + :dp:`fls_y421hdrbs6ak` + An :dt:`irrefutable pattern` is a :t:`pattern` that always matches the + :t:`value` it is being matched against. + :chapter: + :dp:`fls_9fjspnefoyvz` + An :t:`irrefutable pattern` is a :t:`pattern` that always matches any :t:`value` of its :t:`type`. + +.. glossary-entry:: refutability + :glossary-dp: fls_bkwy183h9ygt + + :glossary: + :dp:`fls_gzjrfx19fg40` + :dt:`Refutability` is a property of :t:`[pattern]s` that expresses the ability + to match all possible :t:`[value]s` of a :t:`type`. + +.. glossary-entry:: refutable pattern + :glossary-dp: fls_srdcx5oi4dcp + + :glossary: + :dp:`fls_re7qz78koman` + A :dt:`refutable pattern` is a :t:`pattern` that has a possibility of not + matching the :t:`value` it is being matched against. + :chapter: + :dp:`fls_uq7ftuuq1sig` + A :t:`refutable pattern` is a :t:`pattern` that has a possibility of not + matching a :t:`value` of its :t:`type` + + :dp:`fls_mnbyt7jfYAZ9` + A :t:`pattern` that is not an :t:`irrefutable pattern` is a + :t:`refutable pattern`. + +.. glossary-entry:: refutable type + :glossary-dp: fls_dkq1h6p9yaar + + :glossary: + :dp:`fls_l2yz6jeehm52` + A :dt:`refutable type` is a :t:`type` that has more than one :t:`value`. + +.. glossary-entry:: irrefutable constant + :glossary-dp: fls_fgmvmcw2kw5i + + :glossary: + :dp:`fls_hd02jah50qzl` + An :dt:`irrefutable constant` is a :t:`constant` of a :t:`type` that has at most + one :t:`value`. + :chapter: + :dp:`fls_l76ycteulo8e` + An :t:`irrefutable constant` is a :t:`constant` of a :t:`type` that has at most + one :t:`value`. + +.. glossary-entry:: refutable constant + :glossary-dp: fls_v99joc4m6cup + + :glossary: + :dp:`fls_mc6hsomq08uu` + A :dt:`refutable constant` is a :t:`constant` of a :t:`refutable type`. + :chapter: + :dp:`fls_lh0d85tl4qvy` + A :t:`refutable constant` is a :t:`constant` of a :t:`refutable type`. .. rubric:: Examples @@ -153,21 +248,58 @@ Identifier Patterns .. rubric:: Legality Rules -:dp:`fls_uljdw9rf7ies` -An :t:`identifier pattern` is a :t:`pattern` that binds the :t:`value` it -matches to a :t:`binding`. - -:dp:`fls_vy9uw586wy0d` -A :t:`bound pattern` is a :t:`pattern` that imposes a constraint on a related -:t:`identifier pattern`. +.. glossary-entry:: identifier pattern + :glossary-dp: fls_1g9xxx8s498u + + :glossary: + :dp:`fls_f2va67gvpqe0` + An :dt:`identifier pattern` is a :t:`pattern` that binds the :t:`value` it + matches to a :t:`binding`. + + :dp:`fls_nxa1gvqgitgk` + See :s:`IdentifierPattern`. + :chapter: + :dp:`fls_uljdw9rf7ies` + An :t:`identifier pattern` is a :t:`pattern` that binds the :t:`value` it + matches to a :t:`binding`. + +.. glossary-entry:: bound pattern + :glossary-dp: fls_jlfqyn3enrsi + + :glossary: + :dp:`fls_uusfbosjwyd1` + A :dt:`bound pattern` is a :t:`pattern` that imposes a constraint on a related + :t:`identifier pattern`. + + :dp:`fls_oszhit2crxzc` + See :s:`BoundPattern`. + :chapter: + :dp:`fls_vy9uw586wy0d` + A :t:`bound pattern` is a :t:`pattern` that imposes a constraint on a related + :t:`identifier pattern`. :dp:`fls_hqwt3fvr063y` An :t:`identifier pattern` yields a :t:`binding`. An :t:`identifier pattern` with :t:`keyword` ``mut`` yields a :t:`mutable binding`. -:dp:`fls_joIQdDn44oIT` -An :t:`identifier pattern` with :t:`keyword` ``ref`` is a -:t:`reference identifier pattern`. +.. glossary-entry:: mutable binding + :glossary-dp: fls_ntaA0NtJ9z5h + + :glossary: + :dp:`fls_v2pGKVaQjtcl` + A :dt:`mutable binding` is a :t:`binding` whose :t:`value` can be modified. + +.. glossary-entry:: reference identifier pattern + :glossary-dp: fls_1XGsXRZIFnqL + + :glossary: + :dp:`fls_jQs6oJ4RFBPN` + A :dt:`reference identifier pattern` is an :t:`identifier pattern` with + :t:`keyword` ``ref``. + :chapter: + :dp:`fls_joIQdDn44oIT` + An :t:`identifier pattern` with :t:`keyword` ``ref`` is a + :t:`reference identifier pattern`. :dp:`fls_24c95c56tugl` The :t:`identifier pattern` enters its :t:`binding` into :t:`binding scope` in @@ -274,12 +406,33 @@ Literal Patterns .. rubric:: Legality Rules -:dp:`fls_pah15qa54irs` -A :t:`literal pattern` is a :t:`pattern` that matches a :t:`literal`. - -:dp:`fls_COQKJC0dvtNO` -A :t:`numeric literal pattern` is a :t:`pattern` that matches a :t:`numeric -literal`. +.. glossary-entry:: literal pattern + :glossary-dp: fls_bo2tv8ky1jc + + :glossary: + :dp:`fls_5s9b4bza13xf` + A :dt:`literal pattern` is a :t:`pattern` that matches a :t:`literal`. + + :dp:`fls_o7q7wfjulc24` + See :s:`LiteralPattern`. + :chapter: + :dp:`fls_pah15qa54irs` + A :t:`literal pattern` is a :t:`pattern` that matches a :t:`literal`. + +.. glossary-entry:: numeric literal pattern + :glossary-dp: fls_CmvuNXmowCz8 + + :glossary: + :dp:`fls_azqQ3JxD5Lt7` + A :dt:`numeric literal pattern` is a :t:`pattern` that matches a :t:`numeric + literal`. + + :dp:`fls_QYDZm7pKy1nW` + See :s:`LiteralPattern`. + :chapter: + :dp:`fls_COQKJC0dvtNO` + A :t:`numeric literal pattern` is a :t:`pattern` that matches a :t:`numeric + literal`. :dp:`fls_JP8YSbxSN0Ym` A :t:`numeric literal pattern`'s :t:`numeric literal` value shall not be a IEEE @@ -317,9 +470,20 @@ Parenthesized Patterns .. rubric:: Legality Rules -:dp:`fls_kvqzmt7my5dh` -A :t:`parenthesized pattern` is a :t:`pattern` that controls the precedence of -its :t:`[subpattern]s`. +.. glossary-entry:: parenthesized pattern + :glossary-dp: fls_ww6nyinsw1lr + + :glossary: + :dp:`fls_7j12dwsx9ghg` + A :dt:`parenthesized pattern` is a :t:`pattern` that controls the precedence of + its :t:`[subpattern]s`. + + :dp:`fls_rwt31e8m694i` + See :s:`ParenthesizedPattern`. + :chapter: + :dp:`fls_kvqzmt7my5dh` + A :t:`parenthesized pattern` is a :t:`pattern` that controls the precedence of + its :t:`[subpattern]s`. :dp:`fls_mrjhpiq5refe` A :t:`parenthesized pattern` is an :t:`irrefutable pattern` when its nested @@ -364,9 +528,21 @@ Path Patterns .. rubric:: Legality Rules -:dp:`fls_1crq0mexo5r1` -A :t:`path pattern` is a :t:`pattern` that matches a :t:`constant`, a -:t:`unit enum variant`, or a :t:`unit struct constant` indicated by a :t:`path`. +.. glossary-entry:: path pattern + :glossary-dp: fls_ptikwcw3b20l + + :glossary: + :dp:`fls_vacvk3t26ctg` + A :dt:`path pattern` is a :t:`pattern` that matches a :t:`constant`, a + :t:`unit enum variant`, or a :t:`unit struct constant` indicated by a + :t:`path`. + + :dp:`fls_9fudbxoyq8k4` + See :s:`PathPattern`. + :chapter: + :dp:`fls_1crq0mexo5r1` + A :t:`path pattern` is a :t:`pattern` that matches a :t:`constant`, a + :t:`unit enum variant`, or a :t:`unit struct constant` indicated by a :t:`path`. :dp:`fls_xz5otkhogn31` A :t:`path pattern` expressed as a :t:`path expression` shall refer to either @@ -478,36 +654,124 @@ Range Patterns .. rubric:: Legality Rules -:dp:`fls_okupyoav13rm` -A :t:`range pattern` is a :t:`pattern` that matches :t:`[value]s` which fall -within a range. - -:dp:`fls_jhchm7dy927k` -A :t:`half-open range pattern` is a :t:`range pattern` with only a -:t:`range pattern low bound`. - -:dp:`fls_q86j23iiqv8w` -An :t:`inclusive range pattern` is a :t:`range pattern` with both a -:t:`range pattern low bound` and a :t:`range pattern high bound`. - -:dp:`fls_3PyquOKjA7SI` -An :t:`exclusive range pattern` is a :t:`range pattern` with both a -:t:`range pattern low bound` and a :t:`range pattern high bound`. - -:dp:`fls_akf9x5r6e0ta` -An :t:`obsolete range pattern` is a :t:`range pattern` that uses obsolete syntax -to express an :t:`inclusive range pattern`. - -:dp:`fls_vrpr6ttpfpal` -A :t:`range pattern bound` is a constraint on the range of a :t:`range pattern`. - -:dp:`fls_nk48gregn3me` -A :t:`range pattern low bound` is a :t:`range pattern bound` that specifies the -start of a range. - -:dp:`fls_83v1xqbebs58` -A :t:`range pattern high bound` is a :t:`range pattern bound` that specifies the -end of a range. +.. glossary-entry:: range pattern + :glossary-dp: fls_6pxg401r6juc + + :glossary: + :dp:`fls_vf42zdyq23lc` + A :dt:`range pattern` is a :t:`pattern` that matches :t:`[value]s` which fall + within a range. + + :dp:`fls_r36uf3y2denr` + See ``RangePattern``. + :chapter: + :dp:`fls_okupyoav13rm` + A :t:`range pattern` is a :t:`pattern` that matches :t:`[value]s` which fall + within a range. + +.. glossary-entry:: half-open range pattern + :glossary-dp: fls_fquvoglio1jz + + :glossary: + :dp:`fls_tymjispfgp7u` + A :dt:`half-open range pattern` is a :t:`range pattern` with only a + :t:`range pattern low bound`. + + :dp:`fls_evm3nxwswk00` + See :s:`HalfOpenRangePattern`. + :chapter: + :dp:`fls_jhchm7dy927k` + A :t:`half-open range pattern` is a :t:`range pattern` with only a + :t:`range pattern low bound`. + +.. glossary-entry:: inclusive range pattern + :glossary-dp: fls_nscfxu6huw6q + + :glossary: + :dp:`fls_olfeuvwkosse` + An :dt:`inclusive range pattern` is a :t:`range pattern` with both a + :t:`range pattern low bound` and a :t:`range pattern high bound`. + + :dp:`fls_9bdxsn6nasjr` + See :s:`InclusiveRangePattern`. + :chapter: + :dp:`fls_q86j23iiqv8w` + An :t:`inclusive range pattern` is a :t:`range pattern` with both a + :t:`range pattern low bound` and a :t:`range pattern high bound`. + +.. glossary-entry:: exclusive range pattern + :glossary-dp: fls_EJSzYb4IxvtR + + :glossary: + :dp:`fls_qxsV6ZxFfDHm` + An :dt:`exclusive range pattern` is a :t:`range pattern` with both a + :t:`range pattern low bound` and a :t:`range pattern high bound`. + + :dp:`fls_kHIWYUPhxikM` + See :s:`ExclusiveRangePattern`. + :chapter: + :dp:`fls_3PyquOKjA7SI` + An :t:`exclusive range pattern` is a :t:`range pattern` with both a + :t:`range pattern low bound` and a :t:`range pattern high bound`. + +.. glossary-entry:: obsolete range pattern + :glossary-dp: fls_bo889w63y7oi + + :glossary: + :dp:`fls_ave42vwb45zb` + An :dt:`obsolete range pattern` is a :t:`range pattern` that uses obsolete + syntax to express an :t:`inclusive range pattern`. + + :dp:`fls_ta0wa8ta9ol4` + See :s:`ObsoleteRangePattern`. + :chapter: + :dp:`fls_akf9x5r6e0ta` + An :t:`obsolete range pattern` is a :t:`range pattern` that uses obsolete syntax + to express an :t:`inclusive range pattern`. + +.. glossary-entry:: range pattern bound + :glossary-dp: fls_3ls9xlgt8ei1 + + :glossary: + :dp:`fls_l9xq96bjs4o2` + A :dt:`range pattern bound` is a constraint on the range of a + :t:`range pattern`. + + :dp:`fls_80736cs3axo4` + See :s:`RangePatternBound`. + :chapter: + :dp:`fls_vrpr6ttpfpal` + A :t:`range pattern bound` is a constraint on the range of a :t:`range pattern`. + +.. glossary-entry:: range pattern low bound + :glossary-dp: fls_laev4lmmv0cw + + :glossary: + :dp:`fls_rt7q0msh3op4` + A :dt:`range pattern low bound` is a :t:`range pattern bound` that specifies + the start of a range. + + :dp:`fls_j695o93wsu3i` + See :s:`RangePatternLowBound`. + :chapter: + :dp:`fls_nk48gregn3me` + A :t:`range pattern low bound` is a :t:`range pattern bound` that specifies the + start of a range. + +.. glossary-entry:: range pattern high bound + :glossary-dp: fls_y4rv5cbowvwg + + :glossary: + :dp:`fls_arp7y7yme7yp` + A :dt:`range pattern high bound` is a :t:`range pattern bound` that specifies + the end of a range. + + :dp:`fls_dnwqcswftw71` + See :s:`RangePatternHighBound`. + :chapter: + :dp:`fls_83v1xqbebs58` + A :t:`range pattern high bound` is a :t:`range pattern bound` that specifies the + end of a range. :dp:`fls_2hpuccwh2xml` A :t:`half-open range pattern` shall appear within a :t:`parenthesized pattern` @@ -580,9 +844,20 @@ Reference Patterns .. rubric:: Legality Rules -:dp:`fls_fhahcc1mz2qh` -A :t:`reference pattern` is a :t:`pattern` that dereferences a :t:`pointer` that -is being matched. +.. glossary-entry:: reference pattern + :glossary-dp: fls_kiy6b1wbn0a3 + + :glossary: + :dp:`fls_ebshqnhmwgow` + A :dt:`reference pattern` is a :t:`pattern` that dereferences a :t:`pointer` + that is being matched. + + :dp:`fls_rghv5drrqxs1` + See :s:`ReferencePattern`. + :chapter: + :dp:`fls_fhahcc1mz2qh` + A :t:`reference pattern` is a :t:`pattern` that dereferences a :t:`pointer` that + is being matched. :dp:`fls_x0bmzl1315gq` A :t:`reference pattern` is an :t:`irrefutable pattern` when its nested :t:`pattern` itself is an :t:`irrefutable pattern`. @@ -629,9 +904,20 @@ Rest Patterns .. rubric:: Legality Rules -:dp:`fls_eso51epfofxb` -A :t:`rest pattern` is a :t:`pattern` that matches zero or more elements that -have not already been matched. +.. glossary-entry:: rest pattern + :glossary-dp: fls_uuo1qvrz1i0k + + :glossary: + :dp:`fls_xngp3h1znw9o` + A :dt:`rest pattern` is a :t:`pattern` that matches zero or more elements that + have not already been matched. + + :dp:`fls_rnmhg04u0oga` + See :s:`RestPattern`. + :chapter: + :dp:`fls_eso51epfofxb` + A :t:`rest pattern` is a :t:`pattern` that matches zero or more elements that + have not already been matched. :dp:`fls_5a75a2y43uev` A :t:`rest pattern` shall appear at most once within a :t:`slice pattern`, an @@ -694,9 +980,20 @@ Slice Patterns .. rubric:: Legality Rules -:dp:`fls_qqiu594hki8g` -A :t:`slice pattern` is a :t:`pattern` that matches :t:`[array]s` of fixed size -and :t:`[slice]s` of dynamic size. +.. glossary-entry:: slice pattern + :glossary-dp: fls_1s3a31o9zx1a + + :glossary: + :dp:`fls_7613qu4igwiw` + A :dt:`slice pattern` is a :t:`pattern` that matches :t:`[array]s` of fixed + size and :t:`[slice]s` of dynamic size. + + :dp:`fls_3qey00280x27` + See :s:`SlicePattern`. + :chapter: + :dp:`fls_qqiu594hki8g` + A :t:`slice pattern` is a :t:`pattern` that matches :t:`[array]s` of fixed size + and :t:`[slice]s` of dynamic size. :dp:`fls_h6x9xlxi7y5n` A :t:`slice pattern` is an :t:`irrefutable pattern` when it refers to: @@ -746,13 +1043,35 @@ Struct Patterns .. rubric:: Legality Rules -:dp:`fls_vjdkpr3zml51` -A :t:`struct pattern` is a :t:`pattern` that matches an :t:`enum value`, a -:t:`struct value`, or a :t:`union value`. - -:dp:`fls_6o3x101wo478` -A :t:`deconstructee` indicates the :t:`enum variant` or :t:`type` that is being -deconstructed by a :t:`struct pattern`. +.. glossary-entry:: struct pattern + :glossary-dp: fls_ook43xes5t34 + + :glossary: + :dp:`fls_xbtoiwegp8gu` + A :dt:`struct pattern` is a :t:`pattern` that matches an :t:`enum value`, a + :t:`struct value`, or a :t:`union value`. + + :dp:`fls_pn8e50ep2fln` + See :s:`StructPattern`. + :chapter: + :dp:`fls_vjdkpr3zml51` + A :t:`struct pattern` is a :t:`pattern` that matches an :t:`enum value`, a + :t:`struct value`, or a :t:`union value`. + +.. glossary-entry:: deconstructee + :glossary-dp: fls_GAlaslkO8gLG + + :glossary: + :dp:`fls_QsvWOdoFWtUO` + A :dt:`deconstructee` indicates the :t:`enum variant` or :t:`type` that is + being deconstructed by a :t:`struct pattern`. + + :dp:`fls_TkFjmV7AR7lp` + See :s:`Deconstructee`. + :chapter: + :dp:`fls_6o3x101wo478` + A :t:`deconstructee` indicates the :t:`enum variant` or :t:`type` that is being + deconstructed by a :t:`struct pattern`. :dp:`fls_k9zih9s0oe5h` A :t:`struct pattern` is interpreted based on the :t:`deconstructee`. It is a @@ -816,17 +1135,39 @@ Record Struct Patterns .. rubric:: Legality Rules -:dp:`fls_g6dytd6aq62d` -A :t:`record struct pattern` is a :t:`pattern` that matches a -:t:`enum variant value`, a :t:`struct value`, or a :t:`union value`. +.. glossary-entry:: record struct pattern + :glossary-dp: fls_at2caaqlpva1 + + :glossary: + :dp:`fls_q7njznxhmmw` + A :dt:`record struct pattern` is a :t:`pattern` that matches a + :t:`enum variant value`, a :t:`struct value`, or a :t:`union value`. + + :dp:`fls_viwieu1p3hds` + See :s:`RecordStructPattern`. + :chapter: + :dp:`fls_g6dytd6aq62d` + A :t:`record struct pattern` is a :t:`pattern` that matches a + :t:`enum variant value`, a :t:`struct value`, or a :t:`union value`. :dp:`fls_3px4oiweg9dm` The :t:`deconstructee` of a :t:`record struct pattern` shall resolve to an :t:`enum variant`, a :t:`struct type`, or a :t:`union type`. -:dp:`fls_mnh35ehva8tx` -An :t:`indexed deconstructor` is a :t:`construct` that matches the position of -a :t:`field`. +.. glossary-entry:: indexed deconstructor + :glossary-dp: fls_qs654p61ivpx + + :glossary: + :dp:`fls_q7eta38vw0ig` + An :dt:`indexed deconstructor` is a :t:`construct` that matches the position of + a :t:`tuple field`. + + :dp:`fls_gryv4audvann` + See :s:`IndexedDeconstructor`. + :chapter: + :dp:`fls_mnh35ehva8tx` + An :t:`indexed deconstructor` is a :t:`construct` that matches the position of + a :t:`field`. :dp:`fls_p2rjnlbvifaa` An :t:`indexed deconstructor` matches a :t:`field` of the :t:`deconstructee` @@ -838,9 +1179,20 @@ when its :t:`field index` and the position of the :t:`field` in the The :t:`type` of a :t:`matched indexed deconstructor` and the :t:`type` of the matched :t:`field` shall be :t:`unifiable`. -:dp:`fls_46u4ddj0yf93` -A :t:`named deconstructor` is a :t:`construct` that matches the :t:`name` of -a :t:`field`. +.. glossary-entry:: named deconstructor + :glossary-dp: fls_dgs9y3nan69v + + :glossary: + :dp:`fls_g3k1hy3j4qn9` + A :dt:`named deconstructor` is a :t:`construct` that matches the :t:`name` of + a :t:`field`. + + :dp:`fls_ujreg07979g8` + See :s:`NamedDeconstructor`. + :chapter: + :dp:`fls_46u4ddj0yf93` + A :t:`named deconstructor` is a :t:`construct` that matches the :t:`name` of + a :t:`field`. :dp:`fls_qu3dvfdq6oy7` A :t:`named deconstructor` matches a :t:`field` of the :t:`deconstructee` when @@ -851,10 +1203,22 @@ its :t:`identifier` and the :t:`name` of the :t:`field` are the same. Such a The :t:`type` of a :t:`matched named deconstructor` and the :t:`type` of the matched :t:`field` shall be :t:`unifiable`. -:dp:`fls_9wfizujx0szd` -A :t:`shorthand deconstructor` is a :t:`construct` that matches the :t:`name` -of a :t:`field` and binds the :t:`value` of the matched :t:`field` to a -:t:`binding`. +.. glossary-entry:: shorthand deconstructor + :glossary-dp: fls_5sxhx0w3d63z + + :glossary: + :dp:`fls_22yxrde244w8` + A :dt:`shorthand deconstructor` is a :t:`construct` that matches the :t:`name` + of a :t:`field` and binds the :t:`value` of the matched :t:`field` to a + :t:`binding`. + + :dp:`fls_rlo4237bgbwt` + See :s:`ShorthandDeconstructor`. + :chapter: + :dp:`fls_9wfizujx0szd` + A :t:`shorthand deconstructor` is a :t:`construct` that matches the :t:`name` + of a :t:`field` and binds the :t:`value` of the matched :t:`field` to a + :t:`binding`. :dp:`fls_jTh9Hur0qsIb` A :t:`shorthand deconstructor` with :t:`keyword` ``mut`` yields a @@ -1028,9 +1392,20 @@ Tuple Struct Patterns .. rubric:: Legality Rules -:dp:`fls_ks6y1syab2bp` -A :t:`tuple struct pattern` is a :t:`pattern` that matches a -:t:`tuple enum variant value`, or a :t:`tuple struct value`. +.. glossary-entry:: tuple struct pattern + :glossary-dp: fls_u2j18nl1t12f + + :glossary: + :dp:`fls_gu1mfurivnfz` + A :dt:`tuple struct pattern` is a :t:`pattern` that matches a + :t:`tuple enum variant value` or a :t:`tuple struct value`. + + :dp:`fls_3jx5683mdm10` + See :s:`TupleStructPattern`. + :chapter: + :dp:`fls_ks6y1syab2bp` + A :t:`tuple struct pattern` is a :t:`pattern` that matches a + :t:`tuple enum variant value`, or a :t:`tuple struct value`. :dp:`fls_t1mrijw16k9a` The :t:`deconstructee` of a :t:`tuple struct pattern` shall resolve to a @@ -1110,9 +1485,20 @@ Tuple Patterns .. rubric:: Legality Rules -:dp:`fls_e2manugp4e0b` -A :t:`tuple pattern` is a :t:`pattern` that matches a :t:`tuple` which satisfies -all criteria defined by its :t:`[subpattern]s`. +.. glossary-entry:: tuple pattern + :glossary-dp: fls_7f2sx37kg4ca + + :glossary: + :dp:`fls_al2q3vh1rg6e` + A :dt:`tuple pattern` is a :t:`pattern` that matches a :t:`tuple` which + satisfies all criteria defined by its :t:`[subpattern]s`. + + :dp:`fls_bevmt5t0238j` + See :s:`TuplePattern`. + :chapter: + :dp:`fls_e2manugp4e0b` + A :t:`tuple pattern` is a :t:`pattern` that matches a :t:`tuple` which satisfies + all criteria defined by its :t:`[subpattern]s`. :dp:`fls_xk8udu4k61kj` A :t:`tuple pattern` is an :t:`irrefutable pattern` when all of its @@ -1190,8 +1576,19 @@ Underscore Patterns .. rubric:: Legality Rules -:dp:`fls_dreny9e0ei6r` -An :t:`underscore pattern` is a :t:`pattern` that matches any single :t:`value`. +.. glossary-entry:: underscore pattern + :glossary-dp: fls_fhwqe6afup2o + + :glossary: + :dp:`fls_f6yroesif1q4` + An :dt:`underscore pattern` is a :t:`pattern` that matches any single + :t:`value`. + + :dp:`fls_bktuchv7o4dd` + See :s:`UnderscorePattern`. + :chapter: + :dp:`fls_dreny9e0ei6r` + An :t:`underscore pattern` is a :t:`pattern` that matches any single :t:`value`. :dp:`fls_42fye1v0th8l` An :t:`underscore pattern` is an :t:`irrefutable pattern`. @@ -1222,15 +1619,42 @@ Binding Modes Binding ::= Name -.. rubric:: Legality Rules +.. glossary-entry:: binding mode + :glossary-dp: fls_bv1k866tai6j + + :glossary: + :dp:`fls_e3uvvvvyzq8h` + :dt:`Binding mode` is the mechanism by which a matched :t:`value` is bound to a + :t:`binding` of a :t:`pattern`. -:dp:`fls_7xby6d1903kw` -A :t:`binding pattern` is either an :t:`identifier pattern` or a -:t:`shorthand deconstructor`. +.. rubric:: Legality Rules -:dp:`fls_vnh9wfrvumdz` -A :t:`binding` of a :t:`binding pattern` binds a matched :t:`value` to a -:t:`name`. +.. glossary-entry:: binding pattern + :glossary-dp: fls_1nw19qc14zg6 + + :glossary: + :dp:`fls_ancqgz8pybbe` + A :dt:`binding pattern` is either an :t:`identifier pattern` or a + :t:`shorthand deconstructor`. + :chapter: + :dp:`fls_7xby6d1903kw` + A :t:`binding pattern` is either an :t:`identifier pattern` or a + :t:`shorthand deconstructor`. + +.. glossary-entry:: binding + :glossary-dp: fls_jrelzibadg7b + + :glossary: + :dp:`fls_89qi3unjvwd7` + A :dt:`binding` of a :t:`binding pattern` binds a matched :t:`value` to a + :t:`name`. + + :dp:`fls_lujdci4bphek` + See :s:`Binding`. + :chapter: + :dp:`fls_vnh9wfrvumdz` + A :t:`binding` of a :t:`binding pattern` binds a matched :t:`value` to a + :t:`name`. :dp:`fls_RViC5UEZPQUV` A :t:`binding` with :t:`binding mode` :dt:`by value` binds the matched @@ -1245,10 +1669,19 @@ A :t:`binding` with :t:`binding mode` :dt:`by reference` binds an A :t:`binding` with :t:`binding mode` :dt:`by mutable reference` binds a :t:`mutable reference` to the matched :t:`value` to the :t:`name`. -:dp:`fls_dqe75i8h2fie` -A :t:`non-reference pattern` is any :t:`pattern` except -:t:`non-[binding pattern]s`, :t:`[path pattern]s`, :t:`[reference pattern]s`, -and :t:`[underscore pattern]s`. +.. glossary-entry:: non-reference pattern + :glossary-dp: fls_3vhflvajgqzd + + :glossary: + :dp:`fls_tejled5izyue` + A :dt:`non-reference pattern` is any :t:`pattern` except + :t:`non-[binding pattern]s`, :t:`[path pattern]s`, :t:`[reference pattern]s`, + and :t:`[underscore pattern]s`. + :chapter: + :dp:`fls_dqe75i8h2fie` + A :t:`non-reference pattern` is any :t:`pattern` except + :t:`non-[binding pattern]s`, :t:`[path pattern]s`, :t:`[reference pattern]s`, + and :t:`[underscore pattern]s`. :dp:`fls_y3wuvj1y5j20` If a :t:`binding pattern` does not explicitly specify :t:`keyword` ``ref``, @@ -1302,8 +1735,15 @@ follows: Pattern Matching ---------------- -:dp:`fls_zv73CR8rplIa` -:dt:`Pattern matching` is the process of matching a :t:`pattern` against a :t:`value`. +.. glossary-entry:: pattern matching + :glossary-dp: fls_48mv0zecb0un + + :glossary: + :dp:`fls_y3oputy9e0sz` + :t:`Pattern matching` is the process of matching a :t:`pattern` against a :t:`value`. + :chapter: + :dp:`fls_zv73CR8rplIa` + :dt:`Pattern matching` is the process of matching a :t:`pattern` against a :t:`value`. .. rubric:: Legality Rules diff --git a/src/program-structure-and-compilation.rst b/src/program-structure-and-compilation.rst index e8ef612b..26f991ff 100644 --- a/src/program-structure-and-compilation.rst +++ b/src/program-structure-and-compilation.rst @@ -34,10 +34,21 @@ Source Files .. rubric:: Legality Rules -:dp:`fls_4vicosdeaqmp` -A :t:`source file` contains the program text consisting of :t:`[inner -attribute]s`, :t:`[inner doc comment]s`, and :t:`[item]s`. The location of a -:t:`source file` is tool defined. +.. glossary-entry:: source file + :glossary-dp: fls_wlwwxzpnhk6i + + :glossary: + :dp:`fls_nh737q4mn27u` + A :dt:`source file` contains the program text of :t:`[inner attribute]s`, + :t:`[inner doc comment]s`, and :t:`[item]s`. + + :dp:`fls_zgh1m5357ex1` + See :s:`SourceFile`. + :chapter: + :dp:`fls_4vicosdeaqmp` + A :t:`source file` contains the program text consisting of :t:`[inner + attribute]s`, :t:`[inner doc comment]s`, and :t:`[item]s`. The location of a + :t:`source file` is tool defined. :dp:`fls_ann3cha1xpek` A :s:`Shebang` does not have an effect on the compilation. @@ -69,22 +80,53 @@ Modules .. rubric:: Legality Rules -:dp:`fls_odd1hj3y1mgu` -A :t:`module` is a container for zero or more :t:`[item]s`. +.. glossary-entry:: module + :glossary-dp: fls_kbxk78vm564e + + :glossary: + :dp:`fls_ujlsg58bskl5` + A :dt:`module` is a container for zero or more :t:`[item]s`. + + :dp:`fls_os60q6vvm71c` + See :s:`ModuleDeclaration`. + :chapter: + :dp:`fls_odd1hj3y1mgu` + A :t:`module` is a container for zero or more :t:`[item]s`. :dp:`fls_whgv72emrm47` The ``unsafe`` :t:`keyword` of a :t:`module` is rejected, but may still be consumed by :t:`[macro]s`. -:dp:`fls_qypjjpcf8uwq` -An :t:`inline module` is a :t:`module` with an :s:`InlineModuleSpecification`. - -:dp:`fls_cavwpr1ybk37` -An :t:`outline module` is a :t:`module` with an :s:`OutlineModuleSpecification`. - -:dp:`fls_plepew2319g4` -An :t:`outline module` loads a :t:`source file` and considers the text of the -:t:`source file` to be inlined within the context of the :t:`outline module`. +.. glossary-entry:: inline module + :glossary-dp: fls_c54lmkluwbwr + + :glossary: + :dp:`fls_tbldwtisl9vc` + An :dt:`inline module` is a :t:`module` with an :s:`InlineModuleSpecification`. + + :dp:`fls_8bmjz8o3xu60` + See :s:`InlineModuleSpecification`. + :chapter: + :dp:`fls_qypjjpcf8uwq` + An :t:`inline module` is a :t:`module` with an :s:`InlineModuleSpecification`. + +.. glossary-entry:: outline module + :glossary-dp: fls_de935b1pzd28 + + :glossary: + :dp:`fls_xhe5gmr0r9zn` + An :dt:`outline module` is a :t:`module` with an + :s:`OutlineModuleSpecification`. + + :dp:`fls_wu5wqylzx9ke` + See :s:`OutlineModuleSpecification`. + :chapter: + :dp:`fls_cavwpr1ybk37` + An :t:`outline module` is a :t:`module` with an :s:`OutlineModuleSpecification`. + + :dp:`fls_plepew2319g4` + An :t:`outline module` loads a :t:`source file` and considers the text of the + :t:`source file` to be inlined within the context of the :t:`outline module`. :dp:`fls_1aruwps62c4p` The location of a :t:`module` :t:`source file` can be specified using @@ -109,14 +151,31 @@ Crates .. rubric:: Legality Rules -:dp:`fls_qwghk79ok5h0` -A :t:`crate` is a unit of compilation and linking that contains a tree of -nested :t:`[module]s`. - -:dp:`fls_unxalgMqIr3v` -The :t:`crate type` of a :t:`crate` is the value of the :t:`attribute` -``crate_type`` of a :t:`crate` or the value of ``--crate-type`` flag passed to -the tool compiling the :t:`crate`. +.. glossary-entry:: crate + :glossary-dp: fls_kf8yukhxudw8 + + :glossary: + :dp:`fls_qplsjzb2uyim` + A :dt:`crate` is a unit of compilation and linking that contains a tree of + nested :t:`[module]s`. + :chapter: + :dp:`fls_qwghk79ok5h0` + A :t:`crate` is a unit of compilation and linking that contains a tree of + nested :t:`[module]s`. + +.. glossary-entry:: crate type + :glossary-dp: fls_lVpE4uFDsXH4 + + :glossary: + :dp:`fls_eaxsgPMFNH7f` + The :dt:`crate type` of a :t:`crate` is the value of the :t:`attribute` + ``crate_type`` of a :t:`crate` or the value of ``--crate-type`` flag passed to + the tool compiling the :t:`crate`. + :chapter: + :dp:`fls_unxalgMqIr3v` + The :t:`crate type` of a :t:`crate` is the value of the :t:`attribute` + ``crate_type`` of a :t:`crate` or the value of ``--crate-type`` flag passed to + the tool compiling the :t:`crate`. :dp:`fls_e7jGvXvTsFpC` The :t:`crate type` of a :t:`crate` if not specified is ``bin``. @@ -125,8 +184,15 @@ The :t:`crate type` of a :t:`crate` if not specified is ``bin``. A :t:`crate` may be subject to multiple :t:`[crate type]s`, treating each type as a separate :t:`crate`. -:dp:`fls_9ub6ks8qrang` -A :t:`binary crate` is a :t:`crate` whose :t:`crate type` is ``bin``. +.. glossary-entry:: binary crate + :glossary-dp: fls_kahj3y4rvmvb + + :glossary: + :dp:`fls_8gfe7hajxkd7` + A :dt:`binary crate` is a :t:`crate` whose :t:`crate type` is ``bin``. + :chapter: + :dp:`fls_9ub6ks8qrang` + A :t:`binary crate` is a :t:`crate` whose :t:`crate type` is ``bin``. :dp:`fls_OyFwBtDGVimT` A :t:`binary crate` that is not subject to :t:`attribute` ``no_main`` shall have @@ -138,12 +204,29 @@ The :t:`function` in scope of a :t:`binary crate`'s :t:`crate root module` under the :t:`name` ``main`` with a :t:`main function signature` is the :t:`binary crate`'s :t:`program entry point`. -:dp:`fls_d9nn4yuiw1ja` -A :t:`library crate` is a :t:`crate` whose :t:`crate type` is ``lib``, ``rlib``, -``staticlib``, ``dylib``, or ``cdylib``. - -:dp:`fls_Mf62VqAhoZ3c` -A :t:`proc-macro crate` is a :t:`crate` whose :t:`crate type` is ``proc-macro``. +.. glossary-entry:: library crate + :glossary-dp: fls_r1sk7vdgckym + + :glossary: + :dp:`fls_3m8lg4mdc2x0` + A :dt:`library crate` is a :t:`crate` whose :t:`crate type` is ``lib``, ``rlib``, + ``staticlib``, ``dylib``, or ``cdylib``. + :chapter: + :dp:`fls_d9nn4yuiw1ja` + A :t:`library crate` is a :t:`crate` whose :t:`crate type` is ``lib``, ``rlib``, + ``staticlib``, ``dylib``, or ``cdylib``. + +.. glossary-entry:: proc-macro crate + :glossary-dp: fls_kCA6SW8bUq5x + + :glossary: + .. _fls_AjjdLZWiL9Tq: + + :dp:`fls_DfTszT1PjV7o` + A :dt:`proc-macro crate` is a :t:`crate` whose :t:`crate type` is ``proc-macro``. + :chapter: + :dp:`fls_Mf62VqAhoZ3c` + A :t:`proc-macro crate` is a :t:`crate` whose :t:`crate type` is ``proc-macro``. :dp:`fls_RJJmN4tP7j4m` A :t:`proc-macro crate` shall not declare :t:`[item]s` in its :t:`crate root @@ -171,11 +254,31 @@ Crate Imports .. rubric:: Legality Rules -:dp:`fls_d0pa807s5d5h` -A :t:`crate import` specifies a required dependency on an external :t:`crate`. - -:dp:`fls_vfam3wzeAiah` -A :t:`crate indication` is a :t:`construct` that indicates a :t:`crate`. +.. glossary-entry:: crate import + :glossary-dp: fls_xwbmmcbbowtu + + :glossary: + :dp:`fls_y91ja1a87g7a` + A :dt:`crate import` specifies a dependency on an external :t:`crate`. + + :dp:`fls_nmdxagg39hz6` + See :s:`ExternalCrateImport`. + :chapter: + :dp:`fls_d0pa807s5d5h` + A :t:`crate import` specifies a required dependency on an external :t:`crate`. + +.. glossary-entry:: crate indication + :glossary-dp: fls_CXvNvsO10pLL + + :glossary: + :dp:`fls_XUSFUErxQRRA` + A :dt:`crate indication` is a :t:`construct` that indicates a :t:`crate`. + + :dp:`fls_s1eFklbzjLxQ` + See :s:`CrateIndication`. + :chapter: + :dp:`fls_vfam3wzeAiah` + A :t:`crate indication` is a :t:`construct` that indicates a :t:`crate`. :dp:`fls_ft860vkz0lkc` A :t:`crate import` binds an external :t:`crate` to its :t:`crate indication`. @@ -203,16 +306,38 @@ Compilation Roots .. rubric:: Legality Rules -:dp:`fls_fhiqvgdamq5` -A :t:`crate root module` is the root of the nested :t:`module` tree of a -:t:`crate`. +.. glossary-entry:: crate root + :glossary-dp: fls_hv9zyxb72soh + + :glossary: + :dp:`fls_yxcgiuybqqy8` + A :dt:`crate root` is an entry point into a :t:`crate`. + +.. glossary-entry:: crate root module + :glossary-dp: fls_iucxone5ta26 + + :glossary: + :dp:`fls_oo4nmqv78wno` + A :dt:`crate root module` is the root of the nested :t:`module` tree of a + :t:`crate`. + :chapter: + :dp:`fls_fhiqvgdamq5` + A :t:`crate root module` is the root of the nested :t:`module` tree of a + :t:`crate`. :dp:`fls_tk8tl2e0a34` A tool can define a :t:`crate root module` for a single :t:`crate`. -:dp:`fls_bsyfxdk3ap1t` -A :t:`compilation root` is an input to a compilation performed by a tool. A -:t:`crate root module` is a :t:`compilation root`. +.. glossary-entry:: compilation root + :glossary-dp: fls_riwule1euzlj + + :glossary: + :dp:`fls_stwsfyvov2fx` + A :dt:`compilation root` is an input to a compilation performed by a tool. + :chapter: + :dp:`fls_bsyfxdk3ap1t` + A :t:`compilation root` is an input to a compilation performed by a tool. A + :t:`crate root module` is a :t:`compilation root`. .. _fls_u1afezy1ye99: @@ -252,31 +377,47 @@ Program Entry Point .. rubric:: Legality Rules -:dp:`fls_dp64b08em9BJ` -A :t:`program entry point` is a :t:`function` that is invoked at the start of -a Rust program. - -:dp:`fls_sbGnkm8Ephiu` -A :t:`main function signature` is a :t:`function signature` subject to the -following restrictions: - -* :dp:`fls_o4fxok23134r` - It lacks :t:`[function qualifier]s` ``async`` and ``unsafe``, - -* :dp:`fls_bk755pvc1l53` - Its :t:`ABI` is Rust, - -* :dp:`fls_a3je4wc53bmo` - It lacks :t:`[generic parameter]s`, - -* :dp:`fls_w8q15zp7kyl0` - It lacks :t:`[function parameter]s`, - -* :dp:`fls_4psnfphsgdek` - It lacks a :t:`return type`, - -* :dp:`fls_m7xfrhqif74` - It lacks a :t:`where clause`, - -* :dp:`fls_qq9fzrw4aykd` - It has a :t:`function body`. +.. glossary-entry:: program entry point + :glossary-dp: fls_SIFecOZqloyx + + :glossary: + :dp:`fls_9m37hN9zgEQf` + A :dt:`program entry point` is a :t:`function` that is invoked at the start of + a Rust program. + :chapter: + :dp:`fls_dp64b08em9BJ` + A :t:`program entry point` is a :t:`function` that is invoked at the start of + a Rust program. + +.. glossary-entry:: main function signature + :glossary-dp: fls_MJ1YWiOpxAa8 + + :glossary: + :dp:`fls_QijObGZEIykU` + A :dt:`main function signature` is a :t:`function signature` subject to specific + restrictions. + :chapter: + :dp:`fls_sbGnkm8Ephiu` + A :t:`main function signature` is a :t:`function signature` subject to the + following restrictions: + + * :dp:`fls_o4fxok23134r` + It lacks :t:`[function qualifier]s` ``async`` and ``unsafe``, + + * :dp:`fls_bk755pvc1l53` + Its :t:`ABI` is Rust, + + * :dp:`fls_a3je4wc53bmo` + It lacks :t:`[generic parameter]s`, + + * :dp:`fls_w8q15zp7kyl0` + It lacks :t:`[function parameter]s`, + + * :dp:`fls_4psnfphsgdek` + It lacks a :t:`return type`, + + * :dp:`fls_m7xfrhqif74` + It lacks a :t:`where clause`, + + * :dp:`fls_qq9fzrw4aykd` + It has a :t:`function body`. diff --git a/src/statements.rst b/src/statements.rst index 98739875..b998b1d5 100644 --- a/src/statements.rst +++ b/src/statements.rst @@ -8,6 +8,16 @@ Statements ========== +.. glossary-entry:: statement + :glossary-dp: fls_e7cvo0usw86i + + :glossary: + :dp:`fls_faijgwg4lhp9` + A :dt:`statement` is a component of a block expression. + + :dp:`fls_th7edvxml3mn` + See :s:`Statement`. + .. rubric:: Syntax .. syntax:: @@ -24,22 +34,60 @@ Statements :dp:`fls_7zh6ziglo5iy` An :t:`expression statement` is an :t:`expression` whose result is ignored. -:dp:`fls_kdxe1ukmgl1` -An :t:`item statement` is a :t:`statement` that is expressed as an :t:`item`. - -:dp:`fls_fftdnwe22xrb` -An :t:`empty statement` is a :t:`statement` expressed as character 0x3B -(semicolon). - -:dp:`fls_or125cqtxg9j` -A :t:`macro statement` is a :t:`statement` expressed as a -:t:`terminated macro invocation`. +.. glossary-entry:: item statement + :glossary-dp: fls_yaurxo4ogfsh + + :glossary: + :dp:`fls_r0crucpuhtj` + An :dt:`item statement` is a :t:`statement` that is expressed as an :t:`item`. + :chapter: + :dp:`fls_kdxe1ukmgl1` + An :t:`item statement` is a :t:`statement` that is expressed as an :t:`item`. + +.. glossary-entry:: empty statement + :glossary-dp: fls_iwed9n4jz6b8 + + :glossary: + :dp:`fls_irw5gwuvj3nn` + An :dt:`empty statement` is a :t:`statement` expressed as character 0x3B + (semicolon). + :chapter: + :dp:`fls_fftdnwe22xrb` + An :t:`empty statement` is a :t:`statement` expressed as character 0x3B + (semicolon). + +.. glossary-entry:: macro statement + :glossary-dp: fls_i4yf4lt8qvkt + + :glossary: + :dp:`fls_yhh9k9epv3g6` + A :dt:`macro statement` is a :t:`statement` expressed as a + :t:`terminated macro invocation`. + :chapter: + :dp:`fls_or125cqtxg9j` + A :t:`macro statement` is a :t:`statement` expressed as a + :t:`terminated macro invocation`. .. rubric:: Dynamic Semantics -:dp:`fls_estqu395zxgk` -:t:`Execution` is the process by which a :t:`statement` achieves its runtime -effects. +.. glossary-entry:: execution + :glossary-dp: fls_q0ur239s8uv + + :glossary: + :dp:`fls_e5jbii84hd5g` + :dt:`Execution` is the process by which a :t:`statement` achieves its runtime + effects. + :chapter: + :dp:`fls_estqu395zxgk` + :t:`Execution` is the process by which a :t:`statement` achieves its runtime + effects. + +.. glossary-entry:: executed + :glossary-dp: fls_nw0eg7gwayrg + + :glossary: + :dp:`fls_kelmsc68lyf7` + See :t:`execution`. :dp:`fls_dl763ssb54q1` The :t:`execution` of an :t:`empty statement` has no effect. @@ -61,15 +109,54 @@ Let Statements .. rubric:: Legality Rules -:dp:`fls_ct7pp7jnfr86` -A :t:`let statement` is a :t:`statement` that introduces new :t:`[binding]s` -produced by its :t:`pattern-without-alternation` that are optionally -initialized to a :t:`value`. - -:dp:`fls_SR3dIgR5K0Kq` -A :t:`let initializer` is a :t:`construct` that provides the :t:`value` of -the :t:`[binding]s` of the :t:`let statement` using an :t:`expression`, or -alternatively executes a :t:`block expression`. +.. glossary-entry:: initialization + :glossary-dp: fls_c1wbumq0bumj + + :glossary: + :dp:`fls_xi07ycze6mo0` + :dt:`Initialization` is the act of supplying an initial :t:`value` to a + :t:`constant`, a :t:`static`, or a :t:`variable`. + +.. glossary-entry:: let binding + :glossary-dp: fls_DdZ1ZwjLZTeG + + :glossary: + :dp:`fls_sw6HrsxsnG2y` + A :dt:`let binding` is the :t:`binding` introduced by a :t:`let statement`, an :t:`if let expression`, or a :t:`while let loop expression`. + +.. glossary-entry:: let statement + :glossary-dp: fls_39k0ebr7snb0 + + :glossary: + :dp:`fls_yh7hn6jjv3ur` + A :dt:`let statement` is a :t:`statement` that introduces new :t:`[variable]s` + given by the :t:`[binding]s` produced by its :t:`pattern-without-alternation` + that are optionally initialized to a :t:`value`. + + :dp:`fls_tsem3c6zqmh4` + See :s:`LetStatement`. + :chapter: + :dp:`fls_ct7pp7jnfr86` + A :t:`let statement` is a :t:`statement` that introduces new :t:`[binding]s` + produced by its :t:`pattern-without-alternation` that are optionally + initialized to a :t:`value`. + +.. glossary-entry:: let initializer + :glossary-dp: fls_hqj80jHcxEBB + + :glossary: + :dp:`fls_jtTpBZ4ujZRc` + A :dt:`let initializer` is a :t:`construct` that provides the :t:`value` of + the :t:`[binding]s` of the :t:`let statement` using an :t:`expression`, or + alternatively executes a :t:`block expression`. + + :dp:`fls_GmHsJb6FICfA` + See :s:`LetInitializer`. + :chapter: + :dp:`fls_SR3dIgR5K0Kq` + A :t:`let initializer` is a :t:`construct` that provides the :t:`value` of + the :t:`[binding]s` of the :t:`let statement` using an :t:`expression`, or + alternatively executes a :t:`block expression`. :dp:`fls_iqar7vvtw22c` If a :t:`let statement` lacks a :t:`block expression`, then the :t:`pattern` of @@ -163,8 +250,18 @@ Expression Statements .. rubric:: Legality Rules -:dp:`fls_xmdj8uj7ixoe` -An :t:`expression statement` is an :t:`expression` whose result is ignored. +.. glossary-entry:: expression statement + :glossary-dp: fls_a1rorkjt3vpc + + :glossary: + :dp:`fls_ds0pspiqk4am` + An :dt:`expression statement` is an :t:`expression` whose result is ignored. + + :dp:`fls_41jt1h3audzv` + See :s:`ExpressionStatement`. + :chapter: + :dp:`fls_xmdj8uj7ixoe` + An :t:`expression statement` is an :t:`expression` whose result is ignored. :dp:`fls_gzzmudc1hl6s` The :t:`expected type` of an :t:`expression statement` without character 0x3B diff --git a/src/types-and-traits.rst b/src/types-and-traits.rst index a70989a5..9520e7ed 100644 --- a/src/types-and-traits.rst +++ b/src/types-and-traits.rst @@ -46,12 +46,47 @@ Types .. rubric:: Legality Rules -:dp:`fls_4rhjpdu4zfqj` -A :t:`type` defines a set of :t:`[value]s` and a set of operations that act on -those :t:`[value]s`. - -:dp:`fls_0yaYKnFrJkhG` -A :t:`local type` is a :t:`type` that is defined in the current :t:`crate`. +.. glossary-entry:: type ascription + :glossary-dp: fls_1n50v16et5e6 + + :glossary: + :dp:`fls_pm5jytclqn7y` + A :dt:`type ascription` specifies the :t:`type` of a :t:`construct`. + + :dp:`fls_c3xtiputfxea` + See :s:`TypeAscription`. + +.. glossary-entry:: type specification + :glossary-dp: fls_ukua6gbye6ot + + :glossary: + :dp:`fls_tdjhjg9zhnv5` + A :dt:`type specification` describes the structure of a :t:`type`. + + :dp:`fls_a3sqjp1l8po6` + See :s:`TypeSpecification`. + +.. glossary-entry:: type + :glossary-dp: fls_wzupssn435n + + :glossary: + :dp:`fls_nhlh7vvgsbwo` + A :dt:`type` defines a set of :t:`[value]s` and a set of operations that act on + those :t:`[value]s`. + :chapter: + :dp:`fls_4rhjpdu4zfqj` + A :t:`type` defines a set of :t:`[value]s` and a set of operations that act on + those :t:`[value]s`. + +.. glossary-entry:: local type + :glossary-dp: fls_cexgUIGUUKS4 + + :glossary: + :dp:`fls_HvGPB3CsN4Ah` + A :dt:`local type` is a :t:`type` that is defined in the current :t:`crate`. + :chapter: + :dp:`fls_0yaYKnFrJkhG` + A :t:`local type` is a :t:`type` that is defined in the current :t:`crate`. .. _fls_963gsjp2jas2: @@ -157,6 +192,22 @@ Type Classification Scalar Types ------------ +.. glossary-entry:: scalar type + :glossary-dp: fls_XeMNghZZOBqL + + :glossary: + :dp:`fls_GgBqFW2NywoA` + A :dt:`scalar type` is either a :c:`bool` :t:`type`, a :c:`char` :t:`type`, or + a :t:`numeric type`. + +.. glossary-entry:: textual type + :glossary-dp: fls_mdcbhy96hrau + + :glossary: + :dp:`fls_lv1pdtzf6f58` + A :dt:`textual type` is a :t:`type` class that includes type :c:`char` and type + :c:`str`. + .. _fls_tiqp1gxf116z: Bool Type @@ -164,9 +215,17 @@ Bool Type .. rubric:: Legality Rules -:dp:`fls_h5994su1yft3` -:c:`Bool` is a :t:`type` whose :t:`[value]s` denote the truth :t:`[value]s` of -logic and Boolean algebra. +.. glossary-entry:: bool + :glossary-dp: fls_n485t6wcgx07 + + :glossary: + :dp:`fls_wtmaf5amvleh` + :dc:`bool` is a :t:`type` whose :t:`[value]s` denote the truth values of logic + and Boolean algebra. + :chapter: + :dp:`fls_h5994su1yft3` + :c:`Bool` is a :t:`type` whose :t:`[value]s` denote the truth :t:`[value]s` of + logic and Boolean algebra. :dp:`fls_v8atmrwz6wzk` :t:`Type` :c:`bool` appears in the :t:`language prelude` under the name @@ -338,6 +397,14 @@ Operation ``a <= b`` is equivalent to ``a == b | a < b``. .. rubric:: Undefined Behavior +.. glossary-entry:: validity invariant + :glossary-dp: fls_A5K8aOBsI3BG + + :glossary: + :dp:`fls_3ebC3l839ajF` + A :dt:`validity invariant` is an invariant that when violated results in + immediate :t:`undefined behavior`. + :dp:`fls_2sd39mj05mb9` It is a :t:`validity invariant` for a :t:`value` of :t:`type` :c:`bool` to have a bit pattern of ``0x00`` and ``0x01``. @@ -349,10 +416,17 @@ Char Type .. rubric:: Legality Rules -:dp:`fls_vnwbs0exbwcn` -:c:`Char` is a :t:`type` whose :t:`[value]s` are represented as a 32-bit -unsigned word in the 0x000 - 0xD7FF or the 0xE000 - 0x10FFFF inclusive ranges -of :t:`Unicode`. +.. glossary-entry:: char + :glossary-dp: fls_xl2zlpw070dy + + :glossary: + :dp:`fls_vx0dss1yplw1` + :dc:`char` is a :t:`type` whose :t:`[value]s` denote :t:`Unicode` characters. + :chapter: + :dp:`fls_vnwbs0exbwcn` + :c:`Char` is a :t:`type` whose :t:`[value]s` are represented as a 32-bit + unsigned word in the 0x000 - 0xD7FF or the 0xE000 - 0x10FFFF inclusive ranges + of :t:`Unicode`. .. rubric:: Undefined Behavior @@ -366,6 +440,13 @@ inside the 0x000 - 0xD7FF or the 0xE000 - 0x10FFFF inclusive ranges of Numeric Types ~~~~~~~~~~~~~ +.. glossary-entry:: numeric type + :glossary-dp: fls_rayjriyofmpa + + :glossary: + :dp:`fls_cpdsj94l57af` + A :dt:`numeric type` is a :t:`type` whose :t:`[value]s` denote numbers. + .. _fls_b4xporvr64s: Floating Point Types @@ -373,11 +454,42 @@ Floating Point Types .. rubric:: Legality Rules -:dp:`fls_30yny2xb9b6b` -:t:`Type` :c:`f32` is equivalent to the IEEE 754-2008 binary32 :t:`type`. - -:dp:`fls_yqflrq9s6p6n` -:t:`Type` :c:`f64` is equivalent to the IEEE 754-2008 binary64 :t:`type`. +.. glossary-entry:: floating-point type + :glossary-dp: fls_k32g8cd9friu + + :glossary: + :dp:`fls_1w5yjiffah1u` + A :dt:`floating-point type` is a :t:`numeric type` whose :t:`[value]s` denote + fractional numbers. + +.. glossary-entry:: floating-point value + :glossary-dp: fls_nE6SWuVH7X68 + + :glossary: + :dp:`fls_rx8cvWPlvel5` + A :dt:`floating-point value` is a :t:`value` of a :t:`floating-point type`. + +.. glossary-entry:: f32 + :glossary-dp: fls_4w6garmjhrd9 + + :glossary: + :dp:`fls_4w5rqj7zdemu` + :dc:`f32` is a :t:`floating-point type` equivalent to the IEEE 754-2008 + binary32 :t:`type`. + :chapter: + :dp:`fls_30yny2xb9b6b` + :t:`Type` :c:`f32` is equivalent to the IEEE 754-2008 binary32 :t:`type`. + +.. glossary-entry:: f64 + :glossary-dp: fls_pj450h99yo28 + + :glossary: + :dp:`fls_ly6p0i6lsibh` + :dc:`f64` is a :t:`floating-point type` equivalent to the IEEE 754-2008 + binary64 :t:`type`. + :chapter: + :dp:`fls_yqflrq9s6p6n` + :t:`Type` :c:`f64` is equivalent to the IEEE 754-2008 binary64 :t:`type`. .. rubric:: Dynamic Semantics @@ -391,6 +503,22 @@ Integer Types .. rubric:: Legality Rules +.. glossary-entry:: integer type + :glossary-dp: fls_nu1cnk2b9qx5 + + :glossary: + :dp:`fls_nhfqdhf26ym3` + An :dt:`integer type` is a :t:`numeric type` whose :t:`[value]s` denote whole + numbers. + +.. glossary-entry:: unsigned integer type + :glossary-dp: fls_4jc74lz245z3 + + :glossary: + :dp:`fls_dxnf79qemlg6` + An :dt:`unsigned integer type` is an :t:`integer type` whose :t:`[value]s` + denote zero and positive whole numbers. + :dp:`fls_cokwseo3nnr` :t:`[Unsigned integer type]s` define the following inclusive ranges over the domain of whole numbers: @@ -422,9 +550,65 @@ domain of whole numbers: - 0 - 2\ :sup:`128` - 1 -:dp:`fls_75lntwhg20l` -:t:`Type` :c:`usize` has the same number of bits as the platform's -:t:`pointer type`, and is at least 16-bits wide. +.. glossary-entry:: u8 + :glossary-dp: fls_44uvj9l7q98z + + :glossary: + :dp:`fls_umf9zfeghy6` + :dc:`u8` is an :t:`unsigned integer type` whose :t:`[value]s` range from 0 to + 2\ :sup:`8` - 1, all inclusive. + +.. glossary-entry:: u16 + :glossary-dp: fls_eh24kdjdze5j + + :glossary: + :dp:`fls_8vi7bm2895y0` + :dc:`u16` is an :t:`unsigned integer type` whose :t:`[value]s` range from 0 to + 2\ :sup:`16` - 1, all inclusive. + +.. glossary-entry:: u32 + :glossary-dp: fls_jybcgdujzpqy + + :glossary: + :dp:`fls_pw90erui8vkk` + :dc:`u32` is an :t:`unsigned integer type` whose :t:`[value]s` range from 0 to + 2\ :sup:`32` - 1, all inclusive. + +.. glossary-entry:: u64 + :glossary-dp: fls_1z1e3chuejzz + + :glossary: + :dp:`fls_pbcmhznqft9m` + :dc:`u64` is an :t:`unsigned integer type` whose :t:`[value]s` range from 0 to + 2\ :sup:`64` - 1, all inclusive. + +.. glossary-entry:: u128 + :glossary-dp: fls_5hn9e3ce1smp + + :glossary: + :dp:`fls_8yv891ur2av5` + :dc:`u128` is an :t:`unsigned integer type` whose :t:`[value]s` range from 0 to + 2\ :sup:`128` - 1, all inclusive. + +.. glossary-entry:: usize + :glossary-dp: fls_gvjm5mms9ahz + + :glossary: + :dp:`fls_r22k1l8799k6` + :dc:`usize` is an :t:`unsigned integer type` with the same number of bits as + the platform's :t:`pointer type`, and is at least 16-bits wide. + :chapter: + :dp:`fls_75lntwhg20l` + :t:`Type` :c:`usize` has the same number of bits as the platform's + :t:`pointer type`, and is at least 16-bits wide. + +.. glossary-entry:: signed integer type + :glossary-dp: fls_nmw95nc951iu + + :glossary: + :dp:`fls_vcronf7l2bhy` + A :dt:`signed integer type` is an :t:`integer type` whose :t:`[value]s` denote + negative whole numbers, zero, and positive whole numbers. :dp:`fls_p2shoji3xg5a` :t:`[Signed integer type]s` define the following inclusive ranges over the @@ -457,15 +641,70 @@ domain of whole numbers: - \- (2\ :sup:`127`) - 2\ :sup:`127` - 1 -:dp:`fls_t9oyfmgqka6u` -:t:`Type` :c:`isize` has the same number of bits as the platform's -:t:`pointer type`, and is at least 16-bits wide. +.. glossary-entry:: i8 + :glossary-dp: fls_obiv2a6ywfhh + + :glossary: + :dp:`fls_1y9ulxnz8qba` + :dc:`i8` is a :t:`signed integer type` whose :t:`[value]s` range from - (2\ + :sup:`7`) to 2\ :sup:`7` - 1, all inclusive. + +.. glossary-entry:: i16 + :glossary-dp: fls_rvcjp656gzlm + + :glossary: + :dp:`fls_ci9jl55wxwdg` + :dc:`i16` is a :t:`signed integer type` whose :t:`[value]s` range from - (2\ + :sup:`15`) to 2\ :sup:`15` - 1, all inclusive. + +.. glossary-entry:: i32 + :glossary-dp: fls_l1h9g4ntf3c + + :glossary: + :dp:`fls_yh8wzhhso4xc` + :dc:`i32` is a :t:`signed integer type` whose :t:`[value]s` range from - (2\ + :sup:`31`) to 2\ :sup:`31` - 1, all inclusive. + +.. glossary-entry:: i64 + :glossary-dp: fls_tid10guzn9sq + + :glossary: + :dp:`fls_4bpatxp8yelv` + :dc:`i64` is a :t:`signed integer type` whose :t:`[value]s` range from - (2\ + :sup:`63`) to 2\ :sup:`63` - 1, all inclusive. + +.. glossary-entry:: i128 + :glossary-dp: fls_py2whbcrndmz + + :glossary: + :dp:`fls_p75kpbtonb8z` + :dc:`i128` is a :t:`signed integer type` whose :t:`[value]s` range from - (2\ + :sup:`127`) to 2\ :sup:`127` - 1, all inclusive. + +.. glossary-entry:: isize + :glossary-dp: fls_vt44bvhm4duk + + :glossary: + :dp:`fls_6x617i9zcj7o` + :dc:`isize` is a :t:`signed integer type` with the same number of bits as the + platform's :t:`pointer type`, and is at least 16-bits wide. + :chapter: + :dp:`fls_t9oyfmgqka6u` + :t:`Type` :c:`isize` has the same number of bits as the platform's + :t:`pointer type`, and is at least 16-bits wide. .. _fls_fbchw64p6n2x: Sequence Types -------------- +.. glossary-entry:: sequence type + :glossary-dp: fls_rtgis2k7by2r + + :glossary: + :dp:`fls_lk1oslxh8h9p` + A :dt:`sequence type` represents a sequence of elements. + .. _fls_uj0kpjwyld60: Array Types @@ -483,9 +722,46 @@ Array Types .. rubric:: Legality Rules -:dp:`fls_fx7b3qv3ghca` -An :t:`array type` is a :t:`sequence type` that represents a fixed sequence -of elements. +.. glossary-entry:: array type + :glossary-dp: fls_15gzlmwuu4pk + + :glossary: + :dp:`fls_muddb5qxdc4k` + An :dt:`array type` is a :t:`sequence type` that represents a fixed sequence of + elements. + + :dp:`fls_wre34hexlv6s` + See :s:`ArrayTypeSpecification`. + :chapter: + :dp:`fls_fx7b3qv3ghca` + An :t:`array type` is a :t:`sequence type` that represents a fixed sequence + of elements. + +.. glossary-entry:: element type + :glossary-dp: fls_bxm4njfo2h58 + + :glossary: + :dp:`fls_3bndijf8g9os` + An :dt:`element type` is the :t:`type` of the elements of an :t:`array type` or + a :t:`slice type`. + + :dp:`fls_pvyl887dn016` + See :s:`ElementType`. + +.. glossary-entry:: fixed sized type + :glossary-dp: fls_rljxa45tleq3 + + :glossary: + :dp:`fls_eadiywl20jo4` + A :dt:`fixed sized type` is a :t:`type` that implements the + :std:`core::marker::Sized` :t:`trait`. + +.. glossary-entry:: zero-sized type + :glossary-dp: fls_a5lrxgucl3be + + :glossary: + :dp:`fls_rmd6pearrhr8` + A :dt:`zero-sized type` is a :t:`fixed sized type` with :t:`size` zero. :dp:`fls_pkts1p2dnxo` The :t:`element type` shall be a :t:`fixed sized type`. @@ -511,6 +787,13 @@ An array type in the context of a let statement: Slice Types ~~~~~~~~~~~ +.. glossary-entry:: slice + :glossary-dp: fls_srkftses9sxn + + :glossary: + :dp:`fls_p1sv01ml2ark` + A :dt:`slice` is a :t:`value` of a :t:`slice type`. + .. rubric:: Syntax .. syntax:: @@ -520,9 +803,20 @@ Slice Types .. rubric:: Legality Rules -:dp:`fls_ftvua2hlvr08` -A :t:`slice type` is a :t:`sequence type` that provides a view into a sequence -of elements. +.. glossary-entry:: slice type + :glossary-dp: fls_x3kr88m5gvwv + + :glossary: + :dp:`fls_bvpszep1w90g` + A :dt:`slice type` is a :t:`sequence type` that provides a view into a sequence + of elements. + + :dp:`fls_y7gscwf29htg` + See :s:`SliceTypeSpecification`. + :chapter: + :dp:`fls_ftvua2hlvr08` + A :t:`slice type` is a :t:`sequence type` that provides a view into a sequence + of elements. :dp:`fls_acgtczhk8ci0` The :t:`element type` shall be a :t:`fixed sized type`. @@ -547,9 +841,17 @@ Str Type .. rubric:: Legality Rules -:dp:`fls_wlnoq1qoq2kr` -:c:`Str` is a :t:`sequence type` that represents a :t:`slice` of 8-bit unsigned -bytes. +.. glossary-entry:: str + :glossary-dp: fls_1ricdj86o457 + + :glossary: + :dp:`fls_6977zxb0resa` + :dc:`str` is a :t:`sequence type` that represents a :t:`slice` of 8-bit + unsigned bytes. + :chapter: + :dp:`fls_wlnoq1qoq2kr` + :c:`Str` is a :t:`sequence type` that represents a :t:`slice` of 8-bit unsigned + bytes. :dp:`fls_1xa6fas6laha` :t:`Type` :c:`str` is a :t:`dynamically sized type`. @@ -558,6 +860,14 @@ bytes. A :t:`value` of :t:`type` :c:`str` shall denote a valid UTF-8 sequence of characters. +.. glossary-entry:: safety invariant + :glossary-dp: fls_Q4MRIo7cWv5K + + :glossary: + :dp:`fls_wRZfAmTmMGTX` + A :dt:`safety invariant` is an invariant that when violated may result in + :t:`undefined behavior`. + .. rubric:: Undefined Behavior :dp:`fls_wacoqrtzvrwu` @@ -584,9 +894,62 @@ Tuple Types .. rubric:: Legality Rules -:dp:`fls_bn7wmf681ngt` -A :t:`tuple type` is a :t:`sequence type` that represents a heterogeneous list -of other :t:`[type]s`. +.. glossary-entry:: tuple + :glossary-dp: fls_si70t19ox07e + + :glossary: + :dp:`fls_yhcfqz6p0059` + A :dt:`tuple` is a :t:`value` of a :t:`tuple type`. + +.. glossary-entry:: tuple type + :glossary-dp: fls_k4yz7i2pf9wp + + :glossary: + :dp:`fls_q0ulqfvnxwni` + A :dt:`tuple type` is a :t:`sequence type` that represents a heterogeneous list + of other :t:`[type]s`. + + :dp:`fls_rkugxsau1w78` + See :s:`TupleTypeSpecification`. + :chapter: + :dp:`fls_bn7wmf681ngt` + A :t:`tuple type` is a :t:`sequence type` that represents a heterogeneous list + of other :t:`[type]s`. + +.. glossary-entry:: tuple field + :glossary-dp: fls_bf1v4e1s5xj6 + + :glossary: + :dp:`fls_8rq1gbzij5tk` + A :dt:`tuple field` is a :t:`field` of a :t:`tuple type`. + +.. glossary-entry:: arity + :glossary-dp: fls_9aice4qbiqxf + + :glossary: + :dp:`fls_dl2gkip00bua` + An :dt:`arity` is the number of :t:`[tuple field]s` in a :t:`tuple type`. + +.. glossary-entry:: unit type + :glossary-dp: fls_t32yfzmpid5a + + :glossary: + :dp:`fls_jtdtv3q2ls05` + The :dt:`unit type` is a :t:`tuple type` of zero :t:`arity`. + +.. glossary-entry:: unit tuple + :glossary-dp: fls_wmn9mcqae88q + + :glossary: + :dp:`fls_vo1jw6rmu4yy` + A :dt:`unit tuple` is a :t:`value` of the :t:`unit type`. + +.. glossary-entry:: unit value + :glossary-dp: fls_vxt0ifseehv9 + + :glossary: + :dp:`fls_ycdv4nvsdyx` + The :dt:`unit value` is the :t:`value` of a :t:`unit type`. :dp:`fls_s9a36zsrfqew` If the :t:`type` of a :t:`tuple field` is a :t:`dynamically-sized type`, then @@ -606,11 +969,25 @@ the :t:`tuple field` shall be the last :t:`tuple field` in the Abstract Data Types ------------------- +.. glossary-entry:: abstract data type + :glossary-dp: fls_g40une2uudez + + :glossary: + :dp:`fls_64drmro2fcfo` + An :dt:`abstract data type` is a collection of other :t:`[type]s`. + .. _fls_szibmtfv117b: Enum Types ~~~~~~~~~~ +.. glossary-entry:: enum + :glossary-dp: fls_xnhj9fqlfs2p + + :glossary: + :dp:`fls_9o0ig19xh2f5` + An :dt:`enum` is an :t:`item` that declares an :t:`enum type`. + .. rubric:: Syntax .. syntax:: @@ -634,23 +1011,122 @@ Enum Types .. rubric:: Legality Rules -:dp:`fls_gbdd37seqoab` -An :t:`enum type` is an :t:`abstract data type` that contains -:t:`[enum variant]s`. - -:dp:`fls_il9a1olqmu38` -A :t:`zero-variant enum type` has no :t:`[value]s`. - -:dp:`fls_wQTFwl88VujQ` -An :t:`enum variant` is a :t:`construct` that declares one of the -possible variations of an :t:`enum`. +.. glossary-entry:: enum type + :glossary-dp: fls_grlluqa4ucp3 + + :glossary: + :dp:`fls_idwrgo87ub3i` + An :dt:`enum type` is an :t:`abstract data type` that contains + :t:`[enum variant]s`. + + :dp:`fls_o6ih6n1z1566` + See :s:`EnumDeclaration`. + :chapter: + :dp:`fls_gbdd37seqoab` + An :t:`enum type` is an :t:`abstract data type` that contains + :t:`[enum variant]s`. + +.. glossary-entry:: zero-variant enum type + :glossary-dp: fls_pix563lfbpm + + :glossary: + :dp:`fls_84gqz3vwi5mj` + A :dt:`zero-variant enum type` is an :t:`enum type` without any + :t:`[enum variant]s`. + :chapter: + :dp:`fls_il9a1olqmu38` + A :t:`zero-variant enum type` has no :t:`[value]s`. + +.. glossary-entry:: enum variant + :glossary-dp: fls_klwlx5jixwud + + :glossary: + :dp:`fls_9jq4keg9y94u` + An :dt:`enum variant` is a :t:`construct` that declares one of the + possible variations of an :t:`enum`. + + :dp:`fls_tj2s55onen6b` + See :s:`EnumVariant`. + :chapter: + :dp:`fls_wQTFwl88VujQ` + An :t:`enum variant` is a :t:`construct` that declares one of the + possible variations of an :t:`enum`. + +.. glossary-entry:: record enum variant + :glossary-dp: fls_nG6ikjLsCW7m + + :glossary: + :dp:`fls_NWyvPQmOIjo2` + A :dt:`record enum variant` is an :t:`enum variant` with a + :s:`RecordStructFieldList`. + +.. glossary-entry:: tuple enum variant + :glossary-dp: fls_1XEHpJOK9DKB + + :glossary: + :dp:`fls_eduQhUYBEkVx` + A :dt:`tuple enum variant` is an :t:`enum variant` with a + :s:`TupleStructFieldList`. + +.. glossary-entry:: unit enum variant + :glossary-dp: fls_Rwtgq904NoaL + + :glossary: + :dp:`fls_y6fI5L3Tghie` + A :dt:`unit enum variant` is an :t:`enum variant` without a :t:`field list`. + +.. glossary-entry:: enum field + :glossary-dp: fls_zrRydWZgm03k + + :glossary: + :dp:`fls_J8udq05QGiEj` + An :dt:`enum field` is a :t:`field` of an :t:`enum variant`. + +.. glossary-entry:: enum value + :glossary-dp: fls_H6aUAUjNlx6z + + :glossary: + :dp:`fls_QdBTdVLB2xHk` + An :dt:`enum value` is a :t:`value` of an :t:`enum type`. + +.. glossary-entry:: enum variant value + :glossary-dp: fls_mKxBWCojhnWu + + :glossary: + :dp:`fls_VQRqNPFFWmDp` + An :dt:`enum variant value` is the :t:`enum value` of the corresponding + :t:`enum` of the :t:`enum variant`. + +.. glossary-entry:: tuple enum variant value + :glossary-dp: fls_sP7uHoLxGfRO + + :glossary: + :dp:`fls_ORURxipGqNrZ` + A :dt:`tuple enum variant value` is a :t:`value` of a :t:`tuple enum variant`. :dp:`fls_g5qle7xzaoif` The :t:`name` of an :t:`enum variant` shall be unique within the related :s:`EnumDeclaration`. -:dp:`fls_t4yeovFm83Wo` -A :t:`discriminant` is an opaque integer that identifies an :t:`enum variant`. +.. glossary-entry:: discriminant + :glossary-dp: fls_7vg56eeo0zlg + + :glossary: + :dp:`fls_dfegy9y6awx` + A :dt:`discriminant` is an opaque integer that identifies an :t:`enum variant`. + :chapter: + :dp:`fls_t4yeovFm83Wo` + A :t:`discriminant` is an opaque integer that identifies an :t:`enum variant`. + +.. glossary-entry:: discriminant initializer + :glossary-dp: fls_xayj37ocbqjn + + :glossary: + :dp:`fls_o7hihgcqmnyc` + A :dt:`discriminant initializer` provides the :t:`value` of a :t:`discriminant`. + + :dp:`fls_g5obc23vigng` + See :s:`DiscriminantInitializer`. :dp:`fls_hp5frc752dam` A :t:`discriminant initializer` shall be specified only when all :t:`[enum @@ -728,6 +1204,13 @@ It is a :t:`validity invariant` for a :t:`value` of an :t:`enum type` to have a Struct Types ~~~~~~~~~~~~ +.. glossary-entry:: struct + :glossary-dp: fls_yphnf56fa58r + + :glossary: + :dp:`fls_rufylj7qxs1w` + A :dt:`struct` is an :t:`item` that declares a :t:`struct type`. + .. rubric:: Syntax .. syntax:: @@ -758,11 +1241,150 @@ Struct Types UnitStructDeclaration ::= $$struct$$ Name GenericParameterList? WhereClause? $$;$$ +.. glossary-entry:: record struct + :glossary-dp: fls_jdd6h8pdp30x + + :glossary: + :dp:`fls_qyd7kqnpjs2` + A :dt:`record struct` is a :t:`struct` with a :s:`RecordStructFieldList`. + + :dp:`fls_rqs5rdnhkwnx` + See :s:`RecordStructDeclaration`. + +.. glossary-entry:: record struct type + :glossary-dp: fls_uthd12hz3h4v + + :glossary: + :dp:`fls_mgrz3o51gbis` + A :dt:`record struct type` is the :t:`type` of a :t:`record struct`. + +.. glossary-entry:: record struct field + :glossary-dp: fls_hzkwzbk5wp54 + + :glossary: + :dp:`fls_lb0t10evec6z` + A :dt:`record struct field` is a :t:`field` of a :t:`record struct type`. + + :dp:`fls_bjwmhxf3ae14` + See :s:`RecordStructField`. + +.. glossary-entry:: record struct value + :glossary-dp: fls_cPs5C1chWmce + + :glossary: + :dp:`fls_SMBIc0JMck1H` + A :dt:`record struct value` is a :t:`value` of a :t:`record struct type`. + +.. glossary-entry:: tuple struct + :glossary-dp: fls_245idp9hpqf6 + + :glossary: + :dp:`fls_pdcpmapiq491` + A :dt:`tuple struct` is a :t:`struct` with a :s:`TupleStructFieldList`. + + :dp:`fls_1tj4p05m4wdf` + See :s:`TupleStructDeclaration`. + +.. glossary-entry:: tuple struct type + :glossary-dp: fls_qx8j2lvqigqk + + :glossary: + :dp:`fls_hhikx5ajx3bl` + A :dt:`tuple struct type` is the :t:`type` of a :t:`tuple struct`. + +.. glossary-entry:: tuple struct field + :glossary-dp: fls_xx4slbg8s63e + + :glossary: + :dp:`fls_ndeb1a2hm9d8` + A :dt:`tuple struct field` is a :t:`field` of a :t:`tuple struct type`. + + :dp:`fls_v4eq8xg608d5` + See :s:`TupleStructField`. + +.. glossary-entry:: tuple struct value + :glossary-dp: fls_x4ALCJKhVDZF + + :glossary: + :dp:`fls_xz1p4pss2Ocn` + A :dt:`tuple struct value` is a :t:`value` of a :t:`tuple struct type`. + +.. glossary-entry:: unit struct + :glossary-dp: fls_f3hmx9qya258 + + :glossary: + :dp:`fls_9t7fu8fcak6k` + A :dt:`unit struct` is a :t:`struct` without a :t:`field list`. + + :dp:`fls_mSuiysAVczPx` + See :s:`UnitStructDeclaration`. + +.. glossary-entry:: unit struct constant + :glossary-dp: fls_jdvEnl8F7I8R + + :glossary: + :dp:`fls_lLGn4JqddeAg`: + A :dt:`unit struct constant` is a :t:`constant` implicitly created by a + :t:`unit struct`. + +.. glossary-entry:: unit struct type + :glossary-dp: fls_6j2wnOmBILJa + + :glossary: + :dp:`fls_oIzmvACNeQpE` + A :dt:`unit struct type` is the :t:`type` of a :t:`unit struct`. + +.. glossary-entry:: unit struct value + :glossary-dp: fls_CXp8fgPrBVUe + + :glossary: + :dp:`fls_Kr9nGIjx3N4R` + A :dt:`unit struct value` is a :t:`value` of a :t:`unit struct type`. + +.. glossary-entry:: struct field + :glossary-dp: fls_OT6dJ7CWkSTG + + :glossary: + :dp:`fls_8Z9YWMnrHXJS` + A :dt:`struct field` is a :t:`field` of a :t:`struct type`. + +.. glossary-entry:: struct value + :glossary-dp: fls_GOnQHAsYw1oi + + :glossary: + :dp:`fls_YmZfW9kWlbIX` + A :dt:`struct value` is a :t:`value` of a :t:`struct type`. + .. rubric:: Legality Rules -:dp:`fls_g1azfj548136` -A :t:`struct type` is an :t:`abstract data type` that is a product of other -:t:`[type]s`. +.. glossary-entry:: field + :glossary-dp: fls_7gCAbHnGEIl6 + + :glossary: + :dp:`fls_uAkrgfFTK2YV` + A :dt:`field` is an element of an :t:`abstract data type`. + +.. glossary-entry:: field list + :glossary-dp: fls_8qLL14WfXXNN + + :glossary: + :dp:`fls_xMZsrxMc9Cni` + A :dt:`field list` is a :s:`RecordStructFieldList` or :s:`TupleStructFieldList`. + +.. glossary-entry:: struct type + :glossary-dp: fls_pzj88ust6qrq + + :glossary: + :dp:`fls_7v4dhh3nl8h9` + A :dt:`struct type` is an :t:`abstract data type` that is a product of other + :t:`[type]s`. + + :dp:`fls_dhlww4yrnb2v` + See :s:`StructDeclaration`. + :chapter: + :dp:`fls_g1azfj548136` + A :t:`struct type` is an :t:`abstract data type` that is a product of other + :t:`[type]s`. :dp:`fls_r885av95eivp` The :t:`name` of a :t:`record struct field` shall be unique within the @@ -810,9 +1432,40 @@ Union Types .. rubric:: Legality Rules -:dp:`fls_nskmnzq95yqm` -A :t:`union type` is an :t:`abstract data type` that is a sum of other -:t:`[type]s`. +.. glossary-entry:: union + :glossary-dp: fls_8qljy9e1jjcb + + :glossary: + :dp:`fls_x3oibk39dvem` + A :dt:`union` is an :t:`item` that declares a :t:`union type`. + +.. glossary-entry:: union type + :glossary-dp: fls_nrgyga1rztb3 + + :glossary: + :dp:`fls_af2sscrep7mc` + A :dt:`union type` is an :t:`abstract data type` similar to a :t:`C`-like union. + + :dp:`fls_fgvjogfz8ink` + See :s:`UnionDeclaration`. + :chapter: + :dp:`fls_nskmnzq95yqm` + A :t:`union type` is an :t:`abstract data type` that is a sum of other + :t:`[type]s`. + +.. glossary-entry:: union field + :glossary-dp: fls_71xvazpwi8p0 + + :glossary: + :dp:`fls_6t2fbnlndz8y` + A :dt:`union field` is a :t:`field` of a :t:`union type`. + +.. glossary-entry:: union value + :glossary-dp: fls_2QRQMeA3OSVl + + :glossary: + :dp:`fls_9BPrxky3a4nE` + A :dt:`union value` is a :t:`value` of a :t:`union type`. :dp:`fls_I5fN5Fmo5CyK` A :t:`union` without any :t:`[union field]s` is rejected, but may still be consumed by @@ -857,6 +1510,14 @@ The :t:`type` of a :t:`union field` shall be either: Function Types -------------- +.. glossary-entry:: function type + :glossary-dp: fls_yo2x1llt9ejy + + :glossary: + :dp:`fls_4e19116glgtv` + A :dt:`function type` is either a :t:`closure type` or a + :t:`function item type`. + .. _fls_xd2oxlebhs14: Closure Types @@ -864,9 +1525,17 @@ Closure Types .. rubric:: Legality Rules -:dp:`fls_bsykgnbatpmi` -A :t:`closure type` is a unique anonymous :t:`function type` that encapsulates -all :t:`[capture target]s` of a :t:`closure expression`. +.. glossary-entry:: closure type + :glossary-dp: fls_xjudl8ykbisi + + :glossary: + :dp:`fls_wp4kues3nbvn` + A :dt:`closure type` is a unique anonymous :t:`function type` that encapsulates + all :t:`[capture target]s` of a :t:`closure expression`. + :chapter: + :dp:`fls_bsykgnbatpmi` + A :t:`closure type` is a unique anonymous :t:`function type` that encapsulates + all :t:`[capture target]s` of a :t:`closure expression`. :dp:`fls_zfj4l8bigdg0` A :t:`closure type` implements the :std:`core::ops::FnOnce` :t:`trait`. @@ -910,17 +1579,41 @@ Function Item Types .. rubric:: Legality Rules -:dp:`fls_t24iojx7yc23` -A :t:`function item type` is a unique anonymous :t:`function type` that -identifies a :t:`function`. - -:dp:`fls_sas3ahcshnrh` -An :t:`external function item type` is a :t:`function item type` where the -related :t:`function` is an :t:`external function`. - -:dp:`fls_liwnzwu1el1i` -An :t:`unsafe function item type` is a :t:`function item type` where the related -:t:`function` is an :t:`unsafe function`. +.. glossary-entry:: function item type + :glossary-dp: fls_ayuia853po0a + + :glossary: + :dp:`fls_rfvfo8x42dh8` + A :dt:`function item type` is a unique anonymous :t:`function type` that + identifies a :t:`function`. + :chapter: + :dp:`fls_t24iojx7yc23` + A :t:`function item type` is a unique anonymous :t:`function type` that + identifies a :t:`function`. + +.. glossary-entry:: external function item type + :glossary-dp: fls_ug2kags0o6is + + :glossary: + :dp:`fls_dwlovqly44dj` + An :dt:`external function item type` is a :t:`function item type` where the + related :t:`function` is an :t:`external function`. + :chapter: + :dp:`fls_sas3ahcshnrh` + An :t:`external function item type` is a :t:`function item type` where the + related :t:`function` is an :t:`external function`. + +.. glossary-entry:: unsafe function item type + :glossary-dp: fls_y1iruf62p856 + + :glossary: + :dp:`fls_r91tuwi55nu7` + An :dt:`unsafe function item type` is a :t:`function item type` where the + related :t:`function` is an :t:`unsafe function`. + :chapter: + :dp:`fls_liwnzwu1el1i` + An :t:`unsafe function item type` is a :t:`function item type` where the related + :t:`function` is an :t:`unsafe function`. :dp:`fls_e9x4f7qxvvjv` A :t:`function item type` is coercible to a :t:`function pointer type`. @@ -937,6 +1630,28 @@ the :std:`core::marker::Send` :t:`trait`, and the :std:`core::marker::Sync` Indirection Types ----------------- +.. glossary-entry:: indirection type + :glossary-dp: fls_k9kuxgte6vxn + + :glossary: + :dp:`fls_8so1phpdjyk8` + An :dt:`indirection type` is a :t:`type` whose :t:`[value]s` refer to memory + locations. + +.. glossary-entry:: pointer + :glossary-dp: fls_HnJEHyUiTpb1 + + :glossary: + :dp:`fls_DRjhMWo9mjoF` + A :dt:`pointer` is a :t:`value` of a :t:`pointer type`. + +.. glossary-entry:: pointer type + :glossary-dp: fls_o5o1ssqqD7Jg + + :glossary: + :dp:`fls_F2dUxEa4nheL` + A :dt:`pointer type` is a :t:`type` whose values indicate memory locations. + .. _fls_xztr1kebz8bo: Function Pointer Types @@ -963,19 +1678,60 @@ Function Pointer Types FunctionPointerTypeParameter ::= OuterAttributeOrDoc* (IdentifierOrUnderscore $$:$$)? TypeSpecification -.. rubric:: Legality Rules - -:dp:`fls_v2wrytr3t04h` -A :t:`function pointer type` is an :t:`indirection type` that refers to a -:t:`function`. +.. glossary-entry:: function pointer type parameter + :glossary-dp: fls_v3V6K4S5UhIF + + :glossary: + :dp:`fls_nF1k90JJWq2K` + A :dt:`function pointer type parameter` is a :t:`function parameter` of a + :t:`function pointer type`. + + :dp:`fls_vvy6qogy0xnb` + See :s:`FunctionPointerTypeParameter`. -:dp:`fls_5dd7icjcl3nt` -An :t:`unsafe function pointer type` is a function pointer type subject to -:t:`keyword` ``unsafe``. +.. rubric:: Legality Rules -:dp:`fls_B0SMXRqQMS1E` -A :t:`variadic part` indicates the presence of :t:`C`-like optional -parameters. +.. glossary-entry:: function pointer type + :glossary-dp: fls_fqwzlg78k503 + + :glossary: + :dp:`fls_lcawg25xhblx` + A :dt:`function pointer type` is an :t:`indirection type` that refers to a + :t:`function`. + + :dp:`fls_t50umpk5abjy` + See :s:`FunctionPointerTypeSpecification`. + :chapter: + :dp:`fls_v2wrytr3t04h` + A :t:`function pointer type` is an :t:`indirection type` that refers to a + :t:`function`. + +.. glossary-entry:: unsafe function pointer type + :glossary-dp: fls_bokqlokua059 + + :glossary: + :dp:`fls_tiluwa2v4l6d` + An :dt:`unsafe function pointer type` is a function pointer type subject to + :t:`keyword` ``unsafe``. + :chapter: + :dp:`fls_5dd7icjcl3nt` + An :t:`unsafe function pointer type` is a function pointer type subject to + :t:`keyword` ``unsafe``. + +.. glossary-entry:: variadic part + :glossary-dp: fls_RIe80XOF8VlA + + :glossary: + :dp:`fls_ePnTyLoqJ1i7` + A :dt:`variadic part` indicates the presence of :t:`C`-like optional + parameters. + + :dp:`fls_z9D86gBFbKB5` + See :s:`VariadicPart`. + :chapter: + :dp:`fls_B0SMXRqQMS1E` + A :t:`variadic part` indicates the presence of :t:`C`-like optional + parameters. :dp:`fls_hbn1l42xmr3h` A :t:`variadic part` can only be used in a :t:`variadic function`. @@ -1015,16 +1771,50 @@ Raw Pointer Types .. rubric:: Legality Rules -:dp:`fls_rpbhr0xukbx9` -A :t:`raw pointer type` is an :t:`indirection type` without validity guarantees. - -:dp:`fls_bYWfGDAQcWfA` -A :t:`mutable raw pointer type` is a :t:`raw pointer type` subject to -:t:`keyword` ``mut``. - -:dp:`fls_8uWfFAsZeRCs` -An :t:`immutable raw pointer type` is a :t:`raw pointer type` subject to -:t:`keyword` ``const``. +.. glossary-entry:: raw pointer + :glossary-dp: fls_uv4dyt4gi32x + + :glossary: + :dp:`fls_rbdilcmt2cns` + A :dt:`raw pointer` is a pointer of a :t:`raw pointer type`. + +.. glossary-entry:: raw pointer type + :glossary-dp: fls_9los8hwh60z0 + + :glossary: + :dp:`fls_wspawcoqxfbh` + A :dt:`raw pointer type` is an :t:`indirection type` without safety and + liveness guarantees. + + :dp:`fls_ctksliaxhzo9` + See :s:`RawPointerTypeSpecification`. + :chapter: + :dp:`fls_rpbhr0xukbx9` + A :t:`raw pointer type` is an :t:`indirection type` without validity guarantees. + +.. glossary-entry:: mutable raw pointer type + :glossary-dp: fls_wOvlW47jKEWF + + :glossary: + :dp:`fls_86SFxSDRcC06` + A :dt:`mutable raw pointer type` is a :t:`raw pointer type` subject to + :t:`keyword` ``mut``. + :chapter: + :dp:`fls_bYWfGDAQcWfA` + A :t:`mutable raw pointer type` is a :t:`raw pointer type` subject to + :t:`keyword` ``mut``. + +.. glossary-entry:: immutable raw pointer type + :glossary-dp: fls_RghQKP3lsXEb + + :glossary: + :dp:`fls_2GzYItDXvMhB` + An :dt:`immutable raw pointer type` is a :t:`raw pointer type` subject to + :t:`keyword` ``const``. + :chapter: + :dp:`fls_8uWfFAsZeRCs` + An :t:`immutable raw pointer type` is a :t:`raw pointer type` subject to + :t:`keyword` ``const``. :dp:`fls_hrum767l6dte` Comparing two :t:`[value]s` of :t:`[raw pointer type]s` compares the addresses @@ -1055,12 +1845,30 @@ Reference Types .. rubric:: Legality Rules -:dp:`fls_twhq24s8kchh` -A :t:`reference type` is an :t:`indirection type` with :t:`ownership`. - -:dp:`fls_w4NbA7WhZfR2` -A :t:`shared reference type` is a :t:`reference type` not subject to -:t:`keyword` ``mut``. +.. glossary-entry:: reference type + :glossary-dp: fls_uw32xmrfgzcd + + :glossary: + :dp:`fls_l3knopsdlyf2` + A :dt:`reference type` is an :t:`indirection type` with :t:`ownership`. + + :dp:`fls_jzjatdpxqt9u` + See :s:`ReferenceTypeSpecification`. + :chapter: + :dp:`fls_twhq24s8kchh` + A :t:`reference type` is an :t:`indirection type` with :t:`ownership`. + +.. glossary-entry:: shared reference type + :glossary-dp: fls_antrblstppyf + + :glossary: + :dp:`fls_8z9wb3eu5yp1` + A :dt:`shared reference type` is a :t:`reference type` not subject to + :t:`keyword` ``mut``. + :chapter: + :dp:`fls_w4NbA7WhZfR2` + A :t:`shared reference type` is a :t:`reference type` not subject to + :t:`keyword` ``mut``. :dp:`fls_ie0avzljmxfm` A :t:`shared reference type` prevents the direct mutation of a referenced @@ -1073,9 +1881,24 @@ A :t:`shared reference type` implements the :std:`core::marker::Copy` :dp:`fls_csdjfwczlzfd` Releasing a :t:`shared reference` has no effect on the :t:`value` it refers to. -:dp:`fls_GUZuiST7ucib` -A :t:`mutable reference type` is a :t:`reference type` subject to :t:`keyword` -``mut``. +.. glossary-entry:: shared reference + :glossary-dp: fls_18xazs7sp4 + + :glossary: + :dp:`fls_cspa4c5mscnw` + A :dt:`shared reference` is a :t:`value` of a :t:`shared reference type`. + +.. glossary-entry:: mutable reference type + :glossary-dp: fls_8iq0wcczl465 + + :glossary: + :dp:`fls_q06p9tclwaaw` + A :dt:`mutable reference type` is a :t:`reference type` subject to :t:`keyword` + ``mut``. + :chapter: + :dp:`fls_GUZuiST7ucib` + A :t:`mutable reference type` is a :t:`reference type` subject to :t:`keyword` + ``mut``. :dp:`fls_vaas9kns4zo6` A :t:`mutable reference type` allows the direct mutation of a referenced @@ -1103,6 +1926,14 @@ not :c:`null`. Trait Types ----------- +.. glossary-entry:: trait type + :glossary-dp: fls_nfdfeFVZRC5F + + :glossary: + :dp:`fls_JQsQnQ0dTHlS` + A :dt:`trait type` is either an :t:`impl trait type` or a + :t:`trait object type`. + .. _fls_3xqobbu7wfsf: Impl Trait Types @@ -1130,17 +1961,44 @@ Impl Trait Types .. rubric:: Legality Rules -:dp:`fls_a6zlvyxpgsew` -An :t:`impl trait type` is a :t:`type` that implements a :t:`trait`, where the -:t:`type` is known at compile time. +.. glossary-entry:: impl trait type + :glossary-dp: fls_l20o3hutbfpf + + :glossary: + :dp:`fls_rdctgmnfncnd` + An :dt:`impl trait type` is a :t:`type` that implements a :t:`trait`, where the + :t:`type` is known at compile time. + + :dp:`fls_704soar15v8v` + See :s:`ImplTraitTypeSpecification`, :s:`ImplTraitTypeSpecificationOneBound`. + :chapter: + :dp:`fls_a6zlvyxpgsew` + An :t:`impl trait type` is a :t:`type` that implements a :t:`trait`, where the + :t:`type` is known at compile time. :dp:`fls_ieyqx5vzas2m` An :t:`impl trait type` shall appear only within a :t:`function parameter` or the :t:`return type` of a :t:`function`. -:dp:`fls_3aKZB0ILIkZw` -An :t:`anonymous return type` is an :t:`impl trait type` ascribed to a -:t:`function` :t:`return type`. +.. glossary-entry:: anonymous type parameter + :glossary-dp: fls_8oepaq6ang93 + + :glossary: + :dp:`fls_brqaq0736o09` + An :dt:`anonymous type parameter` is an :t:`impl trait type` ascribed to a + :t:`function parameter`. + +.. glossary-entry:: anonymous return type + :glossary-dp: fls_dgxkklxcrrl0 + + :glossary: + :dp:`fls_z6t6lbwwztuf` + An :dt:`anonymous return type` is an :t:`impl trait type` ascribed to a + :t:`function` return type. + :chapter: + :dp:`fls_3aKZB0ILIkZw` + An :t:`anonymous return type` is an :t:`impl trait type` ascribed to a + :t:`function` :t:`return type`. :dp:`fls_Xo1ODwOyX7Vm` An :t:`anonymous return type` behaves as if it contains all declared :t:`[type @@ -1156,8 +2014,18 @@ of the :t:`return type`'s :t:`function` and its parent :t:`trait` or :dp:`fls_ECjhEI7eCwAj` An :t:`impl trait type` shall not contain :t:`[opt-out trait bound]s`. -:dp:`fls_69hqMjvNno9u` -An :t:`use capture` is a :t:`generic parameter` referenced within an :t:`anonymous return type`. +.. glossary-entry:: use capture + :glossary-dp: fls_Z8qvOkP4Zfj5 + + :glossary: + :dp:`fls_eZyPXG27Zwcg` + An :dt:`use capture` is a :t:`generic parameter` referenced via keyword $$use$$ within an :t:`anonymous return type`. + + :dp:`fls_Z8qvOkP4Zfj5` + See :s:`UseCaptures`. + :chapter: + :dp:`fls_69hqMjvNno9u` + An :t:`use capture` is a :t:`generic parameter` referenced within an :t:`anonymous return type`. :dp:`fls_KgH6c5cC4S0G` An :t:`anonymous return type` that does not specify a list of :t:`[use capture]s` implicitly :t:`[use capture]s` all :t:`[type parameter]s` and :t:`[constant parameter]s` that are in :t:`scope`. @@ -1191,12 +2059,31 @@ Trait Object Types .. rubric:: Legality Rules -:dp:`fls_sgrvona1nb6h` -A :t:`trait object type` is a :t:`type` that implements a :t:`trait`, where the -:t:`type` is not known at compile time. - -:dp:`fls_eWac7zOda3lh` -The :t:`principal trait` of :t:`trait object type` is the first :t:`trait bound`. +.. glossary-entry:: trait object type + :glossary-dp: fls_7qtbro7ipndr + + :glossary: + :dp:`fls_lo2fzzdwxy1l` + A :dt:`trait object type` is a :t:`type` that implements a :t:`trait`, where + the :t:`type` is not known at compile time. + + :dp:`fls_d632mc5c8qwt` + See :s:`TraitObjectTypeSpecification`, + :s:`TraitObjectTypeSpecificationOneBound`. + :chapter: + :dp:`fls_sgrvona1nb6h` + A :t:`trait object type` is a :t:`type` that implements a :t:`trait`, where the + :t:`type` is not known at compile time. + +.. glossary-entry:: principal trait + :glossary-dp: fls_mk3sa7OvtJvB + + :glossary: + :dp:`fls_YtYOHoPaMPFX` + The :dt:`principal trait` of :t:`trait object type` is its first :t:`trait bound`. + :chapter: + :dp:`fls_eWac7zOda3lh` + The :t:`principal trait` of :t:`trait object type` is the first :t:`trait bound`. :dp:`fls_9z8oleh0wdel` The :t:`principal trait` shall denote an :t:`object safe` :t:`trait`. @@ -1242,9 +2129,20 @@ Inferred Types .. rubric:: Legality Rules -:dp:`fls_xdtgr5toulpb` -An :t:`inferred type` is a placeholder for a :t:`type` deduced by -:t:`type inference`. +.. glossary-entry:: inferred type + :glossary-dp: fls_z5593p7wfab + + :glossary: + :dp:`fls_9xgfexeqr4ed` + An :dt:`inferred type` is a placeholder for a :t:`type` deduced by + :t:`type inference`. + + :dp:`fls_z2p8378sd93z` + See :s:`InferredType`. + :chapter: + :dp:`fls_xdtgr5toulpb` + An :t:`inferred type` is a placeholder for a :t:`type` deduced by + :t:`type inference`. :dp:`fls_3abhsuaa8nas` An :t:`inferred type` shall not appear in the following positions: @@ -1281,9 +2179,25 @@ Type Parameters .. rubric:: Legality Rules -:dp:`fls_dCIIVXGhXDlO` -A :t:`type parameter type` is a placeholder :t:`type` of a :t:`type parameter` -to be substituted by :t:`generic substitution`. +.. glossary-entry:: type parameter type + :glossary-dp: fls_HghjWqvyj5bN + + :glossary: + :dp:`fls_EuHHxwHd0RHV` + A :dt:`type parameter type` is a placeholder :t:`type` of a :t:`type parameter` + to be substituted by :t:`generic substitution`. + :chapter: + :dp:`fls_dCIIVXGhXDlO` + A :t:`type parameter type` is a placeholder :t:`type` of a :t:`type parameter` + to be substituted by :t:`generic substitution`. + +.. glossary-entry:: generic substitution + :glossary-dp: fls_VBEBshUrAOKE + + :glossary: + :dp:`fls_Led1Nxfcd70K` + A :dt:`generic substitution` is the replacement of a :t:`generic parameter` + with a :t:`generic argument`. .. rubric:: Examples @@ -1305,9 +2219,20 @@ Never Type .. rubric:: Legality Rules -:dp:`fls_4u0v5uy95pyf` -The :t:`never type` is a :t:`type` that represents the result of a computation -that never completes. +.. glossary-entry:: never type + :glossary-dp: fls_cwcbtnzbqmq2 + + :glossary: + :dp:`fls_m9v5j6detob4` + The :dt:`never type` is a :t:`type` that represents the result of a computation + that never completes. + + :dp:`fls_k5z1vjxepnfj` + See :s:`NeverType`. + :chapter: + :dp:`fls_4u0v5uy95pyf` + The :t:`never type` is a :t:`type` that represents the result of a computation + that never completes. :dp:`fls_xmtc10qzw0ui` The :t:`never type` has no :t:`[value]s`. @@ -1337,9 +2262,20 @@ Parenthesized Types .. rubric:: Legality Rules -:dp:`fls_1dvo1epstrdv` -A :t:`parenthesized type` is a :t:`type` that disambiguates the interpretation -of :t:`[lexical element]s`. +.. glossary-entry:: parenthesized type + :glossary-dp: fls_gilx8zikdq9k + + :glossary: + :dp:`fls_pamypc7t7l5n` + A :dt:`parenthesized type` is a :t:`type` that disambiguates the interpretation + of :t:`[lexical element]s`. + + :dp:`fls_lovkvqoni3xs` + See :s:`ParenthesizedTypeSpecification`. + :chapter: + :dp:`fls_1dvo1epstrdv` + A :t:`parenthesized type` is a :t:`type` that disambiguates the interpretation + of :t:`[lexical element]s`. .. rubric:: Examples @@ -1365,8 +2301,18 @@ Type Aliases .. rubric:: Legality Rules -:dp:`fls_bibigic4jjad` -A :t:`type alias` is an :t:`item` that defines a :t:`name` for a :t:`type`. +.. glossary-entry:: type alias + :glossary-dp: fls_vaklivoy2ix2 + + :glossary: + :dp:`fls_8pcsxodv1xp5` + A :dt:`type alias` is an :t:`item` that defines a :t:`name` for a :t:`type`. + + :dp:`fls_qfzskp1t3h5w` + See :s:`TypeAliasDeclaration`. + :chapter: + :dp:`fls_bibigic4jjad` + A :t:`type alias` is an :t:`item` that defines a :t:`name` for a :t:`type`. :dp:`fls_rosdkeck5ax2` A :t:`type alias` shall not have a :s:`TypeBoundList` unless it is an @@ -1397,23 +2343,77 @@ Type Layout :dp:`fls_kdbq02iguzgl` All :t:`[value]s` have an :t:`alignment` and a :t:`size`. -:dp:`fls_26Xgem831Nqg` -A :dt:`dynamically sized type` is a :t:`type` that does not implement the :std:`core::marker::Sized` :t:`trait`. - -:dp:`fls_ozYgHEHFTT5c` -A :dt:`fat pointer type` is an :t:`indirection type` whose contained :t:`type specification` is a :t:`dynamically sized type`. - -:dp:`fls_muxfn9soi47l` -The :t:`alignment` of a :t:`value` specifies which addresses are valid for -storing the :t:`value`. :t:`Alignment` is measured in bytes, is at least one, -and always a power of two. A :t:`value` of :t:`alignment` ``N`` is stored at an -address that is a multiple of ``N``. - -:dp:`fls_1pbwigq6f3ha` -The :t:`size` of a :t:`type` is the offset in bytes between successive elements -in :t:`array type` ``[T, N]`` where ``T`` is the :t:`type` of the :t:`value`, -including any padding for :t:`alignment`. :t:`Size` is a multiple of the -:t:`alignment`. +.. glossary-entry:: dynamically sized type + :glossary-dp: fls_6uovyjjzh6km + + :glossary: + :dp:`fls_eeyxu730z2pw` + A :dt:`dynamically sized type` is a :t:`type` that does not implement the + :std:`core::marker::Sized` :t:`trait`. + :chapter: + :dp:`fls_26Xgem831Nqg` + A :dt:`dynamically sized type` is a :t:`type` that does not implement the :std:`core::marker::Sized` :t:`trait`. + +.. glossary-entry:: thin pointer + :glossary-dp: fls_lfsgf6u142yb + + :glossary: + :dp:`fls_i2j0u4v5o1bs` + A :dt:`thin pointer` is a :t:`value` of a :t:`thin pointer type`. + +.. glossary-entry:: thin pointer type + :glossary-dp: fls_7ksqpi9j8ba9 + + :glossary: + :dp:`fls_33rka3kyxgrk` + A :dt:`thin pointer type` is an :t:`indirection type` that refers to a + :t:`fixed sized type`. + +.. glossary-entry:: fat pointer + :glossary-dp: fls_nkf9z4pqg8x1 + + :glossary: + :dp:`fls_knbc2jv5c5ds` + A :dt:`fat pointer` is a :t:`value` of a :t:`fat pointer type`. + +.. glossary-entry:: fat pointer type + :glossary-dp: fls_trvkbidlsss8 + + :glossary: + :dp:`fls_l8ew6udd79hh` + A :dt:`fat pointer type` is an :t:`indirection type` whose contained :t:`type specification` is a :t:`dynamically sized type`. + :chapter: + :dp:`fls_ozYgHEHFTT5c` + A :dt:`fat pointer type` is an :t:`indirection type` whose contained :t:`type specification` is a :t:`dynamically sized type`. + +.. glossary-entry:: alignment + :glossary-dp: fls_j775guurkgo4 + + :glossary: + :dp:`fls_c0hbatn5o8x3` + The :dt:`alignment` of a :t:`value` specifies which addresses are valid for + storing the value. + :chapter: + :dp:`fls_muxfn9soi47l` + The :t:`alignment` of a :t:`value` specifies which addresses are valid for + storing the :t:`value`. :t:`Alignment` is measured in bytes, is at least one, + and always a power of two. A :t:`value` of :t:`alignment` ``N`` is stored at an + address that is a multiple of ``N``. + +.. glossary-entry:: size + :glossary-dp: fls_oy5xy5pm1enx + + :glossary: + :dp:`fls_3obnilqhkjux` + The :dt:`size` of a :t:`value` is the offset in bytes between successive + elements in an :t:`array type` with the same :t:`element type`, including any + padding for :t:`alignment`. + :chapter: + :dp:`fls_1pbwigq6f3ha` + The :t:`size` of a :t:`type` is the offset in bytes between successive elements + in :t:`array type` ``[T, N]`` where ``T`` is the :t:`type` of the :t:`value`, + including any padding for :t:`alignment`. :t:`Size` is a multiple of the + :t:`alignment`. :dp:`fls_bk3nm2n47afu` The :t:`size` of :t:`[scalar type]s` is as follows: @@ -1455,6 +2455,14 @@ The :t:`size` of :t:`[scalar type]s` is as follows: Types :c:`usize` and :c:`isize` have :t:`size` big enough to contain every address on the target platform. +.. glossary-entry:: layout + :glossary-dp: fls_w5gslebevlya + + :glossary: + :dp:`fls_qk602dmhc0d6` + :dt:`Layout` specifies the :t:`alignment`, :t:`size`, and the relative offset + of :t:`[field]s` in a :t:`type`. + :dp:`fls_pzi6izljfv0f` For :t:`type` :c:`str`, the :t:`layout` is that of :t:`slice type` ``[u8]``. @@ -1510,11 +2518,26 @@ Type Representation .. rubric:: Legality Rules -:dp:`fls_mpqlyi3lgrfv` -:t:`Type representation` specifies the :t:`layout` of :t:`[field]s` of -:t:`[abstract data type]s`. :t:`Type representation` changes the bit padding -between :t:`[field]s` of :t:`[abstract data type]s` as well as their order, but -does not change the :t:`layout` of the :t:`[field]s` themselves. +.. glossary-entry:: representation + :glossary-dp: fls_o34kkn5pi0sh + + :glossary: + :dp:`fls_69j7pq2o1iu` + See :t:`type representation`. + +.. glossary-entry:: type representation + :glossary-dp: fls_u1zkh2m8p92 + + :glossary: + :dp:`fls_rv80nyxwj2z8` + :dt:`Type representation` specifies the :t:`layout` of :t:`[field]s` of + :t:`[abstract data type]s`. + :chapter: + :dp:`fls_mpqlyi3lgrfv` + :t:`Type representation` specifies the :t:`layout` of :t:`[field]s` of + :t:`[abstract data type]s`. :t:`Type representation` changes the bit padding + between :t:`[field]s` of :t:`[abstract data type]s` as well as their order, but + does not change the :t:`layout` of the :t:`[field]s` themselves. :dp:`fls_9dhnanv21y9z` :t:`Type representation` is classified into: @@ -1531,24 +2554,67 @@ does not change the :t:`layout` of the :t:`[field]s` themselves. * :dp:`fls_ergdb18tpx25` :t:`Transparent representation`. -:dp:`fls_8s1vddh8vdhy` -:t:`C representation` lays out a :t:`type` such that the :t:`type` is -interoperable with the :t:`C` language. - -:dp:`fls_b005bktrkrxy` -:t:`Default representation` makes no guarantees about the :t:`layout`. - -:dp:`fls_7plbkqlmed0r` -:t:`Primitive representation` is the :t:`type representation` of individual -:t:`[integer type]s`. :t:`Primitive representation` applies only to an -:t:`enum type` that is not a :t:`zero-variant enum type`. It is possible to -combine :t:`C representation` and :t:`primitive representation`. - -:dp:`fls_ml4khttq3w5k` -:t:`Transparent representation` applies only to an :t:`enum type` with a -single :t:`enum variant` or a :t:`struct type` where the :t:`struct type` or -:t:`enum variant` has a single :t:`field` of non-zero :t:`size` and any number -of :t:`[field]s` of :t:`size` zero and :t:`alignment` one. +.. glossary-entry:: C + :glossary-dp: fls_lfjgrkwra22i + + :glossary: + :dp:`fls_d4q2ro4nsnop` + :dt:`C` is the programming language described in the ISO/IEC 9899:2018 + International Standard. + +.. glossary-entry:: C representation + :glossary-dp: fls_wenn1wdsicfz + + :glossary: + :dp:`fls_g9pdb06m5fto` + :dt:`C representation` is a :t:`type representation` that lays out :t:`[type]s` + such that they are interoperable with the :t:`C` language. + :chapter: + :dp:`fls_8s1vddh8vdhy` + :t:`C representation` lays out a :t:`type` such that the :t:`type` is + interoperable with the :t:`C` language. + +.. glossary-entry:: default representation + :glossary-dp: fls_g9v8ubx8m1sq + + :glossary: + :dp:`fls_e85fsp10acnh` + :dt:`Default representation` is a :t:`type representation` that does not make + any guarantees about :t:`layout`. + :chapter: + :dp:`fls_b005bktrkrxy` + :t:`Default representation` makes no guarantees about the :t:`layout`. + +.. glossary-entry:: primitive representation + :glossary-dp: fls_fikexts17v7a + + :glossary: + :dp:`fls_bydly1rt63pf` + :dt:`Primitive representation` is the :t:`type representation` of + :t:`[integer type]s`. + :chapter: + :dp:`fls_7plbkqlmed0r` + :t:`Primitive representation` is the :t:`type representation` of individual + :t:`[integer type]s`. :t:`Primitive representation` applies only to an + :t:`enum type` that is not a :t:`zero-variant enum type`. It is possible to + combine :t:`C representation` and :t:`primitive representation`. + +.. glossary-entry:: transparent representation + :glossary-dp: fls_sl62718i1kkn + + :glossary: + :dp:`fls_hb3e72rhzpnv` + :dt:`Transparent representation` is a :t:`type representation` that applies + only to an :t:`enum type` with a single :t:`enum variant` or a :t:`struct type` + where the :t:`struct type` or :t:`enum variant` has a single :t:`field` of + non-zero :t:`size` and any number of :t:`[field]s` of :t:`size` zero and + :t:`alignment` one. + :chapter: + :dp:`fls_ml4khttq3w5k` + :t:`Transparent representation` applies only to an :t:`enum type` with a + single :t:`enum variant` or a :t:`struct type` where the :t:`struct type` or + :t:`enum variant` has a single :t:`field` of non-zero :t:`size` and any number + of :t:`[field]s` of :t:`size` zero and :t:`alignment` one. :dp:`fls_9q2iqzbup8oy` :t:`[Type]s` subject to :t:`transparent representation` have the same @@ -1567,6 +2633,17 @@ modified further using :t:`attribute` :c:`[repr]`'s :s:`Alignment` to a :t:`struct type` or a :t:`union type` subject to :t:`C representation` or :t:`default representation`. +.. glossary-entry:: representation modifier + :glossary-dp: fls_TSbBt6WzropN + + :glossary: + :dp:`fls_BCvXL7HkXqdZ` + A :dt:`representation modifier` is a :t:`construct` that modifies the + :t:`alignment` of a :t:`type`. + + :dp:`fls_TAVyjj66UBUo` + See :s:`Alignment`. + .. _fls_xc1hof4qbf6p: Enum Type Representation @@ -1582,10 +2659,24 @@ The :t:`size` and :t:`alignment` of an :t:`enum type` without :t:`[field]s` subject to :t:`C representation`, :t:`default representation`, or :t:`primitive representation` are those of its :t:`discriminant`. -:dp:`fls_s9c0a0lg6c0p` -The :t:`discriminant type` of an :t:`enum type` with :t:`C representation` is -the corresponding :t:`c signed int type` for the target platform's :t:`C` -:t:`ABI`. +.. glossary-entry:: discriminant type + :glossary-dp: fls_a0ezuPLtENme + + :glossary: + :dp:`fls_kqdvWGi9cglm` + A :dt:`discriminant type` is the :t:`type` of a :t:`discriminant`. + :chapter: + :dp:`fls_s9c0a0lg6c0p` + The :t:`discriminant type` of an :t:`enum type` with :t:`C representation` is + the corresponding :t:`c signed int type` for the target platform's :t:`C` + :t:`ABI`. + +.. glossary-entry:: C signed int type + :glossary-dp: fls_fls_J0xUy4Mcxoe6 + + :glossary: + :dp:`fls_8QIcvapJehqY` + :dt:`C signed int type` is the `signed int` :t:`type` of the :t:`C` language. :dp:`fls_slhvf3gmqz4h` The :t:`discriminant type` of an :t:`enum type` with :t:`default representation` @@ -1719,10 +2810,18 @@ Recursive Types .. rubric:: Legality Rules -:dp:`fls_z22std1crl49` -A :t:`recursive type` is a :t:`type` whose contained :t:`[type]s` refer back to -the containing :t:`type`, either directly or by referring to another :t:`type` -which refers back to the original :t:`recursive type`. +.. glossary-entry:: recursive type + :glossary-dp: fls_94fkxohlnq9i + + :glossary: + :dp:`fls_2t8qom6dhcjb` + A :dt:`recursive type` is a :t:`type` that may define other types within its + :t:`type specification`. + :chapter: + :dp:`fls_z22std1crl49` + A :t:`recursive type` is a :t:`type` whose contained :t:`[type]s` refer back to + the containing :t:`type`, either directly or by referring to another :t:`type` + which refers back to the original :t:`recursive type`. :dp:`fls_eddnwlr0rz59` A :t:`type` that is not an :t:`abstract data type` shall not be recursive. @@ -1743,19 +2842,58 @@ Type Unification .. rubric:: Legality Rules -:dp:`fls_ryvdhkgm7vzj` -:t:`Type unification` is the process by which :t:`type inference` propagates -known :t:`[type]s` across the :t:`type inference root` and assigns concrete -:t:`[type]s` to :t:`[type variable]s`, as well as a general mechanism to check -for compatibility between two :t:`[type]s` during :t:`method resolution`. - -:dp:`fls_67VZrx6dw68H` -A :t:`type` is said to :t:`unify` with another :t:`type` when the domains, -ranges, and structures of both :t:`[type]s` are compatible according to the -rules detailed below. - -:dp:`fls_aie0tr62vhw5` -Two types that :t:`unify` are said to be :t:`[unifiable type]s`. +.. glossary-entry:: type unification + :glossary-dp: fls_qoehu9p00q56 + + :glossary: + :dp:`fls_3vyodut341b5` + :dt:`Type unification` is the process by which :t:`type inference` propagates + known :t:`[type]s` across the :t:`type inference root` and assigns concrete + :t:`[type]s` to :t:`[type variable]s`, as well as a general mechanism to check + for compatibility between two :t:`[type]s` during :t:`method resolution`. + :chapter: + :dp:`fls_ryvdhkgm7vzj` + :t:`Type unification` is the process by which :t:`type inference` propagates + known :t:`[type]s` across the :t:`type inference root` and assigns concrete + :t:`[type]s` to :t:`[type variable]s`, as well as a general mechanism to check + for compatibility between two :t:`[type]s` during :t:`method resolution`. + +.. glossary-entry:: unify + :glossary-dp: fls_da6ssnmmsevo + + :glossary: + :dp:`fls_mango4gffb9e` + A :t:`type` is said to :dt:`unify` with another type when the domains, ranges, + and structures of both :t:`[type]s` are compatible. + :chapter: + :dp:`fls_67VZrx6dw68H` + A :t:`type` is said to :t:`unify` with another :t:`type` when the domains, + ranges, and structures of both :t:`[type]s` are compatible according to the + rules detailed below. + +.. glossary-entry:: unifiable + :glossary-dp: fls_y7m6AentM6Ik + + :glossary: + :dp:`fls_01BNTCL4u8Gn` + For :dt:`unifiable`, see :t:`unify`. + +.. glossary-entry:: unified type + :glossary-dp: fls_9RfuDiI6qrzZ + + :glossary: + :dp:`fls_tqRwIe6z3a4j` + A :dt:`unified type` is a :t:`type` produced by :t:`type unification`. + +.. glossary-entry:: unifiable types + :glossary-dp: fls_u03p4rvz1jhs + + :glossary: + :dp:`fls_jsbggfitv9xk` + Two :t:`[type]s` that :t:`unify` are said to be :dt:`[unifiable type]s`. + :chapter: + :dp:`fls_aie0tr62vhw5` + Two types that :t:`unify` are said to be :t:`[unifiable type]s`. :dp:`fls_3U7Ue6Xzuv9M` :t:`Type unification` is a symmetric operation. If :t:`type` ``A`` unifies @@ -1889,6 +3027,20 @@ A :t:`function pointer type` is unifiable only with another * :dp:`fls_5dh8c5gg0hmk` The :t:`[return type]s` are unifiable. +.. glossary-entry:: mutability + :glossary-dp: fls_yM11Bcxn4p7c + + :glossary: + :dp:`fls_lBrXj9lo4s6o` + :dt:`Mutability` determines whether a :t:`construct` can modify a :t:`value`. + +.. glossary-entry:: mutable + :glossary-dp: fls_wvejcadmzt5p + + :glossary: + :dp:`fls_dqm58deu1orn` + A :t:`value` is :dt:`mutable` when it can be modified. + :dp:`fls_ismr7wwvek4q` A :t:`raw pointer type` is unifiable only with another :t:`raw pointer type` when: @@ -1942,14 +3094,22 @@ Type Coercion .. rubric:: Legality Rules -:dp:`fls_w5pjcj9qmgbv` -:t:`Type coercion` is an implicit operation that changes the :t:`type` of a -:t:`value`. Any implicit conversion allowed by :t:`type coercion` can be made -explicit using a :t:`type cast expression`. - -:dp:`fls_5v0n2a32bk95` -A :t:`type coercion` takes place at a :t:`coercion site` or within a -:t:`coercion-propagating expression`. +.. glossary-entry:: type coercion + :glossary-dp: fls_6j08yuafv0vl + + :glossary: + :dp:`fls_mt36qehtqova` + :dt:`Type coercion` is an implicit operation that changes the :t:`type` of + a :t:`value`. + :chapter: + :dp:`fls_w5pjcj9qmgbv` + :t:`Type coercion` is an implicit operation that changes the :t:`type` of a + :t:`value`. Any implicit conversion allowed by :t:`type coercion` can be made + explicit using a :t:`type cast expression`. + + :dp:`fls_5v0n2a32bk95` + A :t:`type coercion` takes place at a :t:`coercion site` or within a + :t:`coercion-propagating expression`. :dp:`fls_j3kbaf43sgpj` The following :t:`[construct]s` constitute a :dt:`coercion site`: @@ -2050,51 +3210,73 @@ occur when: and the target :t:`type` is a :t:`trait object type` with some :t:`principal trait` ``U``, where ``U`` is a :t:`supertrait` of ``T``. -:dp:`fls_iiiu2q7pym4p` -An :t:`unsized coercion` is a :t:`type coercion` that converts a :t:`sized type` -into an :t:`unsized type`. :t:`Unsized coercion` from a source :t:`type` to a -target :t:`type` is allowed to occur when: - -* :dp:`fls_jte6n2js32af` - The source :t:`type` is :t:`array type` ``[T; N]`` and the target :t:`type` is - :t:`slice type` ``[T]``. - -* :dp:`fls_20pvqqayzqra` - The source :t:`type` is ``T`` and the target :t:`type` is ``dyn U``, where - ``T`` implements ``U + core::marker::Sized``, and ``U`` is :t:`object safe`. - -* :dp:`fls_j8rcy0xvd155` - The source type is - -.. code-block:: rust - - S<..., T, ...> { - ... - last_field: X - } - -:dp:`fls_wuka4uyo3oj7` -where - -* :dp:`fls_w15yo8yvuxq3` - ``S`` is a :t:`struct type`, - -* :dp:`fls_7aw3ifbvfgbd` - ``T`` implements ``core::marker::Unsize``, - -* :dp:`fls_cnkth59djwgl` - ``last_field`` is a :t:`struct field` of ``S``, - -* :dp:`fls_4wbk7pqj010i` - The :t:`type` of ``last_field`` involves ``T`` and if the :t:`type` of - ``last_field`` is ``W``, then ``W`` implements - ``core::marker::Unsize>``, - -* :dp:`fls_47u0039t0l8f` - ``T`` is not part of any other :t:`struct field` of ``S``. - -:dp:`fls_bmh6g3jju7eq` -and the target ``type`` is ``S<..., U, ...>``. +.. glossary-entry:: sized type + :glossary-dp: fls_oiaoWEQQDE7I + + :glossary: + :dp:`fls_pwcgsRCNSwKn` + A :dt:`sized type` is a :t:`type` with statically known size. + +.. glossary-entry:: unsized type + :glossary-dp: fls_KiVgO7I3UUhh + + :glossary: + :dp:`fls_M9NpzBH8Wf4z` + An :dt:`unsized type` is a :t:`type` with statically unknown size. + +.. glossary-entry:: unsized coercion + :glossary-dp: fls_pjup0piqlxe3 + + :glossary: + :dp:`fls_olt5qhyvhmtq` + An :dt:`unsized coercion` is a :t:`type coercion` that converts a + :t:`sized type` into an :t:`unsized type`. + :chapter: + :dp:`fls_iiiu2q7pym4p` + An :t:`unsized coercion` is a :t:`type coercion` that converts a :t:`sized type` + into an :t:`unsized type`. :t:`Unsized coercion` from a source :t:`type` to a + target :t:`type` is allowed to occur when: + + * :dp:`fls_jte6n2js32af` + The source :t:`type` is :t:`array type` ``[T; N]`` and the target :t:`type` is + :t:`slice type` ``[T]``. + + * :dp:`fls_20pvqqayzqra` + The source :t:`type` is ``T`` and the target :t:`type` is ``dyn U``, where + ``T`` implements ``U + core::marker::Sized``, and ``U`` is :t:`object safe`. + + * :dp:`fls_j8rcy0xvd155` + The source type is + + .. code-block:: rust + + S<..., T, ...> { + ... + last_field: X + } + + :dp:`fls_wuka4uyo3oj7` + where + + * :dp:`fls_w15yo8yvuxq3` + ``S`` is a :t:`struct type`, + + * :dp:`fls_7aw3ifbvfgbd` + ``T`` implements ``core::marker::Unsize``, + + * :dp:`fls_cnkth59djwgl` + ``last_field`` is a :t:`struct field` of ``S``, + + * :dp:`fls_4wbk7pqj010i` + The :t:`type` of ``last_field`` involves ``T`` and if the :t:`type` of + ``last_field`` is ``W``, then ``W`` implements + ``core::marker::Unsize>``, + + * :dp:`fls_47u0039t0l8f` + ``T`` is not part of any other :t:`struct field` of ``S``. + + :dp:`fls_bmh6g3jju7eq` + and the target ``type`` is ``S<..., U, ...>``. :dp:`fls_da4w32rsrwxc` :dt:`Least upper bound coercion` is a :t:`multi-[type coercion]` that is used in @@ -2162,9 +3344,17 @@ Structural Equality .. rubric:: Legality Rules -:dp:`fls_uVTpA7gbLCYX` -A :t:`type` is :t:`structurally equal` when its :t:`[value]s` can be compared -for equality by structure. +.. glossary-entry:: structurally equal + :glossary-dp: fls_P7920ALJisrH + + :glossary: + :dp:`fls_glRZUKhmaWmP` + A :t:`type` is :dt:`structurally equal` when its :t:`[value]s` can be compared + for equality by structure. + :chapter: + :dp:`fls_uVTpA7gbLCYX` + A :t:`type` is :t:`structurally equal` when its :t:`[value]s` can be compared + for equality by structure. :dp:`fls_2DZAP6JJjJ9h` The following :t:`[type]s` are :t:`structurally equal`: @@ -2196,9 +3386,17 @@ Interior Mutability .. rubric:: Legality Rules -:dp:`fls_khy2e23i9o7z` -:t:`Interior mutability` is a property of :t:`[type]s` whose :t:`[value]s` can -be modified through :t:`[immutable reference]s`. +.. glossary-entry:: interior mutability + :glossary-dp: fls_mb3xnplwdw9l + + :glossary: + :dp:`fls_e0173dd09znl` + :dt:`Interior mutability` is a property of :t:`[type]s` whose :t:`[value]s` can + be modified through :t:`[immutable reference]s`. + :chapter: + :dp:`fls_khy2e23i9o7z` + :t:`Interior mutability` is a property of :t:`[type]s` whose :t:`[value]s` can + be modified through :t:`[immutable reference]s`. :dp:`fls_sWiU26n2xS3r` A :t:`type` is subject to :t:`interior mutability` when it contains a @@ -2211,14 +3409,35 @@ Visible Emptiness .. rubric:: Legality Rules -:dp:`fls_SD4yUEQ9hHa3` -:t:`Visible emptiness ` is a property of :t:`[type]s` and :t:`[enum variant]s` that have no :t:`[value]s` that are fully observable. - -:dp:`fls_GeoneCP5TYwf` -A :t:`visible empty type` is a :t:`type` subject to :t:`visible emptiness`. - -:dp:`fls_A2W4v53ihTGx` -A :t:`visible empty enum variant` is an :t:`enum variant` subject to :t:`visible emptiness`. +.. glossary-entry:: visible emptiness + :glossary-dp: fls_dLlUt8PrXAls + + :glossary: + :dp:`fls_shXDYqnUy2Pb` + :dt:`Visible emptiness ` is a property of :t:`[type]s` and :t:`[enum variant]s` that have no :t:`[value]s` that are fully observable. + :chapter: + :dp:`fls_SD4yUEQ9hHa3` + :t:`Visible emptiness ` is a property of :t:`[type]s` and :t:`[enum variant]s` that have no :t:`[value]s` that are fully observable. + +.. glossary-entry:: visible empty type + :glossary-dp: fls_HYWQ0lJS3TET + + :glossary: + :dp:`fls_OLVD0u9w68Gl` + A :dt:`visible empty type` is a :t:`type` subject to :t:`visible emptiness`. + :chapter: + :dp:`fls_GeoneCP5TYwf` + A :t:`visible empty type` is a :t:`type` subject to :t:`visible emptiness`. + +.. glossary-entry:: visible empty enum variant + :glossary-dp: fls_EnT5zRuwviWM + + :glossary: + :dp:`fls_MQiPWNwdk95I` + A :dt:`visible empty enum variant` is an :t:`enum variant` subject to :t:`visible emptiness`. + :chapter: + :dp:`fls_A2W4v53ihTGx` + A :t:`visible empty enum variant` is an :t:`enum variant` subject to :t:`visible emptiness`. :dp:`fls_AXOtKdSQR4AF` A :t:`type` is subject to :t:`visible emptiness` as follows: @@ -2251,14 +3470,31 @@ Type Inference .. rubric:: Legality Rules -:dp:`fls_h8sedxew0d4u` -:t:`Type inference` is the process of automatically determining the :t:`type` of -:t:`[expression]s` and :t:`[pattern]s` within a :t:`type inference root`. - -:dp:`fls_ybvrhh96fc7y` -A :t:`type inference root` is an :t:`expression` whose inner :t:`[expression]s` -and :t:`[pattern]s` are subject to :t:`type inference` independently of those -found in other :t:`[type inference root]s`. +.. glossary-entry:: type inference + :glossary-dp: fls_7fpvb2gvqng8 + + :glossary: + :dp:`fls_ky8epvf9834e` + :dt:`Type inference` is the process of deducing the expected :t:`type` of an + arbitrary :t:`value`. + :chapter: + :dp:`fls_h8sedxew0d4u` + :t:`Type inference` is the process of automatically determining the :t:`type` of + :t:`[expression]s` and :t:`[pattern]s` within a :t:`type inference root`. + +.. glossary-entry:: type inference root + :glossary-dp: fls_0jri0m3F1fAT + + :glossary: + :dp:`fls_hLI7lCixs48z` + A :dt:`type inference root` is a :t:`construct` whose inner :t:`[expression]s` + and :t:`[pattern]s` are subject to :t:`type inference` independently of other + :t:`[type inference root]s`. + :chapter: + :dp:`fls_ybvrhh96fc7y` + A :t:`type inference root` is an :t:`expression` whose inner :t:`[expression]s` + and :t:`[pattern]s` are subject to :t:`type inference` independently of those + found in other :t:`[type inference root]s`. :dp:`fls_EWBilpepaDcX` The following :t:`[expression]s` are considered :t:`[type inference root]s`: @@ -2325,29 +3561,77 @@ depending on the :t:`type inference root` as follows: The :t:`expected type` of a :t:`size operand` of an :t:`array expression` or an :t:`array type` is :c:`usize`. -:dp:`fls_uvvn4usfsbhr` -A :t:`type variable` is a placeholder used during :t:`type inference` to stand -in for an undetermined :t:`type` of an :t:`expression` or a :t:`pattern`. - -:dp:`fls_gDalJm1XS0mi` -A :t:`global type variable` is a :t:`type variable` that can refer to any -:t:`type`. - -:dp:`fls_7ov36fpd9mwe` -An :t:`integer type variable` is a :t:`type variable` that can refer only to -:t:`[integer type]s`. - -:dp:`fls_3hv3wxkhjjp1` -A :t:`floating-point type variable` is a :t:`type variable` that can refer only -to :t:`[floating-point type]s`. - -:dp:`fls_bXQ63GYYDuMp` -A :t:`diverging type variable` is a :t:`type variable` that can refer to any -:t:`type` and originates from a :t:`diverging expression`. - -:dp:`fls_JryXiKBIFvF3` -A :dt:`lifetime variable` is a placeholder used during :t:`type inference` to -stand in for an undetermined :t:`lifetime` of a :t:`type`. +.. glossary-entry:: type variable + :glossary-dp: fls_6zhffgxtytku + + :glossary: + :dp:`fls_j9eusnwze4rz` + A :dt:`type variable` is a placeholder used during :t:`type inference` to stand + in for an undetermined :t:`type` of an :t:`expression` or a :t:`pattern`. + :chapter: + :dp:`fls_uvvn4usfsbhr` + A :t:`type variable` is a placeholder used during :t:`type inference` to stand + in for an undetermined :t:`type` of an :t:`expression` or a :t:`pattern`. + +.. glossary-entry:: global type variable + :glossary-dp: fls_hy1clqvaewnp + + :glossary: + :dp:`fls_pvt4nayq006s` + A :dt:`global type variable` is a :t:`type variable` that can refer to any + :t:`type`. + :chapter: + :dp:`fls_gDalJm1XS0mi` + A :t:`global type variable` is a :t:`type variable` that can refer to any + :t:`type`. + +.. glossary-entry:: integer type variable + :glossary-dp: fls_ctuvilpb30gq + + :glossary: + :dp:`fls_e3ed1tyrjsy4` + An :dt:`integer type variable` is a :t:`type variable` that can refer only to + :t:`[integer type]s`. + :chapter: + :dp:`fls_7ov36fpd9mwe` + An :t:`integer type variable` is a :t:`type variable` that can refer only to + :t:`[integer type]s`. + +.. glossary-entry:: floating-point type variable + :glossary-dp: fls_8ih3gh6hoy78 + + :glossary: + :dp:`fls_ls41emhkrxdi` + A :dt:`floating-point type variable` is a :t:`type variable` that can refer + only to :t:`[floating-point type]s`. + :chapter: + :dp:`fls_3hv3wxkhjjp1` + A :t:`floating-point type variable` is a :t:`type variable` that can refer only + to :t:`[floating-point type]s`. + +.. glossary-entry:: diverging type variable + :glossary-dp: fls_9DuaIn6cRbXf + + :glossary: + :dp:`fls_sxyL7yOp3H9s` + A :dt:`diverging type variable` is a :t:`type variable` that can refer to any + :t:`type` and originates from a :t:`diverging expression`. + :chapter: + :dp:`fls_bXQ63GYYDuMp` + A :t:`diverging type variable` is a :t:`type variable` that can refer to any + :t:`type` and originates from a :t:`diverging expression`. + +.. glossary-entry:: lifetime variable + :glossary-dp: fls_joDjnHu1L9Lp + + :glossary: + :dp:`fls_ucZnCBWxXl6n` + A :dt:`lifetime variable` is a placeholder used during :t:`type inference` to + stand in for an undetermined :t:`lifetime` of a :t:`type`. + :chapter: + :dp:`fls_JryXiKBIFvF3` + A :dt:`lifetime variable` is a placeholder used during :t:`type inference` to + stand in for an undetermined :t:`lifetime` of a :t:`type`. :dp:`fls_rvj3XspFZ1u3` The :t:`type inference` algorithm uses :t:`type unification` to propagate known @@ -2723,28 +4007,87 @@ Traits .. rubric:: Legality Rules -:dp:`fls_tani6lesan9u` -A :t:`trait` is an :t:`item` that describes an interface a :t:`type` can -implement. - -:dp:`fls_PiAR1B26SoZV` -A :t:`trait body` is a :t:`construct` that encapsulates the -:t:`[associated item]s`, :t:`[inner attribute]s`, and -:t:`[inner doc comment]s` of a :t:`trait`. +.. glossary-entry:: trait + :glossary-dp: fls_cad25qns4164 + + :glossary: + :dp:`fls_mf4x9g70o5z6` + A :dt:`trait` is an :t:`item` that describes an interface a :t:`type` can + implement. + + :dp:`fls_ypjhwvuyrns` + See :s:`TraitDeclaration`. + :chapter: + :dp:`fls_tani6lesan9u` + A :t:`trait` is an :t:`item` that describes an interface a :t:`type` can + implement. + +.. glossary-entry:: unsafe trait + :glossary-dp: fls_38ae1t48h9cb + + :glossary: + :dp:`fls_w6zlsf2ye457` + An :dt:`unsafe trait` is a :t:`trait` subject to :t:`keyword` ``unsafe`` + +.. glossary-entry:: built-in trait + :glossary-dp: fls_QzAif2NyVJbk + + :glossary: + :dp:`fls_IgzD9l8o6R50` + A :dt:`built-in trait` is a language-defined :t:`trait`. + +.. glossary-entry:: trait body + :glossary-dp: fls_5hNydsQDrICq + + :glossary: + :dp:`fls_u221Me58aZmY` + A :dt:`trait body` is a :t:`construct` that encapsulates the + :t:`[associated item]s`, :t:`[inner attribute]s`, and + :t:`[inner doc comment]s` of a :t:`trait`. + + :dp:`fls_dITFx04TB4h0` + See :s:`TraitBody`. + :chapter: + :dp:`fls_PiAR1B26SoZV` + A :t:`trait body` is a :t:`construct` that encapsulates the + :t:`[associated item]s`, :t:`[inner attribute]s`, and + :t:`[inner doc comment]s` of a :t:`trait`. :dp:`fls_Y28596CVBzDG` Within a :t:`trait`, the :t:`type` :c:`Self` acts as a placeholder for a :t:`type` implementing the :t:`trait`, and behaves like a :t:`type parameter`. -:dp:`fls_AdbbUZZgMEsQ` -A :t:`local trait` is a :t:`trait` that is defined in the current :t:`crate`. - -:dp:`fls_I9JaKZelMiby` -A :t:`subtrait` is a :t:`trait` with a :t:`supertrait`. - -:dp:`fls_CYtxPjK3zq2T` -A :t:`supertrait` is a transitive :t:`trait` that a :t:`type` must additionally -implement. +.. glossary-entry:: local trait + :glossary-dp: fls_bYpBl5zfTibF + + :glossary: + :dp:`fls_H5vkbMFvzrFs` + A :dt:`local trait` is a :t:`trait` that is defined in the current :t:`crate`. + :chapter: + :dp:`fls_AdbbUZZgMEsQ` + A :t:`local trait` is a :t:`trait` that is defined in the current :t:`crate`. + +.. glossary-entry:: subtrait + :glossary-dp: fls_qw3fn1116se9 + + :glossary: + :dp:`fls_wnj95vozis6n` + A :dt:`subtrait` is a :t:`trait` with a :t:`supertrait`. + :chapter: + :dp:`fls_I9JaKZelMiby` + A :t:`subtrait` is a :t:`trait` with a :t:`supertrait`. + +.. glossary-entry:: supertrait + :glossary-dp: fls_1axcyv628aov + + :glossary: + :dp:`fls_s4chur1wutwh` + A :dt:`supertrait` is a transitive :t:`trait` that a :t:`type` must + additionally implement. + :chapter: + :dp:`fls_CYtxPjK3zq2T` + A :t:`supertrait` is a transitive :t:`trait` that a :t:`type` must additionally + implement. :dp:`fls_ytn5cdonytyn` A :t:`subtrait` shall not be its own :t:`supertrait`. @@ -2763,10 +4106,19 @@ is equivalent to a :t:`where clause` of the following form: trait T where Self: Bound {} -:dp:`fls_YynbrIceKmsJ` -An :t:`auto trait` is a :t:`trait` that is implicitly and automatically -implemented by a :t:`type` when the types of its constituent :t:`[field]s` -implement the :t:`trait`. +.. glossary-entry:: auto trait + :glossary-dp: fls_24iVIlHhvnVO + + :glossary: + :dp:`fls_d84nTOR4pZq5` + An :dt:`auto trait` is a :t:`trait` that is implicitly and automatically + implemented by a :t:`type` when the types of its constituent :t:`[field]s` + implement the :t:`trait`. + :chapter: + :dp:`fls_YynbrIceKmsJ` + An :t:`auto trait` is a :t:`trait` that is implicitly and automatically + implemented by a :t:`type` when the types of its constituent :t:`[field]s` + implement the :t:`trait`. :dp:`fls_Bd4HwdrRuXMm` A :t:`type` that has no :t:`[field]s` implements all :t:`[auto trait]s`. @@ -2829,10 +4181,26 @@ Circle is a subtrait of Shape. Object Safety ~~~~~~~~~~~~~ +.. glossary-entry:: object safety + :glossary-dp: fls_vomlqv7i1fc4 + + :glossary: + :dp:`fls_vqmng1l9ab8a` + :dt:`Object safety` is the process of determining whether a :t:`trait` can be + used as a :t:`trait object type`. + .. rubric:: Legality Rules -:dp:`fls_lrdki56hpc3k` -A :t:`trait` is :t:`object safe` when: +.. glossary-entry:: object safe + :glossary-dp: fls_a226qzrb4iq9 + + :glossary: + :dp:`fls_oa2jiklr5nl2` + A :t:`trait` is :dt:`object safe` when it can be used as a + :t:`trait object type`. + :chapter: + :dp:`fls_lrdki56hpc3k` + A :t:`trait` is :t:`object safe` when: * :dp:`fls_5wlltclogfkw` Its :t:`[supertrait]s` are :t:`object safe`, and @@ -2914,51 +4282,118 @@ Trait and Lifetime Bounds .. rubric:: Legality Rules -:dp:`fls_5g508z6c7q5f` -A :t:`bound` imposes a constraint on a :t:`generic parameter` by limiting the -set of possible :t:`[generic substitution]s`. +.. glossary-entry:: bound + :glossary-dp: fls_ehfvcdpo3l4a + + :glossary: + :dp:`fls_q6mxhn1fxjs6` + A :dt:`bound` imposes a constraint on a :t:`generic parameter` by limiting the + set of possible :t:`[generic substitution]s`. + + :dp:`fls_rxabhhigp5uy` + See :s:`TypeBound`. + :chapter: + :dp:`fls_5g508z6c7q5f` + A :t:`bound` imposes a constraint on a :t:`generic parameter` by limiting the + set of possible :t:`[generic substitution]s`. :dp:`fls_BqLPVaSyyXRG` A :t:`bound` does not impose a constraint on a :t:`generic parameter` of a :t:`type alias` unless it is an :t:`associated item`. -:dp:`fls_grby8tmmd8sb` -A :t:`lifetime bound` is a :t:`bound` that imposes a constraint on the -:t:`[lifetime]s` of :t:`[generic parameter]s`. - -:dp:`fls_knut10hoz6wc` -A :t:`trait bound` is a :t:`bound` that imposes a constraint on the -:t:`[trait]s` of :t:`[generic parameter]s`. +.. glossary-entry:: lifetime bound + :glossary-dp: fls_ca9pu348r9jm + + :glossary: + :dp:`fls_u6xfs8fg558` + A :dt:`lifetime bound` is a :t:`bound` that imposes a constraint on the + :t:`[lifetime]s` of :t:`[generic parameter]s`. + + :dp:`fls_ivcjmp54hdej` + See :s:`LifetimeIndication`. + :chapter: + :dp:`fls_grby8tmmd8sb` + A :t:`lifetime bound` is a :t:`bound` that imposes a constraint on the + :t:`[lifetime]s` of :t:`[generic parameter]s`. + +.. glossary-entry:: trait bound + :glossary-dp: fls_868cgnb1soeh + + :glossary: + :dp:`fls_95zx8unuxxpq` + A :dt:`trait bound` is a :t:`bound` that imposes a constraint on the + :t:`[trait]s` of :t:`[generic parameter]s`. + + :dp:`fls_bkbym8v4t6oh` + See :s:`TraitBound`. + :chapter: + :dp:`fls_knut10hoz6wc` + A :t:`trait bound` is a :t:`bound` that imposes a constraint on the + :t:`[trait]s` of :t:`[generic parameter]s`. :dp:`fls_sf6zg0ez9hbb` A :s:`ForGenericParameterList` shall not specify :s:`[ConstantParameter]s` or :s:`[TypeParameter]s`. -:dp:`fls_vujl3fblz6x2` -A :t:`higher-ranked trait bound` is a :t:`bound` that specifies an infinite -list of :t:`[bound]s` for all possible :t:`[lifetime]s` specified by the -:s:`ForGenericParameterList`. - -:dp:`fls_AzuZmR9DXSQh` -An :t:`opt-out trait bound` is a :t:`trait bound` with :s:`Punctuation` ``?`` -that nullifies an implicitly added :t:`trait bound`. - -:dp:`fls_1Sm2Yq1Ow76f` -An :t:`outlives bound` is a :t:`trait bound` which requires that a -:t:`lifetime parameter` or :t:`type` outlives a :t:`lifetime parameter`. - -:dp:`fls_tx4uspewnk7w` -:t:`Outlives bound` ``'a: 'b`` indicates that ``'a`` outlives ``'b``. - -:dp:`fls_5kj8bmvb8xfc` -:t:`Outlives bound` ``T: 'a`` indicates that all :t:`[lifetime parameter]s` of -``T`` outlive ``'a``. - -:dp:`fls_J9DEsd06Ttu9` -An :t:`implied bound` is a :t:`bound` that is not expressed in syntax, but is -is the byproduct of relations between :t:`[lifetime parameter]s` and -:t:`[function parameter]s`, between :t:`[lifetime parameter]s` and a -:t:`return type`, and between :t:`[lifetime parameter]s` and :t:`[field]s`. +.. glossary-entry:: higher-ranked trait bound + :glossary-dp: fls_h87i5nbeuxky + + :glossary: + :dp:`fls_lpyc4omcthv` + A :dt:`higher-ranked trait bound` is a :t:`bound` that specifies an infinite + list of :t:`[bound]s` for all possible :t:`[lifetime]s`. + + :dp:`fls_m3nrsdvxxg6j` + See :s:`ForGenericParameterList`. + :chapter: + :dp:`fls_vujl3fblz6x2` + A :t:`higher-ranked trait bound` is a :t:`bound` that specifies an infinite + list of :t:`[bound]s` for all possible :t:`[lifetime]s` specified by the + :s:`ForGenericParameterList`. + +.. glossary-entry:: opt-out trait bound + :glossary-dp: fls_C5DiCsvsaBsj + + :glossary: + :dp:`fls_wS4EzN0N1GDP` + An :dt:`opt-out trait bound` is a :t:`trait bound` with :s:`Punctuation` ``?`` + that nullifies an implicitly added :t:`trait bound`. + :chapter: + :dp:`fls_AzuZmR9DXSQh` + An :t:`opt-out trait bound` is a :t:`trait bound` with :s:`Punctuation` ``?`` + that nullifies an implicitly added :t:`trait bound`. + +.. glossary-entry:: outlives bound + :glossary-dp: fls_5LhIr1kOIEO5 + + :glossary: + :dp:`fls_J5dt34II7Pm6` + An :dt:`outlives bound` is a :t:`trait bound` which requires that a + :t:`generic parameter` outlives a :t:`lifetime parameter`. + :chapter: + :dp:`fls_1Sm2Yq1Ow76f` + An :t:`outlives bound` is a :t:`trait bound` which requires that a + :t:`lifetime parameter` or :t:`type` outlives a :t:`lifetime parameter`. + + :dp:`fls_tx4uspewnk7w` + :t:`Outlives bound` ``'a: 'b`` indicates that ``'a`` outlives ``'b``. + + :dp:`fls_5kj8bmvb8xfc` + :t:`Outlives bound` ``T: 'a`` indicates that all :t:`[lifetime parameter]s` of + ``T`` outlive ``'a``. + +.. glossary-entry:: implied bound + :glossary-dp: fls_43CCrG952l5i + + :glossary: + :dp:`fls_t77d8xwG1l9Q` + An :dt:`implied bound` is a :t:`bound` that is not expressed in syntax, but is the byproduct of relations between :t:`[lifetime parameter]s` and :t:`[function parameter]s`, between :t:`[lifetime parameter]s` and a :t:`return type`, and between :t:`[lifetime parameter]s` and :t:`[field]s`. + :chapter: + :dp:`fls_J9DEsd06Ttu9` + An :t:`implied bound` is a :t:`bound` that is not expressed in syntax, but is + is the byproduct of relations between :t:`[lifetime parameter]s` and + :t:`[function parameter]s`, between :t:`[lifetime parameter]s` and a + :t:`return type`, and between :t:`[lifetime parameter]s` and :t:`[field]s`. :dp:`fls_IfHRxSasGAih` A :t:`reference` of the form ``&'a T``, where ``'a`` is a @@ -3004,8 +4439,18 @@ Lifetimes .. rubric:: Legality Rules -:dp:`fls_nne91at3143t` -A :t:`lifetime` specifies the expected longevity of a :t:`value`. +.. glossary-entry:: lifetime + :glossary-dp: fls_vdhaa61g6kah + + :glossary: + :dp:`fls_il3n0w4m084b` + A :dt:`lifetime` specifies the expected longevity of a :t:`reference`. + + :dp:`fls_2nywjifee7q` + See :s:`Lifetime`. + :chapter: + :dp:`fls_nne91at3143t` + A :t:`lifetime` specifies the expected longevity of a :t:`value`. :dp:`fls_vbclxg9dq4yo` A :t:`lifetime bound` shall apply to :t:`[type]s` and other :t:`[lifetime]s`. @@ -3027,15 +4472,47 @@ Subtyping and Variance .. rubric:: Legality Rules -:dp:`fls_atq2cltx487m` -:t:`Subtyping` is a property of :t:`[type]s`, allowing one :t:`type` to be used -where another :t:`type` is expected. - -:dp:`fls_df87d44kgwcv` -:t:`Variance` is a property of :t:`[lifetime parameter]s` and -:t:`[type parameter]s` that describes the circumstances under which a -:t:`generic type` is a :t:`subtype` of an instantiation of itself with -different :t:`[generic argument]s`. +.. glossary-entry:: subtype + :glossary-dp: fls_pu4zqJ1tGrfH + + :glossary: + :dp:`fls_pmkjOWsieQog` + A :dt:`subtype` is a :t:`type` with additional constraints. + +.. glossary-entry:: subtyping + :glossary-dp: fls_f5dxz8pvs1kz + + :glossary: + :dp:`fls_bo5xzjsdd3lj` + :dt:`Subtyping` is a property of :t:`[type]s`, allowing one :t:`type` to be + used where another :t:`type` is expected. + :chapter: + :dp:`fls_atq2cltx487m` + :t:`Subtyping` is a property of :t:`[type]s`, allowing one :t:`type` to be used + where another :t:`type` is expected. + +.. glossary-entry:: variance + :glossary-dp: fls_q0xplb4tbzpq + + :glossary: + :dp:`fls_il0krrsf09f8` + :dt:`Variance` is a property of :t:`[lifetime parameter]s` and + :t:`[type parameter]s` that describes the circumstances under which a + :t:`generic type` is a :t:`subtype` of an instantiation of itself with + different :t:`[generic argument]s`. + :chapter: + :dp:`fls_df87d44kgwcv` + :t:`Variance` is a property of :t:`[lifetime parameter]s` and + :t:`[type parameter]s` that describes the circumstances under which a + :t:`generic type` is a :t:`subtype` of an instantiation of itself with + different :t:`[generic argument]s`. + +.. glossary-entry:: generic type + :glossary-dp: fls_3Ss6jDgtF1of + + :glossary: + :dp:`fls_Zn2pIsMZoTry` + A :dt:`generic type` is a :t:`type` with a :t:`generic parameter`. :dp:`fls_7ex941yysuhq` A :t:`type` is its own :t:`subtype`. @@ -3220,10 +4697,19 @@ Lifetime Elision .. rubric:: Legality Rules -:dp:`fls_9wtuclhm7yz5` -:t:`Lifetime elision` is a set of rules that automatically insert -:t:`[lifetime parameter]s` and/or :t:`[lifetime argument]s` when they are -elided in the source code. +.. glossary-entry:: lifetime elision + :glossary-dp: fls_al39r9uz2zmy + + :glossary: + :dp:`fls_dq5wkd61ry3l` + :dt:`Lifetime elision` is a set of rules that automatically insert + :t:`[lifetime parameter]s` and/or :t:`[lifetime argument]s` when they are + elided in the source code. + :chapter: + :dp:`fls_9wtuclhm7yz5` + :t:`Lifetime elision` is a set of rules that automatically insert + :t:`[lifetime parameter]s` and/or :t:`[lifetime argument]s` when they are + elided in the source code. :dp:`fls_JmP6O9zj8fkV` A :t:`lifetime` may be elided either implicitly or explicitly. @@ -3258,11 +4744,21 @@ Function Lifetime Elision .. rubric:: Legality Rules -:dp:`fls_lAdIRCFFlydD` -:t:`Function lifetime elision` is a form of :t:`lifetime elision` that applies -to :t:`[function]s`, :t:`[function pointer type parameter]s`, and :t:`[path]s` -that resolve to one of the :std:`core::ops::Fn`, :std:`core::ops::FnMut`, and -:std:`core::ops::FnOnce` :t:`[trait]s`. +.. glossary-entry:: function lifetime elision + :glossary-dp: fls_WMaE58yv1joW + + :glossary: + :dp:`fls_tZMmRHua1S8K` + :dt:`Function lifetime elision` is a form of :t:`lifetime elision` that applies + to :t:`[function]s`, :t:`[function pointer type parameter]s` and :t:`[path]s` + resolving to one of the :std:`core::ops::Fn`, :std:`core::ops::FnMut`, and + :std:`core::ops::FnOnce` :t:`[trait]s`. + :chapter: + :dp:`fls_lAdIRCFFlydD` + :t:`Function lifetime elision` is a form of :t:`lifetime elision` that applies + to :t:`[function]s`, :t:`[function pointer type parameter]s`, and :t:`[path]s` + that resolve to one of the :std:`core::ops::Fn`, :std:`core::ops::FnMut`, and + :std:`core::ops::FnOnce` :t:`[trait]s`. :dp:`fls_dpudys82dhdc` An :dt:`input lifetime` is one of the following :t:`[lifetime]s`: @@ -3301,6 +4797,30 @@ An :dt:`output lifetime` is one of the following :t:`[lifetime]s`: :std:`core::ops::Fn`, :std:`core::ops::FnMut`, and :std:`core::ops::FnOnce` :t:`[trait]s`. +.. glossary-entry:: unnamed lifetime + :glossary-dp: fls_r8567aozbyxl + + :glossary: + :dp:`fls_4iy6zpq66mit` + An :dt:`unnamed lifetime` is a :t:`lifetime` declared with character 0x5F (low + line). + +.. glossary-entry:: elided lifetime + :glossary-dp: fls_l2181y5566ck + + :glossary: + :dp:`fls_9q28407ev0a6` + An :dt:`elided lifetime` is either an :t:`unnamed lifetime` or a :t:`lifetime` + that has been explicitly omitted from a :t:`function signature` or an + :t:`implementation`. + +.. glossary-entry:: elided + :glossary-dp: fls_vygjg858yxej + + :glossary: + :dp:`fls_lo3c3n9wy6qz` + For :dt:`elided`, see :t:`elided lifetime`. + :dp:`fls_g56br27hq2zj` :t:`Lifetime elision` proceeds as follows: @@ -3344,9 +4864,17 @@ Static Lifetime Elision .. rubric:: Legality Rules -:dp:`fls_l4RDXaFwnQZ6` -:t:`Static lifetime elision` is a form of :t:`lifetime elision` that applies to -the :t:`type ascription` of :t:`[constant]s` and :t:`[static]s`. +.. glossary-entry:: static lifetime elision + :glossary-dp: fls_jCqiKgW9g8n5 + + :glossary: + :dp:`fls_NbVewjYRnQPF` + :dt:`Static lifetime elision` is a form of :t:`lifetime elision` that applies + to :t:`[constant]s` and :t:`[static]s`. + :chapter: + :dp:`fls_l4RDXaFwnQZ6` + :t:`Static lifetime elision` is a form of :t:`lifetime elision` that applies to + the :t:`type ascription` of :t:`[constant]s` and :t:`[static]s`. :dp:`fls_8irr97rZWfSC` An :t:`elided` :t:`lifetime` of a :t:`reference type` or :t:`path` in the @@ -3383,9 +4911,17 @@ Trait Object Lifetime Elision .. rubric:: Legality Rules -:dp:`fls_fuBYWRrgxlbQ` -:t:`Trait object lifetime elision` is a form of :t:`lifetime elision` that -applies to :t:`[trait object type]s`. +.. glossary-entry:: trait object lifetime elision + :glossary-dp: fls_TCIzYoMeGtub + + :glossary: + :dp:`fls_rALP9b6qjlp9` + :dt:`Trait object lifetime elision` is a form of :t:`lifetime elision` that + applies to :t:`[trait object type]s`. + :chapter: + :dp:`fls_fuBYWRrgxlbQ` + :t:`Trait object lifetime elision` is a form of :t:`lifetime elision` that + applies to :t:`[trait object type]s`. :dp:`fls_URl9CeIVsiWs` An :t:`elided` :t:`lifetime` of a :t:`trait object type` is inferred as follows: @@ -3443,10 +4979,19 @@ Impl Header Lifetime Elision .. rubric:: Legality Rules -:dp:`fls_FUdsmzN0T8XP` -:t:`Impl header lifetime elision` is a form of :t:`lifetime elision` that -applies to the :t:`implementing type` and :t:`implemented trait` (if any) of an -:t:`implementation`. +.. glossary-entry:: impl header lifetime elision + :glossary-dp: fls_L9XTxPSujx4v + + :glossary: + :dp:`fls_PvYGu85UAyFb` + :dt:`Impl header lifetime elision` is a form of :t:`lifetime elision` that + applies to the :t:`implementing type` and :t:`implemented trait` (if any) of an + :t:`implementation`. + :chapter: + :dp:`fls_FUdsmzN0T8XP` + :t:`Impl header lifetime elision` is a form of :t:`lifetime elision` that + applies to the :t:`implementing type` and :t:`implemented trait` (if any) of an + :t:`implementation`. :dp:`fls_3p5BdLn3JbKz` The :t:`impl header lifetime elision` rules are as follows: diff --git a/src/undefined-behavior.rst b/src/undefined-behavior.rst index d892ba40..d459e9c2 100644 --- a/src/undefined-behavior.rst +++ b/src/undefined-behavior.rst @@ -10,6 +10,13 @@ List of undefined behavior ========================== +.. glossary-entry:: undefined behavior + :glossary-dp: fls_WuLL4SvSKavZ + + :glossary: + :dp:`fls_WpwmltUMQGZa` + :dt:`Undefined behavior` is a situation that results in an unbounded error. + :dp:`fls_f9mkI99mzPxY` The following sections of the FLS document undefined behavior: diff --git a/src/unsafety.rst b/src/unsafety.rst index 1ede11bd..b75397e8 100644 --- a/src/unsafety.rst +++ b/src/unsafety.rst @@ -10,14 +10,37 @@ Unsafety .. rubric:: Legality Rules -:dp:`fls_8kqo952gjhaf` -:t:`Unsafety` is the presence of :t:`[unsafe operation]s` and :t:`[unsafe trait -implementation]s` in program text. - -:dp:`fls_ovn9czwnwxue` -An :t:`unsafe operation` is an operation that may result in -:t:`undefined behavior` that is not diagnosed as a static error. -:t:`[Unsafe operation]s` are referred to as :t:`unsafe Rust`. +.. glossary-entry:: unsafety + :glossary-dp: fls_pst7yov6vnr9 + + :glossary: + :dp:`fls_742ycx5181n` + :dt:`Unsafety` is the presence of :t:`[unsafe operation]s` in program text. + :chapter: + :dp:`fls_8kqo952gjhaf` + :t:`Unsafety` is the presence of :t:`[unsafe operation]s` and :t:`[unsafe trait + implementation]s` in program text. + +.. glossary-entry:: unsafe operation + :glossary-dp: fls_e2wyfbem6vwn + + :glossary: + :dp:`fls_34h60ubicgsj` + An :dt:`unsafe operation` is an operation that may result in + :t:`undefined behavior` that is not diagnosed as a static error. + :t:`[Unsafe operation]s` are referred to as :t:`unsafe Rust`. + :chapter: + :dp:`fls_ovn9czwnwxue` + An :t:`unsafe operation` is an operation that may result in + :t:`undefined behavior` that is not diagnosed as a static error. + :t:`[Unsafe operation]s` are referred to as :t:`unsafe Rust`. + +.. glossary-entry:: unsafe Rust + :glossary-dp: fls_4f6mppoenj3b + + :glossary: + :dp:`fls_30asi010yf1a` + For :dt:`unsafe Rust`, see :t:`[unsafe operation]s`. :dp:`fls_pfhmcafsjyf7` The :t:`[unsafe operation]s` are: @@ -40,10 +63,17 @@ The :t:`[unsafe operation]s` are: * :dp:`fls_s5nfhBFOk8Bu` Calling :t:`macro` :std:`core::arch::asm`. -:dp:`fls_jb6krd90tjmc` -An :t:`unsafe context` is either an :t:`unsafe block` or an -:t:`unsafe function`. +.. glossary-entry:: unsafe context + :glossary-dp: fls_5m85wlr2qw78 + + :glossary: + :dp:`fls_qn1s845ejbu0` + An :dt:`unsafe context` is either an :t:`unsafe block` or an + :t:`unsafe function`. + :chapter: + :dp:`fls_jb6krd90tjmc` + An :t:`unsafe context` is either an :t:`unsafe block` or an + :t:`unsafe function`. :dp:`fls_ybnpe7ppq1vh` An :t:`unsafe operation` shall be used only within an :t:`unsafe context`. - diff --git a/src/values.rst b/src/values.rst index 68c27eb5..f520d95d 100644 --- a/src/values.rst +++ b/src/values.rst @@ -10,9 +10,24 @@ Values .. rubric:: Legality Rules -:dp:`fls_buyaqara7am4` -A :t:`value` is either a :t:`literal` or the result of a computation, that may -be stored in a memory location, and interpreted based on some :t:`type`. +.. glossary-entry:: value + :glossary-dp: fls_tg866bc926ms + + :glossary: + :dp:`fls_h8jn338b51yu` + A :dt:`value` is either a :t:`literal` or the result of a computation, that may + be stored in a memory location, and interpreted based on some :t:`type`. + :chapter: + :dp:`fls_buyaqara7am4` + A :t:`value` is either a :t:`literal` or the result of a computation, that may + be stored in a memory location, and interpreted based on some :t:`type`. + +.. glossary-entry:: immutable + :glossary-dp: fls_xiocbknerufq + + :glossary: + :dp:`fls_sttdfynyqr5h` + A :t:`value` is :dt:`immutable` when it cannot be modified. :dp:`fls_CUJyMj0Sj8NS` An :dt:`allocated object` is a :t:`value` stored at some memory address. @@ -25,22 +40,37 @@ the object is stored. An :t:`[allocated object]s` :dt:`memory size` is the number of bytes the object spans in memory from its :t:`base address`. -:dp:`fls_rixdyyc525xp` -Two :t:`[value]s` :t:`overlap` when - -* :dp:`fls_m6ctqq70vcxr` - Both :t:`[value]s` are the same, or - -* :dp:`fls_s231d18x5eay` - One :t:`value` is of an :t:`abstract data type` and the other denotes a - :t:`field` of the same :t:`value`, or - -* :dp:`fls_dfr4yqo93fsn` - One :t:`value` denotes an :t:`array` and the other denotes an element of the - same :t:`value`, or - -* :dp:`fls_eoak5mdl6ma` - Both :t:`[value]s` are elements of the same :t:`array`. +.. glossary-entry:: overlap + :glossary-dp: fls_nhamq7xtz384 + + :glossary: + :dp:`fls_itkz9y19923k` + Two :t:`[value]s` :dt:`overlap` when their memory locations overlap, or both + values are elements of the same :t:`array`. + :chapter: + :dp:`fls_rixdyyc525xp` + Two :t:`[value]s` :t:`overlap` when + + * :dp:`fls_m6ctqq70vcxr` + Both :t:`[value]s` are the same, or + + * :dp:`fls_s231d18x5eay` + One :t:`value` is of an :t:`abstract data type` and the other denotes a + :t:`field` of the same :t:`value`, or + + * :dp:`fls_dfr4yqo93fsn` + One :t:`value` denotes an :t:`array` and the other denotes an element of the + same :t:`value`, or + + * :dp:`fls_eoak5mdl6ma` + Both :t:`[value]s` are elements of the same :t:`array`. + +.. glossary-entry:: null + :glossary-dp: fls_gqw1bzwexxt0 + + :glossary: + :dp:`fls_8sh17t37b2ml` + A :dc:`null` :t:`value` denotes the address ``0``. .. rubric:: Undefined Behavior @@ -79,13 +109,32 @@ Constants .. rubric:: Legality Rules -:dp:`fls_5o5iu4j8in4l` -A :t:`constant` is an :t:`immutable` :t:`value expression` whose uses are substituted by -the :t:`value`. - -:dp:`fls_3mhj0kkupwuz` -An :t:`unnamed constant` is a :t:`constant` declared with character 0x5F (low -line). +.. glossary-entry:: constant + :glossary-dp: fls_yw57di94gwpf + + :glossary: + :dp:`fls_p8rjw2qok85b` + A :dt:`constant` is an immutable :t:`value` whose uses are substituted by the + :t:`value`. + + :dp:`fls_hlouedpdg1zd` + See :s:`ConstantDeclaration`. + :chapter: + :dp:`fls_5o5iu4j8in4l` + A :t:`constant` is an :t:`immutable` :t:`value expression` whose uses are substituted by + the :t:`value`. + +.. glossary-entry:: unnamed constant + :glossary-dp: fls_u78ng1tleh0w + + :glossary: + :dp:`fls_ufj01cxxsv1w` + An :dt:`unnamed constant` is a :t:`constant` declared with character 0x5F (low + line). + :chapter: + :dp:`fls_3mhj0kkupwuz` + An :t:`unnamed constant` is a :t:`constant` declared with character 0x5F (low + line). :dp:`fls_ka4y2yd100dx` The :t:`type specification` of a :t:`constant` shall have ``'static`` @@ -95,9 +144,20 @@ The :t:`type specification` of a :t:`constant` shall have ``'static`` The :t:`type` of a :t:`constant` shall implement the :std:`core::marker::Sized` :t:`trait`. -:dp:`fls_ndmfqxjpvsqy` -A :t:`constant initializer` is a :t:`construct` that provides the :t:`value` of -its related :t:`constant`. +.. glossary-entry:: constant initializer + :glossary-dp: fls_mf022jo05ziu + + :glossary: + :dp:`fls_2ge48v1kmw8` + A :dt:`constant initializer` is a :t:`construct` that provides the :t:`value` + of its related :t:`constant`. + + :dp:`fls_h86eg26z19r2` + See :s:`ConstantInitializer`. + :chapter: + :dp:`fls_ndmfqxjpvsqy` + A :t:`constant initializer` is a :t:`construct` that provides the :t:`value` of + its related :t:`constant`. :dp:`fls_6rxwbbhf5tc5` A :t:`constant` shall have a :t:`constant initializer`, unless it is an @@ -113,6 +173,14 @@ The value of a :t:`constant` is determined by evaluating its .. rubric:: Dynamic Semantics +.. glossary-entry:: elaboration + :glossary-dp: fls_2sja3okj27ne + + :glossary: + :dp:`fls_xoahzmwu1std` + :dt:`Elaboration` is the process by which a :t:`declaration` achieves its + runtime effects. + :dp:`fls_xezt9hl069h4` The :t:`elaboration` of a :t:`constant` evaluates its :t:`constant initializer`. @@ -143,9 +211,20 @@ Statics .. rubric:: Legality Rules -:dp:`fls_ibrmiwfypldh` -A :t:`static` is a :t:`value` that is associated with a specific memory -location. +.. glossary-entry:: static + :glossary-dp: fls_tpazbmuq9hag + + :glossary: + :dp:`fls_srx4v1e20yxa` + A :dt:`static` is a :t:`value` that is associated with a specific memory + location. + + :dp:`fls_1b7gpk8e98pw` + See :s:`StaticDeclaration`. + :chapter: + :dp:`fls_ibrmiwfypldh` + A :t:`static` is a :t:`value` that is associated with a specific memory + location. :dp:`fls_mt94jvoot9dx` A :t:`static` defined within a :t:`generic function` exists once in the @@ -162,23 +241,48 @@ The :t:`type` of a :t:`static` shall implement the :std:`core::marker::Sized` :dp:`fls_WRpcVF1fLEpr` A :t:`static` shall only be subject to an :s:`ItemSafety` if it is an :t:`external static` in an :t:`unsafe external block`. -:dp:`fls_doi4z6u55bi7` -A :t:`mutable static` is a :t:`static` with :t:`keyword` ``mut`` whose -:t:`value` can be modified. +.. glossary-entry:: mutable static + :glossary-dp: fls_omgyj7yxwgua + + :glossary: + :dp:`fls_3ss4bokujaby` + A :dt:`mutable static` is a :t:`static` whose :t:`value` can be modified. + :chapter: + :dp:`fls_doi4z6u55bi7` + A :t:`mutable static` is a :t:`static` with :t:`keyword` ``mut`` whose + :t:`value` can be modified. :dp:`fls_74hp208pto22` Access to a :t:`mutable static` shall require :t:`unsafe context`. -:dp:`fls_jfde2vg6mtww` -An :t:`immutable static` is a :t:`static` whose :t:`value` cannot be modified. +.. glossary-entry:: immutable static + :glossary-dp: fls_my7jjwi0ncen + + :glossary: + :dp:`fls_eonlhz79ur3d` + An :dt:`immutable static` is a :t:`static` whose :t:`value` cannot be modified. + :chapter: + :dp:`fls_jfde2vg6mtww` + An :t:`immutable static` is a :t:`static` whose :t:`value` cannot be modified. :dp:`fls_k4tyqb1j6zjo` The type of an :t:`immutable static` shall implement the :std:`core::marker::Sync` :t:`trait`. -:dp:`fls_t17h5h6a6v4c` -A :t:`static initializer` is a :t:`construct` that provides the :t:`value` of -its related :t:`static`. +.. glossary-entry:: static initializer + :glossary-dp: fls_x331kxllyzim + + :glossary: + :dp:`fls_6jjbfni87tax` + A :dt:`static initializer` is a :t:`construct` that provides the :t:`value` of + its related :t:`static`. + + :dp:`fls_igbl5uv0dlhl` + See :s:`StaticInitializer`. + :chapter: + :dp:`fls_t17h5h6a6v4c` + A :t:`static initializer` is a :t:`construct` that provides the :t:`value` of + its related :t:`static`. :dp:`fls_yq0hpy4jx2qb` A :t:`static` shall have a :t:`static initializer`, unless it is an @@ -226,9 +330,17 @@ Temporaries .. rubric:: Legality Rules -:dp:`fls_awpw61yofckz` -A :t:`temporary` is an anonymous :t:`variable` produced by some intermediate -computation. +.. glossary-entry:: temporary + :glossary-dp: fls_4omay4i65dwz + + :glossary: + :dp:`fls_fathkxu9kxvw` + A :dt:`temporary` is an anonymous :t:`variable` produced by some intermediate + computation. + :chapter: + :dp:`fls_awpw61yofckz` + A :t:`temporary` is an anonymous :t:`variable` produced by some intermediate + computation. .. _fls_gho955gmob73: @@ -237,9 +349,39 @@ Variables .. rubric:: Legality Rules -:dp:`fls_hl5tnd9yy252` -A :t:`variable` is a placeholder for a :t:`value` that is allocated on the -stack. +.. glossary-entry:: variable + :glossary-dp: fls_donq6w1906lw + + :glossary: + :dp:`fls_9ab12k4vwsio` + A :dt:`variable` is a placeholder for a :t:`value` that is allocated on the + stack. + :chapter: + :dp:`fls_hl5tnd9yy252` + A :t:`variable` is a placeholder for a :t:`value` that is allocated on the + stack. + +.. glossary-entry:: local variable + :glossary-dp: fls_lkxiws55xhpq + + :glossary: + :dp:`fls_3inlcyi6444u` + For :dt:`local variable`, see :t:`variable`. + +.. glossary-entry:: immutable variable + :glossary-dp: fls_8xrhfwgep3nk + + :glossary: + :dp:`fls_sdg35i92taip` + An :dt:`immutable variable` is a :t:`variable` whose :t:`value` cannot be + modified. + +.. glossary-entry:: mutable variable + :glossary-dp: fls_n7h4xr40xwgb + + :glossary: + :dp:`fls_kjjv9jvdpf2o` + A :dt:`mutable variable` is a :t:`variable` whose :t:`value` can be modified. :dp:`fls_vgi0gh5zmoiu` The following :t:`[construct]s` are :t:`[variable]s`: @@ -254,6 +396,14 @@ The following :t:`[construct]s` are :t:`[variable]s`: A :t:`variable` shall be used only after it has been initialized through all :t:`[reachable control flow path]s` up to the point of its usage. +.. glossary-entry:: reachable control flow path + :glossary-dp: fls_sAe1HaaVSPvP + + :glossary: + :dp:`fls_IxrvzuBg8j3E` + A :dt:`reachable control flow path` is a control flow path that can be + taken by the execution of a program between two given points in the program. + .. rubric:: Dynamic Semantics :dp:`fls_g8etd5lsgn9j` @@ -266,9 +416,17 @@ Constant Promotion .. rubric:: Legality Rules -:dp:`fls_udn9lyf3m0z6` -:t:`Constant promotion` is the process of converting a :t:`value expression` -into a :t:`constant`. +.. glossary-entry:: constant promotion + :glossary-dp: fls_f95c9hrk7t2p + + :glossary: + :dp:`fls_ku2md8lnei12` + :dt:`Constant promotion` is the process of converting a :t:`value expression` + into a :t:`constant`. + :chapter: + :dp:`fls_udn9lyf3m0z6` + :t:`Constant promotion` is the process of converting a :t:`value expression` + into a :t:`constant`. :dp:`fls_yvkdcs4pmxjf` :t:`Constant promotion` is possible only when diff --git a/tools/README.rst b/tools/README.rst new file mode 100644 index 00000000..5e98d35d --- /dev/null +++ b/tools/README.rst @@ -0,0 +1,68 @@ +.. SPDX-License-Identifier: MIT OR Apache-2.0 + SPDX-FileCopyrightText: The Ferrocene Developers + SPDX-FileCopyrightText: The Rust Project Contributors + +===== +Tools +===== + +HTML diff verifier +================== + +``tools/verify-html-diff.py`` exports and compares rendered HTML trees under a +configured comparison policy. + +Comparison policy +----------------- + +The verifier compares ``build/html/**`` with strict byte-for-byte checks and +two explicit exceptions: + +* ``paragraph-ids.json`` compares normalized logical content (sorted + structure), not raw byte order. +* ``.buildinfo`` requires matching ``config`` and ignores ``tags`` + differences. +* Build commit identity is normalized by intercepting ``git rev-parse HEAD`` + during verification builds and returning a fixed commit value. +* ``_sources/`` entries are excluded from the comparison set because they are + source snapshots and not part of rendered output semantics. + +Modes +----- + +* ``--mode export-ref`` builds one git ref in an isolated worktree, exports + ``build/html`` to ``--output-dir``, and writes ``manifest.sha256``. +* ``--mode compare-dirs`` compares two exported HTML directories. +* ``--mode refs`` builds two refs and compares their HTML output. +* ``--mode repro`` builds one ref twice and compares both outputs. + +Exit codes +---------- + +* ``0``: success, no differences under configured comparison policy. +* ``1``: differences found. +* ``2``: operational/tooling failure. + +Report location +--------------- + +If ``--report`` is omitted, reports default to +``$OPENCODE_CONFIG_DIR/reports/`` (or ``build/html-diff/`` when +``OPENCODE_CONFIG_DIR`` is unset). + +Examples +-------- + +Run a reproducibility check for ``HEAD``:: + + ./tools/verify-html-diff.py --mode repro --ref HEAD + +Export two refs and compare them:: + + ./tools/verify-html-diff.py --mode export-ref --ref --output-dir /tmp/html-a + ./tools/verify-html-diff.py --mode export-ref --ref --output-dir /tmp/html-b + ./tools/verify-html-diff.py --mode compare-dirs --left-dir /tmp/html-a --right-dir /tmp/html-b + +Compare refs directly:: + + ./tools/verify-html-diff.py --mode refs --left-ref --right-ref diff --git a/tools/verify-html-diff.py b/tools/verify-html-diff.py new file mode 100755 index 00000000..334954da --- /dev/null +++ b/tools/verify-html-diff.py @@ -0,0 +1,585 @@ +#!/usr/bin/env -S uv run +# SPDX-License-Identifier: MIT OR Apache-2.0 +# SPDX-FileCopyrightText: The Ferrocene Developers + +from __future__ import annotations + +import argparse +import filecmp +import hashlib +import json +import os +from pathlib import Path +import shutil +import subprocess +import sys +import tempfile + +EXIT_SUCCESS = 0 +EXIT_DIFFERENCES = 1 +EXIT_ERROR = 2 +FIXED_BUILD_COMMIT = "0000000000000000000000000000000000000000" + + +def main() -> int: + try: + repo_root = find_repo_root(Path(__file__).resolve().parent) + if repo_root is None: + print("error: make.py not found in repo root", file=sys.stderr) + return EXIT_ERROR + + parser = argparse.ArgumentParser( + description=( + "Build and compare rendered HTML output under configured " "policy" + ), + ) + parser.add_argument( + "--mode", + choices=["export-ref", "compare-dirs", "refs", "repro"], + default="repro", + help="Operation mode", + ) + parser.add_argument("--ref", help="Git reference for export-ref/repro") + parser.add_argument("--left-ref", help="Left Git reference for refs mode") + parser.add_argument("--right-ref", help="Right Git reference for refs mode") + parser.add_argument("--output-dir", help="Output directory for export-ref mode") + parser.add_argument("--left-dir", help="Left directory for compare-dirs mode") + parser.add_argument("--right-dir", help="Right directory for compare-dirs mode") + parser.add_argument("--report", help="Path to write comparison report") + args = parser.parse_args() + + report_root = default_report_root(repo_root) + report_root.mkdir(parents=True, exist_ok=True) + + if args.mode == "export-ref": + ref = require_value(args.ref, "--ref is required for --mode export-ref") + output_dir = resolve_path( + require_value( + args.output_dir, + "--output-dir is required for --mode export-ref", + ), + repo_root, + ) + export_ref(repo_root, ref, output_dir, report_root) + print(f"exported HTML for {ref} to {output_dir}") + return EXIT_SUCCESS + + if args.mode == "compare-dirs": + left_dir = resolve_path( + require_value( + args.left_dir, + "--left-dir is required for --mode compare-dirs", + ), + repo_root, + ) + right_dir = resolve_path( + require_value( + args.right_dir, + "--right-dir is required for --mode compare-dirs", + ), + repo_root, + ) + report_path = resolve_report_path( + args.report, + repo_root, + report_root, + "verify-html-diff-compare-dirs.txt", + ) + return run_comparison_mode( + mode="compare-dirs", + left_label=str(left_dir), + right_label=str(right_dir), + left_dir=left_dir, + right_dir=right_dir, + report_path=report_path, + ) + + if args.mode == "refs": + left_ref = args.left_ref or "HEAD" + right_ref = args.right_ref or "HEAD" + report_path = resolve_report_path( + args.report, + repo_root, + report_root, + f"verify-html-diff-refs-{sanitize_label(left_ref)}-vs-" + f"{sanitize_label(right_ref)}.txt", + ) + with tempfile.TemporaryDirectory( + prefix="verify-html-diff-refs-", + dir=str(report_root), + ) as tmp_dir: + temp_root = Path(tmp_dir) + left_dir = temp_root / "left" + right_dir = temp_root / "right" + worktree_dir = temp_root / "worktree" + export_ref(repo_root, left_ref, left_dir, report_root, worktree_dir) + export_ref(repo_root, right_ref, right_dir, report_root, worktree_dir) + return run_comparison_mode( + mode="refs", + left_label=left_ref, + right_label=right_ref, + left_dir=left_dir, + right_dir=right_dir, + report_path=report_path, + ) + + ref = args.ref or "HEAD" + report_path = resolve_report_path( + args.report, + repo_root, + report_root, + f"verify-html-diff-repro-{sanitize_label(ref)}.txt", + ) + with tempfile.TemporaryDirectory( + prefix="verify-html-diff-repro-", + dir=str(report_root), + ) as tmp_dir: + temp_root = Path(tmp_dir) + left_dir = temp_root / "first" + right_dir = temp_root / "second" + worktree_dir = temp_root / "worktree" + export_ref(repo_root, ref, left_dir, report_root, worktree_dir) + export_ref(repo_root, ref, right_dir, report_root, worktree_dir) + return run_comparison_mode( + mode="repro", + left_label=f"{ref} (run 1)", + right_label=f"{ref} (run 2)", + left_dir=left_dir, + right_dir=right_dir, + report_path=report_path, + ) + except subprocess.CalledProcessError as exc: + command = " ".join(str(part) for part in exc.cmd or []) + if command: + print( + f"error: command failed with exit code {exc.returncode}: {command}", + file=sys.stderr, + ) + else: + print( + f"error: command failed with exit code {exc.returncode}", + file=sys.stderr, + ) + return EXIT_ERROR + except RuntimeError as exc: + print(f"error: {exc}", file=sys.stderr) + return EXIT_ERROR + + +def run_comparison_mode( + mode: str, + left_label: str, + right_label: str, + left_dir: Path, + right_dir: Path, + report_path: Path, +) -> int: + diff = diff_trees(left_dir, right_dir) + write_report(report_path, mode, left_label, right_label, diff) + if has_differences(diff): + print( + "differences found under configured comparison policy; " + f"report written to {report_path}" + ) + return EXIT_DIFFERENCES + print( + "no differences under configured comparison policy; " + f"report written to {report_path}" + ) + return EXIT_SUCCESS + + +def require_value(value: str | None, error_message: str) -> str: + if value is None: + raise RuntimeError(error_message) + return value + + +def resolve_path(value: str, repo_root: Path) -> Path: + path = Path(value) + if not path.is_absolute(): + path = repo_root / path + return path.resolve() + + +def resolve_report_path( + report: str | None, + repo_root: Path, + report_root: Path, + default_name: str, +) -> Path: + if report is None: + path = report_root / default_name + else: + path = resolve_path(report, repo_root) + path.parent.mkdir(parents=True, exist_ok=True) + return path + + +def default_report_root(repo_root: Path) -> Path: + config_dir = os.environ.get("OPENCODE_CONFIG_DIR") + if config_dir: + return Path(config_dir).resolve() / "reports" + return repo_root / "build" / "html-diff" + + +def sanitize_label(value: str) -> str: + sanitized = [] + for char in value: + if char.isalnum() or char in {"-", "_", "."}: + sanitized.append(char) + else: + sanitized.append("-") + return "".join(sanitized).strip("-") or "ref" + + +def export_ref( + repo_root: Path, + ref: str, + output_dir: Path, + report_root: Path, + worktree_dir: Path | None = None, +) -> None: + clean_dir(output_dir) + output_dir.mkdir(parents=True, exist_ok=True) + + worktree_root = report_root / "verify-html-diff-worktrees" + worktree_root.mkdir(parents=True, exist_ok=True) + + cleanup_worktree_path = False + if worktree_dir is None: + worktree_dir = Path( + tempfile.mkdtemp(prefix="worktree-", dir=str(worktree_root)) + ) + cleanup_worktree_path = True + else: + worktree_dir.parent.mkdir(parents=True, exist_ok=True) + clean_dir(worktree_dir) + + worktree_added = False + try: + run_best_effort( + ["git", "worktree", "remove", "--force", str(worktree_dir)], + cwd=repo_root, + ) + run( + ["git", "worktree", "add", "--detach", str(worktree_dir), ref], + cwd=repo_root, + ) + worktree_added = True + git_wrapper_dir = worktree_dir / "build" / "verify-tools-bin" + git_wrapper = git_wrapper_dir / "git" + git_wrapper_dir.mkdir(parents=True, exist_ok=True) + real_git = shutil.which("git") + if real_git is None: + raise RuntimeError("missing git executable") + git_wrapper.write_text( + "#!/bin/sh\n" + 'if [ "$1" = "rev-parse" ] && [ "$2" = "HEAD" ] && [ -z "$3" ]; then\n' + f" printf '%s\\n' '{FIXED_BUILD_COMMIT}'\n" + " exit 0\n" + "fi\n" + f'exec {real_git} "$@"\n', + encoding="utf-8", + ) + git_wrapper.chmod(0o755) + + env = os.environ.copy() + env["PATH"] = f"{git_wrapper_dir}:{env.get('PATH', '')}" + run(["./make.py", "--clear"], cwd=worktree_dir, env=env) + + html_dir = worktree_dir / "build" / "html" + if not html_dir.is_dir(): + raise RuntimeError(f"missing build output at {html_dir}") + copy_tree(html_dir, output_dir) + write_manifest(output_dir) + finally: + if worktree_added: + try: + run( + ["git", "worktree", "remove", "--force", str(worktree_dir)], + cwd=repo_root, + ) + except subprocess.CalledProcessError: + pass + if cleanup_worktree_path: + shutil.rmtree(worktree_dir, ignore_errors=True) + + +def run(command: list[str], cwd: Path, env: dict[str, str] | None = None) -> None: + subprocess.run(command, check=True, cwd=cwd, env=env) + + +def run_best_effort(command: list[str], cwd: Path) -> None: + try: + run(command, cwd=cwd) + except subprocess.CalledProcessError: + return + + +def find_repo_root(start: Path) -> Path | None: + for candidate in (start, *start.parents): + if (candidate / "make.py").is_file(): + return candidate + return None + + +def clean_dir(path: Path) -> None: + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + + +def copy_tree(source: Path, destination: Path) -> None: + if not source.is_dir(): + raise RuntimeError(f"missing build output at {source}") + shutil.copytree(source, destination, dirs_exist_ok=True) + + +def write_manifest(root: Path) -> None: + entries: list[str] = [] + for rel_path, file_path in list_files(root).items(): + if rel_path == "manifest.sha256": + continue + digest = hashlib.sha256(file_path.read_bytes()).hexdigest() + entries.append(f"{digest} {rel_path}") + manifest = root / "manifest.sha256" + manifest.write_text("\n".join(entries) + "\n", encoding="utf-8") + + +def diff_trees(left: Path, right: Path) -> dict[str, list[str]]: + left_files = list_files(left) + right_files = list_files(right) + + only_left: list[str] = [] + only_right: list[str] = [] + changed: list[str] = [] + comparisons: list[str] = [] + + compared_paths = sorted((set(left_files) | set(right_files)) - {"manifest.sha256"}) + for rel in compared_paths: + if rel.startswith("_sources/"): + continue + if rel not in right_files: + only_left.append(rel) + continue + if rel not in left_files: + only_right.append(rel) + continue + + special = compare_special(rel, left_files[rel], right_files[rel]) + if special is not None: + comparisons.append(str(special["message"])) + if not special["equal"]: + changed.append(rel) + continue + + if not filecmp.cmp(left_files[rel], right_files[rel], shallow=False): + changed.append(rel) + + return { + "only_left": only_left, + "only_right": only_right, + "changed": changed, + "comparisons": comparisons, + } + + +def has_differences(diff: dict[str, list[str]]) -> bool: + return bool(diff["only_left"] or diff["only_right"] or diff["changed"]) + + +def compare_special(rel: str, left: Path, right: Path) -> dict[str, object] | None: + name = os.path.basename(rel) + if name == "paragraph-ids.json": + return compare_paragraph_ids(left, right) + if name == "searchindex.js": + return compare_searchindex(left, right) + if name == ".buildinfo": + return compare_buildinfo(left, right) + return None + + +def compare_paragraph_ids(left: Path, right: Path) -> dict[str, object]: + left_data = normalize_paragraph_ids(left) + right_data = normalize_paragraph_ids(right) + if left_data == right_data: + return { + "equal": True, + "message": "paragraph-ids.json: normalized content matches", + } + return { + "equal": False, + "message": "paragraph-ids.json: normalized content differs", + } + + +def normalize_paragraph_ids(path: Path) -> dict[str, object]: + data = json.loads(path.read_text(encoding="utf-8")) + normalized = dict(data) + + documents = [] + for doc in data.get("documents", []): + doc_data = dict(doc) + sections = [] + for section in doc.get("sections", []): + section_data = dict(section) + paragraphs = section_data.get("paragraphs", []) + section_data["paragraphs"] = sorted( + paragraphs, + key=lambda paragraph: json.dumps(paragraph, sort_keys=True), + ) + sections.append(section_data) + sections.sort(key=lambda item: item.get("id", "")) + doc_data["sections"] = sections + documents.append(doc_data) + documents.sort(key=lambda item: item.get("link", "")) + normalized["documents"] = documents + return normalized + + +def compare_buildinfo(left: Path, right: Path) -> dict[str, object]: + left_info = read_buildinfo(left) + right_info = read_buildinfo(right) + + if left_info.get("config") != right_info.get("config"): + return {"equal": False, "message": ".buildinfo: config hash differs"} + + if left_info.get("tags") != right_info.get("tags"): + return { + "equal": True, + "message": ".buildinfo: config matches; tags differ (ignored)", + } + + return {"equal": True, "message": ".buildinfo: config matches"} + + +def compare_searchindex(left: Path, right: Path) -> dict[str, object]: + left_data = normalize_searchindex(read_searchindex_payload(left)) + right_data = normalize_searchindex(read_searchindex_payload(right)) + if left_data == right_data: + return { + "equal": True, + "message": ( + "searchindex.js: normalized content matches " + "(ferrocene_spec envversion ignored)" + ), + } + return { + "equal": False, + "message": "searchindex.js: normalized content differs", + } + + +def read_searchindex_payload(path: Path) -> dict[str, object]: + text = path.read_text(encoding="utf-8").strip() + prefix = "Search.setIndex(" + if not text.startswith(prefix): + raise RuntimeError(f"unexpected searchindex format in {path}") + payload = text[len(prefix) :] + if payload.endswith(");"): + payload = payload[:-2] + elif payload.endswith(")"): + payload = payload[:-1] + else: + raise RuntimeError(f"unexpected searchindex terminator in {path}") + data = json.loads(payload) + if not isinstance(data, dict): + raise RuntimeError(f"unexpected searchindex payload type in {path}") + return data + + +def normalize_searchindex(data: dict[str, object]) -> dict[str, object]: + normalized = dict(data) + envversion = normalized.get("envversion") + if isinstance(envversion, dict) and "ferrocene_spec" in envversion: + envversion_normalized = dict(envversion) + envversion_normalized["ferrocene_spec"] = "" + normalized["envversion"] = envversion_normalized + return normalized + + +def read_buildinfo(path: Path) -> dict[str, str]: + info: dict[str, str] = {} + for line in path.read_text(encoding="utf-8").splitlines(): + stripped = line.strip() + if not stripped or stripped.startswith("#"): + continue + if ":" not in stripped: + continue + key, value = stripped.split(":", 1) + info[key.strip()] = value.strip() + return info + + +def list_files(root: Path) -> dict[str, Path]: + files: dict[str, Path] = {} + for dirpath, dirnames, filenames in os.walk(root): + dirnames.sort() + filenames.sort() + base = Path(dirpath) + for filename in filenames: + path = base / filename + rel = str(path.relative_to(root)) + files[rel] = path + return files + + +def write_report( + path: Path, + mode: str, + left_label: str, + right_label: str, + diff: dict[str, list[str]], +) -> None: + no_diff = not has_differences(diff) + + lines: list[str] = [] + lines.append("verify-html-diff report") + lines.append("") + lines.append(f"mode: {mode}") + lines.append(f"left: {left_label}") + lines.append(f"right: {right_label}") + lines.append("") + if no_diff: + lines.append("result: no differences under configured comparison policy.") + else: + lines.append("result: differences found under configured comparison policy.") + lines.append("") + lines.append("policy:") + lines.append("- strict byte-for-byte file comparison") + lines.append( + "- paragraph-ids.json compared by normalized logical content (sorted structure)" + ) + lines.append( + "- searchindex.js compared by normalized JSON payload " + "(ferrocene_spec envversion ignored)" + ) + lines.append("- .buildinfo compares config; tags differences are ignored") + lines.append("") + lines.append("only in left:") + lines.extend(format_list(diff["only_left"])) + lines.append("") + lines.append("only in right:") + lines.extend(format_list(diff["only_right"])) + lines.append("") + lines.append("changed files:") + lines.extend(format_list(diff["changed"])) + lines.append("") + lines.append("special comparisons:") + lines.extend(format_list(diff["comparisons"])) + lines.append("") + + path.write_text("\n".join(lines), encoding="utf-8") + + +def format_list(values: list[str]) -> list[str]: + if not values: + return ["- (none)"] + return [f"- {value}" for value in values] + + +if __name__ == "__main__": + raise SystemExit(main())