Commit graph

48890 commits

Author SHA1 Message Date
Brian Anderson 6c65cc1f8f Remove links to out-of-tree docs 2015-12-23 14:04:43 -08:00
Brian Anderson 2f3c472d10 Remove the FAQs in favor of the website 2015-12-23 14:03:45 -08:00
bors 2b8e96dad2 Auto merge of #30482 - luqmana:const-fat-ptr, r=dotdash
Fixes #30479.
2015-12-21 00:39:24 +00:00
bors 3d150397a2 Auto merge of #30470 - petrochenkov:owned5, r=nrc
cc https://github.com/rust-lang/rust/pull/30095

r? @nrc
2015-12-20 22:50:34 +00:00
bors 19c997ea5e Auto merge of #30469 - nagisa:mir-gv-prettify, r=luqmana
One will look at graphviz often when working with MIR, so may as well make the tables a bit more
pretty :)

![This is what it looks like now](https://cloud.githubusercontent.com/assets/679122/11908983/438f228e-a5ea-11e5-90bd-a2c2ec52412e.png)
2015-12-20 21:03:48 +00:00
bors 33914f2713 Auto merge of #30468 - Eljay:fix-doc-link, r=alexcrichton 2015-12-20 16:34:09 +00:00
bors d3aec9fd20 Auto merge of #30454 - mmcco:size_t, r=alexcrichton
It returns sizeof(dirent_t), so I'm not sure why its return type is int.
It's only used once, and that usage immediately casts it to usize.
2015-12-20 07:19:07 +00:00
bors b9fd0ca16d Auto merge of #30455 - mmcco:beautify-isaac, r=alexcrichton
Call me verbose, but the existing logic was hideously formatted. The
result still fits in a small terminal. No functional change.
2015-12-20 05:28:26 +00:00
bors f23157b693 Auto merge of #30436 - durka:patch-14, r=alexcrichton
Relevant to #30422.
2015-12-20 02:15:06 +00:00
bors abf60b20aa Auto merge of #30430 - mmcco:master, r=alexcrichton
Rust already supports Linux's getrandom(2), which is very similar and
was based on getentropy(2). This is a pretty clean, simple addition that
uses the same approach as the iOS randomness API support.
2015-12-19 23:21:12 +00:00
bors cef0d0f9a8 Auto merge of #30401 - DiamondLovesYou:pnacl-target, r=alexcrichton
r? @alexcrichton
2015-12-19 21:29:04 +00:00
bors 712eccee29 Auto merge of #30394 - geofft:dt-runpath, r=alexcrichton
This causes the linker to emit DT_RUNPATH instead of DT_RPATH, which fixes #30378. See that bug for rationale.
2015-12-19 19:39:25 +00:00
Luqman Aden 0f860c2977 [MIR] Handle FatPtr in mir::constant::trans_constval. 2015-12-19 09:58:11 -05:00
bors d8cc67fb26 Auto merge of #30435 - Ms2ger:ParseResult, r=alexcrichton 2015-12-19 14:07:08 +00:00
bors fec739bee2 Auto merge of #30408 - durka:issue-26873, r=alexcrichton
I think we can close #26873 with these tests.
2015-12-19 08:08:53 +00:00
Richard Diamond 0442be8e1c Add PNaCl target info to the makefile target cfgs and initialize the PNaCl target
machine if available.
2015-12-19 00:26:53 -06:00
bors 67a2d1f34f Auto merge of #30403 - webmobster:master, r=alexcrichton
I didn't see any reason that debug couldn't be added to this object, since every field derives debug.
2015-12-19 06:21:10 +00:00
Michael McConville 9fde3e9b94 Use libc's syscall() and NR_GETENTROPY const 2015-12-18 22:40:07 -05:00
Michael McConville 314062b701 Pull newer version of libc for NR_GETENTROPY 2015-12-18 22:37:54 -05:00
Michael McConville e8d2706cba Merge branch 'master' of https://github.com/rust-lang/rust 2015-12-18 22:37:00 -05:00
bors 440ef8b154 Auto merge of #30184 - petrochenkov:ascr, r=nikomatsakis
This PR is a rebase of the original PR by @eddyb https://github.com/rust-lang/rust/pull/21836 with some unrebasable parts manually reapplied, feature gate added + type equality restriction added as described below.

This implementation is partial because the type equality restriction is applied to all type ascription expressions and not only those in lvalue contexts. Thus, all difficulties with detection of these contexts and translation of coercions having effect in runtime are avoided.
So, you can't write things with coercions like `let slice = &[1, 2, 3]: &[u8];`. It obviously makes type ascription less useful than it should be, but it's still much more useful than not having type ascription at all.
In particular, things like `let v = something.iter().collect(): Vec<_>;` and `let u = t.into(): U;` work as expected and I'm pretty happy with these improvements alone.

Part of https://github.com/rust-lang/rust/issues/23416
2015-12-19 02:45:15 +00:00
Vadim Petrochenkov e3da2a9003 Improve OwnedSlice and use it in HIR 2015-12-19 04:20:11 +03:00
bors 8ad12c3e25 Auto merge of #30381 - fhahn:memchr-in-std, r=alexcrichton
This PR adds `memchr`and `memrchr` based on @BurntSushi 's rust-memchr crate to libstd (as discussed in #30151).

I've update some places in libstd to use memchr/memrchr, but I am not sure if there are other places where it could be used as well.

ref #30076
2015-12-19 00:57:25 +00:00
Michael McConville 33113f86f4 Fix build by removing needless type prefix 2015-12-18 19:26:11 -05:00
Michael McConville 5b282981d3 Simplify logic checking getentropy's return value 2015-12-18 19:26:11 -05:00
Michael McConville 3ee3a784bf Use a const for getentropy(2)'s syscall number
Reported by Sebastien Marie.
2015-12-18 19:26:10 -05:00
Michael McConville a51b70b816 Use the correct syscall name in panic message
I copied it from the getrandom code but forgot to change the name.
Reported by Sebastien Marie.
2015-12-18 19:26:10 -05:00
Michael McConville f4d409d6ed Use the getentropy(2) syscall on OpenBSD
Rust already supports Linux's getrandom(2), which is very similar and
was based on getentropy(2). This is a pretty clean, simple addition that
uses the same approach as the iOS randomness API support.
2015-12-18 19:26:09 -05:00
Simonas Kazlauskas 03903cbc20 Prettify MIR graphviz output
One will look at graphviz often when working with MIR, so may as well make the tables a bit more
pretty :)
2015-12-19 01:25:10 +02:00
bors 9e278950c2 Auto merge of #30364 - luqmana:mir-calls, r=nikomatsakis 2015-12-18 23:06:24 +00:00
Luqman Aden a6b861b197 [MIR] Initial implementation for translating calls. 2015-12-18 17:33:29 -05:00
Lee Jeffery d724dae2d4 Fix broken link in E0070 description. 2015-12-18 21:47:16 +00:00
Florian Hahn a206e556d0 Use memrchr bindings provided by libc 2015-12-18 21:49:20 +01:00
bors 5dd29cc310 Auto merge of #30389 - nikomatsakis:rfc1214-error, r=arielb1
Make RFC 1214 warnings into errors, and rip out the "warn or err"
associated machinery. Future such attempts should go through lints
anyhow.

