Skip to content

Commit 64ea7ef

Browse files
authored
[naga] Update docs for private items. (#6218)
Make `cargo doc --document-private-items` work again in Naga. Update some documentation missed by the local const work in #6156.
1 parent 9ff161d commit 64ea7ef

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

naga/src/front/wgsl/lower/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ pub enum ExpressionContextType<'temp, 'out> {
286286
/// We are lowering to an arbitrary runtime expression, to be
287287
/// included in a function's body.
288288
///
289-
/// The given [`RuntimeExpressionContext`] holds information about local
289+
/// The given [`LocalExpressionContext`] holds information about local
290290
/// variables, arguments, and other definitions available only to runtime
291291
/// expressions, not constant or override expressions.
292292
Runtime(LocalExpressionContext<'temp, 'out>),

naga/src/front/wgsl/parse/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,5 +484,5 @@ pub enum LocalDecl<'a> {
484484
#[derive(Debug)]
485485
/// A placeholder for a local variable declaration.
486486
///
487-
/// See [`Function::locals`] for more information.
487+
/// See [`super::ExpressionContext::locals`] for more information.
488488
pub struct Local;

naga/src/front/wgsl/parse/mod.rs

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,20 @@ struct ExpressionContext<'input, 'temp, 'out> {
3131

3232
/// A map from identifiers in scope to the locals/arguments they represent.
3333
///
34-
/// The handles refer to the [`Function::locals`] area; see that field's
34+
/// The handles refer to the [`locals`] arena; see that field's
3535
/// documentation for details.
3636
///
37-
/// [`Function::locals`]: ast::Function::locals
37+
/// [`locals`]: ExpressionContext::locals
3838
local_table: &'temp mut SymbolTable<&'input str, Handle<ast::Local>>,
3939

4040
/// Local variable and function argument arena for the function we're building.
4141
///
42-
/// Note that the `Local` here is actually a zero-sized type. The AST keeps
43-
/// all the detailed information about locals - names, types, etc. - in
44-
/// [`LocalDecl`] statements. For arguments, that information is kept in
45-
/// [`arguments`]. This `Arena`'s only role is to assign a unique `Handle`
46-
/// to each of them, and track their definitions' spans for use in
47-
/// diagnostics.
42+
/// Note that the [`ast::Local`] here is actually a zero-sized type. This
43+
/// `Arena`'s only role is to assign a unique `Handle` to each local
44+
/// identifier, and track its definition's span for use in diagnostics. All
45+
/// the detailed information about locals - names, types, etc. - is kept in
46+
/// the [`LocalDecl`] statements we parsed from their declarations. For
47+
/// arguments, that information is kept in [`arguments`].
4848
///
4949
/// In the AST, when an [`Ident`] expression refers to a local variable or
5050
/// argument, its [`IdentExpr`] holds the referent's `Handle<Local>` in this
@@ -53,14 +53,15 @@ struct ExpressionContext<'input, 'temp, 'out> {
5353
/// During lowering, [`LocalDecl`] statements add entries to a per-function
5454
/// table that maps `Handle<Local>` values to their Naga representations,
5555
/// accessed via [`StatementContext::local_table`] and
56-
/// [`RuntimeExpressionContext::local_table`]. This table is then consulted when
56+
/// [`LocalExpressionContext::local_table`]. This table is then consulted when
5757
/// lowering subsequent [`Ident`] expressions.
5858
///
59-
/// [`LocalDecl`]: StatementKind::LocalDecl
60-
/// [`arguments`]: Function::arguments
61-
/// [`Ident`]: Expression::Ident
62-
/// [`StatementContext::local_table`]: StatementContext::local_table
63-
/// [`RuntimeExpressionContext::local_table`]: RuntimeExpressionContext::local_table
59+
/// [`LocalDecl`]: ast::StatementKind::LocalDecl
60+
/// [`arguments`]: ast::Function::arguments
61+
/// [`Ident`]: ast::Expression::Ident
62+
/// [`IdentExpr`]: ast::IdentExpr
63+
/// [`StatementContext::local_table`]: super::lower::StatementContext::local_table
64+
/// [`LocalExpressionContext::local_table`]: super::lower::LocalExpressionContext::local_table
6465
locals: &'out mut Arena<ast::Local>,
6566

6667
/// Identifiers used by the current global declaration that have no local definition.

0 commit comments

Comments
 (0)