]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agostd: Add a new top-level thread_local module
Alex Crichton [Fri, 14 Nov 2014 22:20:57 +0000 (14:20 -0800)]
std: Add a new top-level thread_local module

This commit removes the `std::local_data` module in favor of a new
`std::thread_local` module providing thread local storage. The module provides
two variants of TLS: one which owns its contents and one which is based on
scoped references. Each implementation has pros and cons listed in the
documentation.

Both flavors have accessors through a function called `with` which yield a
reference to a closure provided. Both flavors also panic if a reference cannot
be yielded and provide a function to test whether an access would panic or not.
This is an implementation of [RFC 461][rfc] and full details can be found in
that RFC.

This is a breaking change due to the removal of the `std::local_data` module.
All users can migrate to the new thread local system like so:

    thread_local!(static FOO: Rc<RefCell<Option<T>>> = Rc::new(RefCell::new(None)))

The old `local_data` module inherently contained the `Rc<RefCell<Option<T>>>` as
an implementation detail which must now be explicitly stated by users.

[rfc]: https://github.com/rust-lang/rfcs/pull/461
[breaking-change]

9 years agoauto merge of #19242 : jakub-/rust/roll-up, r=jakub-
bors [Sun, 23 Nov 2014 20:26:58 +0000 (20:26 +0000)]
auto merge of #19242 : jakub-/rust/roll-up, r=jakub-

9 years agoFixes to the roll-up
Jakub Bukaj [Sun, 23 Nov 2014 15:47:25 +0000 (10:47 -0500)]
Fixes to the roll-up

9 years agorollup merge of #19239: jauhien/fix-libdir
Jakub Bukaj [Sun, 23 Nov 2014 19:12:03 +0000 (14:12 -0500)]
rollup merge of #19239: jauhien/fix-libdir

A fix for a windows problem pointed by @retep998 in the PR #16552.

9 years agorollup merge of #19234: P1start/rustdoc-misc
Jakub Bukaj [Sun, 23 Nov 2014 19:12:01 +0000 (14:12 -0500)]
rollup merge of #19234: P1start/rustdoc-misc

This PR:

- makes rustdoc colour trait methods like other functions in search results;
- makes rustdoc display `extern crate` statements with the new `as` syntax instead of the old `=` syntax;
- changes rustdoc to list constants and statics in a way that is more similar to functions and modules and show their full definition and documentation on their own page, fixing #19046:

  ![Constant listing](https://i.imgur.com/L4ZTOCN.png)

  ![Constant page](https://i.imgur.com/RcjZfCv.png)

9 years agorollup merge of #19232: nicholasbishop/bishop_fix_result_typo
Jakub Bukaj [Sun, 23 Nov 2014 19:12:00 +0000 (14:12 -0500)]
rollup merge of #19232: nicholasbishop/bishop_fix_result_typo

9 years agorollup merge of #19230: nick29581/dxr-values
Jakub Bukaj [Sun, 23 Nov 2014 19:11:59 +0000 (14:11 -0500)]
rollup merge of #19230: nick29581/dxr-values

r?

9 years agorollup merge of #19225: reem/any-unnecessary-transmute-copy
Jakub Bukaj [Sun, 23 Nov 2014 19:11:58 +0000 (14:11 -0500)]
rollup merge of #19225: reem/any-unnecessary-transmute-copy

transmute_copy is no longer needed and is just slow.

9 years agorollup merge of #19215: aochagavia/pretty
Jakub Bukaj [Sun, 23 Nov 2014 19:11:57 +0000 (14:11 -0500)]
rollup merge of #19215: aochagavia/pretty

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

I would appreciate any guidance on how to write a test for this. I saw some examples in `test/pretty`, but there are different ways to test... With or without `.pp` files, with a `pp-exact` comment, etc.

9 years agorollup merge of #19211: aochagavia/tuple-index
Jakub Bukaj [Sun, 23 Nov 2014 19:11:56 +0000 (14:11 -0500)]
rollup merge of #19211: aochagavia/tuple-index

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]

r? @aturon

9 years agorollup merge of #19210: petrochenkov/master
Jakub Bukaj [Sun, 23 Nov 2014 19:11:55 +0000 (14:11 -0500)]
rollup merge of #19210: petrochenkov/master

Now `std::hash::hash("abcd")` works.

9 years agorollup merge of #19205: jashank/docs-fix
Jakub Bukaj [Sun, 23 Nov 2014 19:11:54 +0000 (14:11 -0500)]
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.)

