Commit Graph

44012 Commits

Author SHA1 Message Date
Alex Crichton
407fb293db msvc: Ignore extern-pass-empty on MSVC
The MSVC compiler doesn't like empty structs, so this test won't link on MSVC,
so it's ignored.
2015-07-01 09:35:55 -07:00
Alex Crichton
ae0eb675db msvc: Fix TLS destructors
Just like the original article our Windows TLS support is based on predicted,
this symbol must be linked in on MSVC to pull in the necessary support for TLS
variables. This commit fixes a number of unit tests which require that TLS
destructors are run.
2015-07-01 09:35:55 -07:00
Alex Crichton
91c22b6302 msvc: Lookup linker in windows registry
This commit alters the compiler to no longer "just run link.exe" but instead
probe the system's registry to find where the linker is located. The default
library search path (normally found through LIB) is also found through the
registry. This also brings us in line with the default behavior of Clang, and
much of the logic of where to look for information is copied over from Clang as
well. Finally, this commit removes the makefile logic for updating the
environment variables for the compiler, except for stage0 where it's still
necessary.

The motivation for this change is rooted in two positions:

* Not having to set up these environment variables is much less hassle both for
  the bootstrap and for running the compiler itself. This means that the
  compiler can be run outside of VS shells and be run inside of cmd.exe or a
  MSYS shell.

* When dealing with cross compilation, there's not actually a set of environment
  variables that can be set for the compiler. This means, for example, if a
  Cargo compilation is targeting 32-bit from 64-bit you can't actually set up
  one set of environment variables. Having the compiler deal with the logic
  instead is generally much more convenient!
2015-07-01 09:35:55 -07:00
Alex Crichton
f9de964ccf msvc: Enable landing pads by default
This commit turns on landing pads for MSVC by default, which means that we'll
now be running cleanups for values on the stack when an exception is thrown.
This commit "fixes" the previously seen LLVM abort by attaching the `noinline`
attribute to all generated drop glue to prevent landing pads from being inlined
into other landing pads.

The performance of MSVC is highly likely to decrease from this commit, but there
are various routes we can taken in the future if this ends up staying for quite
a while, such as generating a shim function only called from landing pads which
calls the actual drop glue, and this shim is marked noinline.

For now, however, this patch enables MSVC to successfully bootstrap itself!
2015-07-01 09:35:54 -07:00
bors
d4fe2a0027 Auto merge of #26711 - bluss:doc-hide-rand, r=steveklabnik
A follow up to #26530, hide SampleRange too. The numerical types implement this trait.
2015-07-01 13:39:57 +00:00
Ulrik Sverdrup
7dc50b1a07 Hide SampleRange trait from docs 2015-07-01 12:05:57 +02:00
bors
a9e26b5ced Auto merge of #26540 - oli-obk:issue11715, r=nrc
closes #25037
closes #11715

r? @nrc
2015-07-01 08:49:17 +00:00
bors
a5dec98802 Auto merge of #26703 - nrc:dxr-servo-fix, r=huonw
r? @huonw
2015-07-01 07:04:53 +00:00
Nick Cameron
a1d40c81f9 save-analysis: skip generated content in patterns 2015-07-01 15:53:08 +12:00
bors
1fc0f68548 Auto merge of #26698 - alexcrichton:char-fmt, r=huonw
This recently regressed in #24689, and this updates the `Display` implementation
to take formatting flags into account.

Closes #26625
2015-07-01 03:35:46 +00:00
Alex Crichton
98566ea951 std: Fix formatting flags for chars
This recently regressed in #24689, and this updates the `Display` implementation
to take formatting flags into account.

Closes #26625
2015-06-30 19:26:03 -07:00
bors
bf3c979ec3 Auto merge of #26696 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #26373, #26506, #26580, #26622, #26627, #26651, #26678, #26692
- Failed merges:
2015-06-30 23:46:57 +00:00
bors
dc309d79e9 Auto merge of #26686 - arielb1:associated-type-defaults-actually-work, r=eddyb
Fixes #26636.

