Commit Graph

45573 Commits

Author SHA1 Message Date
Manish Goregaokar
4645662a12 Rollup merge of #27648 - tshepang:patch-7, r=brson 2015-08-11 16:48:03 +05:30
Manish Goregaokar
306d2ca49a Rollup merge of #27647 - rust-lang:issue-27646, r=alexcrichton
This is in line with other targets.

Closes #27646
2015-08-11 16:48:02 +05:30
Manish Goregaokar
1bcbeb21a3 Rollup merge of #27633 - tshepang:patch-6, r=alexcrichton 2015-08-11 16:48:02 +05:30
Manish Goregaokar
2fdfe09275 Rollup merge of #27617 - AlisdairO:diagnostics193, r=Manishearth
As title :-)
Part of #24407.

r? @Manishearth
2015-08-11 16:48:02 +05:30
Manish Goregaokar
93f8031303 Rollup merge of #27612 - vincentbernat:fix/doc/iter-nth, r=steveklabnik
The "nth" element can be confusing. In an array context, we know indexes
start from 0 but one may believe this is not the case with "nth". For
example, would `.nth(1)` return the first (1th/1st) or the second
element?  Rephrase a bit to be less confusing.

r? @steveklabnik
2015-08-11 16:48:02 +05:30
Manish Goregaokar
a917f61569 Rollup merge of #27611 - vincentbernat:fix/doc/chars-iterator, r=steveklabnik
The previous wording was confusing. While would we need to go through
the whole list just to find the first code point? `chars()` being an
iterator, we only need to walk from the beginning of the list.

Note that I am not a native English speaker and I have still difficulties to spot if a "the" is needed somewhere. Feel free to take this PR as a mere suggestion.

r? @steveklabnik
2015-08-11 16:48:02 +05:30
Manish Goregaokar
be2d4fbcb0 Rollup merge of #27577 - diaphore:trailing-newline-formatmessagew, r=alexcrichton
`FormatMessageW` always inserts trailing `\r\n` to system messages which is a minor annoyance when they're fed to `Debug` but can break formatting with `Display`.

```rust
fn main() {
    use std::env;
    if let Err(err) = env::set_current_dir("???") {
        println!("{:#?}\n{}", err, err);
    }
}
```
```_
Error {
    repr: Os {
        code: 2,
        message: "The system cannot find the file specified.\r\n"
    }
}
The system cannot find the file specified.
 (os error 2)
```
2015-08-11 16:48:01 +05:30
Manish Goregaokar
2cad6fef60 Rollup merge of #27572 - brson:authors, r=alexcrichton 2015-08-11 16:48:01 +05:30
Manish Goregaokar
e40516bcb4 Rollup merge of #27542 - steveklabnik:gh27303, r=alexcrichton
Fixes #27303
2015-08-11 16:48:01 +05:30
Tim Neumann
f0ea2b66f3 Fix #27567: remove --crate-type=lib from pretty test 2015-08-11 13:00:38 +02:00
Tim Neumann
c8f32769b8 remove unused file in test/pretty 2015-08-11 13:00:14 +02:00
Jose Narvaez
b7a88d8702 Updated the link with rendered version of the Spanish trpl translation. 2015-08-11 11:02:38 +01:00
bors
23f43896ce Auto merge of #27518 - alexcrichton:msvc-builtin-llvm-ar, r=huonw
This means that we no longer need to ship the `llvm-ar.exe` binary in the MSVC
distribution, and after a snapshot we can remove a good bit of logic from the
makefiles!
2015-08-11 07:48:39 +00:00
bors
f1ae605db8 Auto merge of #27549 - tshepang:clarity, r=alexcrichton 2015-08-11 06:11:29 +00:00
bors
50141d7e1e Auto merge of #26818 - sfackler:duration-stabilization, r=aturon
This commit stabilizes the `std::time` module and the `Duration` type.
`Duration::span` remains unstable, and the `Display` implementation for
`Duration` has been removed as it is still being reworked and all trait
implementations for stable types are de facto stable.

This is a [breaking-change] to those using `Duration`'s `Display`
implementation.

