Commit Graph

66778 Commits

Author SHA1 Message Date
kennytm
3093bb85f9
Fix error during cross-platform documentation. 2017-08-12 12:07:39 +08:00
bors
2fa5340318 Auto merge of #43792 - steveklabnik:rustdoc-directives, r=frewsxcv
Document the doc attribute

cc #42322
2017-08-12 03:22:09 +00:00
bors
b8266a90b9 Auto merge of #43772 - arielb1:nonfree-block, r=nagisa
For box expressions, use NZ drop instead of a free block

This falls naturally out of making drop elaboration work with `box`
expressions, which is probably required for sane MIR borrow-checking.
This is a pure refactoring with no intentional functional effects.

r? @nagisa
2017-08-12 00:54:38 +00:00
Alex Crichton
fae60b36cb std: Tag OOM functions as #[cold]
This was forgotten from #42727 by accident, but these functions are rarely
called and codegen can be improved in LLVM with the `#[cold]` tag.
2017-08-11 15:59:11 -07:00
Alex Crichton
a83d2afbba std: Tag AllocErr functions as #[inline]
None of these require a significant amount of code and using `#[inline]` will
allow constructors to get inlined, improving codegen at allocation callsites.
2017-08-11 15:58:26 -07:00
bors
8da3ff3fcc Auto merge of #43766 - michaelwoerister:trans-scheduler-touch-up, r=alexcrichton
Improve LLVM/trans scheduling a bit

Currently it's possible that the main thread is waiting on LLVM threads to finish work while its implicit token is going to waste. This PR let's the main thread take over, so one of the running LLVM threads can free its token earlier.

r? @alexcrichton
2017-08-11 22:23:10 +00:00
steveklabnik
035d4ea2ca rustdoc doc tests 2017-08-11 16:43:38 -04:00
Owen Sanchez
0b2c9f03ef Fix unused_result lint triggering when a function returns () or !
Add a test for this case
2017-08-11 13:43:33 -07:00
steveklabnik
1e4aaea431 address review feedback 2017-08-11 16:24:18 -04:00
bors
a7e0d3a81f Auto merge of #43750 - tbu-:pr_fn_unreachable, r=sfackler
Put `intrinsics::unreachable` on a possible path to stabilization

Mark it with the `unreachable` feature and put it into the `mem` module.
This is a pretty straight-forward API that can already be simulated in
stable Rust by using `transmute` to create an uninhabited enum that can
be matched.
2017-08-11 19:43:44 +00:00
bors
edd82ee9f0 Auto merge of #42932 - bjorn3:no_llvm_try2, r=eddyb
Support compiling rustc without LLVM (try 2)

Now doesn't change rustc_driver.

Supersedes #42752
2017-08-11 15:45:10 +00:00
bors
38bdbb7cf9 Auto merge of #43748 - RalfJung:mir-validate2, r=arielb1
AddValidation: handle Call terminators into blocks that have multiple incoming edges

