Commit Graph

44156 Commits

Author SHA1 Message Date
bors
9d9e2678f5 Auto merge of #26757 - oli-obk:style_fixes, r=brson
the indentation has always been a thorn in my eye.

If it's preferred I'll leave the `unsafe` where it was and change it to

```rust
unsafe { match e.node {
    ...
} } // unsafe { match e.node {
```

so there's no unnecessary indent
2015-07-06 21:22:20 +00:00
bors
2ceaa77ae2 Auto merge of #26741 - alexcrichton:noinline-destructors, r=brson
This PR was originally going to be a "let's start running tests on MSVC" PR, but it didn't quite get to that point. It instead gets us ~80% of the way there! The steps taken in this PR are:

* Landing pads are turned on by default for 64-bit MSVC. The LLVM support is "good enough" with the caveat the destructor glue is now marked noinline. This was recommended [on the associated bug](https://llvm.org/bugs/show_bug.cgi?id=23884) as a stopgap until LLVM has a better representation for exception handling in MSVC. The consequence of this is that MSVC will have a bit of a perf hit, but there are possible routes we can take if this workaround sticks around for too long.
* The linker (`link.exe`) is now looked up in the Windows Registry if it's not otherwise available in the environment. This improves using the compiler outside of a VS shell (e.g. in a MSYS shell or in a vanilla cmd.exe shell). This also makes cross compiles via Cargo "just work" when crossing between 32 and 64 bit!
* TLS destructors were fixed to start running on MSVC (they previously weren't running at all)
* A few assorted `run-pass` tests were fixed.
* The dependency on the `rust_builtin` library was removed entirely for MSVC to try to prevent any `cl.exe` compiled objects get into the standard library. This should help us later remove any dependence on the CRT by the standard library.
* I re-added `rust_try_msvc_32.ll` for 32-bit MSVC and ensured that landing pads were turned off by default there as well.

Despite landing pads being enabled, there are still *many* failing tests on MSVC. The two major classes I've identified so far are:

* Spurious aborts. It appears that when optimizations are enabled that landing pads aren't always lined up properly, and sometimes an exception being thrown can't find the catch block down the stack, causing the program to abort. I've been working to reduce this test case but haven't been met with great success just yet.
* Parallel codegen does not work on MSVC. Our current strategy is to take the N object files emitted by the N codegen threads and use `ld -r` to assemble them into *one* object file. The MSVC linker, however, does not have this ability, and this will need to be rearchitected to work on MSVC.

I will fix parallel codegen in a future PR, and I'll also be watching LLVM closely to see if the aborts... disappear!
2015-07-06 19:49:16 +00:00
bors
943b014609 Auto merge of #26824 - arielb1:fix-26812, r=eddyb
Fixes #26812.

r? @eddyb
2015-07-06 18:15:46 +00:00
bors
20f421cd52 Auto merge of #26822 - tamird:llvm-config, r=alexcrichton
Minor stuff.
2015-07-06 16:22:47 +00:00
Ariel Ben-Yehuda
78761d64a9 don't use type_parameter_def during astconv
astconv is called when converting the type-parameter, which leads to
a crash.

Fixes #26812.
2015-07-06 18:58:54 +03:00
bors
7b7853897b Auto merge of #26820 - liigo:patch-2, r=steveklabnik
Closes #26801
2015-07-06 14:49:52 +00:00
Tamir Duberstein
1491a8fa01 Remove unused variable 2015-07-06 08:40:40 -04:00
Tamir Duberstein
158fcbbdd6 llconfig is llvm-config 2015-07-06 08:40:40 -04:00
Tamir Duberstein
155c8f9fa8 Simplify 2015-07-06 08:40:40 -04:00
bors
9748574271 Auto merge of #26821 - oli-obk:patch-1, r=sanxiyn 2015-07-06 12:20:23 +00:00
Oliver Schneider
144e44923f typo "struct has is 0-sized" 2015-07-06 13:58:37 +02:00
Oliver Schneider
106f3826e9 lower blanket unsafe block to actual cases of unsafe and adjust indents 2015-07-06 10:08:27 +02:00
Liigo Zhuang
03afbf93ed book: introduce //! doc comment in comments section
Closes #26801
2015-07-06 14:55:06 +08:00
bors
a2b927c5a4 Auto merge of #26817 - cmr:vecdeque-docs, r=Gankro
None
2015-07-06 05:01:21 +00:00
bors
d0fdfbfb0d Auto merge of #26811 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #26464, #26789, #26800, #26806, #26808
- Failed merges: #26796
2015-07-05 23:42:50 +00:00
bors
7809e76eb6 Auto merge of #26464 - Gankro:send, r=alexcrichton
Vec contains `Unique<T>` and some usizes, this is already derived.
2015-07-05 22:10:21 +00:00
bors
5d3b0f1f6b Auto merge of #26473 - Eljay:missing_docs, r=alexcrichton
Fixes #24249

I've tagged all items that were missing docs to allow them to compile for now, the ones in core/num should probably be documented at least.

This is also a breaking change for any crates using `#[deny(missing_docs)]` that have undocumented constants, not sure there is any way to avoid this without making it a separate lint?
2015-07-05 20:37:26 +00:00
Steve Klabnik
d1fcb2f502 Rollup merge of #26808 - tshepang:closures, r=steveklabnik 2015-07-05 15:12:21 -04:00
Tshepang Lekhonkhobe
10e762eaad reference: 'inherits' is more clear than 'implies' 2015-07-06 01:01:37 +02:00
Steve Klabnik
8c7fd357e0 Rollup merge of #26806 - cmr:stabilize-drain, r=Gankro
None
2015-07-05 15:12:20 -04:00
Steve Klabnik
4c7c7b7477 Rollup merge of #26800 - tshepang:comma, r=Gankro 2015-07-05 15:12:20 -04:00
Steve Klabnik
8b51b8f181 Rollup merge of #26789 - tshepang:improve-array-examples, r=alexcrichton 2015-07-05 15:12:20 -04:00
Steve Klabnik
2e78d3705f Rollup merge of #26464 - Gankro:send, r=alexcrichton
Vec contains `Unique<T>` and some usizes, this is already derived.
2015-07-05 15:12:19 -04:00
bors
7c1e339f10 Auto merge of #25754 - geofft:remove-compiletest-jit, r=alexcrichton
jit support was removed from rustc in 6b34ba242d
(December 2013), so passing `--jit` wouldn't even work.
2015-07-05 19:05:14 +00:00
bors
281cfb93ab Auto merge of #26798 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #26785, #26787, #26788, #26791, #26792, #26795
- Failed merges: #26796
2015-07-05 17:31:11 +00:00
Corey Richardson
f5ea6208e0 collections: vec_deque: add some notes on how to use VecDeque as a queue effectively 2015-07-05 12:18:57 -04:00
Tshepang Lekhonkhobe
e08bb7f54c reference: remove stray comma 2015-07-05 17:58:46 +02:00
Steve Klabnik
89d7dd1b33 Rollup merge of #26795 - tshepang:typo, r=steveklabnik 2015-07-05 07:35:16 -04:00
Tshepang Lekhonkhobe
a1dd2fb956 reference: fix typo 2015-07-05 16:36:43 +02:00
Steve Klabnik
9d23df481d Rollup merge of #26792 - tshepang:follow-idiom, r=steveklabnik 2015-07-05 07:35:15 -04:00
Tshepang Lekhonkhobe
da90ddb5fd reference: improve lambda example 2015-07-05 14:49:08 +02:00
Steve Klabnik
3b3cdb124a Rollup merge of #26791 - tshepang:misc-ref-fixes, r=steveklabnik
One is for grammar, and the other is for clarity
2015-07-05 07:35:15 -04:00
Tshepang Lekhonkhobe
73c1f242e3 reference: tiny fixes
One is for grammar, and the other is for clarity
2015-07-05 14:45:55 +02:00
Steve Klabnik
a5f9162909 Rollup merge of #26788 - tshepang:not-exclamation-marks, r=steveklabnik
The sentences are also so short that they don't need periods at the end
2015-07-05 07:35:15 -04:00
Steve Klabnik
ec37d456aa Rollup merge of #26787 - tshepang:tuple-usage, r=steveklabnik 2015-07-05 07:35:15 -04:00
Steve Klabnik
08395a9a06 Rollup merge of #26785 - tshepang:inference, r=steveklabnik
…at and integer types
2015-07-05 07:35:14 -04:00
Tshepang Lekhonkhobe
f82276d947 reference: improve examples of the different array types 2015-07-05 13:33:06 +02:00
Tshepang Lekhonkhobe
f76187c426 reference: that looks like exclamations marks for some fonts
The sentences are also so short that they don't need periods at the end
2015-07-05 13:16:33 +02:00
Tshepang Lekhonkhobe
72c027535a reference: make tuple usage examples more meaningful 2015-07-05 13:04:04 +02:00
Tshepang Lekhonkhobe
4fc28c90f8 reference: improve readability of type inference explanations for float and integer types 2015-07-05 12:31:44 +02:00
Corey Richardson
8e2ce46d99 collections: vec_deque: rename "ringbuf" to "VecDeque" in doc comments 2015-07-05 04:01:30 -04:00
bors
f9f580936d Auto merge of #26776 - bluss:num-inline, r=eddyb
Add missing #[inline] to min_value/max_value on integers

Spotted a compiled function call to num::usize::min_value, I'd prefer
the 0 to be inlined.
2015-07-04 20:59:56 +00:00
Ulrik Sverdrup
e68934277f Add missing #[inline] to min_value/max_value on integers
Spotted a compiled function call to num::usize::min_value, I'd prefer
the 0 to be inlined.
2015-07-04 22:54:59 +02:00
bors
42e545ffa7 Auto merge of #26694 - eddyb:method-nan, r=arielb1
`MethodCallee` now has no information about the method, other than its `DefId`.
The previous bits of information can be recovered as follows:
```rust
let method_item = tcx.impl_or_trait_item(callee.def_id);
let container = method_item.container();
```
The method is inherent if `container` is a `ty::ImplContainer`:
* the `impl` the method comes from is `container.id()`

The method is a trait method if `container` is a `ty::TraitContainer:
* the `trait` the method is part of is `container.id()`
* a `ty::TraitRef` can be constructed by putting together:
 * `container.id()` as the `trait` ID
 * `callee.substs.clone().method_to_trait()` as the `trait` substs (including `Self`)
* the above `trait_ref` is a valid `T: Trait<A, B, C>` predicate
* selecting `trait_ref` could result in one of the following:
 * `traits::VtableImpl(data)`: static dispatch to `data.impl_def_id`
 * `traits::VtableObject(data)`: dynamic dispatch, with the vtable index:
`traits::get_vtable_index_of_object_method(tcx, data, callee.def_id)`
 * other variants of `traits::Vtable`: various other `impl` sources
2015-07-04 18:49:28 +00:00
bors
b381449dff Auto merge of #26771 - bluss:str-prefix, r=Gankro
core: Use memcmp in is_prefix_of / is_suffix_of

The basic str equality in core::str calls memcmp, re-use the same
function in StrSearcher's is_prefix_of, is_suffix_of.
2015-07-04 17:16:51 +00:00
Eduard Burtescu
d256eb1c5d rustc: remove MethodOrigin and use the container to distinguish inherent methods. 2015-07-04 17:51:31 +03:00
Eduard Burtescu
536e71b78f rustc: compute the vtable base of a supertrait during selection. Fixes #26339. 2015-07-04 17:51:30 +03:00
bors
c83f8f9bd9 Auto merge of #26770 - arielb1:str-mut-idx, r=eddyb
r? @eddyb

This doesn't seem to make any code valid because the `IndexMut` impls are missing.
2015-07-04 14:44:45 +00:00
Ulrik Sverdrup
c5a0a73253 str: Correct documentation on is_char_boundary
Documentation claims it panics on out of bounds -- it regards out of
bounds as just not a char boundary.

core::str module is aware of how it works and uses it appropriately.
Maybe we should rename it to `is_valid_index`, `is_slicable_index`, or
something similar.
2015-07-04 15:20:34 +02:00
Ariel Ben-Yehuda
90fcf261f2 Remove outdated errors for mutating strings 2015-07-04 16:17:26 +03:00