Skip to content
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

Fix for #31267 and additional zero-width constant bug #31291

Closed
wants to merge 46 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
b2c93d8
Update expression span when transcribing macro args
fhahn Jan 21, 2016
4ac233f
Update tests
fhahn Jan 23, 2016
ce7492d
Set span for interpolated tokens correctly
fhahn Jan 23, 2016
710dda8
Use interpolated token span when building spans for bigger expressions
fhahn Jan 24, 2016
caa9ad5
Add interpolated_or_expr_span macro and pass lo to newly added parse_…
fhahn Jan 26, 2016
37a69e0
Push try! to call site of interpolated_or_expr_span!
fhahn Jan 26, 2016
13b7a0c
Turn interpolated_or_expr_span into a function
fhahn Jan 27, 2016
8fc43d5
Avoid storing interolated token in Parser.last_token
fhahn Jan 27, 2016
dc2b72b
Add NOTE test annotations
fhahn Jan 27, 2016
65c8105
collections: Hash VecDeque in its slice parts
bluss Jan 26, 2016
25a93d8
Improve syntax-index entry for lifetime bounds
Manishearth Jan 4, 2016
351e59a
Added info on the build system to contributing guide
gchp Jan 25, 2016
6760e2b
Updated to reflect comments from review
gchp Jan 26, 2016
d4dcfa6
Re-worded intro paragraph to be more positive
gchp Jan 26, 2016
196ebc4
Fix examples that use missing_docs lint
mbrubeck Jan 26, 2016
7c72c03
book: cover UFCS in Syntax Index
durka Jan 26, 2016
56981c3
capitalization and associated types
durka Jan 26, 2016
6db8cb4
Mention that globs import public symbols
steveklabnik Jan 26, 2016
a5a94c7
Add size hints for BTreeSet iterators
mbrubeck Jan 26, 2016
1264e7c
trpl: fix macro follow sets
durka Jan 27, 2016
0da67f6
Add section about memory safety to `ffi::CString` documentation
dirk Jan 24, 2016
deeaa6b
Fix formatting in documentation of `ffi::CString`
dirk Jan 27, 2016
1e6efb1
doc: insert missing chars
tshepang Jan 27, 2016
eda6b42
Fix checking if there have been new errors.
tmiasko Jan 28, 2016
29fd7ac
Implement MultiSpan error reporting
mitaa Dec 13, 2015
31f057a
Add dependency tracking to trait cache in translation context
michaelwoerister Jan 21, 2016
e6d2a7a
Implement the translation item collector.
michaelwoerister Nov 2, 2015
abca698
Add caching of external MIR in trans::collector
michaelwoerister Jan 26, 2016
0e7d05d
Avoid redundant work for drop-glue translation items in trans::collector
michaelwoerister Jan 26, 2016
8d5b4e1
Add support for armv7 toolchains
fabricedesre Jan 28, 2016
806e5ff
Scaffold internals docs & add initial overview
gchp Jan 15, 2016
a18d6c0
Integrate overview section with existing docs
gchp Jan 24, 2016
3de4e75
Resolve: stop requiring that use declarations precede statements in b…
jseyfried Jan 23, 2016
f9cf64c
Resolve: Fix an ICE that occurs when an identifier refers to an indet…
jseyfried Jan 26, 2016
e959665
Add test for #31212
jseyfried Jan 26, 2016
5079454
Refactor away NameSearchType
jseyfried Jan 26, 2016
4ce71ed
mk: Remove the -mfpu=vfp4 argument from arm iOS
alexcrichton Jan 28, 2016
af28a66
don't leak RUST_BACKTRACE into test process
oli-obk Jan 28, 2016
e7ea801
Fix reference info about parent doc block comments
est31 Jan 28, 2016
5acc2c4
rustdoc: Add missing trailing comma for single element tuples
ollie27 Jan 28, 2016
639957f
rustdoc: Add test for tuple rendering
ollie27 Jan 28, 2016
2526dfe
std::string::String.from_utf16 doc fix
Jan 28, 2016
b98194d
std: Fix rumprun build
alexcrichton Jan 29, 2016
f3eecbb
mk: Fix cross prefix for powerpc64
alexcrichton Jan 29, 2016
fdded1c
Avoid ICE if environment variable is not set
ruuda Jan 27, 2016
c6636d2
Fix for #31267 - associated const related ICE.
sdleffler Jan 29, 2016
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
61 changes: 61 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ links to the major sections:

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

## The Build System