The old code was just wrong: It would add validation on paths that don't even come from the call, and it would add multiple validations if multiple calls end return to the same block.
2017-08-11 13:04:59 +00:00
bjorn3
e5399961c6
Remove some unused dependencies from rustc_trans_utils 2017-08-11 14:00:09 +02:00
bjorn3
b8d5c74c99
It now completely compiles without LLVM!!! 2017-08-11 14:00:07 +02:00
bjorn3
b7314c7caf
Actually make rustc_driver compile without llvm 2017-08-11 14:00:05 +02:00
Guillaume Gomez
e5938ef3c4 Add (a lot of) missing links in fmt module docs 2017-08-11 13:43:31 +02:00
Michael Woerister
a69eaf62c5 Improve validation of TypeckTables keys. 2017-08-11 12:17:07 +02:00
Michael Woerister
1f54df1101 Encapsulate sub-table access in TypeckTables and validate keys on each access. 2017-08-11 12:17:07 +02:00
Michael Woerister
bdfd78db8a Improve documentation for TypeckTables::validate_hir_id(). 2017-08-11 12:11:38 +02:00
Michael Woerister
4dcc3a4aae Use DefIndex instead of NodeId in UpvarId. 2017-08-11 12:11:38 +02:00
Michael Woerister
a8cf6cc6db Add some ID conversion methods to HIR map and Definitions. 2017-08-11 12:11:38 +02:00
Michael Woerister
fbc7398bad Use ItemLocalId as key for TypeckTables::cast_kinds. 2017-08-11 12:11:38 +02:00
Michael Woerister
801dd07a95 Use ItemLocalId as key for TypeckTables::fru_field_types. 2017-08-11 12:11:38 +02:00
Michael Woerister
890f93f8d4 Use ItemLocalId as key for TypeckTables::liberated_fn_sigs. 2017-08-11 12:11:38 +02:00
Michael Woerister
6cd44a9d5e Add missing TypeckTables-switch in save-analysis. 2017-08-11 12:11:38 +02:00
Michael Woerister
55e04d9c17 Make Definitions::find_node_for_hir_id() a linear search instead of a binary one.
Unfortunately, the NodeId->HirId array is not sorted. Since this search is only
done right before calling bug!(), let's not waste time allocating a faster lookup.
2017-08-11 12:11:38 +02:00
Michael Woerister
454533f5d9 Use ItemLocalId as key for closure_tys and closure_kinds in TypeckTables. 2017-08-11 12:11:38 +02:00
Michael Woerister
e777189b4a Use ItemLocalId as key for TypeckTables::pat_binding_modes. 2017-08-11 12:11:38 +02:00
Michael Woerister
7f2423eede Use ItemLocalId as key for node_types, node_substs, and adjustments in TypeckTables. 2017-08-11 12:11:38 +02:00
Michael Woerister
783ccc443b Make TypeckTables::type_dependent_defs use ItemLocalId instead of NodeId. 2017-08-11 12:11:38 +02:00
bors
59675d29eb Auto merge of #43800 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 18 pull requests

- Successful merges: #43176, #43632, #43650, #43712, #43715, #43721, #43739, #43741, #43744, #43747, #43752, #43760, #43773, #43779, #43783, #43791, #43793, #43795
- Failed merges:
2017-08-11 09:37:52 +00:00
bjorn3
b43c02b0aa
Make librustc_driver work without librustc_trans 2017-08-11 10:38:31 +02:00
bjorn3
e152a1620b
Build support for no llvm 2017-08-11 10:38:29 +02:00
Guillaume Gomez
742bba0ebf Rollup merge of #43795 - GuillaumeGomez:improve-variants-doc-style, r=QuietMisdreavus
Improve enum variants display

r? @rust-lang/docs

Before:

<img width="1440" alt="screen shot 2017-08-11 at 00 22 54" src="https://user-images.githubusercontent.com/3050060/29194776-728ce0e2-7e2b-11e7-8299-8300cc0c168b.png">

After:

<img width="1440" alt="screen shot 2017-08-11 at 00 22 57" src="https://user-images.githubusercontent.com/3050060/29194783-78867558-7e2b-11e7-9226-1327fd20163a.png">

(The doc of the variant is more aligned with the "[-]" now).
2017-08-11 10:20:33 +02:00
Guillaume Gomez
77904aad52 Rollup merge of #43793 - j-browne:master, r=steveklabnik
Fix broken links in Arc documentation

Some link references had ticks, when they should not have had them.
2017-08-11 10:20:32 +02:00
Guillaume Gomez
4f5f3faa7d Rollup merge of #43791 - GuillaumeGomez:file-docs, r=QuietMisdreavus
File docs

r? @rust-lang/docs
2017-08-11 10:20:31 +02:00
Guillaume Gomez
3e6e26246e Rollup merge of #43783 - prisme60:prisme60-typo, r=Mark-Simulacrum
Fix typo corersponding -> corresponding

I was reading the documentation of __Struct std::os::unix::net::UnixListener__ when I saw a typo inside.
2017-08-11 10:20:30 +02:00
Guillaume Gomez
6af7b9d4b0 Rollup merge of #43779 - mattico:fix-unicode-typo, r=aidanhs
Fix typo in unicode char definition

Reference: http://www.fileformat.info/info/unicode/char/16ed/index.htm
2017-08-11 10:20:29 +02:00
Guillaume Gomez
7fa572e6a5 Rollup merge of #43773 - ubsan:patch-1, r=eddyb
fix a typo

(this should not have been merged with this typo)
2017-08-11 10:20:28 +02:00
Guillaume Gomez
6fac8dc141 Rollup merge of #43760 - ollie27:rustdoc_search_css, r=GuillaumeGomez
rustdoc: Fix broken CSS in search results

