]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agorollup merge of #27663: tbu-/pr_remove_fixme
Alex Crichton [Wed, 12 Aug 2015 05:11:37 +0000 (22:11 -0700)]
rollup merge of #27663: tbu-/pr_remove_fixme

8 years agorollup merge of #27659: goyox86/goyox86/update-spanish-book-link
Alex Crichton [Wed, 12 Aug 2015 05:11:36 +0000 (22:11 -0700)]
rollup merge of #27659: goyox86/goyox86/update-spanish-book-link

This PR just updates the link of my translation of the book to the final rendered version of it.

/cc @steveklabnik

8 years agorollup merge of #27650: dotdash/backtrace_test
Alex Crichton [Wed, 12 Aug 2015 05:11:34 +0000 (22:11 -0700)]
rollup merge of #27650: dotdash/backtrace_test

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

8 years agorollup merge of #27644: AlisdairO/diagnostics194
Alex Crichton [Wed, 12 Aug 2015 05:11:33 +0000 (22:11 -0700)]
rollup merge of #27644: AlisdairO/diagnostics194

As title :-)
Part of #24407.

r? @Manishearth

This will need merging with E0193, so probably want to delay any r+ until that goes in and I can merge myself.

8 years agorollup merge of #27636: llogiq/patch-1
Alex Crichton [Wed, 12 Aug 2015 05:11:31 +0000 (22:11 -0700)]
rollup merge of #27636: llogiq/patch-1

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). And the `make_lookup` function now uses `map` (as the TODO asked for).

Perhaps the multi-thread output from the fasta benchmark could be used to speed it up even more.

8 years agorollup merge of #27635: GuillaumeGomez/patch-4
Alex Crichton [Wed, 12 Aug 2015 05:11:30 +0000 (22:11 -0700)]
rollup merge of #27635: GuillaumeGomez/patch-4

r? @Manishearth

8 years agorollup merge of #27630: sylvestre/master
Alex Crichton [Wed, 12 Aug 2015 05:11:28 +0000 (22:11 -0700)]
rollup merge of #27630: sylvestre/master

8 years agorollup merge of #27622: eefriedman/https-url
Alex Crichton [Wed, 12 Aug 2015 05:11:25 +0000 (22:11 -0700)]
rollup merge of #27622: eefriedman/https-url

Also fixes a few outdated links.

8 years agorollup merge of #27618: dotdash/drop_fixes
Alex Crichton [Wed, 12 Aug 2015 05:11:22 +0000 (22:11 -0700)]
rollup merge of #27618: dotdash/drop_fixes

8 years agorollup merge of #27615: GuillaumeGomez/send_sync
Alex Crichton [Wed, 12 Aug 2015 05:11:21 +0000 (22:11 -0700)]
rollup merge of #27615: GuillaumeGomez/send_sync

Part of #22709.
cc @Veedrac

r? @bluss

8 years agorollup merge of #27605: AlisdairO/diagnostics387
Alex Crichton [Wed, 12 Aug 2015 05:11:20 +0000 (22:11 -0700)]
rollup merge of #27605: AlisdairO/diagnostics387

As title :-)
Part of #24407.

r? @Manishearth

8 years agoAuto merge of #27584 - TimNN:macro-eof-span, r=huonw
bors [Tue, 11 Aug 2015 23:21:19 +0000 (23:21 +0000)]
Auto merge of #27584 - TimNN:macro-eof-span, r=huonw

The ideas is to use the span of the complete macro invocation if the span of a macro error is `DUMMY_SP`.

fixes #7970

8 years agoAuto merge of #27571 - TimNN:pretty-no-crate-type, r=alexcrichton
bors [Tue, 11 Aug 2015 17:27:34 +0000 (17:27 +0000)]
Auto merge of #27571 - TimNN:pretty-no-crate-type, r=alexcrichton

Because I wanted to change the pretty test as little as possible I added `// compiler-flags: --crate-type=lib` to those test that failed because of a missing `main`. Passes `make check-stage1-pretty` locally.

cc @nrc
cc #27567

8 years agoUpdate E0425 error explanation
Guillaume Gomez [Tue, 11 Aug 2015 17:16:23 +0000 (19:16 +0200)]
Update E0425 error explanation

8 years agoAdd HashSet and HashMap tests
Guillaume Gomez [Sun, 9 Aug 2015 21:38:04 +0000 (23:38 +0200)]
Add HashSet and HashMap tests

