Commit Graph

35587 Commits

Author SHA1 Message Date
Niko Matsakis
2c76ced954 Correct merge failure around imports in str.rs. 2014-12-22 12:27:08 -05:00
Niko Matsakis
2e2906522d Address nit. 2014-12-22 12:27:08 -05:00
Niko Matsakis
69a1d0e610 Change print out to include the path to the fn, a bit ad-hoc for now . 2014-12-22 12:27:08 -05:00
Niko Matsakis
41ef2d85a1 Various simple tests for fn item type vs fn pointer type and for coercions between them. 2014-12-22 12:27:08 -05:00
Niko Matsakis
8fe9e4dff6 Insert coercions to fn pointer types required for the new types
post-unboxed-closure-conversion. This requires a fair amount of
annoying coercions because all the `map` etc types are defined
generically over the `F`, so the automatic coercions don't propagate;
this is compounded by the need to use `let` and not `as` due to
stage0. That said, this pattern is to a large extent temporary and
unusual.
2014-12-22 12:27:07 -05:00
Niko Matsakis
7f6177e646 Fix fallout from changes. In cases where stage0 compiler is needed, we
cannot use an `as` expression to coerce, so I used a one-off function
instead (this is a no-op in stage0, but in stage1+ it triggers
coercion from the fn pointer to the fn item type).
2014-12-22 12:27:07 -05:00
Niko Matsakis
211782fef5 Perform coercions on LHS assignments. 2014-12-22 12:27:07 -05:00
Niko Matsakis
39be95c16b Insert FIXME links to issue #19925: fn item types should be zero-sized. 2014-12-22 12:27:07 -05:00
Niko Matsakis
fad1423d1e Adjust metadata for new fields and enum variants. Yawn. 2014-12-22 12:27:07 -05:00
Niko Matsakis
2a43b352f7 Rote changes that don't care to distinguish between a fn pointer and a fn item. 2014-12-22 12:27:07 -05:00
Niko Matsakis
f46099575a Make ty_bare_fn carry an optional def-id indicating whether it is the
type of a fn item or a fn pointer, which are now differentiated.
Introduce coercion from fn item to fn pointer.
2014-12-22 12:27:07 -05:00
Niko Matsakis
8c8cb997a5 Introduce a tcx() helper method to cleanup this mess. 2014-12-22 10:07:06 -05:00
bors
34d6800092 auto merge of #20104 : alexcrichton/rust/rollup, r=alexcrichton 2014-12-22 00:12:47 +00:00
Alex Crichton
fb7c08876e Test fixes and rebase conflicts 2014-12-21 13:49:04 -08:00
Alex Crichton
dbeef0edb2 rollup merge of #19972: alexcrichton/snapshots
Conflicts:
	src/libcollections/string.rs
	src/libcollections/vec.rs
	src/snapshots.txt
2014-12-21 09:28:07 -08:00
Alex Crichton
b084cda4e9 rollup merge of #20100: alexcrichton/issue-20091
Instead, just pass everything through as a Vec<u8> to get worried about later.

Closes #20091
2014-12-21 09:27:38 -08:00
Alex Crichton
08ac8d7972 rollup merge of #20090: FlaPer87/snapshot
r? @nikomatsakis
2014-12-21 09:27:38 -08:00
Alex Crichton
a666105b4c std: Don't parse argv as a String
Instead, just pass everything through as a Vec<u8> to get worried about later.

Closes #20091
2014-12-21 09:27:38 -08:00
Alex Crichton
2135712a82 rollup merge of #20086: shepmaster/random-typo 2014-12-21 09:27:37 -08:00
Flavio Percoco
1c80446d1b Create a snapshot for 8443b09 2014-12-21 09:27:37 -08:00
Alex Crichton
97f605e858 rollup merge of #20081: tomjakubowski/issue-19646
Encode foreign item attributes and stability levels and visit foreign
items in the stability visitor.

cc @Gankro
2014-12-21 09:27:37 -08:00
Alex Crichton
40e1f7c6ba rollup merge of #20080: seanmonstar/new-show-syntax
First step of #20013. This will allow (after a snapshot) to change all the debug strings from `{}` to `{:?}`.

r? @alexcrichton
2014-12-21 09:27:37 -08:00
Alex Crichton
3e5257f68f rollup merge of #20079: SimonSapin/string_push_ascii_fast_path
`String::push(&mut self, ch: char)` currently has a single code path that calls `Char::encode_utf8`. This adds a fast path for ASCII `char`s, which are represented as a single byte in UTF-8.