The layout is currently broken for struct/union fields and enum variants
in the search results when searching from a struct, union or enum page.

Some examples:
https://doc.rust-lang.org/nightly/std/ops/struct.RangeInclusive.html?search=start
https://doc.rust-lang.org/nightly/std/option/enum.Option.html?search=some

 #34477 was an incomplete fix
2017-08-11 10:20:27 +02:00
Guillaume Gomez
35947cfbc4 Rollup merge of #43752 - arshiamufti:union-test, r=estebank
Add IRC's `!union union` as a test, addresses #43553

This pull request adds a new test, `union` to `weird-exprs.rs`.
2017-08-11 10:20:26 +02:00
Guillaume Gomez
42b06817e6 Rollup merge of #43747 - GuillaumeGomez:fix-css, r=QuietMisdreavus
Improve headers linking

r? @QuietMisdreavus
2017-08-11 10:20:25 +02:00
Guillaume Gomez
2ad3baa2b3 Rollup merge of #43744 - MaloJaffre:stage1-test, r=Mark-Simulacrum
Ignore tests that fail on stage1

That makes `./x.py test --stage 1` work on `x86_64-unknown-linux-gnu`.
2017-08-11 10:20:24 +02:00
Guillaume Gomez
18238c7fa3 Rollup merge of #43741 - Gankro:fix-assert, r=eddyb
fix assertion - trait object pointers don't have infinite fields

r? @eddyb
2017-08-11 10:20:23 +02:00
Guillaume Gomez
6047e9300c Rollup merge of #43739 - ibabushkin:master, r=eddyb
Encode proper module spans in crate metadata.

The spans previously encoded only span the first token after the opening
brace, up to the closing brace of inline `mod` declarations. Thus, when
examining exports from an external crate, the spans don't include the
header of inline `mod` declarations.

r? @eddyb
2017-08-11 10:20:22 +02:00
Guillaume Gomez
03abb9d97f Rollup merge of #43721 - natboehm:patch-1, r=steveklabnik
Provide more explanation for Deref in String docs

While working on a different project I encountered a point of confusion where using `&String` to dereference a `String` into `&str` did not compile. I found the explanation of [String Deref](https://doc.rust-lang.org/std/string/struct.String.html#deref), thought that it matched what I was trying to do, and was confused as to why my program did not compile when the docs stated that it would work with 'any function which takes a `&str`'. At the bottom it is mentioned that this will 'generally' work, unless `String` is needed, but I found this statement confusing based on the previous claim of 'any'. Looking further into the docs I was able to find the function `as_str()` that works instead.

I thought it might be helpful to mention here deref coercion, an instance in which using `&String` does not work, to explain why it does not work, then direct users to a different option that should work in this instance. A user casually skimming the page will likely come to this explanation first, then find `as_str()` later, but be no the wiser as to what potentially went wrong.

r? @steveklabnik
2017-08-11 10:20:21 +02:00
Guillaume Gomez
e9d39094c9 Rollup merge of #43715 - ollie27:docs_long_link, r=QuietMisdreavus
Stop using URL shortener in docs

tidy will no longer complain about long lines containing links so there
is no reason to use a URL shortener here.
2017-08-11 10:20:20 +02:00
Guillaume Gomez
aebfe2b60b Rollup merge of #43712 - oli-obk:cfg, r=arielb1
Reexport all SyntaxExtension variants

This was previously done very inconsistently and made matches look weird since some variants had the `SyntaxExtension::` prefix while others didn't.
2017-08-11 10:20:19 +02:00
Guillaume Gomez
96c09f8550 Rollup merge of #43650 - RalfJung:mir-validate, r=arielb1
test MIR validation statements in closures

r? @nikomatsakis
2017-08-11 10:20:18 +02:00
Guillaume Gomez
643231313a Rollup merge of #43632 - ruuda:allow-long-relative-urls, r=Mark-Simulacrum
Detect relative urls in tidy check

This came up in #43631: there can be long relative urls in Markdown comments, that do not start with `http://` or `https://`, so the tidy check will not detect them as urls and complain about the line length. This PR adds detection of relative urls starting with `../`.
2017-08-11 10:20:17 +02:00