Commit graph

34658 commits

Author SHA1 Message Date
Jakub Bukaj
5ad1512850 rollup merge of #19210: petrochenkov/master
Now `std:#️⃣:hash("abcd")` works.
2014-11-23 14:11:55 -05:00
Jakub Bukaj
072015ee3d rollup merge of #19205: jashank/docs-fix
Catch a missed triple-slash in the docs for `std::os::args()`. Passes `make check`. (I've also eyeballed the rest of `libstd` with the aid of some funky regexes and haven't found anything similar.)
2014-11-23 14:11:54 -05:00
Jakub Bukaj
9d721180f2 rollup merge of #19204: mcpherrinm/master
The old name was sensible when this module was PriorityQueue but isn't
anymore.
2014-11-23 14:11:53 -05:00
Jakub Bukaj
7b2122b966 rollup merge of #19198: alexcrichton/snapshots
Primarily including the libnative removal
2014-11-23 14:11:52 -05:00
Jakub Bukaj
b21b48062f rollup merge of #19194: aturon/stab-ascii
This is an initial API stabilization pass for `std::ascii`. Aside from
some renaming to match conversion conventions, and deprecations in favor
of using iterators directly, almost nothing is changed here. However,
the static case conversion tables that were previously public are now private.

The stabilization of the (rather large!) set of extension traits is left
to a follow-up pass, because we hope to land some more general machinery
that will provide the same functionality without custom traits.

[breaking-change]
2014-11-23 14:11:51 -05:00
Jakub Bukaj
77d1f0b83b rollup merge of #19193: scialex/rc-counts
These functions allow you to see how many weak and strong references
there are to an `Arc`, `Rc`, or an `rc::Weak`. Due to the design of
`Arc` it is not possible to get the number of weak references of an
arbitrary `arc::Weak`. Look in `arc.rs` for a more in-depth explanation.

On `arc::Arc` and `arc::Weak` these operations are wait-free and atomic.

This sort of information is useful for creating dynamically cleared caches for use in OS development, for example holding pages of files in memory until the address space is needed for something else.
2014-11-23 14:11:50 -05:00
Jakub Bukaj
1e5de8cf3c rollup merge of #19184: Gekkio/fix-binary-format-char
This small piece of documentation was missed in the format character change
in 4af3494bb0.
2014-11-23 14:11:49 -05:00
Jakub Bukaj
ab8d811ebd rollup merge of #19166: richo/lldb-cleanups
While poking at rust in lldb I found a few nits to clean up.
2014-11-23 14:11:48 -05:00
Jakub Bukaj
f90471e4e3 rollup merge of #19161: jmesmon/mk-fixes
This is a collection of misc issues I've run into while adding bindir & libdir support that aren't really bindir & libdir specific.

While I continue to fiddle with bindir and libdir bugs, I figured these might be useful for others to have merged.
2014-11-23 14:11:47 -05:00
Keegan McAllister
26c93433da Require <T: Send> for AtomicOption
Fixes #19247.
2014-11-23 10:47:08 -08:00
Jorge Aparicio
02720a4a16 DSTify Str + impl Str for &S where S: Str 2014-11-23 13:21:24 -05:00
Corey Farwell
02355b8726 Clean up some logic/formatting in JSON module 2014-11-23 12:08:11 -05:00
bors
220b99b148 auto merge of #19150 : Manishearth/rust/find-doc, r=Gankro
It's useful to know this (opens up a bunch of other opportunities especially whilst parsing)
2014-11-23 15:46:56 +00:00
Jauhien Piatlicki
6ffb7f0132 fix for PR#16552 implementation on windows: CFG_LIBDIR should be always set in configure variables 2014-11-23 15:36:42 +01:00
bors
e197a2b0ac auto merge of #18140 : JelteF/rust-1/guide-fix, r=cmr
The reason given didn't make any sense when I read it when reading through the docs. I think this is more clear. Please let me know it is also more correct.
2014-11-23 13:51:47 +00:00
Jelte Fennema
17f9de387a Fix the reason for calling a file lib.rs 2014-11-23 14:43:22 +01:00
Ricky Taylor
729bf447ab Search for implemented kinds recursively on Trait types. Fixes #15155 and #13155. 2014-11-23 12:24:34 +00:00
NODA, Kai
ef3b88c5f9 libcollection: generalize StrVector to AsSlice<Str>.
The impl for [T] also works as impl for slices in general.
By generalizing the impl of StrVector for Vec<Str> to that for
AsSlice<Str>, it becomes much more generic.

Once Iterable is implemented, we will prefer it to AsSlice.
But the with_capacity() part might become tricky.

