Commit Graph

55801 Commits

Author SHA1 Message Date
Guillaume Gomez
3e46c9dfcc Add doc examples for FileType struct 2016-08-03 12:52:36 +02:00
bors
9cf189701e Auto merge of #35178 - m4b:fix-relx-musl, r=alexcrichton
Add -mrelax-relocations=no hacks to fix musl build

* this is just a start, dunno if it will work, but I'll just push it out to get feedback (my rust is still building 😢)
* I don't know much about rustbuild, so i just added that flag in there. it's a total hack, don't judge me
* I suspect the places in the musl .mk files are sufficient (but we may also need it present when building std), I'm not sure, needs more testing.
2016-08-03 02:23:29 -07:00
bors
ea07d52676 Auto merge of #35176 - japaric:no-atomics, r=alexcrichton
core: fix `cargo build` for targets with "max-atomic-width": 0

This crate was failing to compile due to dead_code/unused_imports
warnings. This commits disables these two lints for these targets.

---

r? @alexcrichton
cc @Amanieu is `cfg(target_has_atomic = "8")` the right `cfg` to use? I think that all targets that support some form of atomics will at a minimum support byte level atomics.

FWIW, the only thing that's left in `sync::atomic` for these targets is `Ordering` and the `fence` function.
2016-08-02 23:32:31 -07:00
bors
f495483f2d Auto merge of #35159 - michaelwoerister:incr-comp-implies-orbit, r=nikomatsakis
Automatically enable -Zorbit if -Zincremental is specified.

Fixes #34973

r? @nikomatsakis
2016-08-02 20:25:50 -07:00
Niko Matsakis
54595ecb60 use memoized pattern for SizedConstraint
I cannot figure out how to write a test for this, but I observed
incorrect edges as a result of not using memoized pattern here
(e.g., LateLintCheck -> SizedConstraint).
2016-08-02 19:31:25 -04:00
bors
379bfd0bc1 Auto merge of #35197 - eddyb:mir-cross-crate, r=nikomatsakis
rustc_trans: don't lose the cross-crate DefId, MIR trans needs it.

We might have been missing out on some issues because MIR trans was never being used cross-crate.

