Unified
Split
Showing
with
437 additions
and 545 deletions.
- +4 −0 config.toml.example
- +1 −1 src/binaryen
- +23 −6 src/bootstrap/builder.rs
- +4 −1 src/bootstrap/config.rs
- +1 −0 src/bootstrap/configure.py
- +7 −0 src/bootstrap/dist.rs
- +23 −7 src/bootstrap/install.rs
- +1 −1 src/bootstrap/lib.rs
- +1 −1 src/bootstrap/native.rs
- +1 −1 src/bootstrap/test.rs
- +1 −1 src/ci/docker/dist-i686-freebsd/Dockerfile
- +2 −1 src/ci/docker/dist-i686-linux/Dockerfile
- +1 −1 src/ci/docker/dist-x86_64-netbsd/build-netbsd-toolchain.sh
- +1 −1 src/dlmalloc
- +1 −1 src/doc/book
- +1 −1 src/doc/nomicon
- +1 −1 src/doc/reference
- +1 −1 src/doc/rust-by-example
- +2 −2 src/etc/installer/msi/rust.wxs
- +1 −1 src/etc/platform-intrinsics/generator.py
- +1 −1 src/etc/test-float-parse/runtests.py
- +1 −1 src/libbacktrace/ltmain.sh
- +1 −1 src/libbacktrace/macho.c
- +1 −1 src/libcompiler_builtins
- +1 −1 src/libcore/char.rs
- +4 −0 src/libcore/iter/iterator.rs
- +14 −0 src/libcore/iter/mod.rs
- +1 −1 src/libcore/macros.rs
- +2 −2 src/libcore/ops/arith.rs
- +46 −0 src/libcore/sync/atomic.rs
- +14 −0 src/libcore/tests/atomic.rs
- +1 −0 src/libcore/tests/lib.rs
- +1 −1 src/libfmt_macros/lib.rs
- +1 −1 src/librustc/hir/intravisit.rs
- +49 −44 src/librustc/traits/error_reporting.rs
- +0 −363 src/librustc_data_structures/blake2b.rs
- +0 −2 src/librustc_data_structures/lib.rs
- +0 −47 src/librustc_data_structures/veccell/mod.rs
- +7 −0 src/librustc_driver/driver.rs
- +4 −0 src/librustc_mir/interpret/eval_context.rs
- +11 −3 src/librustc_resolve/resolve_imports.rs
- +4 −0 src/librustc_trans/mir/constant.rs
- +4 −0 src/librustc_trans/mir/rvalue.rs
- +32 −0 src/librustc_typeck/check/mod.rs
- +4 −0 src/librustdoc/clean/mod.rs
- +3 −1 src/librustdoc/clean/simplify.rs
- +6 −31 src/librustdoc/html/static/main.js
- +1 −1 src/librustdoc/html/static/rustdoc.css
- +5 −0 src/libsyntax/feature_gate.rs
- +1 −1 src/llvm
- +2 −0 src/rustllvm/RustWrapper.cpp
- +1 −1 src/rustllvm/llvm-rebuild-trigger
- +20 −0 src/test/compile-fail/rustc-args-required-const2.rs
- +28 −6 src/test/run-pass/backtrace-debuginfo.rs
- +13 −0 src/test/rustdoc/auxiliary/unit-return.rs
- +27 −0 src/test/rustdoc/unit-return.rs
- +23 −0 src/test/ui/generator/issue-48048.rs
- +10 −0 src/test/ui/generator/issue-48048.stderr
- +1 −1 src/test/ui/mismatched_types/binops.rs
- +2 −2 src/test/ui/mismatched_types/binops.stderr
- +3 −0 src/test/ui/mismatched_types/closure-arg-count.rs
- +9 −3 src/test/ui/mismatched_types/closure-arg-count.stderr
| @@ -151,6 +151,10 @@ | |||
| # default. | |||
| #extended = false | |||
|
|
|||
| # Installs choosen set of extended tools if enables. By default builds all. | |||
| # If choosen tool failed to build the installation fails. | |||
| #tools = ["cargo", "rls", "rustfmt", "analysis", "src"] | |||
|
|
|||
| # Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose | |||
| #verbose = 0 | |||
|
|
|||
Submodule binaryen
updated
3 files
| +1 −1 | src/tools/asm2wasm.cpp | |
| +1 −1 | src/tools/s2wasm.cpp | |
| +2 −2 | src/wasm/wasm-s-parser.cpp |
| @@ -570,7 +570,7 @@ impl<'a> Builder<'a> { | |||
| // build scripts in that situation. | |||
| // | |||
| // If LLVM support is disabled we need to use the snapshot compiler to compile | |||
| // build scripts, as the new compiler doesnt support executables. | |||
| // build scripts, as the new compiler doesn't support executables. | |||
| if mode == Mode::Libstd || !self.build.config.llvm_enabled { | |||
| cargo.env("RUSTC_SNAPSHOT", &self.initial_rustc) | |||
| .env("RUSTC_SNAPSHOT_LIBDIR", self.rustc_snapshot_libdir()); | |||
| @@ -600,9 +600,25 @@ impl<'a> Builder<'a> { | |||
| // | |||
| // FIXME: the guard against msvc shouldn't need to be here | |||
| if !target.contains("msvc") { | |||
| let cc = self.cc(target); | |||
| cargo.env(format!("CC_{}", target), cc) | |||
| .env("CC", cc); | |||
| let ccache = self.config.ccache.as_ref(); | |||
| let ccacheify = |s: &Path| { | |||
| let ccache = match ccache { | |||
| Some(ref s) => s, | |||
| None => return s.display().to_string(), | |||
| }; | |||
| // FIXME: the cc-rs crate only recognizes the literal strings | |||
| // `ccache` and `sccache` when doing caching compilations, so we | |||
| // mirror that here. It should probably be fixed upstream to | |||
| // accept a new env var or otherwise work with custom ccache | |||
| // vars. | |||
| match &ccache[..] { | |||
| "ccache" | "sccache" => format!("{} {}", ccache, s.display()), | |||
| _ => s.display().to_string(), | |||
| } | |||
| }; | |||
| let cc = ccacheify(&self.cc(target)); | |||
| cargo.env(format!("CC_{}", target), &cc) | |||
| .env("CC", &cc); | |||
|
|
|||
| let cflags = self.cflags(target).join(" "); | |||
| cargo.env(format!("CFLAGS_{}", target), cflags.clone()) | |||
| @@ -617,8 +633,9 @@ impl<'a> Builder<'a> { | |||
| } | |||
|
|
|||
| if let Ok(cxx) = self.cxx(target) { | |||
| cargo.env(format!("CXX_{}", target), cxx) | |||
| .env("CXX", cxx) | |||
| let cxx = ccacheify(&cxx); | |||
| cargo.env(format!("CXX_{}", target), &cxx) | |||
| .env("CXX", &cxx) | |||
| .env(format!("CXXFLAGS_{}", target), cflags.clone()) | |||
| .env("CXXFLAGS", cflags); | |||
| } | |||
| @@ -13,7 +13,7 @@ | |||
| //! This module implements parsing `config.toml` configuration files to tweak | |||
| //! how the build runs. | |||
|
|
|||
| use std::collections::HashMap; | |||
| use std::collections::{HashMap, HashSet}; | |||
| use std::env; | |||
| use std::fs::File; | |||
| use std::io::prelude::*; | |||
| @@ -52,6 +52,7 @@ pub struct Config { | |||
| pub target_config: HashMap<Interned<String>, Target>, | |||
| pub full_bootstrap: bool, | |||
| pub extended: bool, | |||
| pub tools: Option<HashSet<String>>, | |||
| pub sanitizers: bool, | |||
| pub profiler: bool, | |||
| pub ignore_git: bool, | |||
| @@ -191,6 +192,7 @@ struct Build { | |||
| python: Option<String>, | |||
| full_bootstrap: Option<bool>, | |||
| extended: Option<bool>, | |||
| tools: Option<HashSet<String>>, | |||
| verbose: Option<usize>, | |||
| sanitizers: Option<bool>, | |||
| profiler: Option<bool>, | |||
| @@ -395,6 +397,7 @@ impl Config { | |||
| set(&mut config.vendor, build.vendor); | |||
| set(&mut config.full_bootstrap, build.full_bootstrap); | |||
| set(&mut config.extended, build.extended); | |||
| config.tools = build.tools; | |||
| set(&mut config.verbose, build.verbose); | |||
| set(&mut config.sanitizers, build.sanitizers); | |||
| set(&mut config.profiler, build.profiler); | |||
| @@ -144,6 +144,7 @@ def v(*args): | |||
| o("full-bootstrap", "build.full-bootstrap", "build three compilers instead of two") | |||
| o("extended", "build.extended", "build an extended rust tool set") | |||
|
|
|||
| v("tools", "build.tools", "List of extended tools will be installed") | |||
| v("build", "build.build", "GNUs ./configure syntax LLVM build triple") | |||
| v("host", None, "GNUs ./configure syntax LLVM host triples") | |||
| v("target", None, "GNUs ./configure syntax LLVM target triples") | |||
| @@ -31,6 +31,7 @@ use channel; | |||
| use util::{cp_r, libdir, is_dylib, cp_filtered, copy, replace_in_file}; | |||
| use builder::{Builder, RunConfig, ShouldRun, Step}; | |||
| use compile; | |||
| use native; | |||
| use tool::{self, Tool}; | |||
| use cache::{INTERNER, Interned}; | |||
| use time; | |||
| @@ -898,6 +899,12 @@ impl Step for PlainSourceTarball { | |||
| .arg("--vers").arg(CARGO_VENDOR_VERSION) | |||
| .arg("cargo-vendor") | |||
| .env("RUSTC", &build.initial_rustc); | |||
| if let Some(dir) = build.openssl_install_dir(build.config.build) { | |||
| builder.ensure(native::Openssl { | |||
| target: build.config.build, | |||
| }); | |||
| cmd.env("OPENSSL_DIR", dir); | |||
| } | |||
| build.run(&mut cmd); | |||
| } | |||
|
|
|||
| @@ -22,6 +22,7 @@ use dist::{self, pkgname, sanitize_sh, tmpdir}; | |||
|
|
|||
| use builder::{Builder, RunConfig, ShouldRun, Step}; | |||
| use cache::Interned; | |||
| use config::Config; | |||
|
|
|||
| pub fn install_docs(builder: &Builder, stage: u32, host: Interned<String>) { | |||
| install_sh(builder, "docs", "rust-docs", stage, Some(host)); | |||
| @@ -144,6 +145,19 @@ macro_rules! install { | |||
| pub host: Interned<String>, | |||
| } | |||
|
|
|||
| impl $name { | |||
| #[allow(dead_code)] | |||
| fn should_build(config: &Config) -> bool { | |||
| config.extended && config.tools.as_ref() | |||
| .map_or(true, |t| t.contains($path)) | |||
| } | |||
|
|
|||
| #[allow(dead_code)] | |||
| fn should_install(builder: &Builder) -> bool { | |||
| builder.config.tools.as_ref().map_or(false, |t| t.contains($path)) | |||
| } | |||
| } | |||
|
|
|||
| impl Step for $name { | |||
| type Output = (); | |||
| const DEFAULT: bool = true; | |||
| @@ -185,32 +199,34 @@ install!((self, builder, _config), | |||
| install_std(builder, self.stage, *target); | |||
| } | |||
| }; | |||
| Cargo, "cargo", _config.extended, only_hosts: true, { | |||
| Cargo, "cargo", Self::should_build(_config), only_hosts: true, { | |||
| builder.ensure(dist::Cargo { stage: self.stage, target: self.target }); | |||
| install_cargo(builder, self.stage, self.target); | |||
| }; | |||
| Rls, "rls", _config.extended, only_hosts: true, { | |||
| if builder.ensure(dist::Rls { stage: self.stage, target: self.target }).is_some() { | |||
| Rls, "rls", Self::should_build(_config), only_hosts: true, { | |||
| if builder.ensure(dist::Rls { stage: self.stage, target: self.target }).is_some() || | |||
| Self::should_install(builder) { | |||
| install_rls(builder, self.stage, self.target); | |||
| } else { | |||
| println!("skipping Install RLS stage{} ({})", self.stage, self.target); | |||
| } | |||
| }; | |||
| Rustfmt, "rustfmt", _config.extended, only_hosts: true, { | |||
| if builder.ensure(dist::Rustfmt { stage: self.stage, target: self.target }).is_some() { | |||
| Rustfmt, "rustfmt", Self::should_build(_config), only_hosts: true, { | |||
| if builder.ensure(dist::Rustfmt { stage: self.stage, target: self.target }).is_some() || | |||
| Self::should_install(builder) { | |||
| install_rustfmt(builder, self.stage, self.target); | |||
| } else { | |||
| println!("skipping Install Rustfmt stage{} ({})", self.stage, self.target); | |||
| } | |||
| }; | |||
| Analysis, "analysis", _config.extended, only_hosts: false, { | |||
| Analysis, "analysis", Self::should_build(_config), only_hosts: false, { | |||
| builder.ensure(dist::Analysis { | |||
| compiler: builder.compiler(self.stage, self.host), | |||
| target: self.target | |||
| }); | |||
| install_analysis(builder, self.stage, self.target); | |||
| }; | |||
| Src, "src", _config.extended, only_hosts: true, { | |||
| Src, "src", Self::should_build(_config) , only_hosts: true, { | |||
| builder.ensure(dist::Src); | |||
| install_src(builder, self.stage); | |||
| }, ONLY_BUILD; | |||
| @@ -666,7 +666,7 @@ impl Build { | |||
| } | |||
| } | |||
|
|
|||
| /// Returns the path to the linker for the given target if it needs to be overriden. | |||
| /// Returns the path to the linker for the given target if it needs to be overridden. | |||
| fn linker(&self, target: Interned<String>) -> Option<&Path> { | |||
| if let Some(linker) = self.config.target_config.get(&target) | |||
| .and_then(|c| c.linker.as_ref()) { | |||
| @@ -186,7 +186,7 @@ impl Step for Llvm { | |||
| } | |||
|
|
|||
| // http://llvm.org/docs/HowToCrossCompileLLVM.html | |||
| if target != build.build { | |||
| if target != build.build && !emscripten { | |||
| builder.ensure(Llvm { | |||
| target: build.build, | |||
| emscripten: false, | |||
| @@ -902,7 +902,7 @@ impl Step for Compiletest { | |||
| } | |||
| } | |||
| if suite == "run-make" && !build.config.llvm_enabled { | |||
| println!("Ignoring run-make test suite as they generally dont work without LLVM"); | |||
| println!("Ignoring run-make test suite as they generally don't work without LLVM"); | |||
| return; | |||
| } | |||
|
|
|||
| @@ -1,4 +1,4 @@ | |||
| FROM ubuntu:16.04 | |||
| FROM ubuntu:18.04 | |||
|
|
|||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |||
| clang \ | |||
| @@ -86,7 +86,8 @@ ENV RUST_CONFIGURE_ARGS \ | |||
| --enable-extended \ | |||
| --enable-sanitizers \ | |||
| --enable-profiler \ | |||
| --enable-emscripten | |||
| --enable-emscripten \ | |||
| --build=i686-unknown-linux-gnu | |||
| ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS | |||
|
|
|||
| # This is the only builder which will create source tarballs | |||
| @@ -54,7 +54,7 @@ cd usr/src | |||
| # The options, in order, do the following | |||
| # * this is an unprivileged build | |||
| # * output to a predictable location | |||
| # * disable various uneeded stuff | |||
| # * disable various unneeded stuff | |||
| MKUNPRIVED=yes TOOLDIR=/x-tools/x86_64-unknown-netbsd \ | |||
| MKSHARE=no MKDOC=no MKHTML=no MKINFO=no MKKMOD=no MKLINT=no MKMAN=no MKNLS=no MKPROFILE=no \ | |||
| hide_output ./build.sh -j10 -m amd64 tools | |||
Submodule dlmalloc
updated
2 files
| +2 −2 | src/dlmalloc.rs | |
| +7 −10 | src/wasm.rs |
Submodule book
updated
32 files
| +2 −2 | second-edition/dictionary.txt | |
| +1 −0 | second-edition/dot/trpl04-01.dot | |
| +1 −0 | second-edition/dot/trpl04-02.dot | |
| +1 −0 | second-edition/dot/trpl04-03.dot | |
| +1 −0 | second-edition/dot/trpl04-04.dot | |
| +1 −0 | second-edition/dot/trpl04-05.dot | |
| +1 −0 | second-edition/dot/trpl04-06.dot | |
| +1 −0 | second-edition/dot/trpl15-01.dot | |
| +1 −0 | second-edition/dot/trpl15-02.dot | |
| +1 −0 | second-edition/dot/trpl15-03.dot | |
| +797 −1,274 | second-edition/nostarch/chapter15.md | |
| + − | second-edition/nostarch/odt/chapter15.docx | |
| +1 −1 | second-edition/src/ch08-01-vectors.md | |
| +2 −2 | second-edition/src/ch10-02-traits.md | |
| +37 −78 | second-edition/src/ch15-00-smart-pointers.md | |
| +116 −188 | second-edition/src/ch15-01-box.md | |
| +133 −201 | second-edition/src/ch15-02-deref.md | |
| +66 −111 | second-edition/src/ch15-03-drop.md | |
| +95 −119 | second-edition/src/ch15-04-rc.md | |
| +178 −217 | second-edition/src/ch15-05-interior-mutability.md | |
| +183 −257 | second-edition/src/ch15-06-reference-cycles.md | |
| +1 −1 | second-edition/src/ch17-02-trait-objects.md | |
| +6 −6 | second-edition/src/ch18-01-all-the-places-for-patterns.md | |
| +52 −49 | second-edition/src/img/trpl04-01.svg | |
| +75 −70 | second-edition/src/img/trpl04-02.svg | |
| +101 −95 | second-edition/src/img/trpl04-03.svg | |
| +76 −71 | second-edition/src/img/trpl04-04.svg | |
| +67 −62 | second-edition/src/img/trpl04-05.svg | |
| +95 −90 | second-edition/src/img/trpl04-06.svg | |
| +31 −30 | second-edition/src/img/trpl15-01.svg | |
| +14 −13 | second-edition/src/img/trpl15-02.svg | |
| +68 −53 | second-edition/src/img/trpl15-03.svg |
Submodule nomicon
updated
1 files
| +5 −5 | src/send-and-sync.md |
Submodule reference
updated
6 files
| +46 −10 | CONTRIBUTING.md | |
| +17 −4 | src/expressions/match-expr.md | |
| +16 −17 | src/items/use-declarations.md | |
| +1 −1 | src/type-coercions.md | |
| +1 −0 | src/type-layout.md | |
| +0 −1 | src/undocumented.md |
Submodule rust-by-example
updated
24 files
| +2 −0 | .gitattributes | |
| +10 −0 | src/attribute.md | |
| +5 −5 | src/cargo/conventions.md | |
| +3 −3 | src/cargo/deps.md | |
| +1 −1 | src/conversion/from_into.md | |
| +5 −4 | src/crates.md | |
| +1 −1 | src/custom_types/enum/testcase_linked_list.md | |
| +8 −3 | src/custom_types/structs.md | |
| +2 −2 | src/error/multiple_error_types/wrap_error.md | |
| +21 −15 | src/flow_control/for.md | |
| +2 −2 | src/fn/closures.md | |
| +24 −0 | src/fn/closures/capture.md | |
| +1 −4 | src/generics/new_types.md | |
| +10 −10 | src/hello/comment.md | |
| +1 −1 | src/scope/borrow.md | |
| +1 −1 | src/scope/lifetime/struct.md | |
| +1 −1 | src/std/hash.md | |
| +2 −2 | src/std/hash/hashset.md | |
| +2 −2 | src/std/result/question_mark.md | |
| +1 −1 | src/std_misc/arg.md | |
| +3 −3 | src/std_misc/arg/matching.md | |
| +10 −43 | src/std_misc/ffi.md | |
| +1 −1 | src/testing/integration_testing.md | |
| +22 −6 | src/unsafe.md |
| @@ -18,7 +18,7 @@ | |||
| <!-- Upgrade code should be different for each platform --> | |||
| <?if $(sys.BUILDARCH)="x64" ?> | |||
| <?if $(env.CFG_ABI)="GNU" ?> | |||
| <!-- UpgradeCode shoud stay the same for all MSI versions in channel --> | |||
| <!-- UpgradeCode should stay the same for all MSI versions in channel --> | |||
| <?if $(env.CFG_CHANNEL)="stable" ?> | |||
| <?define UpgradeCode="B440B077-F8D1-4730-8E1D-D6D37702B4CE" ?> | |||
| <?elseif $(env.CFG_CHANNEL)="beta" ?> | |||
| @@ -129,7 +129,7 @@ | |||
|
|
|||
| <!-- Path of cmd.exe for the shortcut --> | |||
| <Property Id="SHORTCUTTARGET" Value="%windir%\System32\cmd.exe" /> | |||
| <!-- Microsoft Installer will resolve any Enviroment Variables in the working directory at install time --> | |||
| <!-- Microsoft Installer will resolve any Environment Variables in the working directory at install time --> | |||
| <Property Id="SHORTCUTWKDIR" Value="%SystemDrive%\" /> | |||
|
|
|||
| <InstallUISequence> | |||
| @@ -591,7 +591,7 @@ def parse_args(): | |||
| The X86 architecture is specified as multiple files (for the different | |||
| instruction sets that x86 supports). To generate the compiler | |||
| definitions one needs to pass the script a "platform information file" | |||
| (with the -i flag) next to the files of the different intruction sets. | |||
| (with the -i flag) next to the files of the different instruction sets. | |||
| For example, to generate the X86 compiler-definitions for SSE4.2, just: | |||
| python generator.py --format compiler-defs -i x86/info.json sse42.json | |||
| @@ -41,7 +41,7 @@ | |||
| (as a fraction, using the ``fractions`` module). | |||
| Given an input string and the corresponding float computed via Rust, simply | |||
| decode the float into f * 2^k (for intergers f, k) and the ULP. | |||
| decode the float into f * 2^k (for integers f, k) and the ULP. | |||
| We can now easily compute the error and check if it is within 0.5 ULP as it | |||
| should be. Zero and infinites are handled similarly: | |||
| @@ -487,7 +487,7 @@ func_mkdir_p () | |||
| # While some portion of DIR does not yet exist... | |||
| while test ! -d "$my_directory_path"; do | |||
| # ...make a list in topmost first order. Use a colon delimited | |||
| # list incase some portion of path contains whitespace. | |||
| # list in case some portion of path contains whitespace. | |||
| my_dir_list="$my_directory_path:$my_dir_list" | |||
|
|
|||
| # If the last portion added has no slash in it, the list is done | |||
| @@ -327,7 +327,7 @@ macho_get_commands (struct backtrace_state *state, int descriptor, | |||
| goto end; | |||
| file_header_view_valid = 1; | |||
|
|
|||
| // The endianess of the slice may be different than the fat image | |||
| // The endianness of the slice may be different than the fat image | |||
| switch (*(uint32_t *) file_header_view.data) | |||
| { | |||
| case MH_MAGIC: | |||
Submodule libcompiler_builtins
updated
2 files
| +1 −1 | .gitmodules | |
| +1 −1 | compiler-rt |
| @@ -211,7 +211,7 @@ impl From<u8> for char { | |||
|
|
|||
| /// An error which can be returned when parsing a char. | |||
| #[stable(feature = "char_from_str", since = "1.20.0")] | |||
| #[derive(Clone, Debug)] | |||
| #[derive(Clone, Debug, PartialEq, Eq)] | |||
| pub struct ParseCharError { | |||
| kind: CharErrorKind, | |||
| } | |||
| @@ -1431,6 +1431,10 @@ pub trait Iterator { | |||
| /// Folding is useful whenever you have a collection of something, and want | |||
| /// to produce a single value from it. | |||
| /// | |||
| /// Note: `fold()`, and similar methods that traverse the entire iterator, | |||
| /// may not terminate for infinite iterators, even on traits for which a | |||
| /// result is determinable in finite time. | |||
| /// | |||
| /// # Examples | |||
| /// | |||
| /// Basic usage: | |||
| @@ -298,7 +298,21 @@ | |||
| //! | |||
| //! This will print the numbers `0` through `4`, each on their own line. | |||
| //! | |||
| //! Bear in mind that methods on infinite iterators, even those for which a | |||
| //! result can be determined mathematically in finite time, may not terminate. | |||
| //! Specifically, methods such as [`min`], which in the general case require | |||
| //! traversing every element in the iterator, are likely not to return | |||
| //! successfully for any infinite iterators. | |||
| //! | |||
| //! ```no_run | |||
| //! let ones = std::iter::repeat(1); | |||
| //! let least = ones.min().unwrap(); // Oh no! An infinite loop! | |||
| //! // `ones.min()` causes an infinite loop, so we won't reach this point! | |||
| //! println!("The smallest number one is {}.", least); | |||
| //! ``` | |||
| //! | |||
| //! [`take`]: trait.Iterator.html#method.take | |||
| //! [`min`]: trait.Iterator.html#method.min | |||
|
|
|||
| #![stable(feature = "rust1", since = "1.0.0")] | |||
|
|
|||
| @@ -327,7 +327,7 @@ macro_rules! debug_assert_ne { | |||
| /// } | |||
| /// } | |||
| /// | |||
| /// // The prefered method of quick returning Errors | |||
| /// // The preferred method of quick returning Errors | |||
| /// fn write_to_file_question() -> Result<(), MyError> { | |||
| /// let mut file = File::create("my_best_friends.txt")?; | |||
| /// file.write_all(b"This is a list of my best friends.")?; | |||
| @@ -181,7 +181,7 @@ add_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 } | |||
| /// ``` | |||
| #[lang = "sub"] | |||
| #[stable(feature = "rust1", since = "1.0.0")] | |||
| #[rustc_on_unimplemented(message="cannot substract `{RHS}` from `{Self}`", | |||
| #[rustc_on_unimplemented(message="cannot subtract `{RHS}` from `{Self}`", | |||
| label="no implementation for `{Self} - {RHS}`")] | |||
| pub trait Sub<RHS=Self> { | |||
| /// The resulting type after applying the `-` operator. | |||
| @@ -716,7 +716,7 @@ add_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 } | |||
| /// ``` | |||
| #[lang = "sub_assign"] | |||
| #[stable(feature = "op_assign_traits", since = "1.8.0")] | |||
| #[rustc_on_unimplemented(message="cannot substract-assign `{Rhs}` from `{Self}`", | |||
| #[rustc_on_unimplemented(message="cannot subtract-assign `{Rhs}` from `{Self}`", | |||
| label="no implementation for `{Self} -= {Rhs}`")] | |||
| pub trait SubAssign<Rhs=Self> { | |||
| /// Performs the `-=` operation. | |||
Oops, something went wrong.