Commit Graph

44612 Commits

Author SHA1 Message Date
Felix S. Klock II
cb5f0b4971 Avoid feature-warnings on stage0. 2015-07-22 15:34:00 +02:00
Felix S. Klock II
75da81e782 Change signature for move_val_init intrinsic to take *mut T for dest.
rebase update to typeck/check/mod.rs
2015-07-22 15:34:00 +02:00
Felix S. Klock II
b325e4f28e Add feature-gates for desugaring-based box and placement-in.
update test/compile-fail/feature-gate-box-expr.rs to reflect new feature gates.

Part of what lands with Issue 22181.
2015-07-22 15:33:59 +02:00
Felix S. Klock II
d79bbbc4ef Revise placement-in expansion to use push/pop_unsafe and move_val_init. 2015-07-22 15:33:59 +02:00
Felix S. Klock II
866250c6d4 prototype Placer protocol for unstable overloaded-box and placement-in. 2015-07-22 15:33:59 +02:00
Felix S. Klock II
1829fa5199 Hack for "unsafety hygiene" -- push_unsafe! and pop_unsafe!.
Even after expansion, the generated expressions still track depth of
such pushes (i.e. how often you have "pushed" without a corresponding
"pop"), and we add a rule that in a context with a positive
`push_unsafe!` depth, it is effectively an `unsafe` block context.

(This way, we can inject code that uses `unsafe` features, but still
contains within it a sub-expression that should inherit the outer
safety checking setting, outside of the injected code.)

This is a total hack; it not only needs a feature-gate, but probably
should be feature-gated forever (if possible).

ignore-pretty in test/run-pass/pushpop-unsafe-okay.rs
2015-07-22 15:33:59 +02:00
bors
25281b121f Auto merge of #27176 - alexcrichton:fix-stock-llvm, r=brson
This commit moves the IR files in the distribution, rust_try.ll,
rust_try_msvc_64.ll, and rust_try_msvc_32.ll into the compiler from the main
distribution. There's a few reasons for this change:

* LLVM changes its IR syntax from time to time, so it's very difficult to
  have these files build across many LLVM versions simultaneously. We'll likely
  want to retain this ability for quite some time into the future.
* The implementation of these files is closely tied to the compiler and runtime
  itself, so it makes sense to fold it into a location which can do more
  platform-specific checks for various implementation details (such as MSVC 32
  vs 64-bit).
* This removes LLVM as a build-time dependency of the standard library. This may
  end up becoming very useful if we move towards building the standard library
  with Cargo.

In the immediate future, however, this commit should restore compatibility with
LLVM 3.5 and 3.6.
2015-07-22 09:13:09 +00:00
bors
90904204d6 Auto merge of #27185 - pnkfelix:test-cyclic-collections, r=alexcrichton
This test attempts to exercise cyclic structure in much of `std::collections`

(as much as is possible; e.g. things like `EnumSet` and `BitVec` do not really support carrying references at all, so trying to represent cyclic structure within them dooes not really make sense.)

This work should land before we make future revisions to `dropck`; that is, I am attempting to catch potential regressions to cases where we supported cyclic structure circa Rust 1.2.
2015-07-22 04:21:46 +00:00
bors
d33cab1b1f Auto merge of #27172 - alexcrichton:snapshots, r=brson
Enables bootstrapping a 32-bit MSVC host compiler!

Closes #26602
2015-07-22 00:29:08 +00:00
Alex Crichton
c35b2bd226 trans: Move rust_try into the compiler
This commit moves the IR files in the distribution, rust_try.ll,
rust_try_msvc_64.ll, and rust_try_msvc_32.ll into the compiler from the main
distribution. There's a few reasons for this change:

* LLVM changes its IR syntax from time to time, so it's very difficult to
  have these files build across many LLVM versions simultaneously. We'll likely
  want to retain this ability for quite some time into the future.
* The implementation of these files is closely tied to the compiler and runtime
  itself, so it makes sense to fold it into a location which can do more
  platform-specific checks for various implementation details (such as MSVC 32
  vs 64-bit).
* This removes LLVM as a build-time dependency of the standard library. This may
  end up becoming very useful if we move towards building the standard library
  with Cargo.

In the immediate future, however, this commit should restore compatibility with
LLVM 3.5 and 3.6.
2015-07-21 16:08:11 -07:00
bors
39a780dcbe Auto merge of #27093 - Manishearth:closure-label-shadow, r=pnkfelix
Fixes #25343

To be honest I'm not sure if this is the right fix (I haven't yet fully understood the code),
but it seems to work. I'll look closer at the code when I have some time, in the meantime if this
is the right fix it would be nice to get verification from someone who does understand the code 😄

