Commit Graph

44107 Commits

Author SHA1 Message Date
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
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
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
Ulrik Sverdrup
0da69969d1 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 15:10:20 +02:00
bors
638ffecbd7 Auto merge of #26728 - arielb1:assoc-maybe, r=nrc
r? @nrc
2015-07-04 11:10:16 +00:00
Ariel Ben-Yehuda
6b27005f2f require reimplementations of all items when a defaulted associated type is overriden
This is a
[breaking-change]
but it follows the RFC (not sure whether it will be accepted).
2015-07-04 14:09:26 +03:00
Ariel Ben-Yehuda
ace86701a9 Clean-up check_impl_items_against_trait 2015-07-04 14:08:09 +03:00
bors
0dc08240ea Auto merge of #26763 - steveklabnik:fix_feature_gates, r=sfackler
These aren't actually needed
2015-07-04 04:52:35 +00:00
Eduard Burtescu
96d24a5c58 rustc: remove MethodOrigin::Object and use traits::VtableObject instead. 2015-07-04 06:21:00 +03:00
Eduard Burtescu
a5447e13aa rustc_trans: remove some outdated and unused logic from callee. 2015-07-04 06:21:00 +03:00
Eduard Burtescu
5620a58791 rustc_lint: use traits::select for methods in unconditional_recursion. 2015-07-04 06:21:00 +03:00
Eduard Burtescu
a2fe59afd6 rustc_trans: explicit impl population is unnecessary in fulfill_obligation. 2015-07-04 06:21:00 +03:00
Eduard Burtescu
70365ed911 rustc: simplify ty::MethodOrigin and avoid trait item indices. 2015-07-04 06:21:00 +03:00
Eduard Burtescu
fe354e58bd rustc: remove unused MethodStaticClosure variant of MethodOrigin. 2015-07-04 06:21:00 +03:00
bors
f9274d63a3 Auto merge of #26754 - SaschaNaz:patch-1, r=steveklabnik 2015-07-04 03:19:07 +00:00
bors
50c952b5b7 Auto merge of #26370 - nikomatsakis:better-object-defaults-warn, r=nikomatsakis
This is an implementation of RFC rust-lang/rfcs#1156. It includes the code to implement the new rules, but that code is currently disabled. It also includes code to issue warnings when the change will cause breakage. These warnings try hard to be targeted but are also somewhat approximate. They could, with some effort, be made *more* targeted by adjusting the code in ty_relate that propagates the "will change" flag to consider the specific operation. Might be worth doing.

