]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoRollup merge of #27137 - dhuseby:fixing_bitrig_linking, r=alexcrichton
Steve Klabnik [Fri, 24 Jul 2015 18:56:01 +0000 (14:56 -0400)]
Rollup merge of #27137 - dhuseby:fixing_bitrig_linking, r=alexcrichton

fixes the linking error on bitrig.

8 years agoAuto merge of #27136 - dhuseby:fixing_freebsd_linking, r=alexcrichton
bors [Fri, 24 Jul 2015 14:17:48 +0000 (14:17 +0000)]
Auto merge of #27136 - dhuseby:fixing_freebsd_linking, r=alexcrichton

freebsd linking fix.

8 years agoAuto merge of #27215 - pnkfelix:fsk-placer-take-5-just-in, r=nikomatsakis
bors [Fri, 24 Jul 2015 10:12:20 +0000 (10:12 +0000)]
Auto merge of #27215 - pnkfelix:fsk-placer-take-5-just-in, r=nikomatsakis

Macro desugaring of `in PLACE { BLOCK }` into "simpler" expressions following the in-development "Placer" protocol.

Includes Placer API that one can override to integrate support for `in` into one's own type.  (See [RFC 809].)

[RFC 809]: https://github.com/rust-lang/rfcs/blob/master/text/0809-box-and-in-for-stdlib.md

Part of #22181

Replaced PR #26180.

Turns on the `in PLACE { BLOCK }` syntax, while leaving in support for the old `box (PLACE) EXPR` syntax (since we need to support that at least until we have a snapshot with support for `in PLACE { BLOCK }`.

(Note that we are not 100% committed to the `in PLACE { BLOCK }` syntax.  In particular I still want to play around with some other alternatives.  Still, I want to get the fundamental framework for the protocol landed so we can play with implementing it for non `Box` types.)

----

Also, this PR leaves out support for desugaring-based `box EXPR`.  We will hopefully land that in the future, but for the short term there are type-inference issues injected by that change that we want to resolve separately.

8 years agoAuto merge of #27227 - eternaleye:patch-1, r=alexcrichton
bors [Fri, 24 Jul 2015 07:37:03 +0000 (07:37 +0000)]
Auto merge of #27227 - eternaleye:patch-1, r=alexcrichton

Currently, `rustc` generates nondeterministic archives, which contain system timestamps. These don't really serve any useful purpose, and enabling deterministic archives moves us a little closer to completely deterministic builds. For a small toy library using `std::ops::{Deref,DerefMut}`, this change actually results in a bit-for-bit identical build every time.

8 years agoAuto merge of #27208 - alexcrichton:msvc-less-dllimport, r=brson
bors [Fri, 24 Jul 2015 05:13:39 +0000 (05:13 +0000)]
Auto merge of #27208 - alexcrichton:msvc-less-dllimport, r=brson

Currently you can hit a link error on MSVC by only referencing static items from
a crate (no functions for example) and then link to the crate statically (as all
Rust crates do 99% of the time). A detailed investigation can be found [on
github][details], but the tl;dr is that we need to stop applying dllimport so
aggressively.

This commit alters the application of dllimport on constants to only cases where
the crate the constant originated from will be linked as a dylib in some output
crate type. That way if we're just linking rlibs (like the motivation for this
issue) we won't use dllimport. For the compiler, however, (which has lots of
dylibs) we'll use dllimport.

[details]: https://github.com/rust-lang/rust/issues/26591#issuecomment-123513631

cc #26591

8 years agoAuto merge of #26583 - eefriedman:lint-ffi, r=nrc
bors [Fri, 24 Jul 2015 02:40:42 +0000 (02:40 +0000)]
Auto merge of #26583 - eefriedman:lint-ffi, r=nrc

Makes the lint a bit more accurate, and improves the quality of the diagnostic
messages by explicitly returning an error message.

8 years agoswitching to gnu archive format
Dave Huseby [Thu, 23 Jul 2015 22:47:07 +0000 (15:47 -0700)]
switching to gnu archive format

8 years agofixes #27124 for freebsd
Dave Huseby [Mon, 20 Jul 2015 01:54:47 +0000 (18:54 -0700)]
fixes #27124 for freebsd