Signed-off-by: NODA, Kai <nodakai@gmail.com>
2014-11-23 20:05:58 +08:00
Adolfo Ochagavía
40e1f8f8f1 Add test 2014-11-23 12:59:25 +01:00
bors
22513fed35 auto merge of #19158 : jakub-/rust/issue-14091, r=alexcrichton
Closes #14091.
Closes #19195.
2014-11-23 11:51:50 +00:00
Adolfo Ochagavía
35316972ff Remove type parameters from ExprField and ExprTupField 2014-11-23 12:17:43 +01:00
Adolfo Ochagavía
9a857b4472 libsyntax: Forbid type parameters in tuple indices
This breaks code like

```
let t = (42i, 42i);
... t.0::<int> ...;
```

Change this code to not contain an unused type parameter. For example:

```
let t = (42i, 42i);
... t.0 ...;
```

Closes https://github.com/rust-lang/rust/issues/19096

[breaking-change]
2014-11-23 12:17:30 +01:00
bors
5ff10d5a23 auto merge of #19157 : aturon/rust/cow-doc, r=alexcrichton
This commit makes `Cow` more usable by allowing it to be applied to
unsized types (as was intended) and providing some basic `ToOwned`
implementations on slice types. It also corrects the documentation for
`Cow` to no longer mention `DerefMut`, and adds an example.

Closes #19123
2014-11-23 09:51:49 +00:00
bors
f5212e3cd7 auto merge of #18856 : ruud-v-a/rust/fatptrs, r=cmr
This merges the `trt_field_*`, `fn_field_*` and `slice_elt_*` constants into two `fat_ptr_*` constants. This resolves the first part of #18590.
2014-11-23 07:51:51 +00:00
bors
641e2a110d auto merge of #19152 : alexcrichton/rust/issue-17863, r=aturon
This commit is an implementation of [RFC 240][rfc] when applied to the standard
library. It primarily deprecates the entirety of `string::raw`, `vec::raw`,
`slice::raw`, and `str::raw` in favor of associated functions, methods, and
other free functions. The detailed renaming is:

* slice::raw::buf_as_slice => slice::from_raw_buf
* slice::raw::mut_buf_as_slice => slice::from_raw_mut_buf
* slice::shift_ptr => deprecated with no replacement
* slice::pop_ptr => deprecated with no replacement
* str::raw::from_utf8 => str::from_utf8_unchecked
* str::raw::c_str_to_static_slice => str::from_c_str
* str::raw::slice_bytes => deprecated for slice_unchecked (slight semantic diff)
* str::raw::slice_unchecked => str.slice_unchecked
* string::raw::from_parts => String::from_raw_parts
* string::raw::from_buf_len => String::from_raw_buf_len
* string::raw::from_buf => String::from_raw_buf
* string::raw::from_utf8 => String::from_utf8_unchecked
* vec::raw::from_buf => Vec::from_raw_buf

All previous functions exist in their `#[deprecated]` form, and the deprecation
messages indicate how to migrate to the newer variants.

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0240-unsafe-api-location.md
[breaking-change]

Closes #17863
2014-11-23 05:46:52 +00:00
P1start
55af4aff56 Change how rustdoc shows constants and statics to be more similar to other items
Fixes #19046.
2014-11-23 17:18:35 +13:00
P1start
6b5655cb84 Make rustdoc display extern crate statements correctly 2014-11-23 17:18:35 +13:00
P1start
2f0249b3a8 Highlight trait methods in rustdoc’s search results 2014-11-23 17:18:27 +13:00
Nicholas Bishop
b637a867a5 Fix typo in Result documentation 2014-11-22 22:13:00 -05:00
bors
529f8bcd8b auto merge of #19146 : gereeter/rust/reference-borrow, r=aturon
This should be a more general version of #19131.
2014-11-23 02:36:46 +00:00
Nick Cameron
34c76646b5 save-analysis: add values for types 2014-11-23 15:02:58 +13:00
Nick Cameron
e83785c51f save-analysis: emit a type for enum variants 2014-11-23 15:02:58 +13:00
bors
2274996a1d auto merge of #19137 : tbu-/rust/pr_refcell_unsafety, r=huonw 2014-11-23 00:36:43 +00:00
Jonathan Reem
1b17eefa4a Any: use plain transmute instead of transmute_copy for downcasting.
transmute_copy is no longer needed and is just slow.
2014-11-22 16:06:21 -08:00
Jonathan Reem
4705475be2 Mark Any::get_type_id as experimental
It is likely going to be removed and replaced
with an associated static.

