Skip to content

Add missing closing '/' in tags #938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/appendix/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cx <div id="cx"/> | We tend to use "cx" as an abbreviati
ctxt <div id="ctxt"/> | We also use "ctxt" as an abbreviation for context, e.g. [`TyCtxt`](TyCtxt). See also [cx](#cx) or [tcx](#tcx).
DAG <div id="dag"/> | A directed acyclic graph is used during compilation to keep track of dependencies between queries. ([see more](../queries/incremental-compilation.html))
data-flow analysis <div id="data-flow"/> | A static analysis that figures out what properties are true at each point in the control-flow of a program; see [the background chapter for more](./background.html#dataflow).
DeBruijn Index <div id="debruijn"> | A technique for describing which binder a variable is bound by using only integers. It has the benefit that it is invariant under variable renaming. ([see more](./background.md#what-is-a-debruijn-index))
DeBruijn Index <div id="debruijn"/> | A technique for describing which binder a variable is bound by using only integers. It has the benefit that it is invariant under variable renaming. ([see more](./background.md#what-is-a-debruijn-index))
Copy link
Member

Choose a reason for hiding this comment

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

I thought div was not a self-closing tag. What does this do?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure, but that's what all the others do 🤷

Copy link
Member

Choose a reason for hiding this comment

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

All of these are being recovered by the HTML parser as invalid syntax.

self-closing

I think we should a) close this tag, and b) change it to <a href="#" id="debruijn> so you can click on it; right now you have to type it into your browser manually.

Copy link
Member Author

Choose a reason for hiding this comment

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

You mean change it to:

<a href="#debruijn" id="debruijn">{...}</a>

?

Copy link
Member Author

Choose a reason for hiding this comment

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

Vim regex for the win!

%s/^\(.*\) <div id="\([^"]\+\)"\/>/<a href="#\2" id="\2">\1<\/a>/g

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure if having self-linking anchors is really worth it here. It's kind of busy in the output and in the source:

image

# Glossary

Term                                     | Meaning
-----------------------------------------|--------
<a href="#arena" id="arena">arena/arena allocation</a> |  An _arena_ is a large memory buffer from which other memory allocations are made. This style of allocation is called _arena allocation_. See [this chapter](../memory.md) for more info.
<a href="#ast" id="ast">AST</a>                      |  The abstract syntax tree produced by the `rustc_ast` crate; reflects user syntax very closely.
<a href="#binder" id="binder">binder</a>                |  A "binder" is a place where a variable or type is declared; for example, the `<T>` is a binder for the generic type parameter `T` in `fn foo<T>(..)`, and \|`a`\|` ...` is a binder for the parameter `a`. See [the background chapter for more](./background.html#free-vs-bound).
<a href="#body-id" id="body-id">BodyId</a>               |  An identifier that refers to a specific body (definition of a function or constant) in the crate. See [the HIR chapter for more](../hir.html#identifiers-in-the-hir).
<a href="#bound-var" id="bound-var">bound variable</a>     |  A "bound variable" is one that is declared within an expression/term. For example, the variable `a` is bound within the closure expression \|`a`\|` a * 2`. See [the background chapter for more](./background.html#free-vs-bound)
<a href="#codegen" id="codegen">codegen</a>              |  The code to translate MIR into LLVM IR.
<a href="#codegen-unit" id="codegen-unit">codegen unit</a>    |  When we produce LLVM IR, we group the Rust code into a number of codegen units (sometimes abbreviated as CGUs). Each of these units is processed by LLVM independently from one another, enabling parallelism. They are also the unit of incremental re-use. ([see more](../backend/codegen.md))
<a href="#completeness" id="completeness">completeness</a>    |  A technical term in type theory, it means that every type-safe program also type-checks. Having both soundness and completeness is very hard, and usually soundness is more important. (see "soundness").
<a href="#cfg" id="cfg">control-flow graph</a>       |  A representation of the control-flow of a program; see [the background chapter for more](./background.html#cfg)
<a href="#ctfe" id="ctfe">CTFE</a>                    |  Short for Compile-Time Function Evaluation, this is the ability of the compiler to evaluate `const fn`s at compile time. This is part of the compiler's constant evaluation system. ([see more](../const-eval.html))
<a href="#cx" id="cx">cx</a>                        |  We tend to use "cx" as an abbreviation for context. See also `tcx`, `infcx`, etc.

It would also take a lot of effort to get the aligning spaces right in the source :/

What about just <span id="{id}">{...}</span>?

Copy link
Member

Choose a reason for hiding this comment

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

I'd be ok with <span>, that will still take a lot of time if you want to align the | though.

Copy link
Member Author

Choose a reason for hiding this comment

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

It actually takes no effort since all of the rows add the net same number of characters:

  • Remove <div id="{id}"/>
  • Add <span id="{id}">
  • Add </span>

Copy link
Member Author

Choose a reason for hiding this comment

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

Whereas adding a link adds an additional instance of {id}, which makes the lengths vary.

DefId <div id="def-id"/> | An index identifying a definition (see `rustc_middle/src/hir/def_id.rs`). Uniquely identifies a `DefPath`. See [the HIR chapter for more](../hir.html#identifiers-in-the-hir).
Discriminant <div id="discriminant"/> | The underlying value associated with an enum variant or generator state to indicate it as "active" (but not to be confused with its ["variant index"](#variant-idx)). At runtime, the discriminant of the active variant is encoded in the [tag](#tag).
Double pointer <div id="double-ptr"/> | A pointer with additional metadata. See "fat pointer" for more.
Expand Down Expand Up @@ -75,7 +75,7 @@ substs <div id="substs"/> | The substitutions for a given generi
Tag <div id="tag"/> | The "tag" of an enum/generator encodes the [discriminant](#discriminant) of the active variant/state. Tags can either be "direct" (simply storing the discriminant in a field) or use a ["niche"](#niche).
tcx <div id="tcx"/> | The "typing context", main data structure of the compiler. ([see more](../ty.html))
`'tcx` <div id="lifetime-tcx"/> | The lifetime of the allocation arena. ([see more](../ty.html))
TyCtxt <div id="tyctxt"> | The data structure often referred to as [tcx](#tcx) in code
TyCtxt <div id="tyctxt"/> | The data structure often referred to as [tcx](#tcx) in code
token <div id="token"/> | The smallest unit of parsing. Tokens are produced after lexing ([see more](../the-parser.html)).
[TLS] <div id="tls"/> | Thread-Local Storage. Variables may be defined so that each thread has its own copy (rather than all threads sharing the variable). This has some interactions with LLVM. Not all platforms support TLS.
trait reference <div id="trait-ref"/> | The name of a trait along with a suitable set of input type/lifetimes. ([see more](../traits/goals-and-clauses.html#trait-ref))
Expand Down