8 years agoRewrite the improper_ctypes lint.
Eli Friedman [Thu, 25 Jun 2015 21:48:36 +0000 (14:48 -0700)]
Rewrite the improper_ctypes lint.

Makes the lint a bit more accurate, and improves the quality of the diagnostic
messages by explicitly returning an error message.

The new lint is also a little more aggressive: specifically, it now
rejects tuples, and it recurses into function pointers.

8 years agoAuto merge of #27224 - alexcrichton:configure-lto-right, r=brson
bors [Thu, 23 Jul 2015 23:38:36 +0000 (23:38 +0000)]
Auto merge of #27224 - alexcrichton:configure-lto-right, r=brson

The LTO pass in the compiler forgot to call the `LLVMRustAddBuilderLibraryInfo`
function and configure other options such as merge_functions, vectorize_slp,
etc. This ended up causing linker errors on MSVC targets because the optimizer
didn't have the right knowledge that some system functions are missing on these
platforms.

This commit consolidates creation of PassManagerBuilder instances to one
function which is then called when needed. This ensures that the pass manager is
always correctly configured with the various target-specific information that
LLVM needs.

Overall, this fixes `-C lto -C opt-level=3` on 32-bit MSVC targets.

8 years agoupdate compile-fail/pushpop-unsafe-rejects.rs to reflect switch from saturated to...
Felix S. Klock II [Thu, 23 Jul 2015 21:39:02 +0000 (23:39 +0200)]
update compile-fail/pushpop-unsafe-rejects.rs to reflect switch from saturated to checked arith.

8 years agoreview feedback: common-subexpression-elim across functions in pushpop_safe impl.
Felix S. Klock II [Thu, 23 Jul 2015 14:22:05 +0000 (16:22 +0200)]
review feedback: common-subexpression-elim across functions in pushpop_safe impl.

8 years agoreview feedback: Use checked-arith instead of saturated-arith for `push_unsafe!`...
Felix S. Klock II [Thu, 23 Jul 2015 14:20:59 +0000 (16:20 +0200)]
review feedback: Use checked-arith instead of saturated-arith for `push_unsafe!` and `pop_unsafe!`.

8 years agoAuto merge of #27226 - eefriedman:leftover-negation-lint, r=alexcrichton
bors [Thu, 23 Jul 2015 19:11:51 +0000 (19:11 +0000)]
Auto merge of #27226 - eefriedman:leftover-negation-lint, r=alexcrichton

r? @pnkfelix

8 years agoswitching to gnu archive format per review request
Dave Huseby [Thu, 23 Jul 2015 17:13:49 +0000 (10:13 -0700)]
switching to gnu archive format per review request

8 years agoreview feedback fixes
Dave Huseby [Thu, 23 Jul 2015 13:05:59 +0000 (06:05 -0700)]
review feedback fixes

8 years agofixes #27124 for bitrig
Dave Huseby [Sun, 19 Jul 2015 17:04:27 +0000 (10:04 -0700)]
fixes #27124 for bitrig

8 years agoAuto merge of #27221 - dotdash:no_empty_clean, r=luqmana
bors [Thu, 23 Jul 2015 15:59:20 +0000 (15:59 +0000)]
Auto merge of #27221 - dotdash:no_empty_clean, r=luqmana

When compiling libsyntax this removes about 30k basic blocks that only
contain a single unconditional jump and reduces the peak memory usage by
about 10MB (from 681MB down to 671MB).

8 years agoUpdate suggestion from parenthesized-box-expr-message to reflect new output spacing.
Felix S. Klock II [Thu, 23 Jul 2015 14:00:58 +0000 (16:00 +0200)]
Update suggestion from parenthesized-box-expr-message to reflect new output spacing.

8 years agofix pretty printing tests by opting into the features that the expanded code needs.
Felix S. Klock II [Thu, 23 Jul 2015 14:00:28 +0000 (16:00 +0200)]
fix pretty printing tests by opting into the features that the expanded code needs.

8 years agofix doc-tests by opting into `placement_in_syntax` feature where necessary.
Felix S. Klock II [Thu, 23 Jul 2015 13:59:58 +0000 (15:59 +0200)]
fix doc-tests by opting into `placement_in_syntax` feature where necessary.