I'm opening this PR as a platform for discussion - there may be some method renaming to do as part of the stabilization process.
2015-08-11 03:47:16 +00:00
Steven Fackler
b51e009069 Fix doc test 2015-08-10 22:31:17 -04:00
bors
8b3705528a Auto merge of #27416 - alexcrichton:fix-dll-export, r=brson
These two commits are aimed at "fixing" our usage of `dllexport` in the compiler. Currently we blanket apply this attribute to *everything* public in a crate, but this ends up with a few downsides:

* Executables are larger than the should be as a result of thinking they should export everything
* Native libraries aren't handled correctly because technically a statically included native library should be exported from a DLL in some cases.
* Symbols don't actually need to be exported if they never end up in a DLL.

The first commit adds a new unstable attribute, `#[linked_from]`, which is a way to tell the compiler what native library a block of symbols comes from. This is used to inform the compiler what set of native libraries are statically included in the rlib (or other output). This information is later used to export them from a DLL if necessary. Currently this is only used in a few places (such as the LLVM bindings) to get the compiler to link correctly.

The second commit stops adding `dllexport` to all items in LLVM and instead explicitly telling the linker what symbols should be exported. We only need to do this when building a dynamic library, and otherwise we can avoid adding `dllexport` or telling the linker about exported symbols.

As a testament to this change, the size of "Hello World" on MSVC drops from 1.2MB to 67KB as a result of this patch. This is because the linker can much more aggressively remove unused code.

These commits do not yet attempt to fix our story with `dllimport`, and I'll leave that to a future PR and issue, for now though I'm going to say that this

Closes #7196
2015-08-11 02:10:31 +00:00
Alex Crichton
e648c96c5f trans: Stop informing LLVM about dllexport
Rust's current compilation model makes it impossible on Windows to generate one
object file with a complete and final set of dllexport annotations. This is
because when an object is generated the compiler doesn't actually know if it
will later be included in a dynamic library or not. The compiler works around
this today by flagging *everything* as dllexport, but this has the drawback of
exposing too much.

Thankfully there are alternate methods of specifying the exported surface area
of a dll on Windows, one of which is passing a `*.def` file to the linker which
lists all public symbols of the dynamic library. This commit removes all
locations that add `dllexport` to LLVM variables and instead dynamically
generates a `*.def` file which is passed to the linker. This file will include
all the public symbols of the current object file as well as all upstream
libraries, and the crucial aspect is that it's only used when generating a
dynamic library. When generating an executable this file isn't generated, so all
the symbols aren't exported from an executable.

To ensure that statically included native libraries are reexported correctly,
the previously added support for the `#[linked_from]` attribute is used to
determine the set of FFI symbols that are exported from a dynamic library, and
this is required to get the compiler to link correctly.
2015-08-10 18:20:42 -07:00
Alex Crichton
18607149fb syntax: Add a new unstable #[linked_from] attribute
To correctly reexport statically included libraries from a DLL on Windows, the
compiler will soon need to have knowledge about what symbols are statically
included and which are not. To solve this problem a new unstable
`#[linked_from]` attribute is being added and recognized on `extern` blocks to
indicate which native library the symbols are coming from.

The compiler then keeps track of what the set of FFI symbols are that are
included statically. This information will be used in a future commit to
configure how we invoke the linker on Windows.
2015-08-10 18:20:00 -07:00
Alex Crichton
138252cc6a trans: Specify archive_format for MSVC
This means that we no longer need to ship the `llvm-ar.exe` binary in the MSVC
distribution, and after a snapshot we can remove a good bit of logic from the
makefiles!
2015-08-10 17:45:16 -07:00
Steven Fackler
e29a62f140 Add back and deprecate old methods. 2015-08-10 20:04:22 -04:00
Steven Fackler
999bdeca88 Stabilize the Duration API
This commit stabilizes the `std::time` module and the `Duration` type.
`Duration::span` remains unstable, and the `Display` implementation for
`Duration` has been removed as it is still being reworked and all trait
implementations for stable types are de facto stable.

