Skip to content

Commit 0d8738f

Browse files
committed
auto merge of #16565 : kaseyc/rust/documentation_fixes, r=pcwalton
Corrected the sample rustdoc command to use --output instead of --output-dir and fixed markdown formatting in debuginfo.rs.
2 parents 776c17f + 61b9036 commit 0d8738f

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

src/doc/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ for the 'std' and 'extra' libraries.
1919
To generate HTML documentation from one source file/crate, do something like:
2020

2121
~~~~
22-
rustdoc --output-dir html-doc/ --output-format html ../src/libstd/path.rs
22+
rustdoc --output html-doc/ --output-format html ../src/libstd/path.rs
2323
~~~~
2424

2525
(This, of course, requires a working build of the `rustdoc` tool.)

src/librustc/middle/trans/debuginfo.rs

+19-14
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,13 @@ This file consists of three conceptual sections:
5353
3. Minor utility functions
5454
5555
56-
## Recursive Types Some kinds of types, such as structs and enums can be
57-
recursive. That means that the type definition of some type X refers to some
58-
other type which in turn (transitively) refers to X. This introduces cycles into
59-
the type referral graph. A naive algorithm doing an on-demand, depth-first
60-
traversal of this graph when describing types, can get trapped in an endless
61-
loop when it reaches such a cycle.
56+
## Recursive Types
57+
58+
Some kinds of types, such as structs and enums can be recursive. That means that
59+
the type definition of some type X refers to some other type which in turn (transitively)
60+
refers to X. This introduces cycles into the type referral graph. A naive algorithm doing
61+
an on-demand, depth-first traversal of this graph when describing types, can get trapped
62+
in an endless loop when it reaches such a cycle.
6263
6364
For example, the following simple type for a singly-linked list...
6465
@@ -96,10 +97,12 @@ traversal at the type members after the type has been registered with the cache.
9697
the future)
9798
9899
99-
## Source Locations and Line Information In addition to data type descriptions
100-
the debugging information must also allow to map machine code locations back to
101-
source code locations in order to be useful. This functionality is also handled
102-
in this module. The following functions allow to control source mappings:
100+
## Source Locations and Line Information
101+
102+
In addition to data type descriptions the debugging information must also allow
103+
to map machine code locations back to source code locations in order to be useful.
104+
This functionality is also handled in this module. The following functions allow
105+
to control source mappings:
103106
104107
+ set_source_location()
105108
+ clear_source_location()
@@ -139,10 +142,12 @@ of the prologue, however, they are ignored by LLVM's prologue detection. The
139142
source location emission is still disabled, so there is no need to do anything
140143
special with source location handling here.
141144
142-
## Unique Type Identification In order for link-time optimization to work
143-
properly, LLVM needs a unique type identifier that tells it across compilation
144-
units which types are the same as others. This type identifier is created by
145-
TypeMap::get_unique_type_id_of_type() using the following algorithm:
145+
## Unique Type Identification
146+
147+
In order for link-time optimization to work properly, LLVM needs a unique type
148+
identifier that tells it across compilation units which types are the same as
149+
others. This type identifier is created by TypeMap::get_unique_type_id_of_type()
150+
using the following algorithm:
146151
147152
(1) Primitive types have their name as ID
148153
(2) Structs, enums and traits have a multipart identifier

0 commit comments

Comments
 (0)