8 years agoReview feedback: add unstable marker to Placer API and put in bound that now works.
Felix S. Klock II [Thu, 23 Jul 2015 14:01:46 +0000 (16:01 +0200)]
Review feedback: add unstable marker to Placer API and put in bound that now works.

8 years agoAuto merge of #27203 - marcusklaas:fix-range-span, r=alexcrichton
bors [Thu, 23 Jul 2015 12:52:21 +0000 (12:52 +0000)]
Auto merge of #27203 - marcusklaas:fix-range-span, r=alexcrichton

Right trims the span for certain range expressions.

Closes https://github.com/rust-lang/rust/issues/27162.

8 years agoAuto merge of #26588 - eefriedman:foreign-lifetime, r=nrc
bors [Thu, 23 Jul 2015 09:16:08 +0000 (09:16 +0000)]
Auto merge of #26588 - eefriedman:foreign-lifetime, r=nrc

Pretty straightforward; just need to make sure to explicitly handle
the generic parameters of each ast::ForeignItemFn.

Fixes #26587.

8 years agoWrite deterministic archives
eternaleye [Thu, 23 Jul 2015 06:54:59 +0000 (23:54 -0700)]
Write deterministic archives

Currently, `rustc` generates nondeterministic archives, which contain system timestamps. These don't really serve any useful purpose, and enabling deterministic archives moves us a little closer to completely deterministic builds. For a small toy library using `std::ops::{Deref,DerefMut}`, this change actually results in a bit-for-bit identical build every time.

8 years agoResolve lifetime parameters for foreign functions.
Eli Friedman [Fri, 26 Jun 2015 06:13:03 +0000 (23:13 -0700)]
Resolve lifetime parameters for foreign functions.

Pretty straightforward; just need to make sure to explicitly handle
the generic parameters of each ast::ForeignItemFn.

Fixes #26587.

8 years agoAuto merge of #27192 - dotdash:inline_eq_slice, r=luqmana
bors [Thu, 23 Jul 2015 02:24:06 +0000 (02:24 +0000)]
Auto merge of #27192 - dotdash:inline_eq_slice, r=luqmana

eq_slice_() used to be a common implementation for two function that
both called it, but of those only eq_slice() is left, so we can as well
directly inline the code.

8 years agoRemove orphaned unsigned_negation lint reference.
Eli Friedman [Thu, 23 Jul 2015 00:47:01 +0000 (17:47 -0700)]
Remove orphaned unsigned_negation lint reference.

8 years agoAuto merge of #27191 - pnkfelix:sidestep-unary-negate-warning, r=alexcrichton
bors [Wed, 22 Jul 2015 23:37:37 +0000 (23:37 +0000)]
Auto merge of #27191 - pnkfelix:sidestep-unary-negate-warning, r=alexcrichton

