]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoRollup merge of #30545 - bluss:operator-overload, r=steveklabnik
Manish Goregaokar [Fri, 25 Dec 2015 11:24:30 +0000 (16:54 +0530)]
Rollup merge of #30545 - bluss:operator-overload, r=steveklabnik

book: Some operator fixes for the syntax index

- Correct the names of the comparison traits (PartialOrd)
- Mention only the traits that overload the operator (PartialOrd,
  PartialEq), not operator-unrelated traits (Ord, Eq).
- Add `!=` operator.

8 years agoRollup merge of #30528 - michaelwoerister:fix-extern-def-paths, r=nikomatsakis
Manish Goregaokar [Fri, 25 Dec 2015 11:24:30 +0000 (16:54 +0530)]
Rollup merge of #30528 - michaelwoerister:fix-extern-def-paths, r=nikomatsakis

Avoid duplicating the last element of the def path which led to paths like "std::slice::into_vec::into_vec".

cc @rust-lang/compiler

8 years agoRollup merge of #30518 - semarie:openbsd-snapshot, r=alexcrichton
Manish Goregaokar [Fri, 25 Dec 2015 11:24:30 +0000 (16:54 +0530)]
Rollup merge of #30518 - semarie:openbsd-snapshot, r=alexcrichton

as the buildbot has timeouted when building snap3 branch, I regenerate one locally.

here the diff that registers the OpenBSD snapshot.

the archive is available at http://semarie.online.fr/rust/rust-stage0-2015-12-18-3391630-openbsd-x86_64-6c8aab2c8a169274942f9a15e460069a3ff64be9.tar.bz2

sha256 : de3c26a93cf9512922cc012f9b57bd08d7b64f7e0469a9bb032fa9c07260cf0c

@alexcrichton does it is the good method for providing a snapshot ?

8 years agoRollup merge of #30513 - alexcrichton:assert-is-safe, r=aturon
Manish Goregaokar [Fri, 25 Dec 2015 11:24:30 +0000 (16:54 +0530)]
Rollup merge of #30513 - alexcrichton:assert-is-safe, r=aturon

Types like `&AssertRecoverSafe<T>` and `Rc<AssertRecoverSafe<T>>` were
mistakenly not considered recover safe, but the point of the assertion wrapper
is that it indeed is! This was caused by an interaction between the
`RecoverSafe` and `NoUnsafeCell` marker traits, and this is updated by adding an
impl of the `NoUnsafeCell` marker trait for `AssertRecoverSafe` to ensure that
it never interacts with the other negative impls of `RecoverSafe`.

cc #30510

8 years agoRollup merge of #30485 - sfackler:panic-handler, r=alexcrichton
Manish Goregaokar [Fri, 25 Dec 2015 11:24:30 +0000 (16:54 +0530)]
Rollup merge of #30485 - sfackler:panic-handler, r=alexcrichton

r? @alexcrichton

8 years agoAuto merge of #30544 - steveklabnik:rollup, r=steveklabnik
bors [Fri, 25 Dec 2015 06:24:56 +0000 (06:24 +0000)]
Auto merge of #30544 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #30251, #30461, #30465, #30473, #30529, #30537, #30539, #30541, #30543
- Failed merges:

8 years agobook: Some operator fixes for the syntax index
Ulrik Sverdrup [Wed, 23 Dec 2015 23:20:12 +0000 (00:20 +0100)]
book: Some operator fixes for the syntax index

- Correct the names of the comparison traits (PartialOrd)
- Mention only the traits that overload the operator (PartialOrd,
  PartialEq), not operator-unrelated traits (Ord, Eq).
- Add `!=` operator.

8 years agoRollup merge of #30543 - brson:doc, r=steveklabnik
Steve Klabnik [Wed, 23 Dec 2015 23:09:12 +0000 (18:09 -0500)]
Rollup merge of #30543 - brson:doc, r=steveklabnik