cc @rust-lang/compiler
2016-08-02 16:13:55 -07:00
Niko Matsakis
b13d5041f6 improve log when something no longer exists 2016-08-02 19:11:46 -04:00
Vadim Petrochenkov
5c88efc0da Properly enforce the "patterns aren't allowed in foreign functions" check
Apply the same check to function pointer types
2016-08-03 01:29:53 +03:00
Eduard Burtescu
ee977e715f rustc_trans: don't lose the cross-crate DefId, MIR trans needs it. 2016-08-03 01:25:34 +03:00
Scott A Carr
d5908a3250 run mir opt test with mir-opt-level=3 so they fire 2016-08-02 14:47:53 -07:00
Vadim Petrochenkov
e5cc046659 Move the E0130 check to AST validation pass 2016-08-03 00:44:10 +03:00
mLuby
d90c16625f Update the-stack-and-the-heap.md
Was surprised to learn that heaps were used in this way, then realized upon reading [the linked paper](http://www.cs.cmu.edu/afs/cs/academic/class/15213-f98/doc/dsa.pdf) that it's a totally different type of heap—an important distinction.
2016-08-02 14:08:19 -07:00
Michael Woerister
44dbc4907d Automatically enable -Zorbit if -Zincremental is specified. 2016-08-02 17:02:01 -04:00
Niko Matsakis
94acff1803 replace graph rewriting with detecting inlined ids
We now detect inlined id's earlier (in the HIR map) and rewrite a read
of them to be a read of the metadata for the associated item.
2016-08-02 16:36:09 -04:00
bors
a005b67859 Auto merge of #35187 - alexcrichton:only-orbit-off-stage1-and-two, r=eddyb
mk: Only pass -Zorbit=off in stage1/2

The stage0 compiler doesn't understand this option.
2016-08-02 13:10:27 -07:00
Alex Crichton
2fd8044cef mk: Only pass -Zorbit=off in stage1/2
The stage0 compiler doesn't understand this option.
2016-08-02 13:06:43 -07:00
Jorge Aparicio
5f80104431 core: fix cargo build for targets with "max-atomic-width": 0
This crate was failing to compile due to dead_code/unused_imports
warnings. This commits disables these two lints for these targets.
2016-08-02 14:34:40 -05:00
Scott A Carr
d918c990de add hashtag to emphasis its a gh issue 2016-08-02 12:30:57 -07:00
Guillaume Gomez
1fa9b8dc96 Add doc example for Vec 2016-08-02 20:45:31 +02:00
Scott A Carr
e8bfba7dc8 fix field type, add test 2016-08-02 11:24:55 -07:00
Scott A Carr
bda46c21fe reduce rightward drift, add fixme 2016-08-02 10:46:26 -07:00
m4b
5383cd7163 Fix style issues 2016-08-02 09:54:05 -07:00
bors
32e462ef99 Auto merge of #35145 - jseyfried:avoid_extra_resolve_error, r=arielb1
resolve: Avoid emitting an unhelpful cascading resolution error

Fixes #35142.
2016-08-02 06:12:23 -07:00
Corey Farwell
727d9293e4 Add doc examples for range::RangeArgument::{start,end}. 2016-08-02 09:01:46 -04:00
Corey Farwell
3081dd8637 Add doc example for std::ffi::NulError::nul_position. 2016-08-02 08:50:04 -04:00
Niko Matsakis
903142aee3 dump statistics about re-use w/ -Z time-passes
It's nice to get a rough idea of how much work we're
saving.
2016-08-02 05:31:25 -04:00
Niko Matsakis
2e7df80098 make metadata hashes determinstic
When we hash the inputs to a MetaData node, we have to hash them in a
consistent order. We achieve this by sorting the stringfied `DefPath`
entries. Also, micro-optimie by cache more results across the saving
process.
2016-08-02 05:31:25 -04:00
Niko Matsakis
2797b2a5ca remove register_reads
The reads will occur naturally as the HIR/MIR is fetched from the
tracked tables, and this winds up adding reads to the hir of foreign
def-ids somehow.
2016-08-02 05:31:25 -04:00
Niko Matsakis
b4929d11ae watch out for krate numbers being reassigned
The biggest problem, actually, is krate numbers being removed entirely,
which can lead to array-index-out-of-bounds errors.

cc #35123 -- not a complete fix, since really we ought to "map" the old
crate numbers to the new ones, not just detect changes.
2016-08-02 05:31:25 -04:00
Niko Matsakis
c56eb4b7f5 remap Hir(InlinedDefId) to MetaData(OriginalDefId)
The way we do HIR inlining introduces reads of the "Hir" into the graph,
but this Hir in fact belongs to other crates, so when we try to load
later, we ICE because the Hir nodes in question don't belond to the
crate (and we haven't done inlining yet). This pass rewrites those HIR
nodes to the metadata from which the inlined HIR was loaded.
2016-08-02 05:31:25 -04:00
bors
97d5be9819 Auto merge of #35084 - tbu-:pr_lowercase_wtf8_debug, r=brson
Escape the unmatched surrogates with lower-case hexadecimal numbers

It's done the same way for the rest of the codepoint escapes.
2016-08-02 02:30:17 -07:00
bors
34d14e7eed Auto merge of #34096 - eddyb:launch, r=nikomatsakis
Switch to MIR-based translation by default.

This patch makes `-Z orbit` default to "on", which means that by default, functions will be translated from Rust to LLVM IR through the upcoming MIR backend, instead of the antiquated AST backend.

This switch is made possible by the recently merged #33622, #33905 and smaller fixes.

If you experience any issues, please file a report for each of them. You can switch to the old backend to work around problems by either setting `RUSTFLAGS="-Zorbit=off"` or by annotating specific functions with `#[rustc_no_mir]` (which requires `#![feature(rustc_attrs)]` at the crate-level).

I would like this PR to get into nightly soon so that we can get early feedback in this release cycle and focus on correctness fixes and performance improvements, with the potential for removing the old backend implementation before beta branches off.

cc @rust-lang/compiler
2016-08-01 23:42:48 -07:00
m4b
884b969f2a Add -mrelax-relocations=no hacks to fix musl build 2016-08-01 23:42:15 -07:00
Eduard Burtescu
b583711ff9 Ignore the lang-items example in the book. 2016-08-02 09:02:19 +03:00
Eduard Burtescu
dbc3391a23 tests: mark the inline asm in run-pass/issue-14936 as volatile. 2016-08-02 09:01:48 +03:00
Eduard Burtescu
98a516274a rustc: parse -Z orbit=off. 2016-08-02 09:01:48 +03:00
Eduard Burtescu
b197a375c0 tests: don't use -Zorbit on run-pass/issue-28950, it stack overflows. 2016-08-02 09:01:48 +03:00
Eduard Burtescu
5d00b8aa06 rustc_trans: load C-like enums larger than usize from memory with -Zorbit. 2016-08-02 09:01:47 +03:00
Eduard Burtescu
90ba77a7a9 Make --enable-orbit the default in ./configure. 2016-08-02 09:01:47 +03:00
bors
19765f2ab1 Auto merge of #35054 - pwoolcoc:stringfromchars, r=brson
implement `From<Vec<char>>` and `From<&'a [char]>` for `String`

Though there are ways to convert a slice or vec of chars into a string,
it would be nice to be able to just do `String::from(&['a', 'b', 'c'])`,
so this PR implements `From<Vec<char>>` and `From<&'a [char]>` for
String.
2016-08-01 20:05:57 -07:00
Eduard Burtescu
a9e291c3c6 Turn -Z orbit on by default. 2016-08-02 03:29:13 +03:00
Corey Farwell
f2d8db15df Link to relevant method/struct for std::net::Shutdown docs. 2016-08-01 20:21:08 -04:00
bors
1ece9ca968 Auto merge of #35018 - cgswords:rope_tstream, r=nrc
Reimplement TokenStreams using ropes

Title says it all; a reimplementation of TokenStreams as ropes.

r? @nrc
2016-08-01 17:17:28 -07:00
Corey Farwell
57e3b9eb71 Indicate where the std::net::Incoming struct is created. 2016-08-01 20:16:56 -04:00
Niko Matsakis
9294f8ed0a hash foreign items too 2016-08-01 19:57:32 -04:00
Scott A Carr
62cdbea8c9 deaggregate structs to enable further optimization 2016-08-01 15:57:10 -07:00
Jeffrey Seyfried
a18fc76049 Refactor directive.import(binding) -> resolver.import(binding, directive). 2016-08-01 19:10:07 +00:00
Jeffrey Seyfried
0db8ca6ca2 nit: rename module_ -> module 2016-08-01 19:10:05 +00:00
Jeffrey Seyfried
6372a6d7c2 Improve diagnostics for pattern bindings that illegally shadow items.
Improve unused import detection.
2016-08-01 19:09:58 +00:00
Jeffrey Seyfried
07c706b57c Clean up resolver.record_use(). 2016-08-01 19:06:47 +00:00