Work around unary negation to-be-feature-gated warning by replacing references to `-1` as a `ast::NodeId` with `ast::DUMMY_NODE_ID`, which seems like a better notation to use (it is currently also `-1`.

(AFAICT the code is not *relying* on the value `-1` anywhere, it really just needed a dummy value for when the input is `None`.)

8 years agotrans: Consolidate creating pass manager builders
Alex Crichton [Wed, 22 Jul 2015 23:22:51 +0000 (16:22 -0700)]
trans: Consolidate creating pass manager builders

The LTO pass in the compiler forgot to call the `LLVMRustAddBuilderLibraryInfo`
function and configure other options such as merge_functions, vectorize_slp,
etc. This ended up causing linker errors on MSVC targets because the optimizer
didn't have the right knowledge that some system functions are missing on these
platforms.

This commit consolidates creation of PassManagerBuilder instances to one
function which is then called when needed. This ensures that the pass manager is
always correctly configured with the various target-specific information that
LLVM needs.

Overall, this fixes `-C lto -C opt-level=3` on 32-bit MSVC targets.

8 years agoaddress review feedback: remove dupe feature opt-in.
Felix S. Klock II [Wed, 22 Jul 2015 21:25:52 +0000 (23:25 +0200)]
address review feedback: remove dupe feature opt-in.

8 years agoplacate `make tidy`.
Felix S. Klock II [Wed, 22 Jul 2015 21:23:36 +0000 (23:23 +0200)]
placate `make tidy`.

8 years agoAvoid creating basic blocks for empty cleanup scopes
Björn Steinbrink [Wed, 22 Jul 2015 21:15:01 +0000 (23:15 +0200)]
Avoid creating basic blocks for empty cleanup scopes

When compiling libsyntax this removes about 30k basic blocks that only
contain a single unconditional jump and reduces the peak memory usage by
about 10MB (from 681MB down to 671MB).

8 years agoAuto merge of #27188 - pnkfelix:sidestep-warning-for-E0045, r=alexcrichton
bors [Wed, 22 Jul 2015 20:44:39 +0000 (20:44 +0000)]
Auto merge of #27188 - pnkfelix:sidestep-warning-for-E0045, r=alexcrichton

Sidestep warning about repeated E0045 `span_err!` invocation.

(That is, take the two expressions with the same message and unify them into one subroutine.)

8 years agoAuto merge of #27219 - steveklabnik:rollup, r=steveklabnik
bors [Wed, 22 Jul 2015 16:58:56 +0000 (16:58 +0000)]
Auto merge of #27219 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #27084, #27127, #27131, #27140, #27146, #27147, #27151, #27154, #27155, #27156, #27157, #27158, #27163, #27164, #27166, #27167, #27170, #27175, #27183, #27201, #27202
- Failed merges: #26778

8 years agoRollup merge of #27202 - apasel422:issue-21174, r=alexcrichton
Steve Klabnik [Wed, 22 Jul 2015 16:56:52 +0000 (12:56 -0400)]
Rollup merge of #27202 - apasel422:issue-21174, r=alexcrichton

8 years agoRollup merge of #27201 - Ticki:master, r=steveklabnik
Steve Klabnik [Wed, 22 Jul 2015 16:56:52 +0000 (12:56 -0400)]
Rollup merge of #27201 - Ticki:master, r=steveklabnik

Just some small changes.

8 years agoRollup merge of #27183 - Dangthrimble:master, r=steveklabnik
Steve Klabnik [Wed, 22 Jul 2015 16:56:52 +0000 (12:56 -0400)]
Rollup merge of #27183 - Dangthrimble:master, r=steveklabnik

Updated "Installing Rust" and "After installation" to provide additional guidance to Windows users on including Rust in the Path system variable.

r? @steveklabnik

8 years agoRollup merge of #27175 - steveklabnik:channels_plus_travis, r=alexcrichton
Steve Klabnik [Wed, 22 Jul 2015 16:56:52 +0000 (12:56 -0400)]
Rollup merge of #27175 - steveklabnik:channels_plus_travis, r=alexcrichton

This should help people configure travis to test all three channels.

8 years agoRollup merge of #27170 - steveklabnik:doc_std_io_intoinnererror, r=alexcrichton
Steve Klabnik [Wed, 22 Jul 2015 16:56:51 +0000 (12:56 -0400)]
Rollup merge of #27170 - steveklabnik:doc_std_io_intoinnererror, r=alexcrichton

Mostly adding examples.

r? @alexcrichton

8 years agoRollup merge of #27167 - steveklabnik:doc_std_io_take, r=alexcrichton
Steve Klabnik [Wed, 22 Jul 2015 16:56:51 +0000 (12:56 -0400)]
Rollup merge of #27167 - steveklabnik:doc_std_io_take, r=alexcrichton

Better and more consistent links to their creators.

8 years agoRollup merge of #27166 - steveklabnik:doc_std_io_linewriter, r=alexcrichton
Steve Klabnik [Wed, 22 Jul 2015 16:56:51 +0000 (12:56 -0400)]
Rollup merge of #27166 - steveklabnik:doc_std_io_linewriter, r=alexcrichton

Beef up the struct docs, add examples for the methods.

r? @alexcrichton

8 years agoRollup merge of #27164 - steveklabnik:doc_io_utils, r=alexcrichton
Steve Klabnik [Wed, 22 Jul 2015 16:56:50 +0000 (12:56 -0400)]
Rollup merge of #27164 - steveklabnik:doc_io_utils, r=alexcrichton

These provide various special readers, so point their docs to their
constructor functions in a manner consistent with everything else.

r? @alexcrichton

8 years agoRollup merge of #27163 - steveklabnik:doc_std_io_cursor, r=alexcrichton
Steve Klabnik [Wed, 22 Jul 2015 16:56:50 +0000 (12:56 -0400)]
Rollup merge of #27163 - steveklabnik:doc_std_io_cursor, r=alexcrichton

Beef up the docs on the type, as well as adding examples for all
methods.

r? @alexcrichton

8 years agoRollup merge of #27158 - apasel422:issue-14382, r=alexcrichton
Steve Klabnik [Wed, 22 Jul 2015 16:56:50 +0000 (12:56 -0400)]
Rollup merge of #27158 - apasel422:issue-14382, r=alexcrichton

closes #14382

8 years agoRollup merge of #27157 - steveklabnik:doc_std_io_iterators, r=alexcrichton
Steve Klabnik [Wed, 22 Jul 2015 16:56:50 +0000 (12:56 -0400)]
Rollup merge of #27157 - steveklabnik:doc_std_io_iterators, r=alexcrichton

Make them all consistent and link up the documentation.

r? @alexcrichton

8 years agoRollup merge of #27156 - AlisdairO:diagnostics253, r=Manishearth
Steve Klabnik [Wed, 22 Jul 2015 16:56:49 +0000 (12:56 -0400)]
Rollup merge of #27156 - AlisdairO:diagnostics253, r=Manishearth

This is a resubmission of my previous git failure - apologies.  Just fixing up a wording error that was discovered in E0253 after the r.

r? @Manishearth

8 years agoRollup merge of #27155 - steveklabnik:doc_std_io_buf_writer, r=alexcrichton
Steve Klabnik [Wed, 22 Jul 2015 16:56:49 +0000 (12:56 -0400)]
Rollup merge of #27155 - steveklabnik:doc_std_io_buf_writer, r=alexcrichton

Mostly through adding examples.

r? @alexcrichton

I'm going to be doing a bunch of these today, but I figured I'd keep it one PR per struct, since the last 'all the things in one PR' ended up taking a week to actually land.

8 years agoRollup merge of #27154 - apasel422:issue-10436, r=Gankro
Steve Klabnik [Wed, 22 Jul 2015 16:56:49 +0000 (12:56 -0400)]
Rollup merge of #27154 - apasel422:issue-10436, r=Gankro

closes #10436

8 years agoRollup merge of #27151 - pfalabella:patch-2, r=steveklabnik
Steve Klabnik [Wed, 22 Jul 2015 16:56:49 +0000 (12:56 -0400)]
Rollup merge of #27151 - pfalabella:patch-2, r=steveklabnik

I'm pretty sure this was a typo

8 years agoRollup merge of #27147 - apasel422:issue-19404, r=alexcrichton
Steve Klabnik [Wed, 22 Jul 2015 16:56:48 +0000 (12:56 -0400)]
Rollup merge of #27147 - apasel422:issue-19404, r=alexcrichton

closes #19404

8 years agoRollup merge of #27146 - apasel422:issue-14229, r=alexcrichton
Steve Klabnik [Wed, 22 Jul 2015 16:56:48 +0000 (12:56 -0400)]
Rollup merge of #27146 - apasel422:issue-14229, r=alexcrichton

closes #14229

8 years agoRollup merge of #27140 - dotdash:test-26468, r=luqmana
Steve Klabnik [Wed, 22 Jul 2015 16:56:48 +0000 (12:56 -0400)]
Rollup merge of #27140 - dotdash:test-26468, r=luqmana

The fix for #26468 was made upstream and landed with the LLVM update in #27076.

Closes #26468

8 years agoRollup merge of #27131 - apasel422:issue-20162, r=arielb1
Steve Klabnik [Wed, 22 Jul 2015 16:56:48 +0000 (12:56 -0400)]
Rollup merge of #27131 - apasel422:issue-20162, r=arielb1

closes #20162

8 years agoRollup merge of #27127 - AlisdairO:diagnostics172, r=Manishearth
Steve Klabnik [Wed, 22 Jul 2015 16:56:47 +0000 (12:56 -0400)]
Rollup merge of #27127 - AlisdairO:diagnostics172, r=Manishearth

As title :-)

