Commit Graph

59314 Commits

Author SHA1 Message Date
Liigo Zhuang
d5785a368e rustdoc: fix up --playground-url 2016-11-30 10:33:23 +08:00
Liigo Zhuang
943bf96300 unstable --playground-url, add test code 2016-11-30 10:33:22 +08:00
Liigo Zhuang
c1a6f17031 rustdoc: get back missing crate-name when --playground-url is used
follow up PR #37763
2016-11-30 10:33:22 +08:00
Andrew Gallant
80ef1dbf2d Add new #[target_feature = "..."] attribute.
This commit adds a new attribute that instructs the compiler to emit
target specific code for a single function. For example, the following
function is permitted to use instructions that are part of SSE 4.2:

    #[target_feature = "+sse4.2"]
    fn foo() { ... }

In particular, use of this attribute does not require setting the
-C target-feature or -C target-cpu options on rustc.

This attribute does not have any protections built into it. For example,
nothing stops one from calling the above `foo` function on hosts without
SSE 4.2 support. Doing so may result in a SIGILL.

This commit also expands the target feature whitelist to include lzcnt,
popcnt and sse4a. Namely, lzcnt and popcnt have their own CPUID bits,
but were introduced with SSE4.
2016-11-29 20:32:14 -05:00
bors
fa0005f2d5 Auto merge of #37863 - mikhail-m1:mut_error, r=nikomatsakis
add hint to fix error for immutable ref in arg

fix  #36412 part of #35233
r? @jonathandturner
2016-11-29 17:27:00 -06:00
Alex Crichton
8e9f7f5836 rustbuild: Use src/rustc for assembled compilers
The `src/rustc` path is intended for assembling a compiler (e.g. the bare bones)
not actually compiling the whole compiler itself. This path was accidentally
getting hijacked to represent the whole compiler being compiled, so let's
redirect that elsewhere for that particular cargo project.

Closes #38039
2016-11-29 13:40:43 -08:00
Eduard-Mihai Burtescu
07ff914be1 rustc: simplify AdtDef by removing the field types and ty::ivar. 2016-11-29 21:24:26 +02:00
Eduard-Mihai Burtescu
3f338eed99 rustc: remove type information from TraitDef. 2016-11-29 21:24:26 +02:00
Doug Goldstein
ffcdc19178
bootstrap/README: fix small typo 2016-11-29 13:14:37 -06:00
bors
b30022a1d3 Auto merge of #37369 - estebank:multiline-span, r=nikomatsakis
Show multiline spans in full if short enough

When dealing with multiline spans that span few lines, show the complete span instead of restricting to the first character of the first line.

For example, instead of:

```
% ./rustc file2.rs
error[E0277]: the trait bound `{integer}: std::ops::Add<()>` is not satisfied
  --> file2.rs:13:9
   |
13 |    foo(1 + bar(x,
   |        ^ trait `{integer}: std::ops::Add<()>` not satisfied
   |
```

show

```
% ./rustc file2.rs
error[E0277]: the trait bound `{integer}: std::ops::Add<()>` is not satisfied
  --> file2.rs:13:9
   |
13 |      foo(1 + bar(x,
   |  ________^ starting here...
14 | |            y),
   | |_____________^ ...ending here: trait `{integer}: std::ops::Add<()>` not satisfied
   |
```