This is a [breaking-change] to those using `Duration`'s `Display`
implementation.
2015-08-10 20:04:18 -04:00
Felix S. Klock II
af32c015aa placate the pretty tests by ignoring my test. 2015-08-10 20:04:17 -04:00
Felix S. Klock II
fc54934d88 Regression test for dropflag reinit issue.
Fix #27401.
2015-08-10 20:04:17 -04:00
Felix S. Klock II
91f5d3275f Turn nonzeroing move hints back off by default.
This is a temporary workaround for the bugs that have been found in
the implementation of PR #26173.

 * pnkfelix is unavailable in the short-term (i.e. for the next week) to fix them.

 * When the bugs are fixed, we will turn this back on by default.

(If you want to play with the known-to-be-buggy optimization in the
meantime, you can opt-back in via the debugging option that this
commit is toggling.)
2015-08-10 20:04:17 -04:00
bors
5aca49c693 Auto merge of #27338 - alexcrichton:remove-morestack, r=brson
This commit removes all morestack support from the compiler which entails:

* Segmented stacks are no longer emitted in codegen.
* We no longer build or distribute libmorestack.a
* The `stack_exhausted` lang item is no longer required

The only current use of the segmented stack support in LLVM is to detect stack
overflow. This is no longer really required, however, because we already have
guard pages for all threads and registered signal handlers watching for a
segfault on those pages (to print out a stack overflow message). Additionally,
major platforms (aka Windows) already don't use morestack.

This means that Rust is by default less likely to catch stack overflows because
if a function takes up more than one page of stack space it won't hit the guard
page. This is what the purpose of morestack was (to catch this case), but it's
better served with stack probes which have more cross platform support and no
runtime support necessary. Until LLVM supports this for all platform it looks
like morestack isn't really buying us much.

cc #16012 (still need stack probes)
Closes #26458 (a drive-by fix to help diagnostics on stack overflow)

r? @brson
2015-08-10 23:40:54 +00:00
Alex Crichton
7a3fdfbf67 Remove morestack support
This commit removes all morestack support from the compiler which entails:

* Segmented stacks are no longer emitted in codegen.
* We no longer build or distribute libmorestack.a
* The `stack_exhausted` lang item is no longer required

The only current use of the segmented stack support in LLVM is to detect stack
overflow. This is no longer really required, however, because we already have
guard pages for all threads and registered signal handlers watching for a
segfault on those pages (to print out a stack overflow message). Additionally,
major platforms (aka Windows) already don't use morestack.

This means that Rust is by default less likely to catch stack overflows because
if a function takes up more than one page of stack space it won't hit the guard
page. This is what the purpose of morestack was (to catch this case), but it's
better served with stack probes which have more cross platform support and no
runtime support necessary. Until LLVM supports this for all platform it looks
like morestack isn't really buying us much.

cc #16012 (still need stack probes)
Closes #26458 (a drive-by fix to help diagnostics on stack overflow)
2015-08-10 16:35:44 -07:00
Björn Steinbrink
689d13dde9 Make the backtrace-debuginfo test less error prone
LLVM might perform tail merging on the calls that initiate the unwinding
process which breaks debuginfo and therefore this test. Since tail
merging is guaranteed to break debuginfo, it should be disabled for this
test.

This allows us to restore a testcase that I had to remove earlier
because of the same problem, because back then I didn't realize that
disabling tail merging was an option.

cc #27619
2015-08-11 01:18:45 +02:00
Tshepang Lekhonkhobe
9f597fe7ef doc: remove an unneeded distinction 2015-08-11 01:13:15 +02:00
Brian Anderson
620d1ee534 Update AUTHORS.txt for 1.3 2015-08-10 15:25:32 -07:00
bors
75383ea7d7 Auto merge of #27531 - bluss:io-copy-dst, r=alexcrichton
std: Allow ?Sized parameters in std::io::copy
2015-08-10 22:03:09 +00:00
Elaine "See More" Nemo
ac25b449e2 Use pentium4 for base CPU on i686-pc-windows-msvc
This is in line with other targets.