r? @pnkfelix
2015-07-21 22:23:34 +00:00
bors
ee2d3bc8a2 Auto merge of #27073 - alexcrichton:less-proc-fs, r=brson
This can fail on linux for various reasons, such as the /proc filesystem not
being mounted. There are already many cases where we can't set up stack guards,
so just don't worry about this case and communicate that no guard was enabled.

I've confirmed that this allows the compiler to run in a chroot without /proc
mounted.

Closes #22642
2015-07-21 20:51:04 +00:00
bors
21dfd24c4b Auto merge of #26856 - steveklabnik:gh26475, r=alexcrichton
Fixes #26475 

I'm not sure this is enough, really, but I'm not totally clear on what specific information would be valuable here. In the original issue, the Java page was pretty decent, but now I can't think of a different way to word it, and copying their prose is of course not acceptable.

thoughts @alexcrichton @aturon @aidanhs ?
2015-07-21 18:34:08 +00:00
Steve Klabnik
cbdc52e986 Expand a bit on thread::park spurious wakeups
Fixes #26475
2015-07-21 13:23:34 -04:00
Alex Crichton
d68b152c3e std: Be resilient to failure in pthread_getattr_np
This can fail on linux for various reasons, such as the /proc filesystem not
being mounted. There are already many cases where we can't set up stack guards,
so just don't worry about this case and communicate that no guard was enabled.

I've confirmed that this allows the compiler to run in a chroot without /proc
mounted.

Closes #22642
2015-07-21 09:18:30 -07:00
bors
5dbddfb210 Auto merge of #26935 - oli-obk:const_val_description, r=eddyb
r? @eddyb 

Adding new variants is annoying as one needs to modify all these places that **don't** handle the new variant.

I chose not to use `Display` as I don't think it is appropriate.
2015-07-21 16:14:46 +00:00
bors
90a36923e5 Auto merge of #27171 - steveklabnik:doc_std_io, r=brson
This is the landing page for all of io, so we should have more than just
a sentence here.

r? @alexcrichton and I know @brson has been caring a lot about landing page style docs lately.
2015-07-21 14:41:01 +00:00
Felix S. Klock II
4128583939 This test attempts to exercise cyclic structure much of std::collections
(as much as is possible; e.g. things like `EnumSet` and `BitVec` do
not really support carrying references at all, so trying to represent
cyclic structure within them dooes not really make sense.)
2015-07-21 16:16:21 +02:00
bors
fec23d9d59 Auto merge of #27168 - brson:stdprim, r=steveklabnik
This makes the primitive descriptions on the front page read properly
as descriptions of types and not of the associated modules.

Having the primitive and module docs derived from the same source
causes problems, primarily that they can't contain hyperlinks
cross-referencing each other.
    
This crates dedicated private modules in `std` to document the
primitive types, then for all primitives that have a corresponding
module, puts hyperlinks in moth the primitive docs and the module docs
cross-linking each other.
    
This should help clear up confusion when readers find themselves on
the wrong page.

This also removes all the duplicate `#[doc(primitive)]` tags in various places (especially core), so the core docs will no longer attempt to document the primitives for now. Seems like an acceptable tradeoff to get some cleanup for std.
2015-07-21 13:06:45 +00:00
bors
2afe47d168 Auto merge of #27160 - brson:revdoc, r=huonw
This reverts commit 00130cff99.

As mentioned in a regression report[1], this caused a notable amount
of breakage. Because there's a plan to mitigate[2] this type of
breakage, I'm reverting this until then.

[1]: https://internals.rust-lang.org/t/new-crater-reports-1-1-stable-vs-beta-2015-07-10-and-nightly-2015-07-10/2358
[2]: https://github.com/rust-lang/rfcs/pull/1193
2015-07-21 11:32:54 +00:00
bors
e33b128e01 Auto merge of #26816 - nrc:zero-codemap, r=@jroesch
See commits for details
2015-07-21 09:59:18 +00:00
Nick Cameron
f47d20aecd Use a span from the correct file for the inner span of a module
This basically only affects modules which are empty (or only contain comments).

Closes #26755
2015-07-21 21:55:19 +12:00
Nick Cameron
bf34187a2f Test 2015-07-21 21:55:19 +12:00
Nick Cameron
0e907fa542 Provide a filemap ctor with line info 2015-07-21 21:55:19 +12:00
Nick Cameron
007246c17f Allow for space between each filemap in the codemap
So if a filemap's last byte is at position n in the codemap, then n+1 will not refer to any filemap, and the next filemap will begin an n+2.

