Commit Graph

50379 Commits

Author SHA1 Message Date
Manish Goregaokar
d5dddb4acd Rollup merge of #31582 - tshepang:missing-words, r=steveklabnik 2016-02-14 05:06:33 +05:30
Manish Goregaokar
1598995766 Rollup merge of #31563 - SDX2000:docfixes1, r=steveklabnik
This is a minor change. Please see title. IMO this is important since this is the first instance when we talk about allocating a vector. Not saying that it is allocated on the stack here leaves room for speculation and this might put off some people (they might not even read the later sections which go into more detail about this).
2016-02-14 05:06:33 +05:30
Manish Goregaokar
302e5cb232 Rollup merge of #31559 - scottrobertwhittaker:fix-typo, r=steveklabnik
"destructors" was misspelled.

r? @steveklabnik
2016-02-14 05:06:32 +05:30
Manish Goregaokar
42d17cc7cd Rollup merge of #31542 - nodakai:concat_idents-desc, r=steveklabnik
Just a small documentation change.

It would be great if anyone could check my English.
2016-02-14 05:06:32 +05:30
Manish Goregaokar
1c5c2f548e Rollup merge of #31537 - ollie27:book_doc_example, r=steveklabnik
The code sections shouldn't be inside a ```text block.

r? @steveklabnik
2016-02-14 05:06:32 +05:30
Manish Goregaokar
3c845fe869 Rollup merge of #31535 - Ketsuban:more-detail-in-wrapping-shift-documentation, r=steveklabnik
`wrapping_shl` and `wrapping_shr` are easy to mistake for rotations, when in fact they work somewhat differently. The documentation currently available is a little sparse and easy to misinterpret, so I've added a warning to anyone who bumps into them that the equivalent rotate methods may actually be what they're looking for.

If it's deemed useful to add a symmetrical mention to the documentation for the `rotate_left` and `rotate_right` methods, I can certainly have a go at that, but my gut feeling is that people likely to want a rotate will already know about the wrapping-arithmetic methods, for example from writing CPU simulators.
2016-02-14 05:06:32 +05:30
bors
6e446532e8 Auto merge of #31602 - mitaa:rdoc_doc_shorter, r=alexcrichton
fixes #25787
fixes #30366

r? @alexcrichton
2016-02-13 21:43:28 +00:00
bors
c438802aa7 Auto merge of #31596 - mitaa:rdoc_assoc_item, r=alexcrichton 2016-02-13 19:28:09 +00:00
bors
bc9192738d Auto merge of #31591 - alexcrichton:make-clean-with-rustbuild, r=brson
At the same time also touch up the job management on Windows to be a little more resilient to failure.
2016-02-13 17:05:50 +00:00
bors
4b7245047b Auto merge of #31588 - soltanmm:layer, r=nikomatsakis
<sup>**context:** moving back to a layered approach to type checking.</sup>

It looks like they'd not ended up tightly coupled in the time one was owned by the other. Every instance outside of `FnCtxt.inh` was from an `InferCtxt` created and dropped in the same function body.

This conflicts slightly with #30652, but there too it looks like the `FulfillmentContext` is from an `InferCtxt` that is created and dropped within the same function body (across one call to a module-private function).

That said, I heard that the PR that originally moved `FulfillmentContext` into `InferCtxt` was big, which leaves me concerned that I'm missing something.

r? @nikomatsakis
2016-02-13 15:25:23 +00:00
bors
5367776bd1 Auto merge of #31579 - ollie27:msvc_link, r=alexcrichton
/LARGEADDRESSAWARE is already enabled for i686-pc-windows-gnu so we should probably be consistent.
https://msdn.microsoft.com/en-us/library/wz223b1z.aspx

/SAFESEH is a good thing to enable by default.
https://msdn.microsoft.com/en-us/library/9a89h429.aspx
2016-02-13 13:44:02 +00:00
bors
7fc4df6d23 Auto merge of #31570 - tomaka:ignore-emscripten, r=brson
Ignores 82 rpass tests that use threads.
I took care to only ignore tests that call `thread::spawn`. Some tests, for example `issue-16597`, also do fail because of lack of threads support, but for other reasons.

With this PR, we're down to 49 failures.

r? @brson
2016-02-13 12:03:38 +00:00
bors
1ab22d77f9 Auto merge of #31564 - durka:lang-item-icemelt, r=nikomatsakis
This changes three ICEs to fatal errors.