8 years agoRemove unneeded FIXME
Tobias Bucher [Tue, 11 Aug 2015 15:13:35 +0000 (17:13 +0200)]
Remove unneeded FIXME

8 years agoAuto merge of #27575 - brson:lint, r=alexcrichton
bors [Tue, 11 Aug 2015 14:42:23 +0000 (14:42 +0000)]
Auto merge of #27575 - brson:lint, r=alexcrichton

This reverts commit 9191a7895574ec3aa5a9b84ce0008d91e32ccd6a.

This was reverted previously until the `--cap-lints` option was implemented.

8 years agoadd long diagnostics for E0194
Alisdair Owens [Mon, 10 Aug 2015 19:53:37 +0000 (20:53 +0100)]
add long diagnostics for E0194

8 years agoAuto merge of #27553 - Diggsey:win-path-fix, r=alexcrichton
bors [Tue, 11 Aug 2015 12:59:14 +0000 (12:59 +0000)]
Auto merge of #27553 - Diggsey:win-path-fix, r=alexcrichton

I have no idea how bors keeps working without this - I can only assume it's some peculiarity of how windows searches for DLLs.

Without this change, running `make check` on windows will not correctly set PATH to include eg. `x86_64-pc-windows-gnu\stage1\bin\rustlib\x86_64-pc-windows-gnu\lib`, and when it tries to run eg. `stage1/test/stdtest-x86_64-pc-windows-gnu.exe`, it will fail because windows can't find the DLLs on which it relies.

It seems to be just a mistake: when the equivalent was added for the branch that deals with unix-like platforms, the windows branch was left unchanged.

8 years agoAuto merge of #27658 - Manishearth:rollup, r=Manishearth
bors [Tue, 11 Aug 2015 11:20:11 +0000 (11:20 +0000)]
Auto merge of #27658 - Manishearth:rollup, r=Manishearth

- Successful merges: #27542, #27571, #27572, #27577, #27611, #27612, #27617, #27633, #27647, #27648, #27651
- Failed merges:

8 years agoRollup merge of #27651 - tshepang:patch-8, r=Gankro
Manish Goregaokar [Tue, 11 Aug 2015 07:56:48 +0000 (13:26 +0530)]
Rollup merge of #27651 - tshepang:patch-8, r=Gankro

8 years agoRollup merge of #27648 - tshepang:patch-7, r=brson
Manish Goregaokar [Tue, 11 Aug 2015 07:56:47 +0000 (13:26 +0530)]
Rollup merge of #27648 - tshepang:patch-7, r=brson

8 years agoRollup merge of #27647 - rust-lang:issue-27646, r=alexcrichton
Manish Goregaokar [Tue, 11 Aug 2015 07:56:47 +0000 (13:26 +0530)]
Rollup merge of #27647 - rust-lang:issue-27646, r=alexcrichton

This is in line with other targets.

Closes #27646

8 years agoRollup merge of #27633 - tshepang:patch-6, r=alexcrichton
Manish Goregaokar [Tue, 11 Aug 2015 07:56:47 +0000 (13:26 +0530)]
Rollup merge of #27633 - tshepang:patch-6, r=alexcrichton

8 years agoRollup merge of #27617 - AlisdairO:diagnostics193, r=Manishearth
Manish Goregaokar [Tue, 11 Aug 2015 07:56:47 +0000 (13:26 +0530)]
Rollup merge of #27617 - AlisdairO:diagnostics193, r=Manishearth

As title :-)
Part of #24407.

r? @Manishearth

8 years agoRollup merge of #27612 - vincentbernat:fix/doc/iter-nth, r=steveklabnik
Manish Goregaokar [Tue, 11 Aug 2015 07:56:46 +0000 (13:26 +0530)]
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

8 years agoRollup merge of #27611 - vincentbernat:fix/doc/chars-iterator, r=steveklabnik
Manish Goregaokar [Tue, 11 Aug 2015 07:56:46 +0000 (13:26 +0530)]
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