r? @eddyb
2015-06-30 21:39:46 +00:00
bors
fdf219dd42 Auto merge of #26663 - Eljay:fix-repr-attribute, r=sanxiyn
Fixes #26646.

Loops over all `#[repr(..)]` attributes instead of stopping at the first one to make sure they are all marked as used. Previously it stopped after the first `#[repr(C)]` was found causing all other attributes to be skipped by the linter.
2015-06-30 20:07:18 +00:00
Steve Klabnik
08f9b98e57 Rollup merge of #26692 - steveklabnik:gh26620, r=alexcrichton
Fixes #26620
2015-06-30 15:37:45 -04:00
Steve Klabnik
8b81f76593 Make note of Ord's derive ordering
Fixes #26620
2015-06-30 19:37:34 -04:00
Steve Klabnik
26ff4714dd Rollup merge of #26678 - bluss:doc-fmt, r=steveklabnik
fmt: Update docs and mention :#? pretty-printing

Expose `:#?` well in the docs for fmt and Debug itself. Also update some out of date information and fix formatting in `std::fmt` docs.
2015-06-30 15:37:45 -04:00
Steve Klabnik
65b5c15384 Rollup merge of #26651 - GuillaumeGomez:patch-2, r=Manishearth
Part of #24407.
cc @michaelsproul
r? @Manishearth
2015-06-30 15:37:45 -04:00
Steve Klabnik
825e48fadf Rollup merge of #26627 - tshepang:stdin-example, r=steveklabnik 2015-06-30 15:37:45 -04:00
Steve Klabnik
cf1c5b22d8 Rollup merge of #26622 - tshepang:indents, r=sanxiyn 2015-06-30 15:37:44 -04:00
Steve Klabnik
bac361558e Rollup merge of #26580 - adamheins:master, r=steveklabnik
I found a sentence that felt a bit awkward to read in its current form, so I added a comma to break it up.
2015-06-30 15:37:44 -04:00
Steve Klabnik
96dd82ff9c Rollup merge of #26506 - tshepang:doc-fix, r=steveklabnik 2015-06-30 15:37:44 -04:00
Steve Klabnik
9d641316f1 Rollup merge of #26373 - tshepang:patch-2, r=steveklabnik 2015-06-30 15:37:44 -04:00
Ariel Ben-Yehuda
cebb118bff Actually encode default associated types
Fixes #26636
2015-06-30 22:03:25 +03:00
bors
7fc0675f35 Auto merge of #26327 - bluss:two-way, r=aturon
Update substring search to use the Two Way algorithm

To improve our substring search performance, revive the two way searcher
and adapt it to the Pattern API.

Fixes #25483, a performance bug: that particular case now completes faster
in optimized rust than in ruby (but they share the same order of magnitude).

Many thanks to @gereeter who helped me understand the reverse case
better and wrote the comment explaining `next_back` in the code.

I had quickcheck to fuzz test forward and reverse searching thoroughly.

The two way searcher implements both forward and reverse search,
but not double ended search. The forward and reverse parts of the two
way searcher are completely independent.

The two way searcher algorithm has very small, constant space overhead,
requiring no dynamic allocation. Our implementation is relatively fast,
especially due to the `byteset` addition to the algorithm, which speeds
up many no-match cases.

A bad case for the two way algorithm is:

```
let haystack = (0..10_000).map(|_| "dac").collect::<String>();
let needle = (0..100).map(|_| "bac").collect::<String>());
```