9 years agorollup merge of #19204: mcpherrinm/master
Jakub Bukaj [Sun, 23 Nov 2014 19:11:53 +0000 (14:11 -0500)]
rollup merge of #19204: mcpherrinm/master

The old name was sensible when this module was PriorityQueue but isn't
anymore.

9 years agorollup merge of #19198: alexcrichton/snapshots
Jakub Bukaj [Sun, 23 Nov 2014 19:11:52 +0000 (14:11 -0500)]
rollup merge of #19198: alexcrichton/snapshots

Primarily including the libnative removal

9 years agorollup merge of #19194: aturon/stab-ascii
Jakub Bukaj [Sun, 23 Nov 2014 19:11:51 +0000 (14:11 -0500)]
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]

9 years agorollup merge of #19193: scialex/rc-counts
Jakub Bukaj [Sun, 23 Nov 2014 19:11:50 +0000 (14:11 -0500)]
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.

9 years agorollup merge of #19184: Gekkio/fix-binary-format-char
Jakub Bukaj [Sun, 23 Nov 2014 19:11:49 +0000 (14:11 -0500)]
rollup merge of #19184: Gekkio/fix-binary-format-char

This small piece of documentation was missed in the format character change
in 4af3494bb02e80badc978faa65e59625ade0c675.

9 years agorollup merge of #19166: richo/lldb-cleanups
Jakub Bukaj [Sun, 23 Nov 2014 19:11:48 +0000 (14:11 -0500)]
rollup merge of #19166: richo/lldb-cleanups

While poking at rust in lldb I found a few nits to clean up.

9 years agorollup merge of #19161: jmesmon/mk-fixes
Jakub Bukaj [Sun, 23 Nov 2014 19:11:47 +0000 (14:11 -0500)]
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.

9 years agoauto merge of #19150 : Manishearth/rust/find-doc, r=Gankro
bors [Sun, 23 Nov 2014 15:46:56 +0000 (15:46 +0000)]
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)

9 years agofix for PR#16552 implementation on windows: CFG_LIBDIR should be always set in config...
Jauhien Piatlicki [Sun, 23 Nov 2014 14:36:36 +0000 (15:36 +0100)]
fix for PR#16552 implementation on windows: CFG_LIBDIR should be always set in configure variables

9 years agoauto merge of #18140 : JelteF/rust-1/guide-fix, r=cmr
bors [Sun, 23 Nov 2014 13:51:47 +0000 (13:51 +0000)]
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.

9 years agoFix the reason for calling a file lib.rs
Jelte Fennema [Sun, 23 Nov 2014 13:43:22 +0000 (14:43 +0100)]
Fix the reason for calling a file lib.rs

9 years agoAdd test
Adolfo Ochagavía [Sun, 23 Nov 2014 11:27:10 +0000 (12:27 +0100)]
Add test

9 years agoauto merge of #19158 : jakub-/rust/issue-14091, r=alexcrichton
bors [Sun, 23 Nov 2014 11:51:50 +0000 (11:51 +0000)]
auto merge of #19158 : jakub-/rust/issue-14091, r=alexcrichton

Closes #14091.
Closes #19195.

9 years agoRemove type parameters from ExprField and ExprTupField
Adolfo Ochagavía [Sun, 23 Nov 2014 11:14:35 +0000 (12:14 +0100)]
Remove type parameters from ExprField and ExprTupField