Rust's build system allows you to bootstrap the compiler, run tests &
benchmarks, generate documentation, install a fresh build of Rust, and more.
It's your best friend when working on Rust, allowing you to compile & test
your contributions before submission.

All the configuration for the build system lives in [the `mk` directory][mkdir]
in the project root. It can be hard to follow in places, as it uses some
advanced Make features which make for some challenging reading. If you have
questions on the build system internals, try asking in
[`#rust-internals`][pound-rust-internals].

[mkdir]: https://github.com/rust-lang/rust/tree/master/mk/

### Configuration

Before you can start building the compiler you need to configure the build for
your system. In most cases, that will just mean using the defaults provided
for Rust. Configuring involves invoking the `configure` script in the project
root.

```
./configure
```

There are large number of options accepted by this script to alter the
configuration used later in the build process. Some options to note:

- `--enable-debug` - Build a debug version of the compiler (disables optimizations)
- `--enable-optimize` - Enable optimizations (can be used with `--enable-debug`
to make a debug build with optimizations)
- `--disable-valgrind-rpass` - Don't run tests with valgrind
- `--enable-clang` - Prefer clang to gcc for building dependencies (e.g., LLVM)
- `--enable-ccache` - Invoke clang/gcc with ccache to re-use object files between builds
- `--enable-compiler-docs` - Build compiler documentation

To see a full list of options, run `./configure --help`.

### Useful Targets

Some common make targets are:

- `make rustc-stage1` - build up to (and including) the first stage. For most
cases we don't need to build the stage2 compiler, so we can save time by not
building it. The stage1 compiler is a fully functioning compiler and
(probably) will be enough to determine if your change works as expected.
- `make check` - build the full compiler & run all tests (takes a while). This
is what gets run by the continuous integration system against your pull
request. You should run this before submitting to make sure your tests pass
& everything builds in the correct manner.
- `make check-stage1-std NO_REBUILD=1` - test the standard library without
rebuilding the entire compiler
- `make check TESTNAME=<path-to-test-file>.rs` - Run a single test file
- `make check-stage1-rpass TESTNAME=<path-to-test-file>.rs` - Run a single
rpass test with the stage1 compiler (this will be quicker than running the
command above as we only build the stage1 compiler, not the entire thing).
You can also leave off the `-rpass` to run all stage1 test types.
- `make check-stage1-coretest` - Run stage1 tests in `libcore`.

## Pull Requests

Pull requests are the primary mechanism we use to change Rust. GitHub itself
Expand Down
1 change: 1 addition & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -1409,6 +1409,7 @@ do
make_dir $h/test/debuginfo-gdb
make_dir $h/test/debuginfo-lldb
make_dir $h/test/codegen
make_dir $h/test/codegen-units
make_dir $h/test/rustdoc
done

