Commit Graph

34344 Commits

Author SHA1 Message Date
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
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
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
Simon Sapin
dff48a99d6 Add Utf16Encoder. Generalize Utf16CodeUnits for any Iterator<char>.
This allows encoding to UTF-16 something that is not in UTF-8, e.g. a
`[char]` UTF-32 string.

This might help with https://github.com/servo/servo/issues/4023
2014-11-20 14:05:28 +00:00
bors
394269d16e auto merge of #19033 : pnkfelix/rust/fsk-introduce-scopedata-via-refactor, r=nikomatsakis
(Previously, scopes were solely identified with NodeId's; this
refactoring prepares for a future where that does not hold.)

Ground work for a proper fix to #8861.
2014-11-20 14:01:51 +00:00
Felix S. Klock II
5ff9087e05 Refactored new CodeExtent type for improved abstraction.
(Previously, statically identifiable scopes/regions were solely
identified with NodeId's; this refactoring prepares for a future
where that 1:1 correspondence does not hold.)
2014-11-20 13:10:03 +01:00
bors
1d81776209 auto merge of #19113 : nikomatsakis/rust/unboxed-boxed-closure-unification, r=acrichto
Use the expected type to infer the argument/return types of unboxed closures. Also, in `||` expressions, use the expected type to decide if the result should be a boxed or unboxed closure (and if an unboxed closure, what kind).

This supercedes PR #19089, which was already reviewed by @pcwalton.
2014-11-20 12:01:44 +00:00
bors
b825b3496a auto merge of #18638 : aturon/rust/as_slice_dst, r=japaric
This PR changes `AsSlice` to work on unsized types, and changes the
`impl` for `&[T]` to `[T]`. Aside from making the trait more general,
this also helps some ongoing work with method resolution changes.

This is a breaking change: code that uses generics bounded by `AsSlice`
will have to change. In particular, such code previously often took
arguments of type `V` where `V: AsSlice<T>` by value. These should now
be taken by reference:

```rust
fn foo<Sized? V: AsSlice<T>>(v: &V) { .. }
```

A few std lib functions have been changed accordingly.

The PR also relaxes constraints on generics and traits within the
`core::ops` module and for the `Equiv` trait.

[breaking-change]

r? @nikomatsakis 
cc @japaric
2014-11-20 10:01:42 +00:00
Huon Wilson
3f3b2d6b7e Rename col! to column!.
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.

[breaking-change]
2014-11-20 20:18:21 +11:00
Aaron Turon
c287afb2fa libcore: DSTify ops traits, Equiv
This commit relaxes constraints on generics and traits within the
`core::ops` module and for the `Equiv` trait.
2014-11-20 00:05:00 -08:00
Aaron Turon
004db80afe libcore: DST-ify AsSlice
This commit changes `AsSlice` to work on unsized types, and changes the
`impl` for `&[T]` to `[T]`. Aside from making the trait more general,
this also helps some ongoing work with method resolution changes.

This is a breaking change: code that uses generics bounded by `AsSlice`
will have to change. In particular, such code previously often took
arguments of type `V` where `V: AsSlice<T>` by value. These should now
be taken by reference:

```rust
fn foo<Sized? V: AsSlice<T>>(v: &V) { .. }
```

A few std lib functions have been changed accordingly.