r? @pnkfelix (I think you understand region inference best)
2015-07-04 00:23:30 +00:00
Niko Matsakis
db5f3bc65c Fix some merge conflicts 2015-07-03 19:42:55 -04:00
Niko Matsakis
65a456df43 Now that I made the warning smarter, these tests no longer require modification 2015-07-03 19:42:35 -04:00
Niko Matsakis
18e9007ac2 Adjust tests to silence warnings (or record them, as appropriate). 2015-07-03 19:42:35 -04:00
Niko Matsakis
1e7a6b880c After inferring regions, scan for any bounds that are due to a lifetime
bound that is likely to change. In that case, it will change to 'static,
so then scan down the graph to see whether there are any hard
constraints that would prevent 'static from being a valid value
here. Report a warning.
2015-07-03 19:42:35 -04:00
Niko Matsakis
909957793e Add a boolean flag to ExistentialBounds tracking whether the
region-bound is expected to change in Rust 1.3, but don't use it for
anything in this commit. Note that this is not a "significant" part of
the type (it's not part of the formal model) so we have to normalize
this away or trans starts to get confused because two equal types wind
up with distinct LLVM types.
2015-07-03 19:42:35 -04:00
Niko Matsakis
ef85338175 Code up the new lifetime default rules, but leave them disabled
for now.
2015-07-03 19:42:35 -04:00
bors
f027bdc1c8 Auto merge of #26378 - arielb1:unused-mut, r=pnkfelix
This makes it somewhat more aggressive, so this is kind-of a [breaking-change] for these compiling with `#[deny(unused_mut)]`.

r? @pnkfelix
2015-07-03 21:31:46 +00:00
bors
7b148381c7 Auto merge of #26762 - rick68:patch-9, r=alexcrichton
Remove the tagged attribute `stable` from all private functions.
2015-07-03 19:59:52 +00:00
Steve Klabnik
66f757b26d remove some feature gates from the docs
These aren't actually needed
2015-07-03 15:45:06 -04:00
Wei-Ming Yang
409fc2f605 Update atomic.rs
Remove the tagged attribute `stable` from all private functions
2015-07-04 03:24:25 +08:00
bors
320bd6f874 Auto merge of #26759 - dotdash:drop_dst, r=pnkfelix
Fixes #26709
2015-07-03 13:59:42 +00:00
Björn Steinbrink
eaeede2126 Fix ICE caused by Drop implementations for unsized types
Fixes #26709
2015-07-03 14:44:51 +02:00
Kagami Sascha Rosylight
f24089cfd1 MYSY2 -> MSYS2 2015-07-03 17:16:13 +09:00
bors
f3b97a74aa Auto merge of #26752 - frewsxcv:patch-25, r=alexcrichton 2015-07-03 07:13:57 +00:00
Corey Farwell
e2b6b02e3a Fix 'Relaaxed' typo in code comment 2015-07-03 00:13:02 -07:00
bors
4c246ecb64 Auto merge of #26740 - steveklabnik:gh26737, r=gankro
Fixes #26737.
2015-07-03 02:32:27 +00:00
bors
4a217759ad Auto merge of #26610 - aturon:fix_make_unique, r=alexcrichton
This commit resolves the race condition in the `get_mut` and
`make_unique` functions, which arose through interaction with weak
pointers. The basic strategy is to "lock" the weak pointer count when
trying to establish uniqueness, by reusing the field as a simple
spinlock. The overhead for normal use of `Arc` is expected to be minimal
-- it will be *none* when only strong pointers are used, and only
requires a move from atomic increment to CAS for usage of weak pointers.

The commit also removes the `unsafe` and deprecated status of these functions.

Closes #24880

r? @alexcrichton 

cc @metajack @SimonSapin @Ms2ger
2015-07-03 01:00:31 +00:00
bors
f234a6beaa Auto merge of #26733 - nhowell:update-jquery, r=steveklabnik
r? @steveklabnik
2015-07-02 23:28:20 +00:00
bors
d1e31f396c Auto merge of #26725 - tshepang:patch-2, r=bluss 2015-07-02 21:56:28 +00:00
Aaron Turon
d77c4b0fa6 Fix race condition in Arc's get_mut and make_unqiue
This commit resolves the race condition in the `get_mut` and
`make_unique` functions, which arose through interaction with weak
pointers. The basic strategy is to "lock" the weak pointer count when
trying to establish uniqueness, by reusing the field as a simple
spinlock. The overhead for normal use of `Arc` is expected to be minimal
-- it will be *none* when only strong pointers are used, and only
requires a move from atomic increment to CAS for usage of weak pointers.

The commit also removes the `unsafe` and deprecated status of these
functions.

Along the way, the commit also improves several memory orderings, and
adds commentary about why various orderings suffice.
2015-07-02 13:58:38 -07:00
bors
b4abed6476 Auto merge of #26738 - dotdash:trans_args, r=luqmana
The current split between create_datums_for_fn_args, copy_args_to_allocas and
store_arg involves a detour via rvalue datums which cause additional work in
form of insertvalue/extractvalue pairs for fat pointer arguments, and an extra
alloca and memcpy for tupled args in rust-call functions.

By merging those three functions into just one that actually covers the whole
process of creating the final argument datums, we can skip all that.  Also,
this allows to easily merge in the handling of rust-call functions, allowing to
make create_datum_for_fn_args_under_call_abi obsolete.

cc #26600 -- The insertvalue instructions kicked us off of fast-isel.
2015-07-02 20:23:45 +00:00
bors
fb379ef05c Auto merge of #26682 - posix4e:netbsd, r=alexcrichton
This is dependent on https://github.com/rust-lang/rust-installer/pull/38. Once it is merged we most likely need to update the commit.
2015-07-02 18:50:46 +00:00
Steve Klabnik
57eed53041 Add more description for from_raw_parts's unsafety
Fixes #26737.
2015-07-02 14:05:57 -04:00
Björn Steinbrink
a04784f7f9 Directly construct lvalue datums for function arguments
The current split between create_datums_for_fn_args,
copy_args_to_allocas and store_arg involves a detour via rvalue datums
which cause additional work in form of insertvalue/extractvalue pairs
for fat pointer arguments, and an extra alloca and memcpy for tupled
args in rust-call functions.

By merging those three functions into just one that actually covers the
whole process of creating the final argument datums, we can skip all
that. Also, this allows to easily merge in the handling of rust-call
functions, allowing to make create_datum_for_fn_args_under_call_abi
obsolete.

cc #26600 -- The insertvalue instructions kicked us off of fast-isel.
2015-07-02 18:34:58 +02:00