I've grepped for `lang_item.*expect` and `\.expect.*lang` and didn't come up with any more. But, there could be more ICEs lurking.

I wasn't sure about a test because there already _is_ a cfail test for missing lang items, but it only checks one.

Relevant to (already closed) #31477 #31480 #31558.
cc @lilred
2016-02-13 10:23:49 +00:00
bors
5801991b5d Auto merge of #31562 - llogiq:lint_post, r=Manishearth
This fixes #31512 for me.

A bit of explanation: I want to have `check_block_post(&mut self, &Context, &Block)` and `check_crate_post(&mut self, &Context, &Crate)` methods in both early and late lint passes. Ideally we'd have _post methods for all operations that walk, but this'll do for now.

@Manishearth r?
2016-02-13 08:27:42 +00:00
bors
a94642c6f5 Auto merge of #31557 - retep998:house-directory, r=alexcrichton
This is the simple solution. I know @nodakai was working on a more complex solution that overhauled the `fill_utf16_buf` stuff.

r? @alexcrichton
2016-02-13 06:47:29 +00:00
bors
97842f54c9 Auto merge of #31358 - japaric:print-targets, r=alexcrichton
that prints a list of all the triples supported by the `--target` flag

r? @alexcrichton
2016-02-13 03:21:49 +00:00
bors
3548b8c273 Auto merge of #31524 - jonas-schievink:autoderef, r=steveklabnik 2016-02-13 00:16:03 +00:00
Alex Crichton
07638b95ce bootstrap: Be resilient to job object failures
The build bots already use job objects, and they don't support nested job
objects, and we shouldn't entirely bail out in this case anyway!
2016-02-12 10:40:32 -08:00
Jonas Schievink
559fca0fd3 Autoderef in librustc 2016-02-12 19:28:42 +01:00
Jonas Schievink
62bada40de Autoderef in librustc_borrowck 2016-02-12 19:28:42 +01:00
Jonas Schievink
fbeb67985d Autoderef in librustc_lint 2016-02-12 19:28:42 +01:00
Jonas Schievink
65b38f304d Autoderef in librustc_metadata 2016-02-12 19:28:42 +01:00
Jonas Schievink
53b7464e67 Autoderef in librustc_mir 2016-02-12 19:28:42 +01:00
Jonas Schievink
003879ccaa Autoderef in librustc_passes 2016-02-12 19:28:42 +01:00
Jonas Schievink
d12adae719 Autoderef in librustc_plugin 2016-02-12 19:28:42 +01:00
Jonas Schievink
650c082b1e Autoderef in librustc_privacy 2016-02-12 19:28:42 +01:00
Jonas Schievink
8ac5f87db8 Autoderef in librustc_resolve 2016-02-12 19:28:42 +01:00
Jonas Schievink
93e58cc28f Autoderef in librustc_trans 2016-02-12 19:28:42 +01:00
Jonas Schievink
f831d98ba2 Autoderef in librustc_typeck 2016-02-12 19:28:42 +01:00
Jonas Schievink
c877d61b15 Use more autoderef in libsyntax 2016-02-12 19:28:42 +01:00
Jonas Schievink
db6e5d5ef9 Use more autoderef in libsyntax_ext 2016-02-12 19:28:10 +01:00
Jonas Schievink
2b69c989ee Use more autoderef in rustc_driver 2016-02-12 19:27:20 +01:00
Jonas Schievink
5fc61657c9 Make more use of autoderef in librustc_front 2016-02-12 19:27:20 +01:00
bors
ce4b75f256 Auto merge of #30726 - GuillaumeGomez:compile-fail, r=brson
r? @brson
cc @alexcrichton

I still need to add error code explanation test with this, but I can't figure out a way to generate the `.md` files in order to test example source codes.

Will fix #27328.
2016-02-12 18:25:08 +00:00
llogiq
a270b7b2d9 fix double check_item 2016-02-12 18:21:43 +01:00
bors
0c4d81f9bc Auto merge of #31550 - Stebalien:fix-color, r=nrc
Fixes #31546
2016-02-12 16:42:03 +00:00
Jorge Aparicio
0bb4209b88 rustc: add a --print target-list command 2016-02-12 10:39:19 -05:00
bors
c7640aa2aa Auto merge of #31583 - petrochenkov:indi_ast, r=Manishearth
cc #31487
plugin-[breaking-change]