8 years agoRollup merge of #27577 - diaphore:trailing-newline-formatmessagew, r=alexcrichton
Manish Goregaokar [Tue, 11 Aug 2015 07:56:46 +0000 (13:26 +0530)]
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)
```

8 years agoRollup merge of #27572 - brson:authors, r=alexcrichton
Manish Goregaokar [Tue, 11 Aug 2015 07:56:46 +0000 (13:26 +0530)]
Rollup merge of #27572 - brson:authors, r=alexcrichton

8 years agoRollup merge of #27542 - steveklabnik:gh27303, r=alexcrichton
Manish Goregaokar [Tue, 11 Aug 2015 07:56:45 +0000 (13:26 +0530)]
Rollup merge of #27542 - steveklabnik:gh27303, r=alexcrichton

Fixes #27303

8 years agoFix #27567: remove --crate-type=lib from pretty test
Tim Neumann [Thu, 6 Aug 2015 21:57:31 +0000 (23:57 +0200)]
Fix #27567: remove --crate-type=lib from pretty test

8 years agoremove unused file in test/pretty
Tim Neumann [Thu, 6 Aug 2015 21:53:05 +0000 (23:53 +0200)]
remove unused file in test/pretty

8 years agoUpdated the link with rendered version of the Spanish trpl translation.
Jose Narvaez [Tue, 11 Aug 2015 10:02:38 +0000 (11:02 +0100)]
Updated the link with rendered version of the Spanish trpl translation.

8 years agoAuto merge of #27518 - alexcrichton:msvc-builtin-llvm-ar, r=huonw
bors [Tue, 11 Aug 2015 07:48:39 +0000 (07:48 +0000)]
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!

8 years agoAuto merge of #27549 - tshepang:clarity, r=alexcrichton
bors [Tue, 11 Aug 2015 06:11:29 +0000 (06:11 +0000)]
Auto merge of #27549 - tshepang:clarity, r=alexcrichton

8 years agoAuto merge of #26818 - sfackler:duration-stabilization, r=aturon
bors [Tue, 11 Aug 2015 03:47:16 +0000 (03:47 +0000)]
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.

8 years agoFix doc test
Steven Fackler [Tue, 11 Aug 2015 02:31:17 +0000 (22:31 -0400)]
Fix doc test

8 years agoAuto merge of #27416 - alexcrichton:fix-dll-export, r=brson
bors [Tue, 11 Aug 2015 02:10:31 +0000 (02:10 +0000)]
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

8 years agotrans: Stop informing LLVM about dllexport
Alex Crichton [Wed, 29 Jul 2015 00:19:08 +0000 (17:19 -0700)]
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.

8 years agosyntax: Add a new unstable #[linked_from] attribute
Alex Crichton [Thu, 30 Jul 2015 21:20:36 +0000 (14:20 -0700)]
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.

8 years agotrans: Specify `archive_format` for MSVC
Alex Crichton [Tue, 4 Aug 2015 16:08:07 +0000 (09:08 -0700)]
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!

8 years agoAdd back and deprecate old methods.
Steven Fackler [Fri, 7 Aug 2015 19:54:49 +0000 (12:54 -0700)]
Add back and deprecate old methods.

8 years agoStabilize the Duration API
Steven Fackler [Mon, 6 Jul 2015 06:20:00 +0000 (23:20 -0700)]
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.

8 years agoplacate the pretty tests by ignoring my test.
Felix S. Klock II [Fri, 7 Aug 2015 16:23:37 +0000 (18:23 +0200)]
placate the pretty tests by ignoring my test.

8 years agoRegression test for dropflag reinit issue.
Felix S. Klock II [Fri, 7 Aug 2015 14:21:22 +0000 (16:21 +0200)]
Regression test for dropflag reinit issue.

Fix #27401.

8 years agoTurn nonzeroing move hints back off by default.
Felix S. Klock II [Fri, 7 Aug 2015 13:51:25 +0000 (15:51 +0200)]
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.)

8 years agoAuto merge of #27338 - alexcrichton:remove-morestack, r=brson
bors [Mon, 10 Aug 2015 23:40:54 +0000 (23:40 +0000)]
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

8 years agoRemove morestack support
Alex Crichton [Mon, 27 Jul 2015 20:41:35 +0000 (13:41 -0700)]
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)

8 years agoMake the backtrace-debuginfo test less error prone
Björn Steinbrink [Mon, 10 Aug 2015 23:03:36 +0000 (01:03 +0200)]
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

8 years agodoc: remove an unneeded distinction
Tshepang Lekhonkhobe [Mon, 10 Aug 2015 23:13:15 +0000 (01:13 +0200)]
doc: remove an unneeded distinction

8 years agoUpdate AUTHORS.txt for 1.3
Brian Anderson [Thu, 6 Aug 2015 22:27:42 +0000 (15:27 -0700)]
Update AUTHORS.txt for 1.3

8 years agoAuto merge of #27531 - bluss:io-copy-dst, r=alexcrichton
bors [Mon, 10 Aug 2015 22:03:09 +0000 (22:03 +0000)]
Auto merge of #27531 - bluss:io-copy-dst, r=alexcrichton

std: Allow ?Sized parameters in std::io::copy

8 years agoUse pentium4 for base CPU on i686-pc-windows-msvc
Elaine "See More" Nemo [Mon, 10 Aug 2015 21:53:00 +0000 (17:53 -0400)]
Use pentium4 for base CPU on i686-pc-windows-msvc

This is in line with other targets.

Closes #27646

8 years agodoc: success is implied really
Tshepang Lekhonkhobe [Mon, 10 Aug 2015 21:52:18 +0000 (23:52 +0200)]
doc: success is implied really

8 years agoAdd Send/Sync traits on Iter struct in hash/table
Guillaume Gomez [Sun, 9 Aug 2015 19:04:22 +0000 (21:04 +0200)]
Add Send/Sync traits on Iter struct in hash/table

8 years agoAuto merge of #27451 - seanmonstar:use-groups-as, r=alexcrichton
bors [Mon, 10 Aug 2015 20:24:06 +0000 (20:24 +0000)]
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.

8 years agofix import nit for long diagnostics on E0387
Alisdair Owens [Mon, 10 Aug 2015 19:35:27 +0000 (20:35 +0100)]
fix import nit for long diagnostics on E0387

8 years agoAuto merge of #27252 - tbu-:pr_less_transmutes, r=alexcrichton
bors [Mon, 10 Aug 2015 18:46:21 +0000 (18:46 +0000)]
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.

8 years agoadd and use Span.substitute_dummy method
Tim Neumann [Mon, 10 Aug 2015 18:40:46 +0000 (20:40 +0200)]
add and use Span.substitute_dummy method

8 years agoAuto merge of #27516 - alexcrichton:osx-flaky-zomg, r=brson
bors [Mon, 10 Aug 2015 17:06:15 +0000 (17:06 +0000)]
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.

8 years agoadd info about cell types to diagnostic message E0387
Alisdair Owens [Mon, 10 Aug 2015 15:48:01 +0000 (16:48 +0100)]
add info about cell types to diagnostic message E0387

8 years agoAuto merge of #27547 - vberger:more_perseverant_resolve, r=nrc
bors [Mon, 10 Aug 2015 14:40:07 +0000 (14:40 +0000)]
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

8 years agoFixed algorithm to match shootout requirements
llogiq [Mon, 10 Aug 2015 13:41:19 +0000 (15:41 +0200)]
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.

8 years agoAdd another example for E0425
Guillaume Gomez [Mon, 10 Aug 2015 13:29:06 +0000 (15:29 +0200)]
Add another example for E0425

8 years agostd: Allow ?Sized parameters in std::io::copy
Ulrik Sverdrup [Wed, 5 Aug 2015 11:31:05 +0000 (13:31 +0200)]
std: Allow ?Sized parameters in std::io::copy

std::io::copy did not allow passing trait objects directly (only with an
extra &mut wrapping).

8 years agoAuto merge of #27634 - TimNN:master, r=dotdash
bors [Mon, 10 Aug 2015 12:01:01 +0000 (12:01 +0000)]
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).

8 years agoRevert "Mark round_up_to_next as inline"
Tim Neumann [Mon, 10 Aug 2015 11:51:55 +0000 (13:51 +0200)]
Revert "Mark round_up_to_next as inline"

This reverts commit febdc3b201bcce1546c88e3be1b956d3f90d3059.

8 years agodoc: add missing symbol
Tshepang Lekhonkhobe [Mon, 10 Aug 2015 11:46:03 +0000 (13:46 +0200)]
doc: add missing symbol

8 years agoBug #27621 - Make sure that LLVM FileCheck is available on the system
Sylvestre Ledru [Mon, 10 Aug 2015 07:35:03 +0000 (09:35 +0200)]
Bug #27621 - Make sure that LLVM FileCheck is available on the system

8 years agoTweak style guide to avoid referencing the removed ascii::Ascii.
Eli Friedman [Mon, 10 Aug 2015 01:56:48 +0000 (18:56 -0700)]
Tweak style guide to avoid referencing the removed ascii::Ascii.

8 years agoRemove unused feature
Tobias Bucher [Sun, 9 Aug 2015 21:53:28 +0000 (23:53 +0200)]
Remove unused feature

8 years agoUse https URLs to refer to rust-lang.org where appropriate.
Eli Friedman [Sun, 9 Aug 2015 21:15:05 +0000 (14:15 -0700)]
Use https URLs to refer to rust-lang.org where appropriate.

Also fixes a few outdated links.

8 years agoRemove #[cfg(stage0)] annotation
Tobias Bucher [Sun, 9 Aug 2015 19:53:00 +0000 (21:53 +0200)]
Remove #[cfg(stage0)] annotation

8 years agoChange TODO to FIXME
Tobias Bucher [Sun, 9 Aug 2015 19:50:53 +0000 (21:50 +0200)]
Change TODO to FIXME

8 years agoMake `str::as_bytes_mut` private
Tobias Bucher [Fri, 24 Jul 2015 20:10:12 +0000 (22:10 +0200)]
Make `str::as_bytes_mut` private

8 years agoMake `slice::transmute*` private
Tobias Bucher [Fri, 24 Jul 2015 19:02:05 +0000 (21:02 +0200)]
Make `slice::transmute*` private

8 years agoReplace many uses of `mem::transmute` with more specific functions
Tobias Bucher [Fri, 24 Jul 2015 01:04:55 +0000 (03:04 +0200)]
Replace many uses of `mem::transmute` with more specific functions

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`.