Part of #24407.
r? @Manishearth

8 years agoRollup merge of #27084 - GuillaumeGomez:patch-2, r=brson
Steve Klabnik [Wed, 22 Jul 2015 16:56:47 +0000 (12:56 -0400)]
Rollup merge of #27084 - GuillaumeGomez:patch-2, r=brson

Part of #24407.
r? @Manishearth

8 years agoImprove documentation for std::io::Cursor
Steve Klabnik [Mon, 20 Jul 2015 18:33:36 +0000 (14:33 -0400)]
Improve documentation for std::io::Cursor

Beef up the docs on the type, as well as adding examples for all
methods.

8 years agoImprove documentation for std::io::LineWriter
Steve Klabnik [Mon, 20 Jul 2015 19:43:57 +0000 (15:43 -0400)]
Improve documentation for std::io::LineWriter

Beef up the struct docs, add examples for the methods.

8 years agoAdd test of placement-in syntax, analogous to `new-box-syntax.rs`
Felix S. Klock II [Wed, 22 Jul 2015 13:33:09 +0000 (15:33 +0200)]
Add test of placement-in syntax, analogous to `new-box-syntax.rs`

8 years agorefine set of allowed warnings in `new-box-syntax.rs` test.
Felix S. Klock II [Wed, 22 Jul 2015 13:32:17 +0000 (15:32 +0200)]
refine set of allowed warnings in `new-box-syntax.rs` test.