The AST part of https://github.com/rust-lang/rust/pull/30087

r? @Manishearth
2016-02-12 14:56:20 +00:00
mitaa
5c98ae34a6 Shorten docstrings after Markdown rendering 2016-02-12 14:12:27 +01:00
bors
9257e8956e Auto merge of #31541 - tomaka:more-emscripten, r=brson
r? @brson
2016-02-12 12:51:12 +00:00
mitaa
938202c81f Fix associated item identifiers
Search results use the mapping found in `ItemType::to_static_str` for
the identifier, which could not be found on the page in the case of
associated items.
2016-02-12 10:26:46 +01:00
mitaa
a085e3bd45 Fix inherent-associated-const search result links
Normal constants have their own page while associated constants are
embedded within their parent-items page.
2016-02-12 10:25:42 +01:00
bors
77f9231818 Auto merge of #31368 - JohanLorenzo:dont-strip-if-test-build, r=alexcrichton
Tools which rely on DWARF for generating code coverage report, don't generate accurate numbers on test builds. For instance, [this sample main](757bdbf388/src/main.rs) returns [100% coverage](https://coveralls.io/builds/4940156/source?filename=main.rs) when [kcov](https://github.com/SimonKagstrom/kcov/) runs.

With @pnkfelix 's great help, we could narrow down the issue: The linker strips unused function during phase 6. Here's a patch which stops stripping when someone calls `rustc --test $ARGS`. @pnkfelix wasn't sure if we should add a new flag, or just use --test. What do you think @alexcrichton ?

Also, I'm not too sure: where is the best place to add a test for this addition?

Thanks for the help!
2016-02-12 05:53:18 +00:00
Alex Crichton
a1c13d03a5 bootstrap: Add a --clean flag
Also add a `clean` target for the makefiles to blow away everything related to
the build. Note that this specifically does not tamper with:

* the LLVM build directory
* the directory of the bootstrap system
* the cached downloads of cargo/rustc
2016-02-11 20:44:03 -08:00
bors
4b2c7030fd Auto merge of #30830 - arcnmx:static-extern, r=alexcrichton
See #29676

r? @alexcrichton
2016-02-12 02:16:13 +00:00
bors
78a5d5b54e Auto merge of #31123 - alexcrichton:who-doesnt-want-two-build-systems, r=brson
This series of commits adds the initial implementation of a new build system for
the compiler and standard library based on Cargo. The high-level architecture
now looks like:

1. The `./configure` script is run with `--enable-rustbuild` and other standard
   configuration options.
2. A `Makefile` is generate which proxies commands to the new build system.
3. The new build system has a Python script entry point which manages
   downloading both a Rust and Cargo nightly. This initial script also manages
   building the build system itself (which is written in Rust).
4. The build system, written in rust and called `bootstrap`, architects how to
   call `cargo` and manages building all native libraries and such.

One might reasonably ask "why rewrite the build system?", which is a good
question! The Rust project has used Makefiles for as long as I can remember at
least, and while ugly and difficult to use are undeniably robust as they contain
years worth of tweaking and tuning for working on as many platforms in as many
situation as possible. The rationale behind this PR, however is:

* The makefiles are impenetrable to all but a few people on this
  planet. This means that contributions to the build system are almost
  nonexistent, and furthermore if a build system change is needed it's
  incredibly difficult to figure out how to do so. This hindrance prevents us
  from doing some "perhaps fancier" things we may wish to do in make.

* Our build system, while portable, is unfortunately not infinitely portable
  everywhere.  For example the recently-introduced MSVC target is quite unlikely
  to have `make` installed by default (e.g. it requires building inside of an
  MSYS2 shell currently). Conversely, the portability of make comes at a cost of
  crazy and weird hacks to work around all sorts of versions of software
  everywhere, especially when it comes to the configure script and makefiles.
  By rewriting this logic in one of the most robust platforms there is, Rust,
  we get to assuage all of these worries for free!

* There's a standard tool to build Rust crates, Cargo, but the standard library
  and compiler don't use it. This means that they cannot benefit easily from the
  crates.io ecosystem, nor can the ecosystem benefit from a standard way to
  build this repository itself. Moving to Cargo should help assuage both of
  these needs. This has the added benefit of making the compiler more
  approachable for newbies as working on the compiler will just happen to be
  working on a large Cargo project, all the same standard tools and tricks will
  apply.