8 years agoadd diagnostics for E0193
Alisdair Owens [Sun, 9 Aug 2015 15:45:56 +0000 (16:45 +0100)]
add diagnostics for E0193

8 years agoMark round_up_to_next as inline
Ariel Ben-Yehuda [Sun, 9 Aug 2015 14:20:12 +0000 (17:20 +0300)]
Mark round_up_to_next as inline

This speeds up rustc on #25916 from 1.36Â0.022s to 1.326Â0.025s

8 years agodoc/core: fix description of `nth` function
Vincent Bernat [Sat, 8 Aug 2015 23:04:59 +0000 (01:04 +0200)]
doc/core: fix description of `nth` function

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.

8 years agoTRPL: minor correction on how `chars().nth()` work
Vincent Bernat [Sat, 8 Aug 2015 22:56:38 +0000 (00:56 +0200)]
TRPL: minor correction on how `chars().nth()` work

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.

8 years agoAuto merge of #27182 - AlisdairO:diagnostics382, r=Manishearth
bors [Sat, 8 Aug 2015 20:32:27 +0000 (20:32 +0000)]
Auto merge of #27182 - AlisdairO:diagnostics382, r=Manishearth

As title :-)
Part of #24407.

r? @Manishearth

8 years agoadd long diagnostics for E0382
Alisdair Owens [Tue, 21 Jul 2015 11:03:21 +0000 (12:03 +0100)]
add long diagnostics for E0382