8 years agoAdd actual use of the `struct Structure` lying dormant in `new-box-syntax.rs`.
Felix S. Klock II [Wed, 22 Jul 2015 13:30:05 +0000 (15:30 +0200)]
Add actual use of the `struct Structure` lying dormant in `new-box-syntax.rs`.

The original test program exercised the (garbage-collected heap)
allocation form `box (GC) ...`, feeding an instance of `Structure` in
as the expression. This obviously went away when `GC` went away, but
there's no reason for us not to include an appropriate unit test here
for the same form, just for heap-allocated instances of `Structure`.

8 years agouncomment feature-gate testing for `in PLACE BLOCK` now that its in the parser.
Felix S. Klock II [Wed, 22 Jul 2015 13:09:51 +0000 (15:09 +0200)]
uncomment feature-gate testing for `in PLACE BLOCK` now that its in the parser.

8 years agoAdded support for parsing `in PLACE { BLOCK_CONTENT }`.
Felix S. Klock II [Tue, 21 Jul 2015 16:31:37 +0000 (18:31 +0200)]
Added support for parsing `in PLACE { BLOCK_CONTENT }`.

8 years agoAdd new feature gate opt-in necessary for `new-box-syntax.rs`.
Felix S. Klock II [Tue, 21 Jul 2015 12:32:33 +0000 (14:32 +0200)]
Add new feature gate opt-in necessary for `new-box-syntax.rs`.

8 years agoUpdate `issue-14084.rs` test to reflect changes to error output.
Felix S. Klock II [Tue, 21 Jul 2015 12:32:11 +0000 (14:32 +0200)]
Update `issue-14084.rs` test to reflect changes to error output.

8 years agoUpdate the `intrinsic-move-val.rs` test to reflect its newer signature.
Felix S. Klock II [Tue, 21 Jul 2015 12:31:51 +0000 (14:31 +0200)]
Update the `intrinsic-move-val.rs` test to reflect its newer signature.

8 years agoAdd necessary feature gate opt-in for the pushpop_unsafe test.
Felix S. Klock II [Tue, 21 Jul 2015 12:31:30 +0000 (14:31 +0200)]
Add necessary feature gate opt-in for the pushpop_unsafe test.

8 years agoFactor feature gate tests for box syntax into two separate files.
Felix S. Klock II [Tue, 21 Jul 2015 12:31:07 +0000 (14:31 +0200)]
Factor feature gate tests for box syntax into two separate files.