* There's a huge amount of portability information in the main distribution, for
  example around cross compiling, compiling on new OSes, etc. Pushing this logic
  into standard crates (like `gcc`) enables the community to immediately benefit
  from new build logic.

Despite these benefits, it's going to be a long road to actually replace our
current build system. This PR is just the beginning and doesn't implement the
full suite of functionality as the current one, but there are many more to
follow! The current implementation strategy hopes to look like:

1. Land a second build system in-tree that can be itereated on an and
   contributed to. This will not be used just yet in terms of gating new commits
   to the repo.
2. Over time, bring the second build system to feature parity with the old build
   system, start setting up CI for both build systems.
3. At some point in the future, switch the default to the new build system, but
   keep the old one around.
4. At some further point in the future, delete the entire old build system.

---

Alright, so with all that out of the way, here's some more info on this PR
itself. The inital build system here is contained in the `src/bootstrap`
directory and just adds the necessary minimum bits to bootstrap the compiler
itself. There is currently no support for building documentation, running tests,
or installing, but the implemented support is:

* Compiling LLVM with `cmake` instead of `./configure` + `make`. The LLVM
  project is removing their autotools build system, so we'd have to make this
  transition eventually anyway.

* Compiling compiler-rt with `cmake` as well (for the same rationale as above).

* Adding `Cargo.toml` to map out the dependency graph to all crates, and also
  adding `build.rs` files where appropriate. For example `alloc_jemalloc` has a
  script to build jemalloc, `flate` has a script to build `miniz.c`, `std` will
  build `libbacktrace`, etc.

* Orchestrating all the calls to `cargo` to build the standard distribution,
  following the normal bootstrapping process. This also tracks dependencies
  between steps to ensure cross-compilation targets happen as well.

* Configuration is intended to eventually be done through a `config.toml` file,
  so support is implemented for this. The most likely vector of configuration
  for now, however, is likely through `config.mk` (what `./configure` emits), so
  the build system currently parses this information.

There's still quite a few steps left to do, and I'll open up some follow-up
issues (as well as a tracking issue) for this migration, but hopefully this is a
great start to get going! This PR is currently tested on all the
Windows/Linux/OSX triples for x86\_64 and x86, but more portability is always
welcome!

---

Future functionality left to implement

* [ ] Re-verify that multi-host builds work
* [ ] Verify android build works
* [ ] Verify iOS build work (mostly compiler-rt)
* [ ] Verify sha256 and ideally gpg of downloaded nightly compiler and nightly rustc
* [ ] Implement testing -- this is a huge bullet point with lots of sub-bullets
* [ ] Build and generate documentation (plus the various tools we have in-tree)
* [ ] Move various src/etc scripts into Rust -- not sure how this interacts with `make` build system
* [ ] Implement `make install` - like testing this is also quite massive
* [x] Deduplicate version information with makefiles
2016-02-12 00:19:13 +00:00
bors
98ec51a4dd Auto merge of #31545 - dotdash:no_noalias, r=alexcrichton
LLVM's memory dependence analysis doesn't properly account for calls
that could unwind and thus effectively act as a branching point. This
can lead to stores that are only visible when the call unwinds being
removed, possibly leading to calls to drop() functions with b0rked
memory contents.

As there is no fix for this in LLVM yet and we want to keep
compatibility to current LLVM versions anyways, we have to workaround
this bug by omitting the noalias attribute on &mut function arguments.
Benchmarks suggest that the performance loss by this change is very
small.

Thanks to @RalfJung for pushing me towards not removing too many
noalias annotations and @alexcrichton for helping out with the test for
this bug.

Fixes #29485
2016-02-11 22:22:54 +00:00
Tshepang Lekhonkhobe
583f638a73 doc: add missing words 2016-02-11 22:59:34 +02:00
Vadim Petrochenkov
77cc5764b9 Remove some unnecessary indirection from AST structures 2016-02-11 23:33:09 +03:00
Alex Crichton
55dd595c08 rustc_back: Fix disabling jemalloc
When building with Cargo we need to detect `feature = "jemalloc"` to enable
jemalloc, so propagate this same change to the build system to pass the right
`--cfg` argument.
2016-02-11 11:12:33 -08:00