The [proposal in internals](https://internals.rust-lang.org/t/proposal-for-multiline-span-comments/4242/6) outlines the reasoning behind this.
2016-11-29 12:53:47 -06:00
bors
f50dbd580f Auto merge of #37918 - flodiebold:separate-bodies, r=nikomatsakis
Separate function bodies from their signatures in HIR

Also give them their own dep map node.

I'm still unhappy with the handling of inlined items (1452edc1), but maybe you have a suggestion how to improve it.

Fixes #35078.

r? @nikomatsakis
2016-11-29 08:50:38 -06:00
Florian Diebold
593b273659 librustdoc: Fix compilation after visitor change 2016-11-29 13:18:02 +01:00
Niko Matsakis
9457497bcc update comments 2016-11-29 13:04:27 +01:00
Niko Matsakis
104125d5f7 revamp Visitor with a single method for controlling nested visits 2016-11-29 13:04:27 +01:00
Florian Diebold
8575184b39 Fix rebase breakage 2016-11-29 13:04:27 +01:00
Florian Diebold
bf298aebfd Fix doc test collection 2016-11-29 13:04:27 +01:00
Florian Diebold
b10bbde335 Fix SVH tests some more 2016-11-29 13:04:27 +01:00
Florian Diebold
f0ce5bb66b Split nested_visit_mode function off from nested_visit_map
... and make the latter mandatory to implement.
2016-11-29 13:04:27 +01:00
Florian Diebold
725cffb1d5 Address remaining review comments 2016-11-29 13:04:27 +01:00
Florian Diebold
d5a501d312 Fix remaining SVH tests 2016-11-29 13:04:27 +01:00
Florian Diebold
d0ae2c8142 Refactor inlined items some more
They don't implement FnLikeNode anymore, instead are handled differently
further up in the call tree. Also, keep less information (just def ids
for the args).
2016-11-29 13:04:27 +01:00
Niko Matsakis
dd1491cfbe WIP: update tests to pass -- not complete 2016-11-29 13:04:27 +01:00
Niko Matsakis
688946d671 restructure CollectItem dep-node to separate fn sigs from bodies
Setup two tasks, one of which only processes the signatures, in order to
isolate the typeck entries for signatures from those for bodies.

Fixes #36078
Fixes #37720
2016-11-29 13:04:27 +01:00
Florian Diebold
f75c8a98dd Add make tidy fixes 2016-11-29 13:04:27 +01:00
Florian Diebold
23a8c7d4d9 Remove unused import 2016-11-29 13:04:27 +01:00
Florian Diebold
8d5ca62dcd Fix some comments 2016-11-29 13:04:27 +01:00
Florian Diebold
78b54c07e5 Make hello_world test work again
This used to work with the rustc_clean attribute, but doesn't anymore
since my rebase; but I don't know enough about the type checking to find
out what's wrong. The dep graph looks like this:

ItemSignature(xxxx) -> CollectItem(xxxx)
CollectItem(xxxx) -> ItemSignature(xxxx)
ItemSignature(xxxx) -> TypeckItemBody(yyyy)
HirBody(xxxx) -> CollectItem(xxxx)

The cycle between CollectItem and ItemSignature looks wrong, and my
guess is the CollectItem -> ItemSignature edge shouldn't be there, but
I'm not sure how to prevent it.
2016-11-29 13:04:27 +01:00
Florian Diebold
7b021298d9 Fix new tests 2016-11-29 13:04:27 +01:00
Florian Diebold
fb968d225a rustc_typeck: Make CollectItemTypesVisitor descend into bodies as well 2016-11-29 13:04:27 +01:00
Florian Diebold
c91037b964 Fix cross-crate associated constant evaluation 2016-11-29 13:04:27 +01:00
Florian Diebold
936dbbce37 Give function bodies their own dep graph node 2016-11-29 13:04:27 +01:00
Florian Diebold
16eedd2a78 Save bodies of functions for inlining into other crates
This is quite hacky and I hope to refactor it a bit, but at least it
seems to work.
2016-11-29 13:04:27 +01:00
Florian Diebold
1ac338c2a7 rustc_driver: fix compilation 2016-11-29 13:04:27 +01:00
Florian Diebold
0389cc6bcd rustc_passes: fix compilation 2016-11-29 13:04:27 +01:00
Florian Diebold
37e75411dd rustc_plugin: fix compilation 2016-11-29 13:04:27 +01:00
Florian Diebold
2b790f75c5 rustc_plugin: fix compilation 2016-11-29 13:04:27 +01:00
Florian Diebold
441e099195 rustc_metadata: fix compilation 2016-11-29 13:04:27 +01:00
Florian Diebold
0cdd1d4bc1 rustc_privacy: fix compilation 2016-11-29 13:04:27 +01:00
Florian Diebold
dd6a57ce2a rustc_trans: fix compilation 2016-11-29 13:04:27 +01:00
Florian Diebold
8f63b416af rustc_trans: fix compilation 2016-11-29 13:04:27 +01:00
Florian Diebold
2f6976ede9 rustc_incremental: fix compilation 2016-11-29 13:04:27 +01:00
Florian Diebold
490c23f054 rustc_incremental: fix compilation 2016-11-29 13:04:27 +01:00
Florian Diebold
b7a6cf8f10 rustc_typeck: fix compilation 2016-11-29 13:04:27 +01:00
Florian Diebold
8c8257a8c6 rustc_borrowck: fix compilation 2016-11-29 13:04:27 +01:00
Florian Diebold
8f6bb85b98 rustc_mir: fix compilation 2016-11-29 13:04:27 +01:00
Florian Diebold
8e754736dc rustc_const_eval: fix compilation 2016-11-29 13:04:27 +01:00
Florian Diebold
f55482e7c9 rustc: replace body exprs by their ids 2016-11-29 13:04:27 +01:00
Florian Diebold
069a2442b8 Add exprs map to crate, collect item blocks there 2016-11-29 13:04:27 +01:00
Jeffrey Seyfried
c871637e43 Remove resolver.record_resolution(). 2016-11-29 04:47:47 +00:00
bors
5de15be5ec Auto merge of #38046 - rkruppe:fix-32bit-rustbuild, r=alexcrichton
Fix rustbuild on 32 bit Linux

This is cherry-picked from #37817 which seems to be stalled and currently needs to be rebased anyway.

r? @alexcrichton (who authored this change)
2016-11-28 21:44:44 -06:00