9 years agolibsyntax: Forbid type parameters in tuple indices
Adolfo Ochagavía [Sat, 22 Nov 2014 15:02:49 +0000 (16:02 +0100)]
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]

9 years agoauto merge of #19157 : aturon/rust/cow-doc, r=alexcrichton
bors [Sun, 23 Nov 2014 09:51:49 +0000 (09:51 +0000)]
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

9 years agoauto merge of #18856 : ruud-v-a/rust/fatptrs, r=cmr
bors [Sun, 23 Nov 2014 07:51:51 +0000 (07:51 +0000)]
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.

9 years agoauto merge of #19152 : alexcrichton/rust/issue-17863, r=aturon
bors [Sun, 23 Nov 2014 05:46:52 +0000 (05:46 +0000)]
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

9 years agoChange how rustdoc shows constants and statics to be more similar to other items
P1start [Sat, 22 Nov 2014 07:48:55 +0000 (20:48 +1300)]
Change how rustdoc shows constants and statics to be more similar to other items

Fixes #19046.

9 years agoMake rustdoc display `extern crate` statements correctly
P1start [Sat, 22 Nov 2014 06:07:54 +0000 (19:07 +1300)]
Make rustdoc display `extern crate` statements correctly

9 years agoHighlight trait methods in rustdoc’s search results
P1start [Sat, 22 Nov 2014 05:36:02 +0000 (18:36 +1300)]
Highlight trait methods in rustdoc’s search results

9 years agoFix typo in Result documentation
Nicholas Bishop [Sun, 23 Nov 2014 03:13:00 +0000 (22:13 -0500)]
Fix typo in Result documentation

9 years agoauto merge of #19146 : gereeter/rust/reference-borrow, r=aturon
bors [Sun, 23 Nov 2014 02:36:46 +0000 (02:36 +0000)]
auto merge of #19146 : gereeter/rust/reference-borrow, r=aturon

This should be a more general version of #19131.

9 years agosave-analysis: add values for types
Nick Cameron [Sun, 23 Nov 2014 01:57:26 +0000 (14:57 +1300)]
save-analysis: add values for types

9 years agosave-analysis: emit a type for enum variants
Nick Cameron [Sun, 23 Nov 2014 01:39:59 +0000 (14:39 +1300)]
save-analysis: emit a type for enum variants

9 years agoauto merge of #19137 : tbu-/rust/pr_refcell_unsafety, r=huonw
bors [Sun, 23 Nov 2014 00:36:43 +0000 (00:36 +0000)]
auto merge of #19137 : tbu-/rust/pr_refcell_unsafety, r=huonw

9 years agoAny: use plain transmute instead of transmute_copy for downcasting.
Jonathan Reem [Sun, 23 Nov 2014 00:06:21 +0000 (16:06 -0800)]
Any: use plain transmute instead of transmute_copy for downcasting.

transmute_copy is no longer needed and is just slow.

9 years agoauto merge of #19136 : alfie/rust/master, r=steveklabnik
bors [Sat, 22 Nov 2014 22:36:40 +0000 (22:36 +0000)]
auto merge of #19136 : alfie/rust/master, r=steveklabnik

An example of how type definitions work would be handy

9 years agoAdd test
Adolfo Ochagavía [Sat, 22 Nov 2014 20:41:15 +0000 (21:41 +0100)]
Add test

9 years agoauto merge of #19134 : sinistersnare/rust/patch-2, r=alexcrichton
bors [Sat, 22 Nov 2014 20:36:40 +0000 (20:36 +0000)]
auto merge of #19134 : sinistersnare/rust/patch-2, r=alexcrichton

Vec<T> can index now so its a useless conversion.

9 years agostd: Align `raw` modules with unsafe conventions
Alex Crichton [Thu, 20 Nov 2014 18:11:15 +0000 (10:11 -0800)]
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

9 years agoFix pretty printing unsafe match arms
Adolfo Ochagavía [Sat, 22 Nov 2014 15:24:58 +0000 (16:24 +0100)]
Fix pretty printing unsafe match arms

