Commit Graph

34431 Commits

Author SHA1 Message Date
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
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
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
bors
22513fed35 auto merge of #19158 : jakub-/rust/issue-14091, r=alexcrichton
Closes #14091.
Closes #19195.
2014-11-23 11:51:50 +00: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
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
bors
2274996a1d auto merge of #19137 : tbu-/rust/pr_refcell_unsafety, r=huonw 2014-11-23 00:36:43 +00: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
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
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
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
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
bors
2af82f7530 auto merge of #19117 : jmesmon/rust/mk-cfg-suffix, r=cmr
Right now we'll end up globbing them into the accepted targets and (ever worse) they will override the make variables of real target files because we `include`d everything in that directory.

As a side effect, editors get a better hint on file types.
2014-11-22 01:46:46 +00:00
bors
81eeec0941 auto merge of #18603 : brson/rust/stdchar, r=aturon
* Deprecate the free functions in favor of methods, except the two ctors `from_u32` and `from_digit`, whose methods are deprecated.
* Mark the `Char` and `UnicodeChar` traits experimental until we decide for sure that we won't have some sort of inherent methods for primitives.
* The `UnicodeChar` methods related to numerics are now called e.g. `is_numeric` to match the 'numeric' unicode character class, and the `*_digit_radix` methods on `Char` now just called `*_digit`.
* `len_utf8_bytes` -> `len_utf8`
* Converted methods to take self by-value
* Converted `escape_default` and `escape_unicode` to iterators over chars.
* Renamed `is_XID_start`, `is_XID_continue` to `is_xid_start`, `is_xid_continue` to match conventions

This also converts `encode_utf8` and `encode_utf16` to return iterators. I suspect this is not the final form of these methods. Perf is worse (numbers in the commit). Many of the uses ended up being awkward, copying into a buffer then writing that buffer to a `Writer`. It might be more appropriate for these to return `Reader`s instead, but that type is defined in `std`.

Note: although I *did* add the `from_u32` ctor to the `Char` trait, I deprecated it again later, preferring the free ctors.

I've been sitting on this for a while.

cc @aturon
2014-11-21 23:16:48 +00:00
Alexander Light
69861df831 Shuffle locations for Deref
Remove both `strong_count` and `weak_count` from `Weak`s and make the
methods bare functions so as not to cause trouble with `deref`.
2014-11-21 17:56:33 -05:00
Alex Crichton
1684419897 Register new snapshots 2014-11-21 14:15:33 -08:00
Aaron Turon
6733d8b483 Fallout from deprecation 2014-11-21 14:10:13 -08:00
Aaron Turon
7ce2d9c3fa libs: stabilize ascii module
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-21 14:10:13 -08:00
Brian Anderson
75ffadf8b6 core: Convert a 'failure' to 'panic' in docs 2014-11-21 13:18:08 -08:00
Brian Anderson
879af89baf core: Update docs for escape_unicode, escape_default 2014-11-21 13:18:08 -08:00
Brian Anderson
73622f8fdf unicode: Remove unused non_snake_case allows. 2014-11-21 13:18:08 -08:00
Brian Anderson
f39c29d0bc unicode: Rename is_XID_start to is_xid_start, is_XID_continue to is_xid_continue 2014-11-21 13:18:08 -08:00
Brian Anderson
76ddd2b154 unicode: Add stability attributes to u_char
Free functions deprecated. UnicodeChar experimental pending
final decisions about prelude.
2014-11-21 13:18:08 -08:00
Brian Anderson
d6ee804b63 unicode: Convert UnicodeChar methods to by-value
Extension traits for primitive types should be by-value.

[breaking-change]
2014-11-21 13:18:08 -08:00
Brian Anderson
aad2461604 core: Convert Char::escape_default, escape_unicode to iterators
[breaking-change]
2014-11-21 13:18:08 -08:00
Brian Anderson
ca1820b1fc core: Convert Char methods to by-val self
Methods on primitmive Copy types generally should take `self`.

[breaking-change]
2014-11-21 13:18:08 -08:00
Brian Anderson
5928f6c8b6 Fix various deprecation warnings from char changes 2014-11-21 13:18:04 -08:00
Brian Anderson
b577e4c8d8 core: Mark remaining Char methods unstable
The `Char` trait itself may go away in favor of primitive inherent
methods. Still some questions about whether the preconditions are
following the final error handling conventions.
2014-11-21 13:17:09 -08:00
Brian Anderson
95c3f618c0 core: Deprecated remaining free functions in char
Prefer the methods.
2014-11-21 13:17:09 -08:00
Brian Anderson
4dd1724576 core: Add stability attributes to char::from_digit and from_u32
For now we are preferring free functions for primitive ctors,
so they are marked 'unstable' pending final decision. The
methods on `Char` are 'deprecated'.
2014-11-21 13:17:09 -08:00
Brian Anderson
f6607a20c4 core: Add Char::len_utf16
Missing method to pair with len_utf8.
2014-11-21 13:17:09 -08:00
Brian Anderson
0150fa4b1b core: Rename Char::len_utf8_bytes to Char::len_utf8
"bytes" is redundant.

Deprecate the old.
2014-11-21 13:17:09 -08:00
Brian Anderson
acb5fefd6d core: Rename Char::is_digit_radix to is_digit
This fits the naming of `to_digit` and `from_digit`. Leave
the old name deprecated.
2014-11-21 13:17:09 -08:00
Brian Anderson
c2aff692fa unicode: Rename UnicodeChar::is_digit to is_numeric
'Numeric' is the proper name of the unicode character class,
and this frees up the word 'digit' for ascii use in libcore.

Since I'm going to rename `Char::is_digit_radix` to
`is_digit`, I am not leaving a deprecated method in place,
because that would just cause name clashes, as both
`Char` and `UnicodeChar` are in the prelude.

[breaking-change]
2014-11-21 13:17:04 -08:00