The two tests are separate since the current implementation performs
the feature gate checks at distinct phases in the compilation, with an
`abort_if_errors` calls separating them.

8 years agoInstrumentation in effort to understand treatment of `allow_internal_unstable`.
Felix S. Klock II [Fri, 5 Jun 2015 16:53:17 +0000 (18:53 +0200)]
Instrumentation in effort to understand treatment of `allow_internal_unstable`.

It is all `debug!` instrumentation so it should not impose a cost on
non-debug builds.

8 years agoAllow unstable code to be injected by placement-`in` expansion.
Felix S. Klock II [Fri, 5 Jun 2015 16:51:23 +0000 (18:51 +0200)]
Allow unstable code to be injected by placement-`in` expansion.

(Over time the stability checking has gotten more finicky; in
particular one must attach the (whole) span of the original `in PLACE
BLOCK` expression to the injected references to unstable paths, as
noted in the comments.)

call `push_compiler_expansion` during the placement-`in` expansion.

8 years agoAvoid feature-warnings on stage0.
Felix S. Klock II [Fri, 5 Jun 2015 12:20:35 +0000 (14:20 +0200)]
Avoid feature-warnings on stage0.

8 years agoChange signature for `move_val_init` intrinsic to take `*mut T` for `dest`.
Felix S. Klock II [Fri, 5 Jun 2015 12:17:49 +0000 (14:17 +0200)]
Change signature for `move_val_init` intrinsic to take `*mut T` for `dest`.

rebase update to typeck/check/mod.rs

8 years agoAdd feature-gates for desugaring-based `box` and placement-`in`.
Felix S. Klock II [Thu, 12 Feb 2015 10:30:16 +0000 (11:30 +0100)]
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.

8 years agoRevise placement-in expansion to use `push/pop_unsafe` and `move_val_init`.
Felix S. Klock II [Fri, 5 Jun 2015 12:21:32 +0000 (14:21 +0200)]
Revise placement-in expansion to use `push/pop_unsafe` and `move_val_init`.

8 years agoprototype Placer protocol for unstable overloaded-box and placement-in.
Felix S. Klock II [Tue, 27 Jan 2015 00:22:12 +0000 (01:22 +0100)]
prototype Placer protocol for unstable overloaded-box and placement-in.

8 years agoHack for "unsafety hygiene" -- `push_unsafe!` and `pop_unsafe!`.
Felix S. Klock II [Fri, 5 Jun 2015 06:31:27 +0000 (08:31 +0200)]
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

8 years agoAuto merge of #26683 - eefriedman:const-eval-hint, r=pnkfelix
bors [Wed, 22 Jul 2015 12:49:06 +0000 (12:49 +0000)]
Auto merge of #26683 - eefriedman:const-eval-hint, r=pnkfelix

The "hint" mechanism is essentially used as a workaround to compute
types for expressions which have not yet been type-checked. This
commit clarifies that usage, and limits the effects to the places
where it is currently necessary.

Fixes #26210.

8 years agoAuto merge of #27176 - alexcrichton:fix-stock-llvm, r=brson
bors [Wed, 22 Jul 2015 09:13:09 +0000 (09:13 +0000)]
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.

8 years agoPath changed to %PATH%
Jonathan Hansford [Wed, 22 Jul 2015 07:26:40 +0000 (08:26 +0100)]
Path changed to %PATH%

The two references to the "Path system variable" have changed to the
"%PATH% system variable".

8 years agoImprove documentation for std::io::BufWriter
Steve Klabnik [Mon, 20 Jul 2015 17:02:02 +0000 (13:02 -0400)]
Improve documentation for std::io::BufWriter

Mostly through adding examples.

8 years agotrans: Be a little more picky about dllimport
Alex Crichton [Wed, 22 Jul 2015 00:31:35 +0000 (17:31 -0700)]
trans: Be a little more picky about dllimport

Currently you can hit a link error on MSVC by only referencing static items from
a crate (no functions for example) and then link to the crate statically (as all
Rust crates do 99% of the time). A detailed investigation can be found [on
github][details], but the tl;dr is that we need to stop applying dllimport so
aggressively.