The website will [shortly](https://github.com/rust-lang/rust-www/pull/241) provide the main documentation landing page as well as the [FAQ](https://github.com/rust-lang/rust-www/issues/202). All of the content here will be there.

This strips out everything and makes the index *just* an index into the in-tree content. My only real qualm with this is that this will become the content on doc.rust-lang.org (a sweet URL), while the main documentation page will be www.rust-lang.org/documentation.html.

r? @steveklabnik

8 years agoRollup merge of #30541 - fbergr:doc, r=luqmana
Steve Klabnik [Wed, 23 Dec 2015 23:09:12 +0000 (18:09 -0500)]
Rollup merge of #30541 - fbergr:doc, r=luqmana

Country-code top level domain names are tied to a specific country (for example .de for Germany).

r? @steveklabnik

8 years agoRollup merge of #30539 - erickt:whitespace, r=sfackler
Steve Klabnik [Wed, 23 Dec 2015 23:09:12 +0000 (18:09 -0500)]
Rollup merge of #30539 - erickt:whitespace, r=sfackler

8 years agoRollup merge of #30537 - tshepang:make-visible, r=Gankro
Steve Klabnik [Wed, 23 Dec 2015 23:09:12 +0000 (18:09 -0500)]
Rollup merge of #30537 - tshepang:make-visible, r=Gankro

8 years agoRollup merge of #30529 - alexcrichton:less-c-code, r=sanxiyn
Steve Klabnik [Wed, 23 Dec 2015 23:09:12 +0000 (18:09 -0500)]
Rollup merge of #30529 - alexcrichton:less-c-code, r=sanxiyn

The corresopnding C file was removed in #30175 and looks like I forgot to remove
the header as well.

8 years agoRollup merge of #30473 - nwin:patch-2, r=steveklabnik
Steve Klabnik [Wed, 23 Dec 2015 23:09:11 +0000 (18:09 -0500)]
Rollup merge of #30473 - nwin:patch-2, r=steveklabnik

Clarify the difference between compiler-panic and libcore-panic.

8 years agoRollup merge of #30465 - androm3da:master, r=alexcrichton
Steve Klabnik [Wed, 23 Dec 2015 23:09:11 +0000 (18:09 -0500)]
Rollup merge of #30465 - androm3da:master, r=alexcrichton

The `dynamic_lib` library has been deprecated in favor of contents on crates.io, but apparently `libloading` is a more specific direction that fits the need.

8 years agoRollup merge of #30461 - lnmx:doc-typo, r=steveklabnik
Steve Klabnik [Wed, 23 Dec 2015 23:09:11 +0000 (18:09 -0500)]
Rollup merge of #30461 - lnmx:doc-typo, r=steveklabnik

8 years agoRollup merge of #30251 - nodakai:patch-1, r=pnkfelix
Steve Klabnik [Wed, 23 Dec 2015 23:09:11 +0000 (18:09 -0500)]
Rollup merge of #30251 - nodakai:patch-1, r=pnkfelix

On some weird setup where $SHELL is a relative path (can happen under GNU
Screen,) `file -L "$BIN_TO_PROBE"` fails and $CFG_CPUTYPE is wrongly set to
i686.  We should not only check its string value but also permission on
filesystem.

8 years agoStrip the documentation index down to the essentials.
Brian Anderson [Wed, 23 Dec 2015 22:15:13 +0000 (14:15 -0800)]
Strip the documentation index down to the essentials.

The main documentation page is now www.rust-lang.org/documentation.html

8 years agoRemove links to out-of-tree docs
Brian Anderson [Wed, 23 Dec 2015 22:04:43 +0000 (14:04 -0800)]
Remove links to out-of-tree docs

8 years agoRemove the FAQs in favor of the website
Brian Anderson [Wed, 23 Dec 2015 22:03:45 +0000 (14:03 -0800)]
Remove the FAQs in favor of the website

8 years agodoc: Change Google link to generic top level domain
fbergr [Wed, 23 Dec 2015 20:42:36 +0000 (22:42 +0200)]
doc: Change Google link to generic top level domain

8 years agoImplement custom panic handlers
Steven Fackler [Fri, 18 Dec 2015 07:51:55 +0000 (23:51 -0800)]
Implement custom panic handlers

8 years agoMinor fix to whitespace in libsyntax
Erick Tryzelaar [Wed, 23 Dec 2015 16:51:03 +0000 (11:51 -0500)]
Minor fix to whitespace in libsyntax

8 years agodoc: make line visible
Tshepang Lekhonkhobe [Wed, 23 Dec 2015 15:46:59 +0000 (17:46 +0200)]
doc: make line visible

8 years agoAuto merge of #30525 - semarie:ncpu, r=alexcrichton
bors [Wed, 23 Dec 2015 15:19:54 +0000 (15:19 +0000)]
Auto merge of #30525 - semarie:ncpu, r=alexcrichton

Should unbreak build (well, remove one reason to break) for *bsd target.

r? @alexcrichton

8 years agoAuto merge of #30377 - Wafflespeanut:levenshtein, r=Manishearth
bors [Wed, 23 Dec 2015 08:55:38 +0000 (08:55 +0000)]
Auto merge of #30377 - Wafflespeanut:levenshtein, r=Manishearth

fixes part of #30197

8 years agoAuto merge of #30504 - mitaa:rdoc_root, r=alexcrichton
bors [Wed, 23 Dec 2015 06:20:02 +0000 (06:20 +0000)]
Auto merge of #30504 - mitaa:rdoc_root, r=alexcrichton

fixes #30327

8 years agoAuto merge of #30353 - alexcrichton:rpath-by-default, r=brson
bors [Wed, 23 Dec 2015 00:42:19 +0000 (00:42 +0000)]
Auto merge of #30353 - alexcrichton:rpath-by-default, r=brson

This commit changes our distribution and in-tree sources to pass the `-C rpath`
flag by default during compiles. This means that from-source builds, including
our release channels, will have this option enabled as well. Motivated
by #29941, this change means that the compiler should be usable as-is on all
platforms just after extraction or installation. This experience is already true
on Windows but on Unixes you still need to set up LD_LIBRARY_PATH or the
equivalent, which can often be unfortunate.

This option was originally turned off by default for Linux distributions who
tend to take care of these sorts of details themselves, so it is expected that
all those builds of Rust will want to pass `--disable-rpath` to the configure
script to preserve that behavior.

Closes #29941

8 years agoDon't record the root module in the search index
mitaa [Mon, 21 Dec 2015 02:21:56 +0000 (03:21 +0100)]
Don't record the root module in the search index

8 years agostd: Remove old android header file
Alex Crichton [Tue, 22 Dec 2015 17:03:46 +0000 (09:03 -0800)]
std: Remove old android header file

The corresopnding C file was removed in #30175 and looks like I forgot to remove
the header as well.

8 years agoFix def paths creation for items inlined from external crates.
Michael Woerister [Tue, 22 Dec 2015 15:27:20 +0000 (10:27 -0500)]
Fix def paths creation for items inlined from external crates.

Avoid duplicating the last element of the def path which led to paths like "std::slice::into_vec::into_vec".

8 years agovariable `CPUS_SIZE` should have a snake case name such as `cpus_size`
Sébastien Marie [Tue, 22 Dec 2015 13:10:17 +0000 (14:10 +0100)]
variable `CPUS_SIZE` should have a snake case name such as `cpus_size`

8 years agoexplicit use libc to refer to HW_NCPU
Sébastien Marie [Tue, 22 Dec 2015 12:46:17 +0000 (13:46 +0100)]
explicit use libc to refer to HW_NCPU

8 years agoAuto merge of #30417 - alexcrichton:better-detect-elf-tls, r=alexcrichton
bors [Tue, 22 Dec 2015 09:15:29 +0000 (09:15 +0000)]
Auto merge of #30417 - alexcrichton:better-detect-elf-tls, r=alexcrichton

Currently a compiler can be built with the `--disable-elf-tls` option for compatibility with OSX 10.6 which doesn't have ELF TLS. This is unfortunate, however, as a whole new compiler must be generated which can take some time. These commits add a new (feature gated) `cfg(target_thread_local)` annotation set by the compiler which indicates whether `#[thread_local]` is available for use. The compiler now interprets `MACOSX_DEPLOYMENT_TARGET` (a standard environment variable) to set this flag on OSX. With this we may want to start compiling our OSX nightlies with `MACOSX_DEPLOYMENT_TARGET` set to 10.6 which would allow the compiler out-of-the-box to generate 10.6-compatible binaries.

For now the compiler still by default targets OSX 10.7 by allowing ELF TLS by default (e.g. if `MACOSX_DEPLOYMENT_TARGET` isn't set).

8 years agoconfigure: test $SHELL's permission
Kai Noda [Mon, 7 Dec 2015 03:19:03 +0000 (11:19 +0800)]
configure: test $SHELL's permission

On some weird setup where $SHELL is a relative path (can happen under GNU
Screen,) `file -L "$BIN_TO_PROBE"` fails and $CFG_CPUTYPE is wrongly set to
i686.  We should not only check its string value but also permission on
filesystem.

8 years agoAuto merge of #30175 - alexcrichton:less-c-code, r=brson
bors [Tue, 22 Dec 2015 07:23:16 +0000 (07:23 +0000)]
Auto merge of #30175 - alexcrichton:less-c-code, r=brson

All these definitions can now be written in Rust, so do so!

8 years agostd: Remove rust_builtin C support library
Alex Crichton [Wed, 2 Dec 2015 18:31:29 +0000 (10:31 -0800)]
std: Remove rust_builtin C support library

All these definitions can now be written in Rust, so do so!

8 years agostd: Use cfg(target_thread_local) in thread_local!
Alex Crichton [Fri, 11 Dec 2015 20:42:29 +0000 (12:42 -0800)]
std: Use cfg(target_thread_local) in thread_local!

This transitions the standard library's `thread_local!` macro to use the
freshly-added and gated `#[cfg(target_thread_local)]` attribute. This greatly
simplifies the `#[cfg]` logic in play here, but requires that the standard
library expose both the OS and ELF TLS implementation modules as unstable
implementation details.

The implementation details were shuffled around a bit but end up generally
compiling to the same thing.

Closes #26581 (this supersedes the need for the option)
Closes #27057 (this also starts ignoring the option)

8 years agosyntax: Respect allow_internal_unstable in macros
Alex Crichton [Wed, 16 Dec 2015 17:24:08 +0000 (09:24 -0800)]
syntax: Respect allow_internal_unstable in macros

This change modifies the feature gating of special `#[cfg]` attributes to not
require a `#![feature]` directive in the crate-of-use if the source of the macro
was declared with `#[allow_internal_unstable]`. This enables the standard
library's macro for `thread_local!` to make use of the
`#[cfg(target_thread_local)]` attribute despite it being feature gated (e.g.
it's a hidden implementation detail).

8 years agorustc: Add feature-gated cfg(target_thread_local)
Alex Crichton [Thu, 10 Dec 2015 20:21:55 +0000 (12:21 -0800)]
rustc: Add feature-gated cfg(target_thread_local)

Currently the standard library has some pretty complicated logic to detect
whether #[thread_local] should be used or whether it's supported. This is also
unfortunately not quite true for OSX where not all versions support
the #[thread_local] attribute (only 10.7+ does). Compiling code for OSX 10.6 is
typically requested via the MACOSX_DEPLOYMENT_TARGET environment variable (e.g.
the linker recognizes this), but the standard library unfortunately does not
respect this.

This commit updates the compiler to add a `target_thread_local` cfg annotation
if the platform being targeted supports the `#[thread_local]` attribute. This is
feature gated for now, and it is only true on non-aarch64 Linux and 10.7+ OSX
(e.g. what the module already does today). Logic has also been added to parse
the deployment target environment variable.

8 years agoadd openbsd snapshot
Sébastien Marie [Tue, 22 Dec 2015 05:24:13 +0000 (06:24 +0100)]
add openbsd snapshot

8 years agoAuto merge of #30516 - retep998:non-universal-crt, r=alexcrichton
bors [Tue, 22 Dec 2015 02:07:30 +0000 (02:07 +0000)]
Auto merge of #30516 - retep998:non-universal-crt, r=alexcrichton

Checks for a `10.` prefix on the subfolder because that is what vcvars does.

r? @alexcrichton

8 years agoFix Universal CRT detection on weird setups
Peter Atashian [Tue, 22 Dec 2015 01:44:48 +0000 (20:44 -0500)]
Fix Universal CRT detection on weird setups
Checks for a `10.` prefix on the subfolder

Signed-off-by: Peter Atashian <retep998@gmail.com>
8 years agoAuto merge of #30434 - alexcrichton:update-jemalloc, r=alexcrichton
bors [Mon, 21 Dec 2015 23:31:06 +0000 (23:31 +0000)]
Auto merge of #30434 - alexcrichton:update-jemalloc, r=alexcrichton

It's been awhile since we last updated jemalloc, and there's likely some bugs
that have been fixed since the last version we're using, so let's try to update
again.

8 years agostd: Ensure AssertRecoverSafe indeed is more often
Alex Crichton [Mon, 21 Dec 2015 17:39:45 +0000 (09:39 -0800)]
std: Ensure AssertRecoverSafe indeed is more often

Types like `&AssertRecoverSafe<T>` and `Rc<AssertRecoverSafe<T>>` were
mistakenly not considered recover safe, but the point of the assertion wrapper
is that it indeed is! This was caused by an interaction between the
`RecoverSafe` and `NoUnsafeCell` marker traits, and this is updated by adding an
impl of the `NoUnsafeCell` marker trait for `AssertRecoverSafe` to ensure that
it never interacts with the other negative impls of `RecoverSafe`.

cc #30510

8 years agoAuto merge of #30352 - alexcrichton:new-snashots, r=nikomatsakis
bors [Mon, 21 Dec 2015 21:37:26 +0000 (21:37 +0000)]
Auto merge of #30352 - alexcrichton:new-snashots, r=nikomatsakis

Lots of cruft to remove!

8 years agostd: Update jemalloc version
Alex Crichton [Thu, 17 Dec 2015 07:06:00 +0000 (23:06 -0800)]
std: Update jemalloc version

It's been awhile since we last updated jemalloc, and there's likely some bugs
that have been fixed since the last version we're using, so let's try to update
again.

8 years agoAuto merge of #30460 - Ms2ger:BindingMode, r=alexcrichton
bors [Mon, 21 Dec 2015 19:10:51 +0000 (19:10 +0000)]
Auto merge of #30460 - Ms2ger:BindingMode, r=alexcrichton

8 years agoRegister new snapshots
Alex Crichton [Fri, 11 Dec 2015 21:07:11 +0000 (13:07 -0800)]
Register new snapshots

Lots of cruft to remove!

8 years agoAuto merge of #30512 - semarie:openbsd-libc, r=alexcrichton
bors [Mon, 21 Dec 2015 15:52:41 +0000 (15:52 +0000)]
Auto merge of #30512 - semarie:openbsd-libc, r=alexcrichton

- upgrades libc to version with `si_addr` support in openbsd
- declares libc use for getentropy
- remove now unused use

r? @alexcrichton

8 years agounbreak openbsd code
Sébastien Marie [Mon, 21 Dec 2015 09:12:48 +0000 (10:12 +0100)]
unbreak openbsd code

- upgrades libc to version with si_addr support in openbsd
- declares libc use for getentropy

8 years agoAuto merge of #30413 - pnkfelix:fsk-span_note, r=Manishearth
bors [Mon, 21 Dec 2015 07:49:05 +0000 (07:49 +0000)]
Auto merge of #30413 - pnkfelix:fsk-span_note, r=Manishearth

Add note when item accessed from module via `m.i` rather than `m::i`.

(I tried to make this somewhat future-proofed, in that the `UnresolvedNameContext` could be expanded in the future with other cases besides paths that are known to be modules.)

This supersedes PR #30356 ; since I'm responsible for a bunch of new code here, someone else should review it. :)

8 years agoAuto merge of #30400 - fbergr:master, r=steveklabnik
bors [Mon, 21 Dec 2015 06:02:13 +0000 (06:02 +0000)]
Auto merge of #30400 - fbergr:master, r=steveklabnik

See: https://github.com/rust-lang/rust/issues/30397

r? @steveklabnik

8 years agoAuto merge of #30493 - semarie:openbsd-cc, r=alexcrichton
bors [Mon, 21 Dec 2015 04:15:28 +0000 (04:15 +0000)]
Auto merge of #30493 - semarie:openbsd-cc, r=alexcrichton

this PR reverts previous ones, that tried to make `cc` to found `estdc++` in `/usr/local/lib`. It causes more trouble than it resolvs things: rustc become unbuildable if another version already exists in `/usr/local` (for example, `libstd-xxxx.so` is found in `/usr/local/lib` and in builddir).

so this PR tries another way to achieve build, but using the good linker for building. By default, rustc use `cc` for linking. But under OpenBSD, `cc` is gcc 4.2.1 from base, whereas we build with gcc 4.9 from ports. By linking using the compiler found at compile-time, we ensure that the compiler will found his own stdc++ library without trouble.

r? @alexcrichton

8 years agoAuto merge of #30486 - nagisa:mir-fix-geps, r=luqmana
bors [Mon, 21 Dec 2015 02:26:10 +0000 (02:26 +0000)]
Auto merge of #30486 - nagisa:mir-fix-geps, r=luqmana

Fixes https://github.com/rust-lang/rust/issues/30474

8 years agoAuto merge of #30482 - luqmana:const-fat-ptr, r=dotdash
bors [Mon, 21 Dec 2015 00:39:24 +0000 (00:39 +0000)]
Auto merge of #30482 - luqmana:const-fat-ptr, r=dotdash

Fixes #30479.

8 years agoAuto merge of #30470 - petrochenkov:owned5, r=nrc
bors [Sun, 20 Dec 2015 22:50:34 +0000 (22:50 +0000)]
Auto merge of #30470 - petrochenkov:owned5, r=nrc

cc https://github.com/rust-lang/rust/pull/30095

r? @nrc

8 years agoStop re-exporting the ast::BindingMode variants.
Ms2ger [Fri, 18 Dec 2015 13:23:01 +0000 (14:23 +0100)]
Stop re-exporting the ast::BindingMode variants.

8 years agoAuto merge of #30469 - nagisa:mir-gv-prettify, r=luqmana
bors [Sun, 20 Dec 2015 21:03:48 +0000 (21:03 +0000)]
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)

8 years agoCorrected deprecation reference to appropriate crate
ebadf [Sun, 20 Dec 2015 20:37:53 +0000 (14:37 -0600)]
Corrected deprecation reference to appropriate crate

8 years agoAuto merge of #30468 - Eljay:fix-doc-link, r=alexcrichton
bors [Sun, 20 Dec 2015 16:34:09 +0000 (16:34 +0000)]
Auto merge of #30468 - Eljay:fix-doc-link, r=alexcrichton

8 years agoAuto merge of #30454 - mmcco:size_t, r=alexcrichton
bors [Sun, 20 Dec 2015 07:19:07 +0000 (07:19 +0000)]
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.

8 years agoopenbsd: use specific linker for building
Sébastien Marie [Sat, 19 Dec 2015 17:00:23 +0000 (18:00 +0100)]
openbsd: use specific linker for building

By default, rustc use `cc` as linker. Under OpenBSD, `cc` is gcc version 4.2.1.
So use the compiler found at configure-time for linking: it will be gcc 4.9.

It permits to resolv problem of finding -lestdc++ or -lgcc. For base gcc (4.2), there are in not standard path, whereas for ports gcc (4.9) there are in standard path.

8 years agoremove specific code for OpenBSD that define STDCPP_LIBDIR_RUSTFLAGS
Sébastien Marie [Sat, 19 Dec 2015 10:42:10 +0000 (11:42 +0100)]
remove specific code for OpenBSD that define STDCPP_LIBDIR_RUSTFLAGS

it isn't the good way to process, as it makes conflicts when building rustc while another version of rustc in installed system-wide.

8 years agoAuto merge of #30455 - mmcco:beautify-isaac, r=alexcrichton
bors [Sun, 20 Dec 2015 05:28:26 +0000 (05:28 +0000)]
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.

8 years agoAuto merge of #30436 - durka:patch-14, r=alexcrichton
bors [Sun, 20 Dec 2015 02:15:06 +0000 (02:15 +0000)]
Auto merge of #30436 - durka:patch-14, r=alexcrichton

Relevant to #30422.

8 years agoAuto merge of #30430 - mmcco:master, r=alexcrichton
bors [Sat, 19 Dec 2015 23:21:12 +0000 (23:21 +0000)]
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.

8 years agoAuto merge of #30401 - DiamondLovesYou:pnacl-target, r=alexcrichton
bors [Sat, 19 Dec 2015 21:29:04 +0000 (21:29 +0000)]
Auto merge of #30401 - DiamondLovesYou:pnacl-target, r=alexcrichton

r? @alexcrichton

8 years agoAuto merge of #30394 - geofft:dt-runpath, r=alexcrichton
bors [Sat, 19 Dec 2015 19:39:25 +0000 (19:39 +0000)]
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.

8 years agoFix GEPs for MIR indexing translation
Simonas Kazlauskas [Sat, 19 Dec 2015 18:28:12 +0000 (20:28 +0200)]
Fix GEPs for MIR indexing translation

Fixes #30474

8 years ago[MIR] Handle FatPtr in mir::constant::trans_constval.
Luqman Aden [Sat, 19 Dec 2015 14:32:08 +0000 (09:32 -0500)]
[MIR] Handle FatPtr in mir::constant::trans_constval.

8 years agoAuto merge of #30435 - Ms2ger:ParseResult, r=alexcrichton
bors [Sat, 19 Dec 2015 14:07:08 +0000 (14:07 +0000)]
Auto merge of #30435 - Ms2ger:ParseResult, r=alexcrichton

8 years agoUpdate no-stdlib.md
nwin [Sat, 19 Dec 2015 08:19:05 +0000 (09:19 +0100)]
Update no-stdlib.md

Clarify the difference between compiler-panic and libcore-panic.

8 years agoAuto merge of #30408 - durka:issue-26873, r=alexcrichton
bors [Sat, 19 Dec 2015 08:08:53 +0000 (08:08 +0000)]
Auto merge of #30408 - durka:issue-26873, r=alexcrichton

I think we can close #26873 with these tests.

8 years agoAdd PNaCl target info to the makefile target cfgs and initialize the PNaCl target
Richard Diamond [Tue, 15 Dec 2015 21:34:06 +0000 (15:34 -0600)]
Add PNaCl target info to the makefile target cfgs and initialize the PNaCl target
machine if available.

8 years agoAuto merge of #30403 - webmobster:master, r=alexcrichton
bors [Sat, 19 Dec 2015 06:21:10 +0000 (06:21 +0000)]
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.

8 years agoUse libc's syscall() and NR_GETENTROPY const
Michael McConville [Sat, 19 Dec 2015 03:40:07 +0000 (22:40 -0500)]
Use libc's syscall() and NR_GETENTROPY const

8 years agoPull newer version of libc for NR_GETENTROPY
Michael McConville [Sat, 19 Dec 2015 03:37:54 +0000 (22:37 -0500)]
Pull newer version of libc for NR_GETENTROPY

8 years agoMerge branch 'master' of https://github.com/rust-lang/rust
Michael McConville [Sat, 19 Dec 2015 03:37:00 +0000 (22:37 -0500)]
Merge branch 'master' of https://github.com/rust-lang/rust

8 years agoAuto merge of #30184 - petrochenkov:ascr, r=nikomatsakis
bors [Sat, 19 Dec 2015 02:45:15 +0000 (02:45 +0000)]
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

8 years agoImprove OwnedSlice and use it in HIR
Vadim Petrochenkov [Sat, 19 Dec 2015 01:20:11 +0000 (04:20 +0300)]
Improve OwnedSlice and use it in HIR

8 years agoAuto merge of #30381 - fhahn:memchr-in-std, r=alexcrichton
bors [Sat, 19 Dec 2015 00:57:25 +0000 (00:57 +0000)]
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

8 years agoFix build by removing needless type prefix
Michael McConville [Thu, 17 Dec 2015 07:13:48 +0000 (02:13 -0500)]
Fix build by removing needless type prefix

8 years agoSimplify logic checking getentropy's return value
Michael McConville [Thu, 17 Dec 2015 05:52:18 +0000 (00:52 -0500)]
Simplify logic checking getentropy's return value

8 years agoUse a const for getentropy(2)'s syscall number
Michael McConville [Thu, 17 Dec 2015 05:21:11 +0000 (00:21 -0500)]
Use a const for getentropy(2)'s syscall number

Reported by Sebastien Marie.

8 years agoUse the correct syscall name in panic message
Michael McConville [Thu, 17 Dec 2015 05:17:31 +0000 (00:17 -0500)]
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.

8 years agoUse the getentropy(2) syscall on OpenBSD
Michael McConville [Thu, 17 Dec 2015 02:54:16 +0000 (21:54 -0500)]
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.

8 years agoPrettify MIR graphviz output
Simonas Kazlauskas [Fri, 18 Dec 2015 22:45:39 +0000 (00:45 +0200)]
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 :)

8 years agoAuto merge of #30364 - luqmana:mir-calls, r=nikomatsakis
bors [Fri, 18 Dec 2015 23:06:24 +0000 (23:06 +0000)]
Auto merge of #30364 - luqmana:mir-calls, r=nikomatsakis

8 years ago[MIR] Initial implementation for translating calls.
Luqman Aden [Sun, 13 Dec 2015 13:48:43 +0000 (05:48 -0800)]
[MIR] Initial implementation for translating calls.

8 years agoFix broken link in E0070 description.
Lee Jeffery [Fri, 18 Dec 2015 21:47:16 +0000 (21:47 +0000)]
Fix broken link in E0070 description.

8 years agoUse memrchr bindings provided by libc
Florian Hahn [Thu, 17 Dec 2015 23:36:38 +0000 (00:36 +0100)]
Use memrchr bindings provided by libc

8 years agoAuto merge of #30389 - nikomatsakis:rfc1214-error, r=arielb1
bors [Fri, 18 Dec 2015 20:44:33 +0000 (20:44 +0000)]
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

8 years agoAuto merge of #29973 - petrochenkov:privinpub, r=nikomatsakis
bors [Fri, 18 Dec 2015 18:54:52 +0000 (18:54 +0000)]
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

8 years agoDo not substitute type aliases during error reporting
Vadim Petrochenkov [Fri, 18 Dec 2015 17:57:36 +0000 (20:57 +0300)]
Do not substitute type aliases during error reporting
Type aliases are still substituted when determining impl publicity

8 years agoMake RFC 1214 warnings into errors, and rip out the "warn or err"
Niko Matsakis [Tue, 15 Dec 2015 09:31:58 +0000 (04:31 -0500)]
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.

8 years agoadd tests for #26873
Alex Burka [Wed, 16 Dec 2015 02:35:11 +0000 (21:35 -0500)]
add tests for #26873

8 years agoAuto merge of #30374 - durka:issue-30371, r=alexcrichton
bors [Fri, 18 Dec 2015 17:06:19 +0000 (17:06 +0000)]
Auto merge of #30374 - durka:issue-30371, r=alexcrichton

Fixes #30371.

8 years agoRequire exact type equality + add tests
Vadim Petrochenkov [Fri, 18 Dec 2015 17:00:19 +0000 (20:00 +0300)]
Require exact type equality + add tests

+ Rebase fixes

8 years agoAdded doc comments for new UnresolvedNameContext enum.
Felix S. Klock II [Fri, 18 Dec 2015 16:42:46 +0000 (17:42 +0100)]
Added doc comments for new UnresolvedNameContext enum.

8 years agoMade dynamic_lib migration path more explicit
ebadf [Fri, 18 Dec 2015 16:21:13 +0000 (10:21 -0600)]
Made dynamic_lib migration path more explicit