Expand Down
26 changes: 26 additions & 0 deletions mk/cfg/armv7-unknown-linux-gnueabihf.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# armv7-unknown-linux-gnueabihf configuration
CROSS_PREFIX_armv7-unknown-linux-gnueabihf=armv7-unknown-linux-gnueabihf-
CC_armv7-unknown-linux-gnueabihf=gcc
CXX_armv7-unknown-linux-gnueabihf=g++
CPP_armv7-unknown-linux-gnueabihf=gcc -E
AR_armv7-unknown-linux-gnueabihf=ar
CFG_LIB_NAME_armv7-unknown-linux-gnueabihf=lib$(1).so
CFG_STATIC_LIB_NAME_armv7-unknown-linux-gnueabihf=lib$(1).a
CFG_LIB_GLOB_armv7-unknown-linux-gnueabihf=lib$(1)-*.so
CFG_LIB_DSYM_GLOB_armv7-unknown-linux-gnueabihf=lib$(1)-*.dylib.dSYM
CFG_JEMALLOC_CFLAGS_armv7-unknown-linux-gnueabihf := -D__arm__ $(CFLAGS)
CFG_GCCISH_CFLAGS_armv7-unknown-linux-gnueabihf := -Wall -g -fPIC -D__arm__ $(CFLAGS)
CFG_GCCISH_CXXFLAGS_armv7-unknown-linux-gnueabihf := -fno-rtti $(CXXFLAGS)
CFG_GCCISH_LINK_FLAGS_armv7-unknown-linux-gnueabihf := -shared -fPIC -g
CFG_GCCISH_DEF_FLAG_armv7-unknown-linux-gnueabihf := -Wl,--export-dynamic,--dynamic-list=
CFG_LLC_FLAGS_armv7-unknown-linux-gnueabihf :=
CFG_INSTALL_NAME_ar,-unknown-linux-gnueabihf =
CFG_EXE_SUFFIX_armv7-unknown-linux-gnueabihf :=
CFG_WINDOWSY_armv7-unknown-linux-gnueabihf :=
CFG_UNIXY_armv7-unknown-linux-gnueabihf := 1
CFG_LDPATH_armv7-unknown-linux-gnueabihf :=
CFG_RUN_armv7-unknown-linux-gnueabihf=$(2)
CFG_RUN_TARG_armv7-unknown-linux-gnueabihf=$(call CFG_RUN_armv7-unknown-linux-gnueabihf,,$(2))
RUSTC_FLAGS_armv7-unknown-linux-gnueabihf := -C target-feature=+v7,+vfp2,+neon
RUSTC_CROSS_FLAGS_armv7-unknown-linux-gnueabihf :=
CFG_GNU_TRIPLE_armv7-unknown-linux-gnueabihf := armv7-unknown-linux-gnueabihf
4 changes: 2 additions & 2 deletions mk/cfg/armv7s-apple-ios.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ CFG_LIB_GLOB_armv7s-apple-ios = lib$(1)-*.a
CFG_INSTALL_ONLY_RLIB_armv7s-apple-ios = 1
CFG_STATIC_LIB_NAME_armv7s-apple-ios=lib$(1).a
CFG_LIB_DSYM_GLOB_armv7s-apple-ios = lib$(1)-*.a.dSYM
CFG_JEMALLOC_CFLAGS_armv7s-apple-ios := -arch armv7s -mfpu=vfp4 $(CFG_IOS_SDK_FLAGS_armv7s-apple-ios)
CFG_GCCISH_CFLAGS_armv7s-apple-ios := -Wall -Werror -g -fPIC $(CFG_IOS_SDK_FLAGS_armv7s-apple-ios) -mfpu=vfp4 -arch armv7s
CFG_JEMALLOC_CFLAGS_armv7s-apple-ios := -arch armv7s $(CFG_IOS_SDK_FLAGS_armv7s-apple-ios)
CFG_GCCISH_CFLAGS_armv7s-apple-ios := -Wall -Werror -g -fPIC $(CFG_IOS_SDK_FLAGS_armv7s-apple-ios) -arch armv7s
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
CFG_GCCISH_LINK_FLAGS_armv7s-apple-ios := -lpthread -syslibroot $(CFG_IOS_SDK_armv7s-apple-ios) -Wl,-no_compact_unwind
CFG_GCCISH_DEF_FLAG_armv7s-apple-ios := -Wl,-exported_symbols_list,
Expand Down
2 changes: 1 addition & 1 deletion mk/cfg/powerpc64-unknown-linux-gnu.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# powerpc64-unknown-linux-gnu configuration
CROSS_PREFIX_powerpc64-unknown-linux-gnu=powerpc64-linux-gnu-
CROSS_PREFIX_powerpc64-unknown-linux-gnu=powerpc-linux-gnu-
CC_powerpc64-unknown-linux-gnu=$(CC)
CXX_powerpc64-unknown-linux-gnu=$(CXX)
CPP_powerpc64-unknown-linux-gnu=$(CPP)
Expand Down
12 changes: 11 additions & 1 deletion mk/tests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-gdb-exec \
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-lldb-exec \
check-stage$(1)-T-$(2)-H-$(3)-codegen-exec \
check-stage$(1)-T-$(2)-H-$(3)-codegen-units-exec \
check-stage$(1)-T-$(2)-H-$(3)-doc-exec \
check-stage$(1)-T-$(2)-H-$(3)-pretty-exec