This commit alters the application of dllimport on constants to only cases where
the crate the constant originated from will be linked as a dylib in some output
crate type. That way if we're just linking rlibs (like the motivation for this
issue) we won't use dllimport. For the compiler, however, (which has lots of
dylibs) we'll use dllimport.

[details]: https://github.com/rust-lang/rust/issues/26591#issuecomment-123513631

cc #26591

8 years agoAuto merge of #27185 - pnkfelix:test-cyclic-collections, r=alexcrichton
bors [Wed, 22 Jul 2015 04:21:46 +0000 (04:21 +0000)]
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.

8 years agoAuto merge of #27172 - alexcrichton:snapshots, r=brson
bors [Wed, 22 Jul 2015 00:29:08 +0000 (00:29 +0000)]
Auto merge of #27172 - alexcrichton:snapshots, r=brson

Enables bootstrapping a 32-bit MSVC host compiler!

Closes #26602

8 years agotrans: Move rust_try into the compiler
Alex Crichton [Mon, 20 Jul 2015 20:27:38 +0000 (13:27 -0700)]
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.

8 years agoAuto merge of #27093 - Manishearth:closure-label-shadow, r=pnkfelix
bors [Tue, 21 Jul 2015 22:23:34 +0000 (22:23 +0000)]
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 :smile:

r? @pnkfelix

8 years agoAssign proper span to range expression
Marcus Klaas [Tue, 21 Jul 2015 21:04:23 +0000 (23:04 +0200)]
Assign proper span to range expression

8 years agoupdate compile-fail test for #21174 to account for #27127
Andrew Paseltiner [Tue, 21 Jul 2015 20:58:26 +0000 (16:58 -0400)]
update compile-fail test for #21174 to account for #27127

8 years agoAuto merge of #27073 - alexcrichton:less-proc-fs, r=brson
bors [Tue, 21 Jul 2015 20:51:04 +0000 (20:51 +0000)]
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

8 years agoKlabnik nit-picks ;)
Ticki [Tue, 21 Jul 2015 20:09:29 +0000 (22:09 +0200)]
Klabnik nit-picks ;)

8 years agorust -> Rust
Ticki [Tue, 21 Jul 2015 19:40:11 +0000 (21:40 +0200)]
rust -> Rust

8 years agoAdd info about usage of 'unsafe' keyword in bindings to foreign interfaces.
Ticki [Tue, 21 Jul 2015 19:36:29 +0000 (21:36 +0200)]
Add info about usage of 'unsafe' keyword in bindings to foreign interfaces.

8 years agoadd test for #14382
Andrew Paseltiner [Mon, 20 Jul 2015 17:31:04 +0000 (13:31 -0400)]
add test for #14382

closes #14382

8 years agoAuto merge of #26856 - steveklabnik:gh26475, r=alexcrichton
bors [Tue, 21 Jul 2015 18:34:08 +0000 (18:34 +0000)]
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 ?

8 years agoAdd E0433 error explanation
Guillaume Gomez [Fri, 17 Jul 2015 15:21:58 +0000 (17:21 +0200)]
Add E0433 error explanation

8 years agoExpand documentation for IntoInnerError
Steve Klabnik [Mon, 20 Jul 2015 20:46:34 +0000 (16:46 -0400)]
Expand documentation for IntoInnerError

Mostly adding examples.

8 years agoAdd E0428 error explanation
Guillaume Gomez [Fri, 17 Jul 2015 14:09:25 +0000 (16:09 +0200)]
Add E0428 error explanation

8 years agoAdd E0407 error explanation
Guillaume Gomez [Fri, 17 Jul 2015 13:54:44 +0000 (15:54 +0200)]
Add E0407 error explanation

8 years agoAdd E0404 error explanation
Guillaume Gomez [Fri, 17 Jul 2015 12:55:42 +0000 (14:55 +0200)]
Add E0404 error explanation

8 years agoAdd E0405 error explanation
Guillaume Gomez [Fri, 17 Jul 2015 12:14:41 +0000 (14:14 +0200)]
Add E0405 error explanation

8 years agoAdd E0403 error explanation
Guillaume Gomez [Fri, 17 Jul 2015 12:00:03 +0000 (14:00 +0200)]
Add E0403 error explanation