Commit Graph

34523 Commits

Author SHA1 Message Date
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
Richo Healey
125677e3f0 Add vim modeline to lldb formatter
The file doesn't adhere to the python standard, but this will let vi do
The Right Thing by default
2014-11-20 16:30:05 -08:00
Cody P Schafer
12749fc8ec mk/rt: use CFG_LLVM_TARGET instead of plain target when calling llc
We add CFG_LLVM_TARGET_$(target) (which can be defined in any of the
mk/cfg/* files) and supply a default to the plain target name

CFG_LLVM_TARGET mirrors the value of llvm_target (aka llvm-target) in
the librustc_back runtime target specification.
2014-11-20 18:34:10 -05: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
Cody P Schafer
9c320dd7af configure: silence warning about LOCAL_RUST_ROOT being set
We have a default value for this ('/usr/local'), so this warning is
printed ALL the time unless one does --enable-local-rust. As a result,
it doesn't really help at all.
2014-11-20 16:00:12 -05:00
Cody P Schafer
bc5a139baa rustdoc: avoid supplying a bad default sysroot so the librustc code can calculate it properly 2014-11-20 16:00:12 -05:00
Cody P Schafer
29cc7c2adf mk/target: fix typo so we depend on the correct directory
Without this, if we we're using a non-standard host libdir, the target
bindir would not exist (and rustc would fail to write to the
non-existent directory).
2014-11-20 16:00:12 -05:00
Cody P Schafer
aa58d534e5 mk/stage0: complain instead of creating an empty file
If the expected rustc snapshot is not where we expect it to be,
complain and fail at that point rather than creating a empty rustc file
and continuing until we try to run it.
2014-11-20 16:00:12 -05:00
Jakub Bukaj
0524161c0b Fix an ICE on diagnostics originating in external macros 2014-11-20 21:31:59 +01:00
Aaron Turon
bab9564280 libs: make Cow usable, improve documentation
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.
2014-11-20 12:00:07 -08:00
Manish Goregaokar
f85f971e44 Mention that find() doesn't consume the full iterator 2014-11-21 01:15:56 +05:30
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
Jonathan S
07af6f0f43 Implement BorrowFrom<&'a T> for T (with mutable variants) 2014-11-20 10:34:54 -06:00
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
Tobias Bucher
f9f5c03026 Add comment on why RefCell::unwrap is safe 2014-11-20 12:28:32 +01: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
Alfie John
e87894ef04 doc: adding example for type definitions 2014-11-20 09:44:57 +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
Davis Silverman
fb67b05506 Removed unneeded conversion to a slice.
Vec<T> can index now so its a useless conversion.
2014-11-20 01:34:14 -05:00
NODA, Kai
102b1a5bf1 test/run-make: some test cases lacked $(EXTRACFLAGS).
Signed-off-by: NODA, Kai <nodakai@gmail.com>
2014-11-20 14:12:57 +08:00