Fixes #19222
2014-11-22 15:31:51 -08:00
bors
ccc4a7cebc auto merge of #19136 : alfie/rust/master, r=steveklabnik
An example of how type definitions work would be handy
2014-11-22 22:36:40 +00:00
Adolfo Ochagavía
d678684236 Add test 2014-11-22 21:47:49 +01:00
bors
0d0a290614 auto merge of #19134 : sinistersnare/rust/patch-2, r=alexcrichton
Vec<T> can index now so its a useless conversion.
2014-11-22 20:36:40 +00:00
Alex Crichton
8ca27a633e std: Align raw modules with unsafe conventions
This commit is an implementation of [RFC 240][rfc] when applied to the standard
library. It primarily deprecates the entirety of `string::raw`, `vec::raw`,
`slice::raw`, and `str::raw` in favor of associated functions, methods, and
other free functions. The detailed renaming is:

* slice::raw::buf_as_slice => slice::with_raw_buf
* slice::raw::mut_buf_as_slice => slice::with_raw_mut_buf
* slice::shift_ptr => deprecated with no replacement
* slice::pop_ptr => deprecated with no replacement
* str::raw::from_utf8 => str::from_utf8_unchecked
* str::raw::c_str_to_static_slice => str::from_c_str
* str::raw::slice_bytes => deprecated for slice_unchecked (slight semantic diff)
* str::raw::slice_unchecked => str.slice_unchecked
* string::raw::from_parts => String::from_raw_parts
* string::raw::from_buf_len => String::from_raw_buf_len
* string::raw::from_buf => String::from_raw_buf
* string::raw::from_utf8 => String::from_utf8_unchecked
* vec::raw::from_buf => Vec::from_raw_buf

All previous functions exist in their `#[deprecated]` form, and the deprecation
messages indicate how to migrate to the newer variants.

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0240-unsafe-api-location.md
[breaking-change]

Closes #17863
2014-11-22 09:36:56 -08:00
Adolfo Ochagavía
9f15ccb448 Fix pretty printing unsafe match arms 2014-11-22 17:30:45 +01:00
bors
caec7b0414 auto merge of #19133 : nodakai/rust/run-make-tests-missing-extracflags, r=alexcrichton
Missing `$(EXTRACFLAGS)` resutled in compile failures.
2014-11-22 14:46:38 +00:00
we
97d435497c DSTify free functions in std::hash 2014-11-22 17:03:40 +03:00
bors
4389ee3893 auto merge of #19132 : sinistersnare/rust/patch-1, r=alexcrichton
Just used Githubs edit view, so I hope this works...
2014-11-22 12:46:37 +00:00
bors
acfdb14044 auto merge of #19125 : chris-morgan/rust/vim-prelude-2014-11-20, r=alexcrichton 2014-11-22 10:46:40 +00:00
Vadim Petrochenkov
46bdb455c3 Merge pull request #1 from rust-lang/master
Update from original
2014-11-22 13:42:36 +03:00
bors
7765993d62 auto merge of #19124 : Kintaro/rust/remove_test_struct_variants, r=bstrie
Removed usage of struct_variant feature from all tests.
2014-11-22 08:46:44 +00:00
Matt McPherrin
0beaccb9bb Rename variables called pq to heap
The old name was sensible when this module was PriorityQueue but isn't
anymore.
2014-11-21 23:01:38 -08:00
bors
829680840c auto merge of #17513 : dradtke/rust/master, r=kballard
Looks like I made my previous PR a little too hastily. =)

This PR fixes a couple issues that I discovered with my previous revision:

1. Updated the errorformat to ignore "pointer lines" so that they don't show up in the output (with quickfix jumping, they're redundant and unnecessary).
2. Renamed a couple variables to be more in line with Cargo's terminology (`g:cargo_toml_name` should now be `g:cargo_manifest_name`).
3. Added support for errors reported with absolute paths (looks to be the case when compiling an executable instead of a library).
4. Most importantly, added support for errors reported while compiling a dependency. When building a Cargo package with local dependencies, if one of those dependencies failed to compile, the quickfix would be completely broken as it assumed that all errors were relative to the local manifest, or the closest Cargo.toml. With this update, it now pays attention to lines that end with `(file://<path>)`, and from then on adjusts all errors to be relative to `<path>`.

As a side note, that `<path>` output is somewhat broken on Windows. While `file:///home/damien/...` on *Nix is a valid URI, `file:///C:/Users/damien/...` on Windows is not, because `C:/` (or whatever the drive is) should take the place of the third slash which is *Nix's root, not be appended to it. I added a workaround for this in my script, but I figured I'd mention it to see if this is a bug in how Rust formats paths.
2014-11-22 06:31:43 +00:00
bors
2a4c0100fe auto merge of #19122 : Kintaro/rust/remove_struct_variant, r=jakub-
The struct_variant is not gated anymore. This commit just removes it and the resulting warnings when compiling rust. Now compiles with the snapshot from 11/18 (as opposed to PR #19014)
2014-11-22 04:06:45 +00:00
Jashank Jeremy
ab854481ba args() doc: Fix a documentation line. 2014-11-22 13:34:38 +11:00