Commit Graph

49108 Commits

Author SHA1 Message Date
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
Simonas Kazlauskas
2b2f983523 Fix GEPs for MIR indexing translation
Fixes #30474
2015-12-19 20:30:13 +02: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
nwin
aacdfb8a2a Update no-stdlib.md
Clarify the difference between compiler-panic and libcore-panic.
2015-12-19 09:19:05 +01: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
Sebastian Hahn
5b3bdafb96 Have to use Weak instead of Arc in Weak::new() example 2015-12-19 01:49:36 +01:00
Sebastian Hahn
7dd618fd23 Address review comments 2015-12-19 01:31:21 +01: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
Sebastian Hahn
9697076b62 Implement arc::Weak::new() 2015-12-19 00:23:07 +01:00
Sebastian Hahn
4741ad38b5 Rename Weak::new_downgraded to Weak::new 2015-12-19 00:23:07 +01:00
Sebastian Hahn
0e043862bf use core::mem::unintialized instead of uninit intrinsic 2015-12-19 00:23:07 +01:00
Sebastian Hahn
8bed2acf92 Fix doctest failure 2015-12-19 00:23:07 +01: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
Sebastian Hahn
79d0235439 Implement Weak::new_downgraded() (#30425)
This adds a constructor for a Weak that can never be upgraded. These are
mostly useless, but for example are required when deserializing.
2015-12-18 20:40:17 +01: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
Felix S. Klock II
04c05c7b01 Added doc comments for new UnresolvedNameContext enum. 2015-12-18 17:42:46 +01:00
ebadf
cb7017ce3a Made dynamic_lib migration path more explicit 2015-12-18 10:21:13 -06:00
lnmx
49dc357e3e doc: minor format fixes in book/error-handling 2015-12-18 10:27:39 -05: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