Commit Graph

34373 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
bors
770378a313 auto merge of #18773 : subhashb/rust/convert_remaining_failures_to_panic, r=steveklabnik
I have also renamed `fail` to `panic` in some non-documentation comments, where I thought it mattered.
Fixes #18677 

cc @steveklabnik
2014-11-20 23:02:01 +00:00
Alexander Light
26107f6181 rustdoc: Allow private modules be included in docs
Made it so that what passes are used is passed onto the renderer so it
can intelligently deal with private modules.
2014-11-20 17:02:58 -05:00
mdinger
16bb4e6400 Add examples for all literal types in reference grouped together 2014-11-20 16:05:33 -05:00
bors
d13aff1224 auto merge of #18750 : nikomatsakis/rust/issue-18333-skolemize-open-existential, r=nrc
In the general case, at least, it is not possible to make an object out of an unsized type. This is because the object type would have to store the fat pointer information for the `self` value *and* the vtable -- meaning it'd have to be a fat pointer with three words -- but for the compiler to know that the object requires three words, it would have to know the self-type of the object (is `self` a thin or fat pointer?), which of course it doesn't.

Fixes #18333.

r? @nick29581
2014-11-20 19:26:40 +00:00
mdinger
c8106a016f Link std::str to reference literals section 2014-11-20 14:10:25 -05:00
Subhash Bhushan
bc9de771d5 Rename remaining Failures to Panic 2014-11-20 23:45:42 +05:30
bors
96c8f2b0c1 auto merge of #19071 : huonw/rust/col2column, r=nikomatsakis
This macro is very rarely used, so there is no need (and it is better)
for it to avoid the abbreviation.

Closes rust-lang/rfcs#467.
2014-11-20 16:02:03 +00:00
Niko Matsakis
7a372e23cb Require that objects can only be made from Sized types. Fixes #18333. 2014-11-20 09:16:20 -05:00