There is a fair amount of fallout in the compile-fail tests, as WF
checking now occurs earlier in the process.

r? @arielb1
2015-12-18 20:44:33 +00:00
bors ef91cdb140 Auto merge of #29973 - petrochenkov:privinpub, r=nikomatsakis
Some notes:
This patch enforces the rules from [RFC 136](https://github.com/rust-lang/rfcs/blob/master/text/0136-no-privates-in-public.md) and makes "private in public" a module-level concept and not crate-level. Only `pub` annotations are used by the new algorithm, crate-level exported node set produced by `EmbargoVisitor` is not used. The error messages are tweaked accordingly and don't use the word "exported" to avoid confusing people (https://github.com/rust-lang/rust/issues/29668).

The old algorithm tried to be extra smart with impls, but it mostly led to unpredictable behavior and bugs like https://github.com/rust-lang/rust/issues/28325.
The new algorithm tries to be as simple as possible - an impl is considered public iff its type is public and its trait is public (if presents).
A type or trait is considered public if all its components are public, [complications](https://internals.rust-lang.org/t/limits-of-type-inference-smartness/2919) with private types leaking to other crates/modules through trait impls and type inference are deliberately ignored so far.

The new algorithm is not recursive and uses the nice new facility `Crate::visit_all_items`!

Obsolete pre-1.0 feature `visible_private_types` is removed.

This is a [breaking-change].
The two main vectors of breakage are type aliases (https://github.com/rust-lang/rust/issues/28450) and impls (https://github.com/rust-lang/rust/issues/28325).
I need some statistics from a crater run (cc @alexcrichton) to decide on the breakage mitigation strategy.
UPDATE: All the new errors are reported as warnings controlled by a lint `private_in_public` and lint group `future_incompatible`, but the intent is to make them hard errors eventually.

Closes https://github.com/rust-lang/rust/issues/28325
Closes https://github.com/rust-lang/rust/issues/28450
Closes https://github.com/rust-lang/rust/issues/29524
Closes https://github.com/rust-lang/rust/issues/29627
Closes https://github.com/rust-lang/rust/issues/29668
Closes https://github.com/rust-lang/rust/issues/30055

r? @nikomatsakis
2015-12-18 18:54:52 +00:00
Vadim Petrochenkov 785cbe0200 Do not substitute type aliases during error reporting
Type aliases are still substituted when determining impl publicity
2015-12-18 20:57:36 +03:00
Niko Matsakis dbf994bbaf Make RFC 1214 warnings into errors, and rip out the "warn or err"
associated machinery. Future such attempts should go through lints
anyhow.

There is a fair amount of fallout in the compile-fail tests, as WF
checking now occurs earlier in the process.
2015-12-18 12:41:02 -05:00
Alex Burka 3da609fe57 add tests for #26873 2015-12-18 12:14:15 -05:00
bors 29ea4eef9f Auto merge of #30374 - durka:issue-30371, r=alexcrichton
Fixes #30371.
2015-12-18 17:06:19 +00:00
Vadim Petrochenkov 95fdaf2375 Require exact type equality + add tests
+ Rebase fixes
2015-12-18 20:00:19 +03:00
bors 3391630778 Auto merge of #30457 - Manishearth:rollup, r=Manishearth
- Successful merges: #30272, #30286, #30365, #30381, #30384, #30398, #30406, #30408, #30420, #30431, #30447, #30452
- Failed merges:
2015-12-18 15:17:29 +00:00
Manish Goregaokar a8e424685c Rollup merge of #30452 - dotdash:24876_take_2, r=alexcrichton
LLVM doesn't really support reusing the same module to emit more than
one file. One bug this causes is that the IR is invalidated by the stack
coloring pass when emitting the first file, and then the IR verifier
complains by the time we try to emit the second file. Also, we get
different binaries with --emit=asm,link than with just --emit=link. In
some cases leading to segfaults.

Unfortunately, it seems that at this point in time, the most sensible
option to circumvent this problem is to just clone the whole llvm module
for the asm output if we need both, asm and obj file output.

Fixes #24876
Fixes #26235
2015-12-18 20:02:14 +05:30
Manish Goregaokar 4f8b32c96f Rollup merge of #30447 - Xmasreturns:Docu, r=steveklabnik
Added sentences for description of code and changed x in the example to an int
2015-12-18 20:02:14 +05:30
Manish Goregaokar e9166766bd Rollup merge of #30431 - mmcco:cleanup, r=alexcrichton
Remove a needless variable and simply a cfg().
2015-12-18 20:02:13 +05:30
Manish Goregaokar 9e953df6f0 Rollup merge of #30420 - petrochenkov:owned2, r=nrc
Part of https://github.com/rust-lang/rust/pull/30095 not causing mysterious segfaults.

r? @nrc
2015-12-18 20:02:12 +05:30
Florian Hahn aa1f8fd3fb Update liblibc to current master 2015-12-18 13:32:14 +01:00
Florian Hahn de3e843d24 Use memchr in libstd where possible, closes #30076 2015-12-18 13:32:14 +01:00
Florian Hahn ca52c56e34 Add memchr implemenation based on rust-memchr to libstd 2015-12-18 13:32:14 +01:00
bors de62f9d885 Auto merge of #30286 - oli-obk:const_error_span, r=nikomatsakis
previously the error was erased and a `non-const path` error was emitted at the location of the field access instead of at the overflow location (as can be seen in the playground: http://is.gd/EuAF5F )
2015-12-18 12:23:54 +00:00
Manish Goregaokar 158a1bdd7d Rollup merge of #30406 - durka:patch-13, r=sanxiyn
The previous example had no chance of compiling in either form, due to the restrictive follow set for `ty`. This one has the desired behavior: http://is.gd/kYdw4g (well, I don't exactly desire this behavior at all, but it's true at least :p )
2015-12-18 16:47:38 +05:30