about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2016-12-29rustbuild: Don't run pretty tests by defaultAlex Crichton-13/+23
This commit relegates all pretty tests to not get run by default and rather get run as part of an "aux" test suite. This "aux" suite is renamed from the old "cargotest" suite to just collect tests that don't need to run everywhere but should at least pass on Unix/Windows.
2016-12-29Auto merge of #38627 - rkruppe:ninja-build, r=alexcrichtonbors-1/+5
Accept ninja-build binary in place of ninja See comment in the diff for rationale. r? @alexcrichton
2016-12-29Auto merge of #38571 - nrc:emit-metadata-change, r=alexcrichtonbors-77/+154
Change --crate-type metadata to --emit=metadata WIP
2016-12-29Auto merge of #38645 - nikomatsakis:incr-comp-fix-time-depth, r=nrcbors-4/+21
propagate TIME_DEPTH to the helper threads for -Z time-passes Currently, the timing measurements for LLVM passes and the like don't come out indented, which messes up `perf.rust-lang.org`. r? @nrc
2016-12-29Support --emit=foo,metadataNick Cameron-26/+66
2016-12-29Auto merge of #38619 - alexcrichton:less-android-flaky, r=brsonbors-1/+3
travis: Attempt to fix Android flakiness There's been some flaky runs on Travis where the Android emulator is having problems staying alive... presumably? For example: * https://travis-ci.org/rust-lang/rust/jobs/186736745 This commit spawns the emulator in the same way as buildbot with `nohup` to hope that it goes into the background successfully, followed by a `wait-for-device` command. I'm not actually sure if this'll fix the problems we're seeing, but I figure it can't hurt to test out.
2016-12-29Restore --crate-type=metadata as an alias for ↵Nick Cameron-4/+15
--crate-type=rlib,--emit=metadata + a warning
2016-12-29Add a test for #38273Nick Cameron-0/+21
Closes 38273
2016-12-29Change --crate-type metadata to --emit=metadataNick Cameron-56/+61
2016-12-28Auto merge of #38449 - eddyb:lazy-10, r=nikomatsakisbors-2757/+2280
[10/n] Split constants and functions' arguments into disjoint bodies. _This is part of a series ([prev](https://github.com/rust-lang/rust/pull/38053) | [next]()) of patches designed to rework rustc into an out-of-order on-demand pipeline model for both better feature support (e.g. [MIR-based](https://github.com/solson/miri) early constant evaluation) and incremental execution of compiler passes (e.g. type-checking), with beneficial consequences to IDE support as well. If any motivation is unclear, please ask for additional PR description clarifications or code comments._ <hr> Finishes the signature-body split started in #37918, namely: * `trait` items are separated just like `impl` items were, for uniformity, closing #37712 * `static`s, `const`s (including associated ones), `enum` discriminants and array lengths get bodies * even the count in "repeat expressions", i.e. `n` in `[x; n]`, which fixes #24414 * arguments' patterns are moved to the bodies, with the types staying in `FnDecl` * `&self` now desugars to `self: &Self` instead of `self: &_` (similarly for other `self` forms) * `astconv`'s and metadata's (for rustdoc) informative uses are explicitly ignored for the purposes of the dep graph. this could be fixed in the future by hashing the exact information being extracted about the arguments as opposed to generating a dependency on *the whole body*
2016-12-28Auto merge of #38639 - xen0n:nightly-dist-hotfix, r=brsonbors-6/+13
rustbuild: Hotfix to unbreak nightly Fixes an oversight unnoticed in #38468 that eventually broke nightly packaging. I didn't realize this until some moments ago, when I finally found out the failure is actually deterministic. Many apologies for eating 3 nightlies during the holidays. r? @alexcrichton
2016-12-28Auto merge of #38626 - redox-os:args_fix, r=alexcrichtonbors-9/+5
Fix argument handling on Redox After switching the start code to be handled in libc, we are no longer passing in slices as arguments into the libstd main function. This means that handling had to be rewritten to match the unix way of doing things. Additional commits on this branch are going to be merged in this PR: https://github.com/rust-lang/rust/pull/38577#issuecomment-269138394
2016-12-28Auto merge of #38616 - pnkfelix:refactor-mir-dataflow-remove-ctxt, r=arielb1bors-135/+144
Refactor mir::dataflow: remove Ctxt associated type from BitDenotation trait Refactor mir::dataflow: remove Ctxt associated type from BitDenotation trait I no longer remember why I needed this (or thought I did). The way that the `BitDenotation` is passed around in all existing use cases (and planned future ones), the thing that were in the `Ctxt` can just be part of `Self` instead. (I think ariel had been pushing me to do this back when I first put in this infrastructure; it took me a while to see how much of pain the `Ctxt` was causing.)
2016-12-28rustdoc: pretty-print nested bodies in inlined constants.Eduard-Mihai Burtescu-5/+79
2016-12-28rustc: always print nested nodes where a HIR map is available.Eduard-Mihai Burtescu-378/+245
2016-12-28rustc: simplify constant cross-crate loading and rustc_passes::consts.Eduard-Mihai Burtescu-993/+390
2016-12-28rustc: move function arguments into hir::Body.Eduard-Mihai Burtescu-568/+545
2016-12-28rustc: separate bodies for static/(associated)const and embedded constants.Eduard-Mihai Burtescu-655/+637
2016-12-28rustc: separate TraitItem from their parent Item, just like ImplItem.Eduard-Mihai Burtescu-298/+601
2016-12-28hir: lower `ImplicitSelf` to resolved `Self` TyQPath's.Eduard-Mihai Burtescu-183/+106
2016-12-28Auto merge of #38589 - aidanhs:aphs-stage0-rustdoc-test, r=alexcrichtonbors-14/+26
Teach `rustdoc --test` about `--sysroot`, pass it when testing rust This permits rustdoc tests to work in stage0. Logical continuation of #36586. Snippet from https://github.com/rust-lang/rust/issues/38575#issuecomment-269090724: > it should actually be possible to run all the libstd tests immediately after creating std of stage0-out - there's no reason to build librustc at all if you've just made a change to (for example) libcollections, `./x.py test src/libcollections --stage 0 -v --incremental` should just work This PR makes it so (or appears to in my testing). r? @alexcrichton
2016-12-28Auto merge of #38579 - whitequark:min_atomic_width, r=alexcrichtonbors-1/+14
Add a min_atomic_width target option, like max_atomic_width Rationale: some ISAs, e.g. OR1K, do not have atomic instructions for byte and halfword access, and at the same time do not have a fixed endianness, which makes it unreasonable to implement these through word-sized atomic accesses.
2016-12-28rustbuild: fix host-only rules ignoring targets in dist stepsWang Xuerui-4/+10
`arr` is the actual list of targets participating in steps construction, but due to #38468 the hosts array now consists of only the build triple for the `dist` steps, hence all non-build-triple targets are lost for the host-only rules. Fix this by using the original non-shadowed hosts array in `arr` calculation. This should unbreak the nightly packaging process. Fixes #38637.
2016-12-27propagate TIME_DEPTH to the helper threads for -Z time-passesNiko Matsakis-4/+21
2016-12-28Auto merge of #38479 - michaelwoerister:extern_mod_ich, r=nikomatsakisbors-14/+307
ICH: Fix and test foreign mod hashing. r? @nikomatsakis
2016-12-27Auto merge of #38329 - ollie27:rustdoc_stab_em_div, r=steveklabnikbors-15/+16
rustdoc: Fix invalid HTML in stability notices `em` tags cannot contain `p` tags so use `div`s instead of `em`s as the Markdown will create `p` tags.
2016-12-28rustbuild: clarify comment on target array calculationWang Xuerui-2/+3
The comment touched, as originally written, only concerned itself with the `test` steps. However, since #38468 the `arr` variable actually has gained an indirect relationship with the `dist` steps too. The comment failed to convey the extra meaning, contributing to the misunderstanding which eventually lead to #38637. Fix that by moving the comment into the right place near the relevant condition, and properly documenting `arr`'s purpose.
2016-12-28rustbuild: get an empty slice the straight-forward wayWang Xuerui-1/+1
2016-12-27Auto merge of #38600 - arielb1:dead-drop, r=eddybbors-38/+93
clear discriminant drop flag at the bottom of a drop ladder Fixes #38437. Beta-nominating because serious I-wrong. r? @eddyb
2016-12-27Fix arguments on RedoxJeremy Soller-9/+5
2016-12-27Accept ninja-build binary in place of ninjaRobin Kruppe-1/+5
2016-12-27Auto merge of #38577 - redox-os:master, r=alexcrichtonbors-2/+3
Add Debug to OpenOptions and DirBuilder This fixes the build on Redox as the platform independent structs now implement Debug.
2016-12-27Auto merge of #38574 - Mark-Simulacrum:box-free-unspecialize, r=eddybbors-64/+32
Remove special case for Box<ZST> in trans Remove extra lang item, `exchange_free`; use `box_free` instead. Trans used to insert code equivalent to `box_free` in a wrapper around `exchange_free`, and that code is now removed from trans. Fixes #37710.
2016-12-27Auto merge of #38537 - jseyfried:fix_rustdoc_ice, r=nrcbors-0/+58
Fix ICE in rustdoc Fixes #38237. r? @nrc
2016-12-27Auto merge of #38507 - alexcrichton:travis-lldb, r=brsonbors-0/+1
travis: Update the OSX image we run tests in The current image is `xcode7.3`, Travis's current default. Unfortunately this has a version of LLDB which doesn't support debuginfo-lldb tests (see #32520), so we're not running LLDB tests on Travis yet. This switches us to the newest image from Travis, `xcode8.2`, which should have a newer version of LLDB we can run tests against.
2016-12-26Remove extra lang item, exchange_free; use box_free instead.Mark Simulacrum-64/+32
Trans used to insert code equivalent to box_free in a wrapper around exchange_free, and that code is now removed from trans.
2016-12-26travis: Update the OSX image we run tests inAlex Crichton-0/+1
The current image is `xcode7.3`, Travis's current default. Unfortunately this has a version of LLDB which doesn't support debuginfo-lldb tests (see #32520), so we're not running LLDB tests on Travis yet. This switches us to the newest image from Travis, `xcode8.2`, which should have a newer version of LLDB we can run tests against.
2016-12-26Auto merge of #38274 - elahn:windows-readconsole-ctrl-z, r=alexcrichtonbors-4/+33
Ctrl-Z returns from Stdin.read() when reading from the console on Windows Fixes #19914. Fixes read(), read_to_string(), read_to_end(), etc. r? @alexcrichton
2016-12-26Auto merge of #38314 - japaric:do-not-delete-enable-llvm-backend, r=alexcrichtonbors-3/+121
initial SPARC support ### UPDATE Can now compile `no_std` executables with: ``` $ cargo new --bin app && cd $_ $ edit Cargo.toml && tail -n2 $_ [dependencies] core = { path = "/path/to/rust/src/libcore" } $ edit src/main.rs && cat $_ #![feature(lang_items)] #![no_std] #![no_main] #[no_mangle] pub fn _start() -> ! { loop {} } #[lang = "panic_fmt"] fn panic_fmt() -> ! { loop {} } $ edit sparc-none-elf.json && cat $_ { "arch": "sparc", "data-layout": "E-m:e-p:32:32-i64:64-f128:64-n32-S64", "executables": true, "llvm-target": "sparc", "os": "none", "panic-strategy": "abort", "target-endian": "big", "target-pointer-width": "32" } $ cargo rustc --target sparc-none-elf -- -C linker=sparc-unknown-elf-gcc -C link-args=-nostartfiles $ file target/sparc-none-elf/debug/app app: ELF 32-bit MSB executable, SPARC, version 1 (SYSV), statically linked, not stripped $ sparc-unknown-elf-readelf -h target/sparc-none-elf/debug/app ELF Header: Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00 Class: ELF32 Data: 2's complement, big endian Version: 1 (current) OS/ABI: UNIX - System V ABI Version: 0 Type: EXEC (Executable file) Machine: Sparc Version: 0x1 Entry point address: 0x10074 Start of program headers: 52 (bytes into file) Start of section headers: 1188 (bytes into file) Flags: 0x0 Size of this header: 52 (bytes) Size of program headers: 32 (bytes) Number of program headers: 2 Size of section headers: 40 (bytes) Number of section headers: 14 Section header string table index: 11 $ sparc-unknown-elf-objdump -Cd target/sparc-none-elf/debug/app target/sparc-none-elf/debug/app: file format elf32-sparc Disassembly of section .text: 00010074 <_start>: 10074: 9d e3 bf 98 save %sp, -104, %sp 10078: 10 80 00 02 b 10080 <_start+0xc> 1007c: 01 00 00 00 nop 10080: 10 80 00 02 b 10088 <_start+0x14> 10084: 01 00 00 00 nop 10088: 10 80 00 00 b 10088 <_start+0x14> 1008c: 01 00 00 00 nop ``` --- Someone wants to attempt launching some Rust [into space](https://www.reddit.com/r/rust/comments/5h76oa/c_interop/) but their platform is based on the SPARCv8 architecture. Let's not block them by enabling LLVM's SPARC backend. Something very important that they'll also need is the "cabi" stuff as they'll be embedding some Rust code into a bigger C application (i.e. heavy use of `extern "C"`). The question there is what name(s) should we use for "target_arch" as the "cabi" implementation [varies according to that parameter](https://github.com/rust-lang/rust/blob/1.13.0/src/librustc_trans/abi.rs#L498-L523). AFAICT, SPARCv8 is a 32-bit architecture and SPARCv9 is a 64-bit architecture. And, LLVM uses `sparc`, `sparcv9` and `sparcel` for [the architecture triple](https://github.com/rust-lang/llvm/blob/ac1c94226e9fa17005ce7e2dd52dd6d1875f3137/include/llvm/ADT/Triple.h#L67-L69) so perhaps we should use `target_arch = "sparc"` (32-bit) and `target_arch = "sparcv9"` (64-bit) as well. r? @alexcrichton This PR only enables this LLVM backend when rustbuild is used. Do I also need to implement this for the old Makefile-based build system? Or are all our nightlies now being generated using rustbuild? cc @brson
2016-12-26travis: Attempt to fix Android flakinessAlex Crichton-1/+3
There's been some flaky runs on Travis where the Android emulator is having problems staying alive... presumably? For example: * https://travis-ci.org/rust-lang/rust/jobs/186736745 This commit spawns the emulator in the same way as buildbot with `nohup` to hope that it goes into the background successfully, followed by a `wait-for-device` command. I'm not actually sure if this'll fix the problems we're seeing, but I figure it can't hurt to test out.
2016-12-26Auto merge of #38542 - YaLTeR:fastcall-fix, r=pnkfelixbors-4/+149
Fix fastcall not applying inreg attributes to arguments Fixes https://github.com/rust-lang/rust/issues/18086
2016-12-26Refactor mir::dataflow: remove Ctxt associated type from BitDenotation trait.Felix S. Klock II-135/+144
I no longer remember why I needed this (or thought I did). The way that the `BitDenotation` is passed around in all existing use cases (and planned future ones), the thing that were in the `Ctxt` can just be part of `Self` instead. (I think ariel had been pushing me to do this back when I first put in this infrastructure; it took me a while to see how much of pain the `Ctxt` was causing.)
2016-12-26Auto merge of #38154 - petrochenkov:altname, r=jseyfriedbors-1335/+2291
More systematic error reporting in path resolution Path resolution for types, expressions and patterns used various heuristics to give more helpful messages on unresolved or incorrectly resolved paths. This PR combines these heuristics and applies them to all non-import paths. First a path is resolved in all namespaces, starting from its primary namespace (to give messages like "expected function, found macro, you probably forgot `!`"). If this resolution doesn't give a desired result we create a base error - either "path is not resolved" or "path is resolved, but the resolution is not acceptable in this context". Other helps and notes are applied to this base error using heuristics. Here's the list of heuristics for a path with a last segment `name` in order. First we issue special messages for unresolved `Self` and `self`. Second we try to find free items named `name` in other modules and suggest to import them. Then we try to find fields and associated items named `name` and suggest `self.name` or `Self::name`. After that we try several deterministic context dependent heuristics like "expected value, found struct, you probably forgot `{}`". If nothing of the above works we try to find candidates with other names using Levenshtein distance. --- Some alternatives/notes/unresolved questions: - ~~I had a strong desire to migrate all affected tests to `test/ui`, diagnostics comparison becomes much more meaningful, but I did this only for few tests so far.~~ (Done) - ~~Labels for "unresolved path" errors are mostly useless now, it may make sense to move some help/notes to these labels, help becomes closer to the error this way.~~ (Done) - ~~Currently only the first successful heuristic results in additional message shown to the user, it may make sense to print them all, they are rarely compatible, so the diagnostics bloat is unlikely.~~ (Done) - Now when https://github.com/rust-lang/rust/pull/38014 landed `resolve_path` can potentially be replaced with `smart_resolve_path` in couple more places - e.g. ~~visibilities~~ (done), ~~import prefixes~~ (done), HIR paths. --- Some additional fixes: - Associated suggestions and typo suggestions are filtered with a context specific predicate to avoid inapplicable suggestions. - `adjust_local_def` works properly in speculative resolution. - I also fixed a recently introduced ICE in partially resolved UFCS paths (see test `ufcs-partially-resolved.rs`). Minimal reproduction: ``` enum E {} fn main() { <u8 as E>::A; } ``` Fixes https://github.com/rust-lang/rust/issues/38409, fixes https://github.com/rust-lang/rust/issues/38504 (duplicates). - Some bugs in resolution of visibilities are fixed - `pub(Enum)`, `pub(Trait)`, `pub(non::local::path)`. - Fixes https://github.com/rust-lang/rust/issues/38012. --- r? @jseyfried for technical details + @jonathandturner for diagnostics changes How to read the patch: `smart_resolve_path(_fragment)/resolve_qpath_anywhere` are written anew and replace `resolve_trait_reference`/`resolve_type`/`resolve_pattern_path`/`resolve_struct_path`/`resolve_expr` for `ExprKind::Path`, everything else can be read as a diff.
2016-12-26More systematic error reporting in path resolutionVadim Petrochenkov-1252/+1246
2016-12-26Auto merge of #38536 - retep998:flauschige-kaninchen, r=petrochenkovbors-20/+25
Fix fs tests on Windows systems with non-english locales. Fixes https://github.com/rust-lang/rust/issues/34628 r? @alexcrichton
2016-12-26Move some compile-fail tests into UI directoryVadim Petrochenkov-323/+1285
2016-12-26Auto merge of #38598 - brson:em, r=alexcrichtonbors-0/+2
Emscripten targets are Unix targets I suspect this will fix the errors compiling libc https://buildbot.rust-lang.org/builders/auto-linux-rustbuild-cross-opt/builds/689/steps/compile/logs/stdio that are occurring on every PR. Emscripten is basically a posix emulation layer for the web and I consider it a Unix. cc @alexcrichton
2016-12-25Move target_family to TargetOptions, not TargetAlex Crichton-2/+2
Just fixing a compile error
2016-12-25Auto merge of #38490 - jseyfried:def_id_vis, r=nrcbors-161/+137
Use `DefId`s instead of `NodeId`s for `pub(restricted)` visibilities This is groundwork for hygiene 2.0, specifically privacy checking hygienic intercrate name resolutions. r? @nrc
2016-12-25Auto merge of #38539 - jseyfried:fix_resolve_hang, r=eddybbors-2/+5
resolve: fix non-termination Fixes #34324. r? @eddyb