Benchmarks of stage1 libcollections at the intermediate commit show that the fast path very significantly improves the performance of repeatedly pushing an ASCII `char`, but does not significantly affect the performance for a non-ASCII `char` (where the fast path is not taken).

```
bench_push_char_one_byte                  59552 ns/iter (+/- 2132) = 167 MB/s
bench_push_char_one_byte_with_fast_path    6563 ns/iter (+/- 658) = 1523 MB/s
bench_push_char_two_bytes                 71520 ns/iter (+/- 3541) = 279 MB/s
bench_push_char_two_bytes_with_slow_path  71452 ns/iter (+/- 4202) = 279 MB/s
bench_push_str_one_byte                   38910 ns/iter (+/- 2477) = 257 MB/s
```

A benchmark of pushing a one-byte-long `&str` is added for comparison, but its performance [has varied a lot lately](https://github.com/rust-lang/rust/pull/19640#issuecomment-67741561). (When the input is fixed, `s.push_str("x")` could be used just as well as `s.push('x')`.)
2014-12-21 09:27:37 -08:00
Alex Crichton
0191dce41d rollup merge of #20077: shepmaster/stdin-typo 2014-12-21 09:27:36 -08:00
Alex Crichton
1dc5e6312f rollup merge of #20070: aturon/stab-2-clone
This patch marks `clone` stable, as well as the `Clone` trait, but
leaves `clone_from` unstable. The latter will be decided by the beta.

The patch also marks most manual implementations of `Clone` as stable,
except where the APIs are otherwise deprecated or where there is
uncertainty about providing `Clone`.

r? @alexcrichton
2014-12-21 09:27:36 -08:00
Alex Crichton
6495c27ee6 rollup merge of #20069: jarod/bitflags
Although using hex literals is not wrong, but I think use binary literals will be better.(especially in examples)
2014-12-21 09:27:36 -08:00
Alex Crichton
b187ae55aa rollup merge of #20066: aturon/stab-2-cell
This patch finalizes stabilization for the `cell` module, settling on
the current names `Cell`, `RefCell`, `UnsafeCell`, `Ref` and `RefMut`.

While we had considered improving these names, no one was able to
produce a truly compelling alternative.

There is one substantive change here: the `get` method of `UnsafeSell`
is now marked `unsafe`. Merely getting a raw pointer to the contents is
not, by itself, an unsafe operation. (Consider that you can always
safely turn a reference into a raw pointer, and that raw pointer may
then be aliased by subsequent references.)

r? @alexcrichton
2014-12-21 09:27:36 -08:00
Alex Crichton
f6a7388210 rollup merge of #20062: aturon/stab-2-ints
This small patch stabilizes the names of all integer modules (including
`int` and `uint`) and the `MIN` and `MAX` constants. The `BITS` and
`BYTES` constants are left unstable for now.

r? @alexcrichton
2014-12-21 09:27:35 -08:00
Alex Crichton
e1d09766ad rollup merge of #20059: nick29581/self-impl
r? @sfackler

closes #20000
2014-12-21 09:27:35 -08:00
Alex Crichton
bc1d818b83 rollup merge of #20057: nick29581/array-syntax
This does NOT break any existing programs because the `[_, ..n]` syntax is also supported.

Part of #19999

r? @nikomatsakis
2014-12-21 09:27:35 -08:00
Alex Crichton
7e62684bb4 rollup merge of #20054: bheesham/nomet
#19145
2014-12-21 09:27:35 -08:00
Alex Crichton
40d59e9467 rollup merge of #20052: barosl/deref-for-box
As the previous pull request (#19023) was closed due to inactivity, I steal the chance and open this pull request. 😊

Fixes #18624.
2014-12-21 09:27:35 -08:00
Alex Crichton
fb6ff04994 rollup merge of #20044: csouth3/vec-resize
This PR adds `resize()` to `Vec` in accordance with RFC 509.
2014-12-21 09:27:34 -08:00
Alex Crichton
eb47e1e446 rollup merge of #20039: barosl/if-let-friendly-error
Fixes #19991.
2014-12-21 09:27:34 -08:00
Alex Crichton
cfc815bef4 rollup merge of #20029: vhbit/ios-no-rt 2014-12-21 09:27:34 -08:00
Alex Crichton
a3dfaa62fe rollup merge of #20027: michaelwoerister/for-loop-var
Back when for-loop iteration variables were just de-sugared into `let` bindings, debuginfo for them was created like for any other `let` binding. When the implementation approach for for-loops changed, we ceased having debuginfo for the iteration variable. This PR fixes this omission and adds a more prominent test case for it.

Also contains some minor, general cleanup of the debuginfo module.

Fixes #19732
2014-12-21 09:27:34 -08:00
Alex Crichton
de7abcf6d3 rollup merge of #20014: kballard/unsized-marker-type-params
Tweak CovariantType, ContravariantType, and InvariantType to allow their
type parameter to be unsized.
2014-12-21 09:27:34 -08:00
Alex Crichton
fc40812b0f rollup merge of #20006: alexcrichton/no-more-empty-modules
This commit modifies rustdoc to not require these empty modules to be public in
the standard library. The modules still remain as a location to attach
documentation to, but the modules themselves are now private (don't have to
commit to an API). The documentation for the standard library now shows all of
the primitive types on the main index page.
2014-12-21 09:27:33 -08:00
Alex Crichton
4ae3107e72 rollup merge of #19996: th0114nd/boolean-inden
The current indentation level would indicate that Boolean literals are on the same level as Integer and Float literals under Number literals, unindenting moves it to the same scope as Character and string literals, Byte and byte string literals, and Number literals under Literals.
2014-12-21 09:27:33 -08:00
Alex Crichton
7e2ed4adc1 rollup merge of #19994: bluss/doc-ownership
Disambiguate maximally by using 'and' instead of '&' next to discussion
about references.

As a bonus, fix the spelling of the car too.
2014-12-21 09:27:33 -08:00
Alex Crichton
91b3232764 rollup merge of #19993: bluss/setalgebraitems
This removes the type SetAlgebraItems and replaces it with the
structs Intersection and Difference.

Rename the existing HashSet iterators according to RFC #344:

* SetItems -> Iter
* SetMoveItems -> IntoIter
* Remaining set combination iterators renamed to Union and SymmetricDifference
2014-12-21 09:27:31 -08:00
Alex Crichton
67ea1dc4bf rollup merge of #19989: th0114nd/quotes-around-as 2014-12-21 09:26:45 -08:00
Alex Crichton
576467b492 rollup merge of #19983: Munksgaard/fix-19981
The use of `+a+x` is deprecated.

Fixes #19981.
2014-12-21 09:26:44 -08:00
Alex Crichton
583112269a rollup merge of #19980: erickt/cleanup-serialize
This brings over some changes from [rustc-serialize](https://github.com/rust-lang/rustc-serialize). It makes sense to keep the two in sync until we finally remove libserialize, just to make sure they don't diverge from each other.
2014-12-21 09:26:44 -08:00
Alex Crichton
ca521fb7a9 rollup merge of #19979: Munksgaard/19978
This fixes #19978. The bug was introduced by 570325d, where if the type
of an Fn has not been inferred (strs[0] is "_") we slice from 1 to 0.
2014-12-21 09:26:44 -08:00
Alex Crichton
1d34d93d11 rollup merge of #19977: pnkfelix/add-test-for-issue-19811
Add regression test for Issue 19811.

(Thanks for @emk for providing this.)

Fix #19811.
2014-12-21 09:26:44 -08:00
Alex Crichton
319ed81307 rollup merge of #19974: vhbit/json-unicode-literals 2014-12-21 09:26:44 -08:00
Alex Crichton
31800b38e6 rollup merge of #19973: vhbit/ios-no-copy 2014-12-21 09:26:43 -08:00
Alex Crichton
ee1bb3f25b rollup merge of #19969: aturon/inherit-trait-stab
There is currently no way to specify the stability level for a trait
impl produced by `deriving`. This patch is a stopgap solution that:

* Turns of stability inheritance for trait impls, and
* Uses the stability level of the *trait* if no level is directly
  specified.

That is, manual trait impls may still provide a directly stability
level, but `deriving` will use the level of the trait. While not a
perfect solution, it should be good enough for 1.0 API stabilization, as
we will like *remove* any unwanted impls outright.

r? @alexcrichton
2014-12-21 09:26:43 -08:00
Alex Crichton
b4f393ee8a rollup merge of #19967: apasel422/binary_heap
Just a few simplifications and a missing `assert!`.
2014-12-21 09:26:43 -08:00