about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2017-04-12COPYRIGHT: remove hoedown licenseNODA, Kai-2/+0
Hoedown was removed in b96fef8411f Also cleanup src/tools/tidy/src/main.rs Signed-off-by: NODA, Kai <nodakai@gmail.com>
2017-04-11Auto merge of #41168 - Shizmob:jemalloc-musl, r=alexcrichtonbors-6/+6
Fix jemalloc support for musl Just like DragonFlyBSD, using the same symbols as the system allocator will result in a segmentation fault at runtime due to allocator mismatches. As such, it's better to prefix the jemalloc symbols instead, avoiding crashes. We encountered this problem on a dynamically-linked musl target (with patches to Rust to make that possible, see #40113). It may not show up immediately obviously on the current statically-linked CRT targets.
2017-04-11Auto merge of #41174 - estebank:issue-41155, r=nikomatsakisbors-3/+28
Point at only one char on `Span::next_point` Avoid pointing at two chars so the diagnostic output doesn't display a multiline span when starting beyond a line end. Fix #41155. Instead of ```rust error: expected one of `(`, `const`, `default`, `extern`, `fn`, `type`, or `unsafe`, found `}` --> <anon>:3:1 | 1 | impl S { pub | _____________- starting here... 2 | | | | ...ending here: expected one of 7 possible tokens here 3 | } | ^ unexpected token ``` show ```rust error: expected one of `(`, `const`, `default`, `extern`, `fn`, `type`, or `unsafe`, found `}` --> <anon>:13:1 | 12 | pub | - expected one of 7 possible tokens here 13 | } | ^ unexpected token ```
2017-04-10Auto merge of #40565 - estebank:binops-help, r=arielb1bors-17/+164
Explicit help message for binop type mismatch When trying to do `1 + Some(2)`, or some other binary operation on two types different types without an appropriate trait implementation, provide an explicit help message: ```rust help: `{integer} + std::option::Option<{integer}>` has no implementation ``` Re: #39579, #38564, #37626, #39942, #34698.
2017-04-10Explicit help message for binop type missmatchEsteban Küber-17/+164
When trying to do a binary operation with missing implementation, for example `1 + Some(2)`, provide an explicit help message: ``` note: no implementation for `{integer} + std::option::Option<{integer}>` ``` Use `rustc_on_unimplemented` for the suggestions. Move cfail test to ui.
2017-04-10Point at only one char on `Span::next_point`Esteban Küber-3/+28
Avoid pointing at two chars so the diagnostic output doesn't display a multiline span when starting beyond a line end.
2017-04-10Auto merge of #40018 - japaric:ld, r=alexcrichtonbors-240/+682
-Z linker-flavor (Please read the commit message first) This PR is an alternative to rust-lang/rust#36120 (internal lld linker). The main goal of this PR is to make it *possible* to use LLD as a linker to allow out of tree experimentation. Now that LLD is going to be shipped with LLVM 4.0, it should become easier to get a hold of LLD (hopefully, it will be packaged by Linux distros soon). Since LLD is a multiarch linker, it has the potential to make cross compilation easier (less tools need to be installed). Supposedly, LLD is also faster than the gold linker so LLD may improve build times where link times are significant (e.g. 100% incremental compilation reuse). The place where LLD shines is at linking Rust programs that don't depend on system libraries. For example, here's how you would link a bare metal ARM Cortex-M program: ``` $ xargo rustc --target thumbv7m-none-eabi -- -Z linker-flavor=ld -C linker=ld.lld -Z print-link-args "ld.lld" \ "-L" \ "$XARGO_HOME/lib/rustlib/thumbv7m-none-eabi/lib" \ "$PWD/target/thumbv7m-none-eabi/debug/deps/app-de1f86df314ad68c.0.o" \ "-o" \ "$PWD/target/thumbv7m-none-eabi/debug/deps/app-de1f86df314ad68c" \ "--gc-sections" \ "-L" \ "$PWD/target/thumbv7m-none-eabi/debug/deps" \ "-L" \ "$PWD/target/debug/deps" \ "-L" \ "$XARGO_HOME/lib/rustlib/thumbv7m-none-eabi/lib" \ "-Bstatic" \ "-Bdynamic" \ "$XARGO_HOME/lib/rustlib/thumbv7m-none-eabi/lib/libcore-11670d2bd4951fa7.rlib" $ file target/thumbv7m-none-eabi/debug/app app: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped, with debug_info ``` This doesn't require installing the `arm-none-eabi-gcc` toolchain. Even cooler (but I'm biased) is that you can link Rust programs that use [`steed`] (`steed` is a `std` re-implementation free of C dependencies for Linux systems) instead of `std` for a bunch of different architectures without having to install a single cross toolchain. [`steed`]: https://github.com/japaric/steed ``` $ xargo rustc --target aarch64-unknown-linux-steed --example hello --release -- -Z print-link-args "ld.lld" \ "-L" \ "$XARGO_HOME/lib/rustlib/aarch64-unknown-linux-steed/lib" \ "$PWD/target/aarch64-unknown-linux-steed/release/examples/hello-80c130ad884c0f8f.0.o" \ "-o" \ "$PWD/target/aarch64-unknown-linux-steed/release/examples/hello-80c130ad884c0f8f" \ "--gc-sections" \ "-L" \ "$PWD/target/aarch64-unknown-linux-steed/release/deps" \ "-L" \ "$PWD/target/release/deps" \ "-L" \ "$XARGO_HOME/lib/rustlib/aarch64-unknown-linux-steed/lib" \ "-Bstatic" \ "-Bdynamic" \ "/tmp/rustc.lAybk9Ltx93Q/libcompiler_builtins-589aede02de78434.rlib" $ file target/aarch64-unknown-linux-steed/release/examples/hello hello: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, not stripped, with debug_info ``` All these targets (architectures) worked with LLD: - [aarch64-unknown-linux-steed](https://github.com/japaric/steed/blob/lld/docker/aarch64-unknown-linux-steed.json) - [arm-unknown-linux-steedeabi](https://github.com/japaric/steed/blob/lld/docker/arm-unknown-linux-steedeabi.json) - [arm-unknown-linux-steedeabihf](https://github.com/japaric/steed/blob/lld/docker/arm-unknown-linux-steedeabihf.json) - [armv7-unknown-linux-steedeabihf](https://github.com/japaric/steed/blob/lld/docker/armv7-unknown-linux-steedeabihf.json) - [i686-unknown-linux-steed](https://github.com/japaric/steed/blob/lld/docker/i686-unknown-linux-steed.json) - [mips-unknown-linux-steed](https://github.com/japaric/steed/blob/lld/docker/mips-unknown-linux-steed.json) - [mipsel-unknown-linux-steed](https://github.com/japaric/steed/blob/lld/docker/mipsel-unknown-linux-steed.json) - [powerpc-unknown-linux-steed](https://github.com/japaric/steed/blob/lld/docker/powerpc-unknown-linux-steed.json) - [powerpc64-unknown-linux-steed](https://github.com/japaric/steed/blob/lld/docker/powerpc64-unknown-linux-steed.json) - [x86_64-unknown-linux-steed](https://github.com/japaric/steed/blob/lld/docker/x86_64-unknown-linux-steed.json) --- The case where lld is unergonomic is linking binaries that depend on system libraries. Like "Hello, world" for `x86_64-unknown-linux-gnu`. Because you have to pass as linker arguments: the path to the startup objects, the path to the dynamic linker and the library search paths. And all those are system specific so they can't be encoded in the target itself. ``` $ cargo \ rustc \ --release \ -- \ -C \ linker=ld.lld \ -Z \ linker-flavor=ld \ -C \ link-args='-dynamic-linker /lib64/ld-linux-x86-64.so.2 -L/usr/lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.1 /usr/lib/Scrt1.o /usr/lib/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.1/crtbeginS.o /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.1/crtendS.o /usr/lib/crtn.o' ``` --- Another case where `-Z linker-flavor` may come in handy is directly calling Solaris' linker which is also a multiarch linker (or so I have heard). cc @binarycrusader cc @alexcrichton Heads up: [breaking-change] due to changes in the target specification format.
2017-04-10explain why we have a fake cfail testJorge Aparicio-0/+5
2017-04-10--subsystem needs -Wl when using non-ld linkersJorge Aparicio-1/+1
2017-04-10Auto merge of #41179 - mandeep:add-fmtresult-example, r=frewsxcvbors-1/+24
Added doc comments for fmt::Result Added doc comments for fmt::Result in regards to item 3 in issue #29355. I'm not certain that this is all that's needed but I think it's a good starting point on this item.
2017-04-10Auto merge of #41103 - projektir:channel_error_docs, r=GuillaumeGomezbors-51/+87
Channel error docs r? @steveklabnik I'm going to need some help on this one, a few ambiguities.
2017-04-10Auto merge of #41178 - llogiq:collections-doc-markdown, r=frewsxcvbors-20/+20
Apply clippy's doc_markdown improvements to libcollections Since my last PR led to linker failure, I'm now taking much smaller steps. This only fixes some doc_markdown warnings; as they are in comments only, we shouldn't get any problems building.
2017-04-09Added doc comments for fmt::Resultmandeep-1/+24
2017-04-10Apply clippy's doc_markdown improvements to libcollectionsAndre Bogus-20/+20
Since my last PR led to linker failure, I'm now taking much smaller steps. This only fixes some doc_markdown warnings; as they are in comments only, we shouldn't get any problems building.
2017-04-10Auto merge of #41175 - goffrie:patch-1, r=frewsxcvbors-1/+1
Minor fix to mutex example Presumably `N` was supposed to be used in both places.
2017-04-09Minor fix to mutex exampleGeoffry Song-1/+1
Presumably `N` was supposed to be used in both places.
2017-04-09Auto merge of #40653 - frewsxcv:tidy-handling, r=alexcrichtonbors-39/+39
A couple minor improvements for tidy error handling. None
2017-04-09Auto merge of #41136 - estebank:multiline, r=jonathandturnerbors-97/+269
Always show end line of multiline annotations ```rust error[E0046]: not all trait items implemented, missing: `Item` --> $DIR/issue-23729.rs:20:9 | 20 | impl Iterator for Recurrence { | _________^ starting here... 21 | | //~^ ERROR E0046 22 | | //~| NOTE missing `Item` in implementation 23 | | //~| NOTE `Item` from trait: `type Item;` ... | 36 | | } 37 | | } | |_________^ ...ending here: missing `Item` in implementation | = note: `Item` from trait: `type Item;` ``` instead of ```rust error[E0046]: not all trait items implemented, missing: `Item` --> $DIR/issue-23729.rs:20:9 | 20 | impl Iterator for Recurrence { | ^ missing `Item` in implementation | = note: `Item` from trait: `type Item;` ```
2017-04-09Always show end line of multiline annotationsEsteban Küber-97/+269
```rust error[E0046]: not all trait items implemented, missing: `Item` --> $DIR/issue-23729.rs:20:9 | 20 | impl Iterator for Recurrence { | _________^ starting here... 21 | | //~^ ERROR E0046 22 | | //~| NOTE missing `Item` in implementation 23 | | //~| NOTE `Item` from trait: `type Item;` ... | 36 | | } 37 | | } | |_________^ ...ending here: missing `Item` in implementation | = note: `Item` from trait: `type Item;` ``` instead of ```rust error[E0046]: not all trait items implemented, missing: `Item` --> $DIR/issue-23729.rs:20:9 | 20 | impl Iterator for Recurrence { | ^ missing `Item` in implementation | = note: `Item` from trait: `type Item;` ```
2017-04-09Print tidy errors to stderr, prefix with 'tidy error: ', handle 'bad' state.Corey Farwell-37/+34
2017-04-09Auto merge of #41084 - QuietMisdreavus:rustdoc-format-redux, ↵bors-133/+137
r=frewsxcxv,GuillaumeGomez rustdoc: update formatting of fn signatures and where clauses to match style rfcs Recent updates to style RFCs ([where clauses](https://github.com/rust-lang-nursery/fmt-rfcs/issues/38), [function definitions](https://github.com/rust-lang-nursery/fmt-rfcs/issues/39)) changed the "canonical" style for these items, so this is a rustdoc update to make it emit that style where necessary. This is mainly a conversion from visual indent to block indent, which helps out in situations where there was excessive indent causing lines to wrap regardless. Samples: ![std::iter::IntoIterator](https://cloud.githubusercontent.com/assets/5217170/24712947/e586604c-19e9-11e7-87ae-4fe64d689dc3.png) ![excerpt from std::iter::Iterator](https://cloud.githubusercontent.com/assets/5217170/24713209/91e65112-19ea-11e7-9ff8-d4cf6b31aae1.png) ![std::iter::FromIterator](https://cloud.githubusercontent.com/assets/5217170/24713138/59f36114-19ea-11e7-9dbb-5f5ba7126e2e.png) ![std::cmp::min](https://cloud.githubusercontent.com/assets/5217170/24713038/1bab88b4-19ea-11e7-935d-defed5648de4.png) ![some trait impls on std::collections::HashMap](https://cloud.githubusercontent.com/assets/5217170/24713251/b7ef69e8-19ea-11e7-94a7-e01fbf89fa31.png) ![`fn extract_code_blocks`, an example given in #40687](https://cloud.githubusercontent.com/assets/5217170/24713159/672717cc-19ea-11e7-9acb-6ac278b90339.png) ![excerpt from itertools::Itertools](https://cloud.githubusercontent.com/assets/5217170/24713323/f06716ea-19ea-11e7-94cc-6ef68d9980ec.png) fixes #41025 and #40687 r? @rust-lang/docs
2017-04-09merge with master to pick up pulldown switchQuietMisdreavus-37071/+28647
2017-04-09Auto merge of #40829 - mgattozzi:ChildStderr, r=steveklabnikbors-2/+3
Update ChildStderr docs to be clearer Before the docs only had a line about where it was found and that it was a handle to stderr. This commit changes it so that the summary second line is removed and that it's a bit clearer about what can be done with it. Part of #29370
2017-04-09Auto merge of #40658 - eddyb:lay-more-out, r=arielb1bors-1819/+1442
Use ty::layout for ABI computation instead of LLVM types. This is the first step in creating a backend-agnostic library for computing call ABI details from signatures. I wanted to open the PR *before* attempting to move `cabi_*` from trans to avoid rebase churn in #39999. **EDIT**: As I suspected, #39999 needs this PR to fully work (see https://github.com/rust-lang/rust/pull/39999#issuecomment-287723379). The first 3 commits add more APIs to `ty::layout` and replace non-ABI uses of `sizing_type_of`. These APIs are probably usable by other backends, and miri too (cc @stoklund @solson). The last commit rewrites `rustc_trans::cabi_*` to use `ty::layout` and new `rustc_trans::abi` APIs. Also, during the process, a couple trivial bugs were identified and fixed: * `msp430`, `nvptx`, `nvptx64`: type sizes *in bytes* were compared with `32` and `64` * `x86` (`fastcall`): `f64` was incorrectly not treated the same way as `f32` Although not urgent, this PR also uses the more general "homogenous aggregate" logic to fix #32045.
2017-04-09rustc_trans: use ty::layout for ABI computation instead of LLVM types.Eduard-Mihai Burtescu-1672/+992
2017-04-09Auto merge of #41095 - clarcharr:as_extras, r=alexcrichtonbors-0/+15
Add as_c_str Again, tying up some consistencies with `CString`.
2017-04-09Auto merge of #41163 - nagisa:ldflags-llvm-config, r=alexcrichtonbors-0/+3
Specify type libraries for llvm-config --ldflags This matters on systems where static libraries and dynamic libraries reside in different location
2017-04-09Auto merge of #41154 - bluss:slice-rfind, r=alexcrichtonbors-0/+27
Implement .rfind() for slice iterators Iter and IterMut Just like the forward case find, implement rfind explicitly for slice iterators Iter and IterMut.
2017-04-08Auto merge of #41092 - jonhoo:std-fence-intrinsics, r=alexcrichtonbors-0/+148
Add safe wrapper for atomic_compilerfence intrinsics This PR adds a proposed safe wrapper for the `atomic_singlethreadfence_*` intrinsics introduced by [RFC #888](https://github.com/rust-lang/rfcs/pull/888). See #41091 for further discussion.
2017-04-08this code block is text not Rust codeJorge Aparicio-1/+1
2017-04-08rustc: add some abstractions to ty::layout for a more concise API.Eduard-Mihai Burtescu-80/+188
2017-04-08rustc_trans: avoid sizing_type_of everywhere possible.Eduard-Mihai Burtescu-82/+53
2017-04-08rustc: add a TyLayout helper for type-related layout queries.Eduard-Mihai Burtescu-13/+237
2017-04-08Fix jemalloc support for muslShiz-6/+6
Just like DragonFlyBSD, using the same symbols as the system allocator will result in a segmentation fault at runtime due to allocator mismatches. As such, prefix the jemalloc symbols instead.
2017-04-08Auto merge of #41148 - arielb1:dead-unwind, r=nagisabors-38/+174
borrowck::mir::dataflow: ignore unwind edges of empty drops This avoids creating drop flags in many unnecessary situations. Fixes #41110. r? @nagisa beta-nominating because regression. However, that is merely a small perf regression and codegen changes are always risky, so we might let this slide for 1.17.
2017-04-08borrowck::mir::dataflow: ignore unwind edges of empty dropsAriel Ben-Yehuda-38/+174
This avoids creating drop flags in many unnecessary situations. Fixes #41110.
2017-04-08Adding links around Sender/SyncSender/Receiver errors; Adding more ↵projektir-51/+87
documentation to channel() and sync_channel(); adding more links #29377
2017-04-08Address @parched's commentsJon Gjengset-8/+3
2017-04-08Specify type libraries for llvm-config --ldflagsSimonas Kazlauskas-0/+3
This matters on systems where static libraries and dynamic libraries reside in different location
2017-04-08Auto merge of #41055 - Archytaus:compile-fail/const-match-pattern-arm, r=arielb1bors-12/+33
Fixed ICEs with pattern matching in const expression Fixed 2 ICEs with when pattern matching inside a constant expression. Both of these ICEs now resolve to an appropriate compiler error. 1. ICE was caused by a compiler bug to implement discriminant const qualify. I removed this intentionally thrown bug and changed it to a FIXME as the unimplemented expression type is handled as a compiler error elsewhere. 2. ICE was caused during a drop check when checking if a variable lifetime outlives the current scope if there was no parent scope . I've changed it to stop checking if there is no parent scope for the current scope. It is valid syntax for a const variable to be assigned a match expression with no enclosing scope. The ICE seemed to mainly be used as a defensive check for bugs elsewhere. Fixes #38199. Fixes #31577. Fixes #29093. Fixes #40012.
2017-04-08Auto merge of #40887 - estebank:ty-placeholder, r=petrochenkovbors-5/+113
Introduce `TyErr` independent from `TyInfer` Add a `TyErr` type to represent unknown types in places where parse errors have happened, while still able to build the AST. Initially only used to represent incorrectly written fn arguments and avoid "expected X parameters, found Y" errors when called with the appropriate amount of parameters. We cannot use `TyInfer` for this as `_` is not allowed as a valid argument type. Example output: ```rust error: expected one of `:` or `@`, found `,` --> file.rs:12:9 | 12 | fn bar(x, y: usize) {} | ^ error[E0061]: this function takes 2 parameters but 3 parameters were supplied --> file.rs:19:9 | 12 | fn bar(x, y) {} | --------------- defined here ... 19 | bar(1, 2, 3); | ^^^^^^^ expected 2 parameters ``` Fix #34264.
2017-04-08Auto merge of #40775 - estebank:variant-as-type, r=petrochenkovbors-0/+99
Suggest using enum when a variant is used as a type Given a file: ```rust enum Fruit { Apple(i64), Orange(i64), } fn should_return_fruit() -> Apple { Apple(5) } ``` Provide the following output: ```rust error[E0412]: cannot find type `Apple` in this scope --> file.rs:16:29 | 16 | fn should_return_fruit() -> Apple { | ^^^^^ not found in this scope | help: there is an enum variant `Fruit::Apple`, did you mean to use `Fruit`? --> file.rs:12:5 | 12 | Apple(i64), | ^^^^^^^^^^ error[E0425]: cannot find function `Apple` in this scope --> file.rs:17:5 | 17 | Apple(5) | ^^^^^ not found in this scope | = help: possible candidate is found in another module, you can import it into scope: `use Fruit::Apple;` ``` Fix #35675.
2017-04-08Rollup merge of #41152 - cuviper:bootstrap-armv7, r=japaricTim Neumann-2/+2
bootstrap.py: fix armv7 detection This matches the logic that was in `./configure` before f8ca805422db8.
2017-04-08Rollup merge of #41146 - est31:master, r=nrcTim Neumann-1/+1
pub(restricted) didn't make it into 1.17 Gets shipped in 1.18 instead.
2017-04-08Rollup merge of #41143 - stjepang:optimize-bool-fetch-nand, r=nagisaTim Neumann-11/+23
Optimize AtomicBool::fetch_nand This is an attempt to push the PR #40563 to completion. Benchmark: [source](https://gist.github.com/stjepang/023f5025623f5474184f9f4dfd6379ae) Improvement: ``` name old_ ns/iter new_ce_ ns/iter diff ns/iter diff % 1t 146,440 89,904 -56,536 -38.61% 2t 561,456 316,835 -244,621 -43.57% 4t 2,822,821 1,005,424 -1,817,397 -64.38% ``` r? @eddyb cc @alexcrichton @nagisa
2017-04-08Rollup merge of #41135 - japaric:unstable-docs, r=steveklabnikTim Neumann-4/+123
document some existing unstable features "msp430-interrupt", "ptx-kernel" and #![compiler_builtins_lib] r? @steveklabnik
2017-04-08Auto merge of #41147 - aidanhs:aphs-fix-appveyor-cache, r=TimNNbors-1/+3
Disable errexit for sanity checking git repo Unblock appveyor
2017-04-07fake the feature-gate-linker-flavor compile fail testJorge Aparicio-1/+3
as there's no way to generate a `#![feature(linker_flavor)]` error
2017-04-08slice: Implement .rfind() for slice iterators Iter and IterMutUlrik Sverdrup-0/+27
Just like the forward case find, implement rfind explicitly
2017-04-07Move tests from ui to cfailEsteban Küber-118/+67