8 years agorustc: rename multiple imports in a list
Sean McArthur [Sat, 1 Aug 2015 05:20:25 +0000 (22:20 -0700)]
rustc: rename multiple imports in a list

8 years agoadd diagnostics for E0387
Alisdair Owens [Sat, 8 Aug 2015 16:32:13 +0000 (17:32 +0100)]
add diagnostics for E0387

8 years agoAuto merge of #27595 - mike-marcacci:patch-1, r=steveklabnik
bors [Sat, 8 Aug 2015 16:27:12 +0000 (16:27 +0000)]
Auto merge of #27595 - mike-marcacci:patch-1, r=steveklabnik

Keeping integer values and integer references in the "value" columns made the examples quite difficult for me to follow. I've added unicode arrows to references to make them more obvious, without using any characters with actual meaning in the rust language (like `&` or previously `~`).

r? @steveklabnik

8 years agoFix the function return type used in get_res_dtor()
Björn Steinbrink [Sat, 8 Aug 2015 13:32:35 +0000 (15:32 +0200)]
Fix the function return type used in get_res_dtor()

Instead of the actual return type, we're currently passing the function
type to get_extern_fn(). The only reason this doesn't explode is because
get_extern_fn() actually doesn't care about the actual return type, just
about it being converging or not.

8 years agoAuto merge of #27596 - tsion:fix-27450, r=arielb1
bors [Sat, 8 Aug 2015 09:55:42 +0000 (09:55 +0000)]
Auto merge of #27596 - tsion:fix-27450, r=arielb1