9 years agoauto merge of #19133 : nodakai/rust/run-make-tests-missing-extracflags, r=alexcrichton
bors [Sat, 22 Nov 2014 14:46:38 +0000 (14:46 +0000)]
auto merge of #19133 : nodakai/rust/run-make-tests-missing-extracflags, r=alexcrichton

Missing `$(EXTRACFLAGS)` resutled in compile failures.

9 years agoDSTify free functions in std::hash
we [Sat, 22 Nov 2014 14:03:40 +0000 (17:03 +0300)]
DSTify free functions in std::hash

9 years agoauto merge of #19132 : sinistersnare/rust/patch-1, r=alexcrichton
bors [Sat, 22 Nov 2014 12:46:37 +0000 (12:46 +0000)]
auto merge of #19132 : sinistersnare/rust/patch-1, r=alexcrichton

Just used Githubs edit view, so I hope this works...

9 years agoauto merge of #19125 : chris-morgan/rust/vim-prelude-2014-11-20, r=alexcrichton
bors [Sat, 22 Nov 2014 10:46:40 +0000 (10:46 +0000)]
auto merge of #19125 : chris-morgan/rust/vim-prelude-2014-11-20, r=alexcrichton

9 years agoMerge pull request #1 from rust-lang/master
Vadim Petrochenkov [Sat, 22 Nov 2014 10:42:36 +0000 (13:42 +0300)]
Merge pull request #1 from rust-lang/master

Update from original

9 years agoauto merge of #19124 : Kintaro/rust/remove_test_struct_variants, r=bstrie
bors [Sat, 22 Nov 2014 08:46:44 +0000 (08:46 +0000)]
auto merge of #19124 : Kintaro/rust/remove_test_struct_variants, r=bstrie

Removed usage of struct_variant feature from all tests.

9 years agoRename variables called pq to heap
Matt McPherrin [Sat, 22 Nov 2014 07:01:38 +0000 (23:01 -0800)]
Rename variables called pq to heap

The old name was sensible when this module was PriorityQueue but isn't
anymore.

9 years agoauto merge of #17513 : dradtke/rust/master, r=kballard
bors [Sat, 22 Nov 2014 06:31:43 +0000 (06:31 +0000)]
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.

9 years agoauto merge of #19122 : Kintaro/rust/remove_struct_variant, r=jakub-
bors [Sat, 22 Nov 2014 04:06:45 +0000 (04:06 +0000)]
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)

9 years agoargs() doc: Fix a documentation line.
Jashank Jeremy [Sat, 22 Nov 2014 02:34:38 +0000 (13:34 +1100)]
args() doc: Fix a documentation line.

9 years agoauto merge of #19117 : jmesmon/rust/mk-cfg-suffix, r=cmr
bors [Sat, 22 Nov 2014 01:46:46 +0000 (01:46 +0000)]
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.

9 years agoauto merge of #18603 : brson/rust/stdchar, r=aturon
bors [Fri, 21 Nov 2014 23:16:48 +0000 (23:16 +0000)]
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

