Skip to content

Commit 8de737c

Browse files
committed
---
yaml --- r: 274370 b: refs/heads/stable c: 0f196bc h: refs/heads/master
1 parent 5390f6b commit 8de737c

File tree

97 files changed

+5247
-710
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+5247
-710
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: a7f1d12ae4e0adbabc4c371d9959e4adeb4d75dd
32+
refs/heads/stable: 0f196bcc3b23925854e3d758c03f56c7520e9b99
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/CONTRIBUTING.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ links to the major sections:
66

77
* [Feature Requests](#feature-requests)
88
* [Bug Reports](#bug-reports)
9+
* [The Build System](#the-build-system)
910
* [Pull Requests](#pull-requests)
1011
* [Writing Documentation](#writing-documentation)
1112
* [Issue Triage](#issue-triage)
@@ -77,6 +78,66 @@ to do this is to invoke `rustc` like this:
7778
$ RUST_BACKTRACE=1 rustc ...
7879
```
7980

81+
## The Build System
82+
83+
Rust's build system allows you to bootstrap the compiler, run tests &
84+
benchmarks, generate documentation, install a fresh build of Rust, and more.
85+
It's your best friend when working on Rust, allowing you to compile & test
86+
your contributions before submission.
87+
88+
All the configuration for the build system lives in [the `mk` directory][mkdir]
89+
in the project root. It can be hard to follow in places, as it uses some
90+
advanced Make features which make for some challenging reading. If you have
91+
questions on the build system internals, try asking in
92+
[`#rust-internals`][pound-rust-internals].
93+
94+
[mkdir]: https://github.com/rust-lang/rust/tree/master/mk/
95+
96+
### Configuration
97+
98+
Before you can start building the compiler you need to configure the build for
99+
your system. In most cases, that will just mean using the defaults provided
100+
for Rust. Configuring involves invoking the `configure` script in the project
101+
root.
102+
103+
```
104+
./configure
105+
```
106+
107+
There are large number of options accepted by this script to alter the
108+
configuration used later in the build process. Some options to note:
109+
110+
- `--enable-debug` - Build a debug version of the compiler (disables optimizations)
111+
- `--enable-optimize` - Enable optimizations (can be used with `--enable-debug`
112+
to make a debug build with optimizations)
113+
- `--disable-valgrind-rpass` - Don't run tests with valgrind
114+
- `--enable-clang` - Prefer clang to gcc for building dependencies (e.g., LLVM)
115+
- `--enable-ccache` - Invoke clang/gcc with ccache to re-use object files between builds
116+
- `--enable-compiler-docs` - Build compiler documentation
117+
118+
To see a full list of options, run `./configure --help`.
119+
120+
### Useful Targets
121+
122+
Some common make targets are:
123+
124+
- `make rustc-stage1` - build up to (and including) the first stage. For most
125+
cases we don't need to build the stage2 compiler, so we can save time by not
126+
building it. The stage1 compiler is a fully functioning compiler and
127+
(probably) will be enough to determine if your change works as expected.
128+
- `make check` - build the full compiler & run all tests (takes a while). This
129+
is what gets run by the continuous integration system against your pull
130+
request. You should run this before submitting to make sure your tests pass
131+
& everything builds in the correct manner.
132+
- `make check-stage1-std NO_REBUILD=1` - test the standard library without
133+
rebuilding the entire compiler
134+
- `make check TESTNAME=<path-to-test-file>.rs` - Run a single test file
135+
- `make check-stage1-rpass TESTNAME=<path-to-test-file>.rs` - Run a single
136+
rpass test with the stage1 compiler (this will be quicker than running the
137+
command above as we only build the stage1 compiler, not the entire thing).
138+
You can also leave off the `-rpass` to run all stage1 test types.
139+
- `make check-stage1-coretest` - Run stage1 tests in `libcore`.
140+
80141
## Pull Requests
81142

82143
Pull requests are the primary mechanism we use to change Rust. GitHub itself

branches/stable/configure

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,6 +1409,7 @@ do
14091409
make_dir $h/test/debuginfo-gdb
14101410
make_dir $h/test/debuginfo-lldb
14111411
make_dir $h/test/codegen
1412+
make_dir $h/test/codegen-units
14121413
make_dir $h/test/rustdoc
14131414
done
14141415

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# armv7-unknown-linux-gnueabihf configuration
2+
CROSS_PREFIX_armv7-unknown-linux-gnueabihf=armv7-unknown-linux-gnueabihf-
3+
CC_armv7-unknown-linux-gnueabihf=gcc
4+
CXX_armv7-unknown-linux-gnueabihf=g++
5+
CPP_armv7-unknown-linux-gnueabihf=gcc -E
6+
AR_armv7-unknown-linux-gnueabihf=ar
7+
CFG_LIB_NAME_armv7-unknown-linux-gnueabihf=lib$(1).so
8+
CFG_STATIC_LIB_NAME_armv7-unknown-linux-gnueabihf=lib$(1).a
9+
CFG_LIB_GLOB_armv7-unknown-linux-gnueabihf=lib$(1)-*.so
10+
CFG_LIB_DSYM_GLOB_armv7-unknown-linux-gnueabihf=lib$(1)-*.dylib.dSYM
11+
CFG_JEMALLOC_CFLAGS_armv7-unknown-linux-gnueabihf := -D__arm__ $(CFLAGS)
12+
CFG_GCCISH_CFLAGS_armv7-unknown-linux-gnueabihf := -Wall -g -fPIC -D__arm__ $(CFLAGS)
13+
CFG_GCCISH_CXXFLAGS_armv7-unknown-linux-gnueabihf := -fno-rtti $(CXXFLAGS)
14+
CFG_GCCISH_LINK_FLAGS_armv7-unknown-linux-gnueabihf := -shared -fPIC -g
15+
CFG_GCCISH_DEF_FLAG_armv7-unknown-linux-gnueabihf := -Wl,--export-dynamic,--dynamic-list=
16+
CFG_LLC_FLAGS_armv7-unknown-linux-gnueabihf :=
17+
CFG_INSTALL_NAME_ar,-unknown-linux-gnueabihf =
18+
CFG_EXE_SUFFIX_armv7-unknown-linux-gnueabihf :=
19+
CFG_WINDOWSY_armv7-unknown-linux-gnueabihf :=
20+
CFG_UNIXY_armv7-unknown-linux-gnueabihf := 1
21+
CFG_LDPATH_armv7-unknown-linux-gnueabihf :=
22+
CFG_RUN_armv7-unknown-linux-gnueabihf=$(2)
23+
CFG_RUN_TARG_armv7-unknown-linux-gnueabihf=$(call CFG_RUN_armv7-unknown-linux-gnueabihf,,$(2))
24+
RUSTC_FLAGS_armv7-unknown-linux-gnueabihf := -C target-feature=+v7,+vfp2,+neon
25+
RUSTC_CROSS_FLAGS_armv7-unknown-linux-gnueabihf :=
26+
CFG_GNU_TRIPLE_armv7-unknown-linux-gnueabihf := armv7-unknown-linux-gnueabihf

branches/stable/mk/cfg/armv7s-apple-ios.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ CFG_LIB_GLOB_armv7s-apple-ios = lib$(1)-*.a
1414
CFG_INSTALL_ONLY_RLIB_armv7s-apple-ios = 1
1515
CFG_STATIC_LIB_NAME_armv7s-apple-ios=lib$(1).a
1616
CFG_LIB_DSYM_GLOB_armv7s-apple-ios = lib$(1)-*.a.dSYM
17-
CFG_JEMALLOC_CFLAGS_armv7s-apple-ios := -arch armv7s -mfpu=vfp4 $(CFG_IOS_SDK_FLAGS_armv7s-apple-ios)
18-
CFG_GCCISH_CFLAGS_armv7s-apple-ios := -Wall -Werror -g -fPIC $(CFG_IOS_SDK_FLAGS_armv7s-apple-ios) -mfpu=vfp4 -arch armv7s
17+
CFG_JEMALLOC_CFLAGS_armv7s-apple-ios := -arch armv7s $(CFG_IOS_SDK_FLAGS_armv7s-apple-ios)
18+
CFG_GCCISH_CFLAGS_armv7s-apple-ios := -Wall -Werror -g -fPIC $(CFG_IOS_SDK_FLAGS_armv7s-apple-ios) -arch armv7s
1919
CFG_GCCISH_CXXFLAGS_armv7s-apple-ios := -fno-rtti $(CFG_IOS_SDK_FLAGS_armv7s-apple-ios) -I$(CFG_IOS_SDK_armv7s-apple-ios)/usr/include/c++/4.2.1
2020
CFG_GCCISH_LINK_FLAGS_armv7s-apple-ios := -lpthread -syslibroot $(CFG_IOS_SDK_armv7s-apple-ios) -Wl,-no_compact_unwind
2121
CFG_GCCISH_DEF_FLAG_armv7s-apple-ios := -Wl,-exported_symbols_list,

branches/stable/mk/cfg/powerpc64-unknown-linux-gnu.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# powerpc64-unknown-linux-gnu configuration
2-
CROSS_PREFIX_powerpc64-unknown-linux-gnu=powerpc64-linux-gnu-
2+
CROSS_PREFIX_powerpc64-unknown-linux-gnu=powerpc-linux-gnu-
33
CC_powerpc64-unknown-linux-gnu=$(CC)
44
CXX_powerpc64-unknown-linux-gnu=$(CXX)
55
CPP_powerpc64-unknown-linux-gnu=$(CPP)

branches/stable/mk/tests.mk

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
310310
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-gdb-exec \
311311
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-lldb-exec \
312312
check-stage$(1)-T-$(2)-H-$(3)-codegen-exec \
313+
check-stage$(1)-T-$(2)-H-$(3)-codegen-units-exec \
313314
check-stage$(1)-T-$(2)-H-$(3)-doc-exec \
314315
check-stage$(1)-T-$(2)-H-$(3)-pretty-exec
315316

@@ -473,6 +474,7 @@ DEBUGINFO_GDB_RS := $(wildcard $(S)src/test/debuginfo/*.rs)
473474
DEBUGINFO_LLDB_RS := $(wildcard $(S)src/test/debuginfo/*.rs)
474475
CODEGEN_RS := $(wildcard $(S)src/test/codegen/*.rs)
475476
CODEGEN_CC := $(wildcard $(S)src/test/codegen/*.cc)
477+
CODEGEN_UNITS_RS := $(wildcard $(S)src/test/codegen-units/*.rs)
476478
RUSTDOCCK_RS := $(wildcard $(S)src/test/rustdoc/*.rs)
477479

478480
RPASS_TESTS := $(RPASS_RS)
@@ -488,6 +490,7 @@ PRETTY_TESTS := $(PRETTY_RS)
488490
DEBUGINFO_GDB_TESTS := $(DEBUGINFO_GDB_RS)
489491
DEBUGINFO_LLDB_TESTS := $(DEBUGINFO_LLDB_RS)
490492
CODEGEN_TESTS := $(CODEGEN_RS) $(CODEGEN_CC)
493+
CODEGEN_UNITS_TESTS := $(CODEGEN_UNITS_RS)
491494
RUSTDOCCK_TESTS := $(RUSTDOCCK_RS)
492495

493496
CTEST_SRC_BASE_rpass = run-pass
@@ -550,6 +553,11 @@ CTEST_BUILD_BASE_codegen = codegen
550553
CTEST_MODE_codegen = codegen
551554
CTEST_RUNTOOL_codegen = $(CTEST_RUNTOOL)
552555

556+
CTEST_SRC_BASE_codegen-units = codegen-units
557+
CTEST_BUILD_BASE_codegen-units = codegen-units
558+
CTEST_MODE_codegen-units = codegen-units
559+
CTEST_RUNTOOL_codegen-units = $(CTEST_RUNTOOL)
560+
553561
CTEST_SRC_BASE_rustdocck = rustdoc
554562
CTEST_BUILD_BASE_rustdocck = rustdoc
555563
CTEST_MODE_rustdocck = rustdoc
@@ -673,6 +681,7 @@ CTEST_DEPS_debuginfo-lldb_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_LLDB_TESTS) \
673681
$(S)src/etc/lldb_batchmode.py \
674682
$(S)src/etc/lldb_rust_formatters.py
675683
CTEST_DEPS_codegen_$(1)-T-$(2)-H-$(3) = $$(CODEGEN_TESTS)
684+
CTEST_DEPS_codegen-units_$(1)-T-$(2)-H-$(3) = $$(CODEGEN_UNITS_TESTS)
676685
CTEST_DEPS_rustdocck_$(1)-T-$(2)-H-$(3) = $$(RUSTDOCCK_TESTS) \
677686
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
678687
$(S)src/etc/htmldocck.py
@@ -739,7 +748,7 @@ endif
739748
endef
740749

741750
CTEST_NAMES = rpass rpass-valgrind rpass-full rfail-full cfail-full rfail cfail pfail \
742-
bench debuginfo-gdb debuginfo-lldb codegen rustdocck
751+
bench debuginfo-gdb debuginfo-lldb codegen codegen-units rustdocck
743752

744753
$(foreach host,$(CFG_HOST), \
745754
$(eval $(foreach target,$(CFG_TARGET), \
@@ -917,6 +926,7 @@ TEST_GROUPS = \
917926
debuginfo-gdb \
918927
debuginfo-lldb \
919928
codegen \
929+
codegen-units \
920930
doc \
921931
$(foreach docname,$(DOC_NAMES),doc-$(docname)) \
922932
pretty \

branches/stable/src/compiletest/common.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ pub enum Mode {
2525
DebugInfoLldb,
2626
Codegen,
2727
Rustdoc,
28+
CodegenUnits
2829
}
2930

3031
impl FromStr for Mode {
@@ -41,6 +42,7 @@ impl FromStr for Mode {
4142
"debuginfo-gdb" => Ok(DebugInfoGdb),
4243
"codegen" => Ok(Codegen),
4344
"rustdoc" => Ok(Rustdoc),
45+
"codegen-units" => Ok(CodegenUnits),
4446
_ => Err(()),
4547
}
4648
}
@@ -59,6 +61,7 @@ impl fmt::Display for Mode {
5961
DebugInfoLldb => "debuginfo-lldb",
6062
Codegen => "codegen",
6163
Rustdoc => "rustdoc",
64+
CodegenUnits => "codegen-units",
6265
}, f)
6366
}
6467
}

branches/stable/src/compiletest/runtest.rs

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010

1111
use common::Config;
1212
use common::{CompileFail, ParseFail, Pretty, RunFail, RunPass, RunPassValgrind};
13-
use common::{Codegen, DebugInfoLldb, DebugInfoGdb, Rustdoc};
13+
use common::{Codegen, DebugInfoLldb, DebugInfoGdb, Rustdoc, CodegenUnits};
1414
use errors;
1515
use header::TestProps;
1616
use header;
1717
use procsrv;
1818
use util::logv;
1919

2020
use std::env;
21+
use std::collections::HashSet;
2122
use std::fmt;
2223
use std::fs::{self, File};
2324
use std::io::BufReader;
@@ -56,6 +57,7 @@ pub fn run(config: Config, testfile: &Path) {
5657
DebugInfoLldb => run_debuginfo_lldb_test(&config, &props, &testfile),
5758
Codegen => run_codegen_test(&config, &props, &testfile),
5859
Rustdoc => run_rustdoc_test(&config, &props, &testfile),
60+
CodegenUnits => run_codegen_units_test(&config, &props, &testfile),
5961
}
6062
}
6163

@@ -1747,3 +1749,44 @@ fn run_rustdoc_test(config: &Config, props: &TestProps, testfile: &Path) {
17471749
fatal_proc_rec("htmldocck failed!", &res);
17481750
}
17491751
}
1752+
1753+
fn run_codegen_units_test(config: &Config, props: &TestProps, testfile: &Path) {
1754+
let proc_res = compile_test(config, props, testfile);
1755+
1756+
if !proc_res.status.success() {
1757+
fatal_proc_rec("compilation failed!", &proc_res);
1758+
}
1759+
1760+
check_no_compiler_crash(&proc_res);
1761+
1762+
let prefix = "TRANS_ITEM ";
1763+
1764+
let actual: HashSet<String> = proc_res
1765+
.stdout
1766+
.lines()
1767+
.filter(|line| line.starts_with(prefix))
1768+
.map(|s| (&s[prefix.len()..]).to_string())
1769+
.collect();
1770+
1771+
let expected: HashSet<String> = errors::load_errors(testfile)
1772+
.iter()
1773+
.map(|e| e.msg.trim().to_string())
1774+
.collect();
1775+
1776+
if actual != expected {
1777+
let mut missing: Vec<_> = expected.difference(&actual).collect();
1778+
missing.sort();
1779+
1780+
let mut too_much: Vec<_> = actual.difference(&expected).collect();
1781+
too_much.sort();
1782+
1783+
println!("Expected and actual sets of codegen-items differ.\n\
1784+
These items should have been contained but were not:\n\n\
1785+
{}\n\n\
1786+
These items were contained but should not have been:\n\n\
1787+
{}\n\n",
1788+
missing.iter().fold("".to_string(), |s1, s2| s1 + "\n" + s2),
1789+
too_much.iter().fold("".to_string(), |s1, s2| s1 + "\n" + s2));
1790+
panic!();
1791+
}
1792+
}

branches/stable/src/doc/book/crates-and-modules.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -567,10 +567,11 @@ to it as "sayings". Similarly, the first `use` statement pulls in the
567567
`ja_greetings` as opposed to simply `greetings`. This can help to avoid
568568
ambiguity when importing similarly-named items from different places.
569569
570-
The second `use` statement uses a star glob to bring in _all_ symbols from the
571-
`sayings::japanese::farewells` module. As you can see we can later refer to
570+
The second `use` statement uses a star glob to bring in all public symbols from
571+
the `sayings::japanese::farewells` module. As you can see we can later refer to
572572
the Japanese `goodbye` function with no module qualifiers. This kind of glob
573-
should be used sparingly.
573+
should be used sparingly. It’s worth noting that it only imports the public
574+
symbols, even if the code doing the globbing is in the same module.
574575
575576
The third `use` statement bears more explanation. It's using "brace expansion"
576577
globbing to compress three `use` statements into one (this sort of syntax

branches/stable/src/doc/book/macros.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -478,9 +478,9 @@ which syntactic form it matches.
478478

479479
There are additional rules regarding the next token after a metavariable:
480480

481-
* `expr` variables may only be followed by one of: `=> , ;`
482-
* `ty` and `path` variables may only be followed by one of: `=> , : = > as`
483-
* `pat` variables may only be followed by one of: `=> , = if in`
481+
* `expr` and `stmt` variables may only be followed by one of: `=> , ;`
482+
* `ty` and `path` variables may only be followed by one of: `=> , = | ; : > [ { as where`
483+
* `pat` variables may only be followed by one of: `=> , = | if in`
484484
* Other variables may be followed by any token.
485485

486486
These rules provide some flexibility for Rust’s syntax to evolve without

branches/stable/src/doc/book/syntax-index.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Keywords
44

5-
* `as`: primitive casting. See [Casting Between Types (`as`)].
5+
* `as`: primitive casting, or disambiguating the specific trait containing an item. See [Casting Between Types (`as`)], [Universal Function Call Syntax (Angle-bracket Form)], [Associated Types].
66
* `break`: break out of loop. See [Loops (Ending Iteration Early)].
77
* `const`: constant items and constant raw pointers. See [`const` and `static`], [Raw Pointers].
88
* `continue`: continue to next loop iteration. See [Loops (Ending Iteration Early)].
@@ -115,8 +115,11 @@
115115
* `::path`: path relative to the crate root (*i.e.* an explicitly absolute path). See [Crates and Modules (Re-exporting with `pub use`)].
116116
* `self::path`: path relative to the current module (*i.e.* an explicitly relative path). See [Crates and Modules (Re-exporting with `pub use`)].
117117
* `super::path`: path relative to the parent of the current module. See [Crates and Modules (Re-exporting with `pub use`)].
118-
* `type::ident`: associated constants, functions, and types. See [Associated Types].
118+
* `type::ident`, `<type as trait>::ident`: associated constants, functions, and types. See [Associated Types].
119119
* `<type>::…`: associated item for a type which cannot be directly named (*e.g.* `<&T>::…`, `<[T]>::…`, *etc.*). See [Associated Types].
120+
* `trait::method(…)`: disambiguating a method call by naming the trait which defines it. See [Universal Function Call Syntax].
121+
* `type::method(…)`: disambiguating a method call by naming the type for which it's defined. See [Universal Function Call Syntax].
122+
* `<type as trait>::method(…)`: disambiguating a method call by naming the trait _and_ type. See [Universal Function Call Syntax (Angle-bracket Form)].
120123

121124
<!-- Generics -->
122125

@@ -132,7 +135,8 @@
132135
<!-- Constraints -->
133136

134137
* `T: U`: generic parameter `T` constrained to types that implement `U`. See [Traits].
135-
* `T: 'a`: generic type `T` must outlive lifetime `'a`.
138+
* `T: 'a`: generic type `T` must outlive lifetime `'a`. When we say that a type 'outlives' the lifetime, we mean that it cannot transitively contain any references with lifetimes shorter than `'a`.
139+
* `T : 'static`: The generic type `T` contains no borrowed references other than `'static` ones.
136140
* `'b: 'a`: generic lifetime `'b` must outlive lifetime `'a`.
137141
* `T: ?Sized`: allow generic type parameter to be a dynamically-sized type. See [Unsized Types (`?Sized`)].
138142
* `'a + trait`, `trait + trait`: compound type constraint. See [Traits (Multiple Trait Bounds)].
@@ -234,6 +238,8 @@
234238
[Traits (`where` clause)]: traits.html#where-clause
235239
[Traits (Multiple Trait Bounds)]: traits.html#multiple-trait-bounds
236240
[Traits]: traits.html
241+
[Universal Function Call Syntax]: ufcs.html
242+
[Universal Function Call Syntax (Angle-bracket Form)]: ufcs.html#angle-bracket-form
237243
[Unsafe]: unsafe.html
238244
[Unsized Types (`?Sized`)]: unsized-types.html#sized
239245
[Variable Bindings]: variable-bindings.html

branches/stable/src/doc/reference.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ comments (`/** ... */`), are interpreted as a special syntax for `doc`
104104
`#[doc="..."]` around the body of the comment, i.e., `/// Foo` turns into
105105
`#[doc="Foo"]`.
106106

107-
Line comments beginning with `//!` and block comments `/*! ... !*/` are
107+
Line comments beginning with `//!` and block comments `/*! ... */` are
108108
doc comments that apply to the parent of the comment, rather than the item
109109
that follows. That is, they are equivalent to writing `#![doc="..."]` around
110110
the body of the comment. `//!` comments are usually used to document
@@ -2095,7 +2095,7 @@ along with their default settings. [Compiler
20952095
plugins](book/compiler-plugins.html#lint-plugins) can provide additional lint checks.
20962096

20972097
```{.ignore}
2098-
mod m1 {
2098+
pub mod m1 {
20992099
// Missing documentation is ignored here
21002100
#[allow(missing_docs)]
21012101
pub fn undocumented_one() -> i32 { 1 }
@@ -2115,9 +2115,9 @@ check on and off:
21152115

21162116
```{.ignore}
21172117
#[warn(missing_docs)]
2118-
mod m2{
2118+
pub mod m2{
21192119
#[allow(missing_docs)]
2120-
mod nested {
2120+
pub mod nested {
21212121
// Missing documentation is ignored here
21222122
pub fn undocumented_one() -> i32 { 1 }
21232123
@@ -2137,7 +2137,7 @@ that lint check:
21372137

21382138
```{.ignore}
21392139
#[forbid(missing_docs)]
2140-
mod m3 {
2140+
pub mod m3 {
21412141
// Attempting to toggle warning signals an error here
21422142
#[allow(missing_docs)]
21432143
/// Returns 2.

0 commit comments

Comments
 (0)