Fixes #27450.

r? @steveklabnik

8 years agoAdded arrows to references in tables
Mike Marcacci [Sat, 8 Aug 2015 06:13:08 +0000 (23:13 -0700)]
Added arrows to references in tables

Keeping integer values and integer references in the "value" columns made the examples quite difficult for me to follow. I've added unicode arrows to make references more obvious, without using a character with actual meaning in the rust language (like `&` or previously `~`).

8 years agoFix the diagnostic for fat pointer to usize casts.
Scott Olson [Sat, 8 Aug 2015 02:08:28 +0000 (22:08 -0400)]
Fix the diagnostic for fat pointer to usize casts.

Fixes #27450.

8 years agoAuto merge of #27378 - GuillaumeGomez:patch-2, r=brson
bors [Fri, 7 Aug 2015 17:58:17 +0000 (17:58 +0000)]
Auto merge of #27378 - GuillaumeGomez:patch-2, r=brson

Part of #24407.
r? @Manishearth

8 years agoFix ICE when trying to drop an unsized type from a different crate
Björn Steinbrink [Fri, 7 Aug 2015 16:29:44 +0000 (18:29 +0200)]
Fix ICE when trying to drop an unsized type from a different crate

The code to get the LLVM type signature for the drop function doesn't
handle unsized types correctly.

8 years agoAuto merge of #27582 - pnkfelix:disable-nonzeroing-move-hint-by-default, r=nikomatsakis
bors [Fri, 7 Aug 2015 16:24:22 +0000 (16:24 +0000)]
Auto merge of #27582 - pnkfelix:disable-nonzeroing-move-hint-by-default, r=nikomatsakis

Turn nonzeroing move hints back off by default.

Works around bugs injected by 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 nonzeroing move hints back on by default.

Fix #27401

8 years agoplacate the pretty tests by ignoring my test.
Felix S. Klock II [Fri, 7 Aug 2015 16:23:37 +0000 (18:23 +0200)]
placate the pretty tests by ignoring my test.

8 years agoimprove span of erroneous empty macro invocation
Tim Neumann [Fri, 7 Aug 2015 14:36:56 +0000 (16:36 +0200)]
improve span of erroneous empty macro invocation

The ideas is to use the span of the complete macro invocation if the span of a
macro error is `DUMMY_SP`.

fixes #7970

8 years agoRegression test for dropflag reinit issue.
Felix S. Klock II [Fri, 7 Aug 2015 14:21:22 +0000 (16:21 +0200)]
Regression test for dropflag reinit issue.

Fix #27401.

8 years agoTurn nonzeroing move hints back off by default.
Felix S. Klock II [Fri, 7 Aug 2015 13:51:25 +0000 (15:51 +0200)]
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.)

8 years agoAdd a guard example for E0416
Guillaume Gomez [Fri, 7 Aug 2015 13:23:00 +0000 (15:23 +0200)]
Add a guard example for E0416

8 years agoImprove examples of E0102
Guillaume Gomez [Fri, 7 Aug 2015 13:07:20 +0000 (15:07 +0200)]
Improve examples of E0102

8 years agoAuto merge of #27551 - arielb1:adt-def, r=nikomatsakis
bors [Fri, 7 Aug 2015 12:23:06 +0000 (12:23 +0000)]
Auto merge of #27551 - arielb1:adt-def, r=nikomatsakis

This ended up being a bigger refactoring than I thought, as I also cleaned a few ugly points in rustc. There are still a few areas that need improvements.

Performance numbers:
```
Before:
572.70user 5.52system 7:33.21elapsed 127%CPU (0avgtext+0avgdata 1173368maxresident)k
llvm-time: 385.858

After:
545.27user 5.49system 7:10.22elapsed 128%CPU (0avgtext+0avgdata 1145348maxresident)k
llvm-time: 387.119
```

A good 5% perf improvement. Note that after this patch >70% of the time is spent in LLVM - Amdahl's law is in full effect.

Passes make check locally.

r? @nikomatsakis