[breaking-change]
2014-11-20 00:05:00 -08:00
bors
dd5ce5ae2f auto merge of #19105 : alfie/rust/master, r=thestinger
As discussed in pull #19068, trying to make the wording more clear for unsafe code vs undefined behavior.
2014-11-20 06:11:36 +00:00
bors
793624261a auto merge of #18999 : aturon/rust/stab-floats, r=alexcrichton,alexcrichton
This commit adds stability markers for the APIs that have recently been aligned with [numerics reform](https://github.com/rust-lang/rfcs/pull/369). For APIs that were changed as part of that reform, `#[unstable]` is used to reflect the recency, but the APIs will become `#[stable]` in a follow-up pass.

In addition, a few aspects of the APIs not explicitly covered by the RFC are marked here -- in particular, constants for floats.

This commit does not mark the `uint` or `int` modules as `#[stable]`, given the ongoing debate out the names and roles of these types.

Due to some deprecation (see the RFC for details), this is a:

[breaking-change]

r? @alexcrichton 
cc @bjz
2014-11-20 02:31:31 +00:00
bors
399ff259e1 auto merge of #19118 : jakub-/rust/roll-up, r=jakub- 2014-11-20 00:27:07 +00:00
Jakub Bukaj
ee66c84165 Fixes to the roll-up 2014-11-19 23:34:01 +01:00
bors
a24b44483a auto merge of #18728 : thestinger/rust/int, r=cmr
This fixes the gap in the language definition causing #18726 by defining
a clear bound on the maximum size for libraries to enforce.

Closes #18069
2014-11-19 22:27:00 +00:00
Jakub Bukaj
2e9f705b93 rollup merge of #19108: steveklabnik/doc_atomic_bool
I don't know enough about the free functions to give them better docs right now.
2014-11-19 22:41:39 +01:00
Jakub Bukaj
1b8ee82b54 rollup merge of #19107: cakebaker/change_an_box_to_a_box 2014-11-19 22:41:24 +01:00
Jakub Bukaj
f71b852d38 rollup merge of #19103: huonw/literal-suffixes
Futureproof Rust for fancier suffixed literals. The Rust compiler tokenises a literal followed immediately (no whitespace) by an identifier as a single token: (for example) the text sequences `"foo"bar`, `1baz` and `1u1024` are now a single token rather than the pairs `"foo"` `bar`, `1` `baz` and `1u` `1024` respectively.

The compiler rejects all such suffixes in the parser, except for the 12 numeric suffixes we have now.

I'm fairly sure this will affect very few programs, since it's not currently legal to have `<literal><identifier>` in a Rust program, except in a macro invocation. Any macro invocation relying on this behaviour can simply separate the two tokens with whitespace: `foo!("bar"baz)` becomes `foo!("bar" baz)`.

This implements [RFC 463](https://github.com/rust-lang/rfcs/blob/master/text/0463-future-proof-literal-suffixes.md), and so closes https://github.com/rust-lang/rust/issues/19088.
2014-11-19 22:41:05 +01:00
Jakub Bukaj
00ffcca016 rollup merge of #19101: vhbit/ios-rng-fix 2014-11-19 22:40:05 +01:00
Jakub Bukaj
c28acd0251 rollup merge of #19090: kmcallister/deriving-non-type
Besides being more helpful, this gives us the flexibility to later define a meaning for something like

```rust
#[deriving(...)]
mod bar { ... }
```
2014-11-19 22:39:49 +01:00
Jakub Bukaj
7884dd9cec rollup merge of #19087: jakub-/issue-19086
Fixes #19086.

Whilst the code that this PR renders invalid was never meant to be valid, this is still a...

[breaking-change]
2014-11-19 22:39:29 +01:00
Jakub Bukaj
9b5ec0e4aa rollup merge of #19076: jxv/master 2014-11-19 22:39:23 +01:00
Jakub Bukaj
1faa09615e rollup merge of #19073: jakub-/issue-19069
Fixes #19069.

These were never intended not to be feature-gated but this PR is nonetheless a...

[breaking-change]
2014-11-19 22:39:12 +01:00
Jakub Bukaj
8997b098d3 rollup merge of #19072: cakebaker/add_missing_dot 2014-11-19 22:39:06 +01:00
Jakub Bukaj
a22f06db19 rollup merge of #19040: alexcrichton/issue-18904
This commit applies the stabilization of std::fmt as outlined in [RFC 380][rfc].
There are a number of breaking changes as a part of this commit which will need
to be handled to migrated old code:

* A number of formatting traits have been removed: String, Bool, Char, Unsigned,
  Signed, and Float. It is recommended to instead use Show wherever possible or
  to use adaptor structs to implement other methods of formatting.

* The format specifier for Boolean has changed from `t` to `b`.

* The enum `FormatError` has been renamed to `Error` as well as becoming a unit
  struct instead of an enum. The `WriteError` variant no longer exists.

* The `format_args_method!` macro has been removed with no replacement. Alter
  code to use the `format_args!` macro instead.

* The public fields of a `Formatter` have become read-only with no replacement.
  Use a new formatting string to alter the formatting flags in combination with
  the `write!` macro. The fields can be accessed through accessor methods on the
  `Formatter` structure.

Other than these breaking changes, the contents of std::fmt should now also all
contain stability markers. Most of them are still #[unstable] or #[experimental]

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0380-stabilize-std-fmt.md
[breaking-change]

Closes #18904
2014-11-19 22:38:26 +01:00
Jakub Bukaj
384f611aa9 rollup merge of #18968: danluu/guide_play
As-is, there's no indication that the code examples pop out into a window that runs on `play.rust-lang.org` until you mouse over them. I managed to get to section 4 of the guide before realizing you could do this since it didn't occur to me to mouse over the example text.

cc @rose since we went through the tutorial together and I think it wasn't obvious to her either.
2014-11-19 22:37:18 +01:00