Closes #27646
2015-08-10 17:53:00 -04:00
Tshepang Lekhonkhobe
b8de07d5e6 doc: success is implied really 2015-08-10 23:52:18 +02:00
Guillaume Gomez
a4e4233828 Add Send/Sync traits on Iter struct in hash/table 2015-08-10 22:46:58 +02:00
bors
8856927f64 Auto merge of #27451 - seanmonstar:use-groups-as, r=alexcrichton
An implementation of [RFC 1219](https://github.com/rust-lang/rfcs/pull/1219).

The RFC is not merged yet, but once merged, this could be.
2015-08-10 20:24:06 +00:00
Alisdair Owens
f0419661f0 fix import nit for long diagnostics on E0387 2015-08-10 20:35:27 +01:00
bors
3d69bec881 Auto merge of #27252 - tbu-:pr_less_transmutes, r=alexcrichton
The replacements are functions that usually use a single `mem::transmute` in their body and restrict input and output via more concrete types than `T` and `U`. Worth noting are the `transmute` functions for slices and the `from_utf8*` family for mutable slices. Additionally, `mem::transmute` was often used for casting raw pointers, when you can already cast raw pointers just fine with `as`.

This builds upon #27233.
2015-08-10 18:46:21 +00:00
Tim Neumann
d46e84081f add and use Span.substitute_dummy method 2015-08-10 20:43:11 +02:00
bors
96a1f40402 Auto merge of #27516 - alexcrichton:osx-flaky-zomg, r=brson
The investigation into #14232 discovered that it's possible that signal delivery
to a newly spawned process is racy on OSX. This test has been failing spuriously
on the OSX bots for some time now, so ignore it as we don't currently know a
solution and it looks like it may be out of our control.
2015-08-10 17:06:15 +00:00
Alisdair Owens
78d28336fe add info about cell types to diagnostic message E0387 2015-08-10 16:48:53 +01:00
bors
1db1417736 Auto merge of #27547 - vberger:more_perseverant_resolve, r=nrc
As noted in my previous PR #27439 , the import resolution algorithm has two cases where it bails out:

- The algorithm will delay an import if the module containing the target of the import still has unresolved glob imports
- The algorithm will delay a glob import of the target module still has unresolved imports

This PR alters the behaviour to only bail out when the above described unresolved imports are `pub`, as non-pub imports don't affect the result anyway.

It is still possible to fail the algorithm with examples like
```rust
pub mod a {
    pub use b::*;
}

pub mod b {
    pub use a::*;
}
```
but such configurations cannot be resolved in any meaningful way, as these are cyclic imports.

Closes #4865
2015-08-10 14:40:07 +00:00
llogiq
86191e2014 Fixed algorithm to match shootout requirements
See line 181: The lookup should start with the random index and iterate from there.

Also locked stdout (which makes it a bit faster on my machine).

Perhaps the multi-thread output from the fasta benchmark could be used to speed it up even more.
2015-08-10 15:41:19 +02:00
Guillaume Gomez
347991540a Add another example for E0425 2015-08-10 15:29:06 +02:00
Ulrik Sverdrup
664fdbed32 std: Allow ?Sized parameters in std::io::copy
std::io::copy did not allow passing trait objects directly (only with an
extra &mut wrapping).
2015-08-10 14:29:08 +02:00
bors
a136d4c95f Auto merge of #27634 - TimNN:master, r=dotdash
I don't know how this single inline caused the breakage but it seems to be the cause of the issue (see https://github.com/rust-lang/rust/issues/27619#issuecomment-129420094).
2015-08-10 12:01:01 +00:00
Tim Neumann
03f561c5f2 Revert "Mark round_up_to_next as inline"
This reverts commit febdc3b201.
2015-08-10 13:51:55 +02:00
Tshepang Lekhonkhobe
3b686a3ffb doc: add missing symbol 2015-08-10 13:46:03 +02:00
Sylvestre Ledru
5bcbc5c735 Bug #27621 - Make sure that LLVM FileCheck is available on the system 2015-08-10 09:53:00 +02:00
William Throwe
f001f9a73e Make tidy-binaries find invocation work on Linux
New enough find on Linux doesn't support "-perm +..." and suggests
using "-perm /..." instead, but that doesn't work on Windows.
Hopefully all platforms are happy with this expanded version.
2015-08-10 00:12:45 -04:00
Eli Friedman
7d3c4bd72a Tweak style guide to avoid referencing the removed ascii::Ascii. 2015-08-09 18:56:48 -07:00