This is useful for empty files, it means that every file (even empty ones) has a byte in the codemap.

Closes #23301, #26504
2015-07-21 21:55:19 +12:00
bors
247a0d1854 Auto merge of #27153 - alexcrichton:flaky-tests, r=brson
This commit ensures that the rustc thread does not leak a panic message whenever
a call to `fatal` happens. This already happens for the main rustc thread as
part of the `rustc_driver::monitor` function, but the compiler also spawns
threads for other operations like `-C codegen-units`, and sometimes errors are
emitted on these threads as well. To ensure that there's a consistent
error-handling experience across threads this unifies these two to never print
the panic message in the case of a normal and expected fatal error.

This should also fix the flaky `asm-src-loc-codegen-units.rs` test as the output
is sometimes garbled if diagnostics are printed while the panic message is also
being printed.
2015-07-21 08:26:19 +00:00
bors
691ce23479 Auto merge of #27150 - retep998:where-are-my-files, r=alexcrichton
cc #24570

r? @alexcrichton
2015-07-21 06:27:15 +00:00
bors
f9f0e44b33 Auto merge of #27144 - semarie:openbsd-archive_format, r=alexcrichton
the "bsd" archive_format don't work under openbsd.
use of "" (system ar) is ok.
use of "gnu" is ok too.

r? @alexcrichton
2015-07-21 04:53:50 +00:00
bors
48a1f1b96f Auto merge of #27139 - pnkfelix:allow-disable-debuginfo, r=dotdash
fix `configure`: allow both `--enable-debug` and `--disable-debuginfo` in one invocation.

This is my very local fix to allow one to be able to (1.) build `rustc` and (2.) run `make check` with internal debug-mode *assertions* turned on in the presence of bugs like  #26447 and #26484 (both of which are solely caused by debuginfo and thus can be sidestepped via `--disable-debuginfo`).

This partially addresses #24416 (namely, it addresses the papercut outlined in the description of that ticket).  But there are other issues mentioned in the comment thread that are not addressed here, so they should be separately addressed before closing that ticket, or separate bugs should be opened for them.
2015-07-21 03:19:43 +00:00
bors
238765e1eb Auto merge of #27103 - wthrowe:doc_format, r=alexcrichton
This fixes a couple of bugs visible on https://doc.rust-lang.org/nightly/std/marker/trait.Sync.html .  For example:
* `impl<T> Sync for *const T` should read `impl<T> !Sync for *const T`
* `impl<T> !Sync for Weak<T>` should read `impl<T> !Sync for Weak<T> where T: ?Sized`

This does change a struct in librustdoc and it seems that almost everything there is marked public, so if librustdoc has stability guarantees that could be a problem.  If it is, I'll find a way to rework the change to avoid modifying public structures.
2015-07-21 01:41:22 +00:00
Brian Anderson
778c89c1bb Address feedback 2015-07-20 17:12:59 -07:00
William Throwe
a3e78f4151 Add test of cross-crate impl formatting 2015-07-20 20:09:36 -04:00
bors
118a5c4c34 Auto merge of #27129 - arthurprs:debug_atomic, r=alexcrichton
I'm being constantly bitten by the lack of this implementation.

I'm unsure if there's a reason to avoid these implementations though.

Since we have a "lossy" implementation for both Mutex and RWLock (RWLock {{ locked }}) I don't think there's a big reason for not having a Debug implementation for the atomic types, even if the user can't specify the ordering.
2015-07-21 00:03:37 +00:00
Alex Crichton
24c5e49275 std: Fix compiling the standard library on i686-MSVC
This commit fixes building the standard library with the `i686-pc-windows-msvc`
target by correcting an included symbol name to the linker.
2015-07-20 16:12:48 -07:00
Steve Klabnik
fa28192312 Write better docs for std::io
This is the landing page for all of io, so we should have more than just
a sentence here.
2015-07-20 18:07:35 -04:00
bors
ed49bad0cc Auto merge of #27056 - Eljay:doc-comments, r=nikomatsakis
Fixes #23812 by stripping the decoration when desugaring macro doc comments into #[doc] attributes, and detects whether the attribute should be inner or outer style and outputs the appropriate token tree.
2015-07-20 21:21:24 +00:00
Brian Anderson
8497c428e5 std: Create separate docs for the primitives
Having the primitive and module docs derived from the same source
causes problems, primarily that they can't contain hyperlinks
cross-referencing each other.

This crates dedicated private modules in `std` to document the
primitive types, then for all primitives that have a corresponding
module, puts hyperlinks in moth the primitive docs and the module docs
cross-linking each other.