9 years agoShuffle locations for Deref
Alexander Light [Fri, 21 Nov 2014 22:56:33 +0000 (17:56 -0500)]
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`.

9 years agoRegister new snapshots
Alex Crichton [Fri, 21 Nov 2014 22:15:33 +0000 (14:15 -0800)]
Register new snapshots

9 years agoFallout from deprecation
Aaron Turon [Fri, 21 Nov 2014 20:51:22 +0000 (12:51 -0800)]
Fallout from deprecation

9 years agolibs: stabilize ascii module
Aaron Turon [Fri, 21 Nov 2014 20:00:05 +0000 (12:00 -0800)]
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]

9 years agocore: Convert a 'failure' to 'panic' in docs
Brian Anderson [Thu, 6 Nov 2014 02:17:27 +0000 (18:17 -0800)]
core: Convert a 'failure' to 'panic' in docs

9 years agocore: Update docs for escape_unicode, escape_default
Brian Anderson [Thu, 6 Nov 2014 01:50:09 +0000 (17:50 -0800)]
core: Update docs for escape_unicode, escape_default

9 years agounicode: Remove unused `non_snake_case` allows.
Brian Anderson [Thu, 6 Nov 2014 01:00:49 +0000 (17:00 -0800)]
unicode: Remove unused `non_snake_case` allows.

9 years agounicode: Rename is_XID_start to is_xid_start, is_XID_continue to is_xid_continue
Brian Anderson [Mon, 3 Nov 2014 23:18:45 +0000 (15:18 -0800)]
unicode: Rename is_XID_start to is_xid_start, is_XID_continue to is_xid_continue

9 years agounicode: Add stability attributes to u_char
Brian Anderson [Mon, 3 Nov 2014 18:22:34 +0000 (10:22 -0800)]
unicode: Add stability attributes to u_char

Free functions deprecated. UnicodeChar experimental pending
final decisions about prelude.

9 years agounicode: Convert UnicodeChar methods to by-value
Brian Anderson [Mon, 3 Nov 2014 18:26:22 +0000 (10:26 -0800)]
unicode: Convert UnicodeChar methods to by-value

Extension traits for primitive types should be by-value.

[breaking-change]

9 years agocore: Convert Char::escape_default, escape_unicode to iterators
Brian Anderson [Fri, 31 Oct 2014 23:20:41 +0000 (16:20 -0700)]
core: Convert Char::escape_default, escape_unicode to iterators

[breaking-change]

9 years agocore: Convert Char methods to by-val self
Brian Anderson [Tue, 14 Oct 2014 20:08:54 +0000 (13:08 -0700)]
core: Convert Char methods to by-val self

Methods on primitmive Copy types generally should take `self`.

[breaking-change]

9 years agoFix various deprecation warnings from char changes
Brian Anderson [Mon, 13 Oct 2014 20:03:42 +0000 (13:03 -0700)]
Fix various deprecation warnings from char changes

9 years agocore: Mark remaining Char methods unstable
Brian Anderson [Mon, 13 Oct 2014 17:57:49 +0000 (10:57 -0700)]
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.

9 years agocore: Deprecated remaining free functions in `char`
Brian Anderson [Mon, 13 Oct 2014 17:54:18 +0000 (10:54 -0700)]
core: Deprecated remaining free functions in `char`

Prefer the methods.

9 years agocore: Add stability attributes to char::from_digit and from_u32
Brian Anderson [Fri, 10 Oct 2014 21:55:11 +0000 (14:55 -0700)]
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'.

9 years agocore: Add Char::len_utf16
Brian Anderson [Thu, 9 Oct 2014 00:40:31 +0000 (17:40 -0700)]
core: Add Char::len_utf16

Missing method to pair with len_utf8.

9 years agocore: Rename Char::len_utf8_bytes to Char::len_utf8
Brian Anderson [Thu, 9 Oct 2014 00:33:02 +0000 (17:33 -0700)]
core: Rename Char::len_utf8_bytes to Char::len_utf8

"bytes" is redundant.

Deprecate the old.

9 years agocore: Rename Char::is_digit_radix to is_digit
Brian Anderson [Thu, 9 Oct 2014 00:24:15 +0000 (17:24 -0700)]
core: Rename Char::is_digit_radix to is_digit

This fits the naming of `to_digit` and `from_digit`. Leave
the old name deprecated.

9 years agounicode: Rename UnicodeChar::is_digit to is_numeric
Brian Anderson [Thu, 9 Oct 2014 00:15:27 +0000 (17:15 -0700)]
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]

9 years agoauto merge of #18822 : scialex/rust/better-rustdoc, r=alexcrichton
bors [Fri, 21 Nov 2014 21:06:51 +0000 (21:06 +0000)]
auto merge of #18822 : scialex/rust/better-rustdoc, r=alexcrichton

Changed `rustdoc` so that if we do not have the `strip-private` pass
enabled private modules will be included in the generated documentation

I added this because it is useful to be able to read the documentation in the very nice `rustdoc` web interface when doing internal work on a project. In this case we want the `rustdoc` to include modules that are hidden from consumers. Since this is not currently possible I added it here.

9 years agochar: Mark the MAX constant stable
Brian Anderson [Thu, 9 Oct 2014 00:06:19 +0000 (17:06 -0700)]
char: Mark the MAX constant stable

9 years agocore: Mark Char trait experimental
Brian Anderson [Thu, 9 Oct 2014 00:05:12 +0000 (17:05 -0700)]
core: Mark Char trait experimental

9 years agocore: Add from_u32 to the Char trait
Brian Anderson [Thu, 9 Oct 2014 00:03:04 +0000 (17:03 -0700)]
core: Add from_u32 to the Char trait

This is the only free function not part of the trait.

9 years agoAdd `weak_count` and `strong_count` to Rc and Arc
Alexander Light [Thu, 20 Nov 2014 21:38:36 +0000 (16:38 -0500)]
Add `weak_count` and `strong_count` to Rc and Arc

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.

9 years agocompiletest: namespaced enums fallout
Richo Healey [Fri, 21 Nov 2014 18:50:44 +0000 (10:50 -0800)]
compiletest: namespaced enums fallout

9 years agolldb: Clean up struct printing
Richo Healey [Fri, 21 Nov 2014 01:24:18 +0000 (17:24 -0800)]
lldb: Clean up struct printing

9 years agoauto merge of #19114 : frewsxcv/rust/master, r=bstrie
bors [Fri, 21 Nov 2014 19:06:52 +0000 (19:06 +0000)]
auto merge of #19114 : frewsxcv/rust/master, r=bstrie

Fixes #19010

9 years agoauto merge of #19095 : juxiliary/rust/master, r=bstrie
bors [Fri, 21 Nov 2014 16:56:47 +0000 (16:56 +0000)]
auto merge of #19095 : juxiliary/rust/master, r=bstrie

Vim plugins shouldn't override user settings unless they ask!

Stops the plugin from modifying the users settings by default
instead makes them opt-in with `g:rust_recommended_style`

9 years agorustc: Change all ABI constants to all caps.
Ruud van Asseldonk [Tue, 11 Nov 2014 09:15:42 +0000 (10:15 +0100)]
rustc: Change all ABI constants to all caps.

This also removes `box_field_refcnt`. It was not used anywhere.

9 years agorustc: Unify fat pointer ABI constants.
Ruud van Asseldonk [Mon, 10 Nov 2014 17:14:31 +0000 (18:14 +0100)]
rustc: Unify fat pointer ABI constants.

This merges the `trt_field_*`, `fn_field_*` and `slice_elt_*` constants
into two `FAT_PTR_*` constants. This resolves the first part of #18590.

9 years agoFix std::fmt::Binary format char in docs
Joonas Javanainen [Fri, 21 Nov 2014 15:12:08 +0000 (15:12 +0000)]
Fix std::fmt::Binary format char in docs

This small piece of documentation was missed in the format character change
in 4af3494bb02e80badc978faa65e59625ade0c675.

9 years agoauto merge of #19042 : SimonSapin/rust/generic-utf16-encoder, r=alexcrichton
bors [Fri, 21 Nov 2014 14:21:48 +0000 (14:21 +0000)]
auto merge of #19042 : SimonSapin/rust/generic-utf16-encoder, r=alexcrichton

This allows encoding to UTF-16 something that is not in UTF-8, e.g. a `[char]` UTF-32 string.

This might help with servo/servo#4023

9 years agoauto merge of #18984 : sheroze1123/rust/fix17574, r=bstrie
bors [Fri, 21 Nov 2014 11:36:45 +0000 (11:36 +0000)]
auto merge of #18984 : sheroze1123/rust/fix17574, r=bstrie

Fix #17574

9 years agoauto merge of #18908 : tbu-/rust/pr_mapinplace_fixzerosized, r=alexcrichton
bors [Fri, 21 Nov 2014 09:01:50 +0000 (09:01 +0000)]
auto merge of #18908 : tbu-/rust/pr_mapinplace_fixzerosized, r=alexcrichton

9 years agoauto merge of #16552 : jauhien/rust/fix-libdir, r=alexcrichton
bors [Fri, 21 Nov 2014 06:21:48 +0000 (06:21 +0000)]
auto merge of #16552 : jauhien/rust/fix-libdir, r=alexcrichton

Fixies #11671

This commit changes default relative libdir 'lib' to a relative libdir calculated using LIBDIR provided by --libdir configuration option. In case if no option was provided behavior does not change.

9 years agoauto merge of #18967 : aturon/rust/remove-runtime, r=alexcrichton
bors [Fri, 21 Nov 2014 03:41:45 +0000 (03:41 +0000)]
auto merge of #18967 : aturon/rust/remove-runtime, r=alexcrichton

This PR completes the removal of the runtime system and green-threaded abstractions as part of implementing [RFC 230](https://github.com/rust-lang/rfcs/pull/230).

Specifically:

* It removes the `Runtime` trait, welding the scheduling infrastructure directly to native threads.

* It removes `libgreen` and `libnative` entirely.

* It rewrites `sync::mutex` as a trivial layer on top of native mutexes. Eventually, the two modules will be merged.

* It hides the vast majority of `std::rt`.

This completes the basic task of removing the runtime system (I/O and scheduling) and components that depend on it.

After this lands, a follow-up PR will pull the `rustrt` crate back into `std`, turn `std::task` into `std::thread` (with API changes to go along with it), and completely cut out the remaining startup/teardown sequence. Other changes, including new [TLS](https://github.com/rust-lang/rfcs/pull/461) and synchronization are in the RFC or pre-RFC phase.

Closes #17325
Closes #18687

[breaking-change]

r? @alexcrichton

9 years agoDisable dubious pipe test
Aaron Turon [Thu, 20 Nov 2014 06:57:28 +0000 (22:57 -0800)]
Disable dubious pipe test

9 years agoLoosen possibly bogus constraints in backtrace test
Aaron Turon [Wed, 19 Nov 2014 05:15:13 +0000 (21:15 -0800)]
Loosen possibly bogus constraints in backtrace test

9 years agoFallout from namespaced enums
Aaron Turon [Mon, 17 Nov 2014 23:27:58 +0000 (15:27 -0800)]
Fallout from namespaced enums

9 years agoFallout from new termination semantics
Aaron Turon [Sat, 15 Nov 2014 07:05:37 +0000 (23:05 -0800)]
Fallout from new termination semantics

9 years agoMake most of std::rt private
Aaron Turon [Sat, 15 Nov 2014 00:30:16 +0000 (16:30 -0800)]
Make most of std::rt private

Previously, the entire runtime API surface was publicly exposed, but
that is neither necessary nor desirable. This commit hides most of the
module, using librustrt directly as needed. The arrangement will need to
be revisited when rustrt is pulled into std.

[breaking-change]

9 years agoFallout from libgreen and libnative removal
Aaron Turon [Fri, 14 Nov 2014 22:38:41 +0000 (14:38 -0800)]
Fallout from libgreen and libnative removal

9 years agoRewrite sync::mutex as thin layer over native mutexes
Aaron Turon [Fri, 14 Nov 2014 22:33:51 +0000 (14:33 -0800)]
Rewrite sync::mutex as thin layer over native mutexes

Previously, sync::mutex had to split between green and native runtime
systems and thus could not simply use the native mutex facility.

This commit rewrites sync::mutex to link directly to native mutexes; in
the future, the two will probably be coalesced into a single
module (once librustrt is pulled into libstd wholesale).