For this particular case, two way is not much faster than the naive
implementation it replaces.
2015-06-30 18:09:51 +00:00
Tshepang Lekhonkhobe
bc1b43cd0b doc: add example for Stdin::read_line 2015-06-30 19:53:05 +02:00
Guillaume Gomez
be38926b69 Add E0119 error explanation
Add more explanations
2015-06-30 19:21:45 +02:00
Guillaume Gomez
2881e83c96 Add E0207 error explanation 2015-06-30 19:21:45 +02:00
Guillaume Gomez
a481c4ecdc Add E0117 error explanation 2015-06-30 19:21:39 +02:00
Guillaume Gomez
edf6132be8 Add E0101 error explanation 2015-06-30 19:21:23 +02:00
Guillaume Gomez
758ea34146 Add E0092 error explanation 2015-06-30 19:21:23 +02:00
Guillaume Gomez
0ba2db5fde Add E0211 error explanation 2015-06-30 19:21:23 +02:00
Guillaume Gomez
ed6940fd38 Add E0094 error explanation 2015-06-30 19:21:22 +02:00
Guillaume Gomez
20f22b7f0e Add E0093 error explanation 2015-06-30 19:21:22 +02:00
Guillaume Gomez
c158be082f Add E0195 error explanation 2015-06-30 19:21:17 +02:00
bors
85361528bc Auto merge of #26669 - frewsxcv:diagnostics-https, r=huonw
None
2015-06-30 15:13:05 +00:00
bors
0b703787ab Auto merge of #26664 - steveklabnik:gh26571, r=alexcrichton
This was pretty misleading, so let's improve.

Fixes #26571
2015-06-30 12:54:16 +00:00
Ulrik Sverdrup
516941b74f fmt: Update docs and mention :#? pretty-printing 2015-06-30 14:37:06 +02:00
bors
f39df49bcd Auto merge of #26662 - steveklabnik:gh26661, r=alexcrichton
This is his own mirror, so it shouldn't go down, unlike the previous one.

Fixes #26661
2015-06-30 10:26:09 +00:00
bors
080d5b74dd Auto merge of #26670 - frewsxcv:regression-test-13902, r=alexcrichton
Closes #13902
2015-06-30 08:04:11 +00:00
bors
e6596d0052 Auto merge of #26668 - frewsxcv:regression-test-17756, r=alexcrichton
Closes #17756
2015-06-30 03:18:45 +00:00
bors
27975c49a6 Auto merge of #26667 - arielb1:audit-walk, r=eddyb
This was originally motivated by checking for HRTB hygiene, but I found several other bugs on the way.

This does not fix the biggest user of ty_walk, which is dtorck - I would prefer to coordinate that with @pnkfelix.

r? @eddyb
2015-06-30 01:45:46 +00:00
Corey Farwell
6419acee34 Add regression test for #13902
Closes #13902
2015-06-29 17:28:21 -07:00
Corey Farwell
e834c0348f Link to docs from error explanations via HTTPS 2015-06-29 17:23:02 -07:00
bors
faa04a8b9c Auto merge of #26666 - huonw:unc-rec, r=alexcrichton
This fixes two false positives for the unconditional recursion lint, when functions use themselves (or almost-themselves) internally, without actually being recursive.

````rust
fn main() { let _ = main; }
```
```rust
trait Bar {
    fn method<T: Bar>(&self, x: &T) {
        x.method(x)
    }
}
```
2015-06-30 00:14:32 +00:00
Corey Farwell
d8680f6534 Add regression test for #17756
Closes #17756
2015-06-29 17:10:53 -07:00
Ariel Ben-Yehuda
fb5dd398f6 Remove now-useless code 2015-06-30 02:31:07 +03:00
Ariel Ben-Yehuda
a5e21daa19 Kill count_late_bound_regions
No, it didn't show up in my profiler. It still needs to die.
2015-06-30 02:24:46 +03:00
Huon Wilson
900af2c6d9 lint: default methods must be called on Self to unconditionally recur.
This catches the case when a trait defines a default method that calls
itself, but on a type that isn't necessarily `Self`, e.g. there's no
reason that `T = Self` in the following, so the call isn't necessarily
recursive (`T` may override the call).

    trait Bar {
        fn method<T: Bar>(&self, x: &T) {
            x.method(x)
        }
    }

Fixes #26333.
2015-06-29 16:00:54 -07:00
Huon Wilson
b1931e48a0 lint: only consider actual calls as unconditional recursion.
Specifically, just mentioning the function name as a value is fine, as
long as it isn't called, e.g. `fn main() { let _ = main; }`.

Closes #21705.
2015-06-29 15:59:37 -07:00