Commit Graph

34503 Commits

Author SHA1 Message Date
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
bors
cd75847437 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.
2014-11-21 21:06:51 +00:00
Brian Anderson
ac2f379abb char: Mark the MAX constant stable 2014-11-21 12:49:51 -08:00
Brian Anderson
070e691379 core: Mark Char trait experimental 2014-11-21 12:49:51 -08:00
Brian Anderson
41fb8f77ee core: Add from_u32 to the Char trait
This is the only free function not part of the trait.
2014-11-21 12:49:51 -08:00
Alexander Light
4c36ad01e7 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.
2014-11-21 15:42:01 -05:00
Richo Healey
68f90a2cad compiletest: namespaced enums fallout 2014-11-21 11:30:24 -08:00
Richo Healey
7191cd92c1 lldb: Clean up struct printing 2014-11-21 11:20:02 -08:00
bors
97c043b2e9 auto merge of #19114 : frewsxcv/rust/master, r=bstrie
Fixes #19010
2014-11-21 19:06:52 +00:00
bors
f530aa08df 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`
2014-11-21 16:56:47 +00:00
Ruud van Asseldonk
c724131a86 rustc: Change all ABI constants to all caps.
This also removes `box_field_refcnt`. It was not used anywhere.
2014-11-21 17:49:11 +01:00
Ruud van Asseldonk
b781c8b08e 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.
2014-11-21 17:49:11 +01:00
Joonas Javanainen
5a08e679c7 Fix std::fmt::Binary format char in docs
This small piece of documentation was missed in the format character change
in 4af3494bb0.
2014-11-21 15:12:08 +00:00
bors
9efa23e9c0 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
2014-11-21 14:21:48 +00:00
bors
47c1d437c9 auto merge of #18984 : sheroze1123/rust/fix17574, r=bstrie
Fix #17574
2014-11-21 11:36:45 +00:00
bors
e583c4d24b auto merge of #18908 : tbu-/rust/pr_mapinplace_fixzerosized, r=alexcrichton 2014-11-21 09:01:50 +00:00
bors
2fcbf90d68 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.
2014-11-21 06:21:48 +00:00
Alfie John
93ba558588 doc: adding example for implementations without traits 2014-11-21 04:43:07 +00:00
bors
c9f6d69642 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
2014-11-21 03:41:45 +00:00
Aaron Turon
32c3d02780 Disable dubious pipe test 2014-11-20 17:19:25 -08:00
Aaron Turon
86992b6437 Loosen possibly bogus constraints in backtrace test 2014-11-20 17:19:24 -08:00
Aaron Turon
243bfc277e Fallout from namespaced enums 2014-11-20 17:19:24 -08:00
Aaron Turon
b3d4379042 Fallout from new termination semantics 2014-11-20 17:19:24 -08:00
Aaron Turon
6987ad22e4 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]
2014-11-20 17:19:24 -08:00
Aaron Turon
40c78ab037 Fallout from libgreen and libnative removal 2014-11-20 17:19:24 -08:00
Aaron Turon
a68ec98166 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).
2014-11-20 17:19:24 -08:00
Aaron Turon
91a2c0d512 Remove libgreen
With runtime removal complete, there is no longer any reason to provide
libgreen.

[breaking-change]
2014-11-20 17:19:24 -08:00
Aaron Turon
3ee916e50b Remove libnative
With runtime removal complete, there's nothing left of libnative. This
commit removes it.

Fixes #18687

[breaking-change]
2014-11-20 17:19:13 -08:00
Aaron Turon
ad022b1a1b Remove Runtime trait
This commit removes most of the remaining runtime infrastructure related
to the green/native split. In particular, it removes the `Runtime` trait
and instead inlines the native implementation.

Closes #17325

[breaking-change]
2014-11-20 17:19:13 -08:00
bors
9830051607 auto merge of #18441 : mdinger/rust/literals, r=steveklabnik
Closes #18415

This links [`std::str`](http://doc.rust-lang.org/std/str/index.html) documentation to [literals](http://doc.rust-lang.org/reference.html#literals) in the reference guide and collects examples of literals into one group at the beginning of the section. ~~The new tables are not exhaustive (some escapes were skipped) and so I try to link back to the respective sections where more detail is located.~~ The tables are are mostly exhaustive. I misunderstood some of the whitespace codes.

I don't think the tables actually look that nice if that's important and I'm not sure how it could be improved. I think it does do a good job of collecting available options together. I think listing the escapes together is particularly helpful because they vary with type and are embedded in paragraphs.

[EDIT]
The [ascii table](http://man-ascii.com/) is here and may be useful.
2014-11-21 01:06:47 +00:00
Richo Healey
0ab01048d5 lldb: refactor print_vec_slice_val
Be more idiomatic and rely less on fiddly construction of output
2014-11-20 16:31:56 -08:00