Expand Down Expand Up @@ -473,6 +474,7 @@ DEBUGINFO_GDB_RS := $(wildcard $(S)src/test/debuginfo/*.rs)
DEBUGINFO_LLDB_RS := $(wildcard $(S)src/test/debuginfo/*.rs)
CODEGEN_RS := $(wildcard $(S)src/test/codegen/*.rs)
CODEGEN_CC := $(wildcard $(S)src/test/codegen/*.cc)
CODEGEN_UNITS_RS := $(wildcard $(S)src/test/codegen-units/*.rs)
RUSTDOCCK_RS := $(wildcard $(S)src/test/rustdoc/*.rs)

RPASS_TESTS := $(RPASS_RS)
Expand All @@ -488,6 +490,7 @@ PRETTY_TESTS := $(PRETTY_RS)
DEBUGINFO_GDB_TESTS := $(DEBUGINFO_GDB_RS)
DEBUGINFO_LLDB_TESTS := $(DEBUGINFO_LLDB_RS)
CODEGEN_TESTS := $(CODEGEN_RS) $(CODEGEN_CC)
CODEGEN_UNITS_TESTS := $(CODEGEN_UNITS_RS)
RUSTDOCCK_TESTS := $(RUSTDOCCK_RS)

CTEST_SRC_BASE_rpass = run-pass
Expand Down Expand Up @@ -550,6 +553,11 @@ CTEST_BUILD_BASE_codegen = codegen
CTEST_MODE_codegen = codegen
CTEST_RUNTOOL_codegen = $(CTEST_RUNTOOL)

CTEST_SRC_BASE_codegen-units = codegen-units
CTEST_BUILD_BASE_codegen-units = codegen-units
CTEST_MODE_codegen-units = codegen-units
CTEST_RUNTOOL_codegen-units = $(CTEST_RUNTOOL)

CTEST_SRC_BASE_rustdocck = rustdoc
CTEST_BUILD_BASE_rustdocck = rustdoc
CTEST_MODE_rustdocck = rustdoc
Expand Down Expand Up @@ -673,6 +681,7 @@ CTEST_DEPS_debuginfo-lldb_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_LLDB_TESTS) \
$(S)src/etc/lldb_batchmode.py \
$(S)src/etc/lldb_rust_formatters.py
CTEST_DEPS_codegen_$(1)-T-$(2)-H-$(3) = $$(CODEGEN_TESTS)
CTEST_DEPS_codegen-units_$(1)-T-$(2)-H-$(3) = $$(CODEGEN_UNITS_TESTS)
CTEST_DEPS_rustdocck_$(1)-T-$(2)-H-$(3) = $$(RUSTDOCCK_TESTS) \
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
$(S)src/etc/htmldocck.py
Expand Down Expand Up @@ -739,7 +748,7 @@ endif
endef

CTEST_NAMES = rpass rpass-valgrind rpass-full rfail-full cfail-full rfail cfail pfail \
bench debuginfo-gdb debuginfo-lldb codegen rustdocck
bench debuginfo-gdb debuginfo-lldb codegen codegen-units rustdocck

$(foreach host,$(CFG_HOST), \
$(eval $(foreach target,$(CFG_TARGET), \
Expand Down Expand Up @@ -917,6 +926,7 @@ TEST_GROUPS = \
debuginfo-gdb \
debuginfo-lldb \
codegen \
codegen-units \
doc \
$(foreach docname,$(DOC_NAMES),doc-$(docname)) \
pretty \
Expand Down
3 changes: 3 additions & 0 deletions src/compiletest/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pub enum Mode {
DebugInfoLldb,
Codegen,
Rustdoc,
CodegenUnits
}

impl FromStr for Mode {
Expand All @@ -41,6 +42,7 @@ impl FromStr for Mode {
"debuginfo-gdb" => Ok(DebugInfoGdb),
"codegen" => Ok(Codegen),
"rustdoc" => Ok(Rustdoc),
"codegen-units" => Ok(CodegenUnits),
_ => Err(()),
}
}
Expand All @@ -59,6 +61,7 @@ impl fmt::Display for Mode {
DebugInfoLldb => "debuginfo-lldb",
Codegen => "codegen",
Rustdoc => "rustdoc",
CodegenUnits => "codegen-units",
}, f)
}
}
Expand Down
45 changes: 44 additions & 1 deletion src/compiletest/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@

use common::Config;
use common::{CompileFail, ParseFail, Pretty, RunFail, RunPass, RunPassValgrind};
use common::{Codegen, DebugInfoLldb, DebugInfoGdb, Rustdoc};
use common::{Codegen, DebugInfoLldb, DebugInfoGdb, Rustdoc, CodegenUnits};
use errors;
use header::TestProps;
use header;
use procsrv;
use util::logv;

use std::env;
use std::collections::HashSet;
use std::fmt;
use std::fs::{self, File};
use std::io::BufReader;
Expand Down Expand Up @@ -56,6 +57,7 @@ pub fn run(config: Config, testfile: &Path) {
DebugInfoLldb => run_debuginfo_lldb_test(&config, &props, &testfile),
Codegen => run_codegen_test(&config, &props, &testfile),
Rustdoc => run_rustdoc_test(&config, &props, &testfile),
CodegenUnits => run_codegen_units_test(&config, &props, &testfile),
}
}

Expand Down Expand Up @@ -1747,3 +1749,44 @@ fn run_rustdoc_test(config: &Config, props: &TestProps, testfile: &Path) {
fatal_proc_rec("htmldocck failed!", &res);
}
}

fn run_codegen_units_test(config: &Config, props: &TestProps, testfile: &Path) {
let proc_res = compile_test(config, props, testfile);

if !proc_res.status.success() {
fatal_proc_rec("compilation failed!", &proc_res);
}

check_no_compiler_crash(&proc_res);

let prefix = "TRANS_ITEM ";

let actual: HashSet<String> = proc_res
.stdout
.lines()
.filter(|line| line.starts_with(prefix))
.map(|s| (&s[prefix.len()..]).to_string())
.collect();

let expected: HashSet<String> = errors::load_errors(testfile)
.iter()
.map(|e| e.msg.trim().to_string())
.collect();

if actual != expected {
let mut missing: Vec<_> = expected.difference(&actual).collect();
missing.sort();

let mut too_much: Vec<_> = actual.difference(&expected).collect();
too_much.sort();

println!("Expected and actual sets of codegen-items differ.\n\
These items should have been contained but were not:\n\n\
{}\n\n\
These items were contained but should not have been:\n\n\
{}\n\n",
missing.iter().fold("".to_string(), |s1, s2| s1 + "\n" + s2),
too_much.iter().fold("".to_string(), |s1, s2| s1 + "\n" + s2));
panic!();
}
}
7 changes: 4 additions & 3 deletions src/doc/book/crates-and-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -567,10 +567,11 @@ to it as "sayings". Similarly, the first `use` statement pulls in the
`ja_greetings` as opposed to simply `greetings`. This can help to avoid
ambiguity when importing similarly-named items from different places.

The second `use` statement uses a star glob to bring in _all_ symbols from the
`sayings::japanese::farewells` module. As you can see we can later refer to
The second `use` statement uses a star glob to bring in all public symbols from
the `sayings::japanese::farewells` module. As you can see we can later refer to
the Japanese `goodbye` function with no module qualifiers. This kind of glob
should be used sparingly.
should be used sparingly. It’s worth noting that it only imports the public
symbols, even if the code doing the globbing is in the same module.

The third `use` statement bears more explanation. It's using "brace expansion"
globbing to compress three `use` statements into one (this sort of syntax
Expand Down
6 changes: 3 additions & 3 deletions src/doc/book/macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,9 @@ which syntactic form it matches.

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

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

These rules provide some flexibility for Rust’s syntax to evolve without
Expand Down
12 changes: 9 additions & 3 deletions src/doc/book/syntax-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Keywords

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

<!-- Generics -->

Expand All @@ -132,7 +135,8 @@
<!-- Constraints -->

* `T: U`: generic parameter `T` constrained to types that implement `U`. See [Traits].
* `T: 'a`: generic type `T` must outlive lifetime `'a`.
* `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`.
* `T : 'static`: The generic type `T` contains no borrowed references other than `'static` ones.
* `'b: 'a`: generic lifetime `'b` must outlive lifetime `'a`.
* `T: ?Sized`: allow generic type parameter to be a dynamically-sized type. See [Unsized Types (`?Sized`)].
* `'a + trait`, `trait + trait`: compound type constraint. See [Traits (Multiple Trait Bounds)].
Expand Down Expand Up @@ -234,6 +238,8 @@
[Traits (`where` clause)]: traits.html#where-clause
[Traits (Multiple Trait Bounds)]: traits.html#multiple-trait-bounds
[Traits]: traits.html
[Universal Function Call Syntax]: ufcs.html
[Universal Function Call Syntax (Angle-bracket Form)]: ufcs.html#angle-bracket-form
[Unsafe]: unsafe.html
[Unsized Types (`?Sized`)]: unsized-types.html#sized
[Variable Bindings]: variable-bindings.html
10 changes: 5 additions & 5 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ comments (`/** ... */`), are interpreted as a special syntax for `doc`
`#[doc="..."]` around the body of the comment, i.e., `/// Foo` turns into
`#[doc="Foo"]`.

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

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

```{.ignore}
#[warn(missing_docs)]
mod m2{
pub mod m2{
#[allow(missing_docs)]
mod nested {
pub mod nested {
// Missing documentation is ignored here
pub fn undocumented_one() -> i32 { 1 }

Expand All @@ -2137,7 +2137,7 @@ that lint check:

```{.ignore}
#[forbid(missing_docs)]
mod m3 {
pub mod m3 {
// Attempting to toggle warning signals an error here
#[allow(missing_docs)]
/// Returns 2.
Expand Down
Loading