Commit Graph

44801 Commits

Author SHA1 Message Date
Felix S. Klock II
07afe91fda 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.
2015-07-22 15:34:00 +02:00
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
Alisdair Owens
dd3ac9058a Add long diagnostics for E0223 and E0225 2015-07-22 13:52:48 +01:00
bors
d4d4206e56 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.
2015-07-22 12:49:06 +00: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
Jonathan Hansford
f2c73459ac Path changed to %PATH%
The two references to the "Path system variable" have changed to the
"%PATH% system variable".
2015-07-22 08:26:40 +01:00
Steve Klabnik
e22c6f7caa Improve documentation for std::io::BufWriter
Mostly through adding examples.
2015-07-22 01:21:17 -04:00
Alex Crichton
a0efd3a3d9 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
2015-07-21 21:31:25 -07: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
Marcus Klaas
b36d107b83 Assign proper span to range expression 2015-07-21 23:04:23 +02:00
Andrew Paseltiner
18f115c2bb update compile-fail test for #21174 to account for #27127 2015-07-21 16:58:26 -04: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
Aidan Hobson Sayers
7af865b333 Static linking 2015-07-21 21:11:52 +01:00
Ticki
cf1e078bf6 Klabnik nit-picks ;) 2015-07-21 22:09:29 +02:00
Ticki
48870d4f05 rust -> Rust 2015-07-21 21:40:11 +02:00
Ticki
a5c7b96426 Add info about usage of 'unsafe' keyword in bindings to foreign interfaces. 2015-07-21 21:36:29 +02:00
Andrew Paseltiner
e6d8434cb3 add test for #14382
closes #14382
2015-07-21 14:39:40 -04: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
Aidan Hobson Sayers
e5c1884c26 Note possiblities of empty extern blocks (based on #12575) 2015-07-21 19:07:21 +01:00
Aidan Hobson Sayers
e6c058e18c Rename 'link-args' to 'advanced-linking', add intro 2015-07-21 19:07:19 +01:00
Guillaume Gomez
2e919b4c51 Add E0433 error explanation 2015-07-21 19:50:28 +02:00
Steve Klabnik
d2aee954fe Expand documentation for IntoInnerError
Mostly adding examples.
2015-07-21 13:37:09 -04:00
Guillaume Gomez
c13295bbc3 Add E0428 error explanation 2015-07-21 19:28:58 +02:00
Guillaume Gomez
95811546e6 Add E0407 error explanation 2015-07-21 19:28:58 +02:00
Guillaume Gomez
bc79f20cca Add E0404 error explanation 2015-07-21 19:28:58 +02:00
Guillaume Gomez
cd385cbe34 Add E0405 error explanation 2015-07-21 19:28:58 +02:00
Guillaume Gomez
0eb7303c70 Add E0403 error explanation 2015-07-21 19:28:57 +02:00
Steve Klabnik
cbdc52e986 Expand a bit on thread::park spurious wakeups
Fixes #26475
2015-07-21 13:23:34 -04:00
Björn Steinbrink
000e870554 Inline eq_slice_() into eq_slice()
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.
2015-07-21 18:30:18 +02: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
Felix S. Klock II
91493df752 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`.)
2015-07-21 18:12:06 +02:00
Felix S. Klock II
3413346be2 Sidestep warning about repeated E0045 span_err! invocation.
(That is, take the two expressions with the same message and unify
them into one subroutine.)
2015-07-21 17:41:08 +02: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
Jonathan Hansford
99572284dc Guidance on Windows install re "Add to PATH"
Updated "Installing Rust" and "After installation" to provide additional
guidance to Windows users on including Rust in the Path system variable.
2015-07-21 12:31:06 +01: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