This should help clear up confusion when readers find themselves on
the wrong page.
2015-07-20 13:18:06 -07:00
Brian Anderson
44dd247cd5 doc: Clean up primitive short descriptions
This makes the primitive descriptions on the front page read properly
as descriptions of types and not of the associated modules.
2015-07-20 13:17:41 -07:00
bors
2fe870a5a7 Auto merge of #26831 - arielb1:lifetime-fixes, r=nikomatsakis
r? @nikomatsakis
2015-07-20 19:46:46 +00:00
bors
47265bbf37 Auto merge of #27064 - alexcrichton:into-raw-os, r=brson
This commit is an implementation of [RFC 1174][rfc] which adds three new traits
to the standard library:

* `IntoRawFd` - implemented on Unix for all I/O types (files, sockets, etc)
* `IntoRawHandle` - implemented on Windows for files, processes, etc
* `IntoRawSocket` - implemented on Windows for networking types

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1174-into-raw-fd-socket-handle-traits.md

Closes #27062
2015-07-20 18:12:40 +00:00
Brian Anderson
9191a78955 Revert "Fix missing_docs lint for const and static."
This reverts commit 00130cff99.

As mentioned in a regression report[1], this caused a notable amount
of breakage.  Because there's a plan to mitigate[2] this type of
breakage, I'm reverting this until then.

[1]: https://internals.rust-lang.org/t/new-crater-reports-1-1-stable-vs-beta-2015-07-10-and-nightly-2015-07-10/2358
[2]: https://github.com/rust-lang/rfcs/pull/1193
2015-07-20 10:44:46 -07:00
Peter Atashian
1e79917bda Improve Debug impl for File on Windows
Adds a path field if a path could be obtained

Signed-off-by: Peter Atashian <retep998@gmail.com>
2015-07-20 13:24:34 -04:00
arthurprs
225ad17520 impl Debug for Atomic types 2015-07-20 14:11:38 -03:00
Alex Crichton
7cb157e74d Register new snapshots
These new snapshots contain the knowledge of how to build the new triples of
32-bit MSVC and 32-bit FreeBSD, both of which should soon start having
nightlies/auto builders!

This does not currently register bitrig/freebsd snapshots but I believe those
will be retroactively added in the near future.
2015-07-20 09:51:29 -07:00
bors
18557500cb Auto merge of #27026 - nagisa:overflowing-unsigned, r=pnkfelix
This commit fixes the negate_unsigned feature gate to appropriately
account for inferred variables.

This is technically a [breaking-change], but I’d consider it a bug fix.

cc @brson for your relnotes.

Fixes https://github.com/rust-lang/rust/issues/24676
Fixes #26840 
Fixes https://github.com/rust-lang/rust/issues/25206
2015-07-20 16:38:33 +00:00
Alex Crichton
013d47b19b syntax: Suppress panic message on fatal
This commit ensures that the rustc thread does not leak a panic message whenever
a call to `fatal` happens. This already happens for the main rustc thread as
part of the `rustc_driver::monitor` function, but the compiler also spawns
threads for other operations like `-C codegen-units`, and sometimes errors are
emitted on these threads as well. To ensure that there's a consistent
error-handling experience across threads this unifies these two to never print
the panic message in the case of a normal and expected fatal error.

This should also fix the flaky `asm-src-loc-codegen-units.rs` test as the output
is sometimes garbled if diagnostics are printed while the panic message is also
being printed.
2015-07-20 09:23:31 -07:00
Alex Crichton
7e9e3896df std: Add IntoRaw{Fd,Handle,Socket} traits
This commit is an implementation of [RFC 1174][rfc] which adds three new traits
to the standard library:

* `IntoRawFd` - implemented on Unix for all I/O types (files, sockets, etc)
* `IntoRawHandle` - implemented on Windows for files, processes, etc
* `IntoRawSocket` - implemented on Windows for networking types

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1174-into-raw-fd-socket-handle-traits.md

Closes #27062
2015-07-20 09:08:50 -07:00
bors
39d4faf989 Auto merge of #27025 - dotdash:issue-26484, r=pnkfelix
See the commits for details

r? @arielb1
2015-07-20 15:04:15 +00:00
Björn Steinbrink
3d65c7ff84 Create proper debuginfo for closure variables
Variables for closures hold a tuple of captured variables, and not the
function itself.

Fixes #26484
2015-07-20 15:45:11 +02:00
bors
4e51763e64 Auto merge of #26887 - andreastt:blur_help_dialogue, r=steveklabnik
Blurs the document's background when the help dialogue is present,
making the contents of the dialogue stand out more.
2015-07-20 13:30:15 +00:00