Commit Graph

1259 Commits

Author SHA1 Message Date
bors
d5798b3902 auto merge of #10972 : metajack/rust/pkgid-with-name, r=alexcrichton
This change extends the pkgid attribute to allow of explicit crate names, instead of always inferring them based on the path. This means that if your GitHub repo is called `rust-foo`, you can have your pkgid set your library name to `foo`. You'd do this with a pkgid attribute like `github.com/somewhere/rust-foo#foo:1.0`.

This is half of the fix for #10922.
2013-12-17 07:41:40 -08:00
Jack Moffitt
262cc4a2bc Update docs to new syntax. 2013-12-17 07:41:39 -07:00
bors
47c9a35747 auto merge of #10830 : alexcrichton/rust/spsc-queue, r=brson
This pull request completely rewrites std::comm and all associated users. Some major bullet points

* Everything now works natively
* oneshots have been removed
* shared ports have been removed
* try_recv no longer blocks (recv_opt blocks)
* constructors are now Chan::new and SharedChan::new
* failure is propagated on send
* stream channels are 3x faster

I have acquired the following measurements on this patch. I compared against Go, but remember that Go's channels are fundamentally different than ours in that sends are by-default blocking. This means that it's not really a totally fair comparison, but it's good to see ballpark numbers for anyway

```
          oneshot         stream          shared1
std         2.111           3.073          1.730 
my          6.639           1.037          1.238 
native      5.748           1.017          1.250 
go8         1.774           3.575          2.948 
go8-inf     slow            0.837          1.376 
go8-128     4.832           1.430          1.504 
go1         1.528           1.439          1.251 
go2         1.753           3.845          3.166 
```

I had three benchmarks:

* oneshot - N times, create a "oneshot channel", send on it, then receive on it (no task spawning)
* stream - N times, send from one task to another task, wait for both to complete
* shared1 - create N threads, each of which sends M times, and a port receives N*M times.

The rows are as follows:

* `std` - the current libstd implementation (before this pull request)
* `my` - this pull request's implementation (in M:N mode)
* `native` - this pull request's implementation (in 1:1 mode)
* `goN` - go's implementation with GOMAXPROCS=N. The only relevant value is 8 (I had 8 cores on this machine)
* `goN-X` - go's implementation where the channels in question were created with buffers of size `X` to behave more similarly to rust's channels.
2013-12-17 01:16:43 -08:00
Alex Crichton
39a6c9d637 Test fallout from std::comm rewrite 2013-12-16 22:55:49 -08:00
Patrick Walton
865701787c doc: Update the documentation to describe the Pod trait. 2013-12-16 22:38:02 -08:00
bors
9eb89a6c6e auto merge of #10982 : ezyang/rust/lvalue-def, r=pcwalton
Based off of Niko's proposed definition of lvalues.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
2013-12-15 15:16:28 -08:00
Huon Wilson
164f7a290e std::vec: convert to(_mut)_ptr to as_... methods on &[] and &mut []. 2013-12-15 23:37:41 +11:00
Edward Z. Yang
b1b905f30b Correct definition of lvalues, fixes #10890
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
2013-12-15 20:31:05 +08:00
Huon Wilson
f53292f7ee Move std::{str,vec}::raw::set_len to an unsafe method on Owned{Vector,Str}. 2013-12-15 23:05:30 +11:00
bors
53d1a67bbd auto merge of #10944 : metajack/rust/pkgid-docs, r=cmr 2013-12-14 08:11:29 -08:00
bors
fbbadae80f auto merge of #10849 : adridu59/rust/patch-css, r=alexcrichton
rustdoc:
- fix search-bar layout

doc: CSS:
- switch to native pandoc toc depth
- rm some dead code
- clamp width to be readable (we're not Wikipedia!)
- don't background-color titles, it's bloating
- make syntax-highlighting colors inline with rust-lang.org
- space indents

@alexcrichton
2013-12-13 14:21:35 -08:00
Adrien Tétar
1999b25310 doc: CSS changes + commit improved favicon 2013-12-13 21:50:26 +01:00
bors
ae3078ca25 auto merge of #10913 : cmr/rust/rustdoc_man, r=huonw
Clarify that it's sundown, and that we don't support magic
2013-12-13 11:31:57 -08:00
Jack Moffitt
da9a02a189 Update documentation for new pkgid attribute. 2013-12-12 15:22:23 -07:00
Erik Price
5731ca3078 Make 'self lifetime illegal.
Also remove all instances of 'self within the codebase.

This fixes #10889.
2013-12-11 10:54:06 -08:00
Corey Richardson
f0867e0ba2 Some rustdoc manual fixes
Clarify that it's sundown, and that we don't support magic
2013-12-11 06:47:05 -05:00
kud1ing
e08c936120 proto is gone
The following files need to be adjusted, too (i can't do it now):
- doc/po/ja/rust.md.po
- doc/po/rust.md.pot
2013-12-11 06:47:05 -05:00
bors
5aad292fb9 auto merge of #10880 : cmr/rust/tut++, r=pnkfelix
Many of them are small. Will squash on request, but I feel like it's easier
for everyone (easier to see and back out individual changes) this way.
2013-12-10 12:51:22 -08:00
Corey Richardson
c935a88a97 Remove duplication of libstd docs.
This is literally a copy-paste, there's no need to have this duplication.
2013-12-10 09:46:40 -05:00
Corey Richardson
c8f47db8f5 Update Freeze information 2013-12-10 09:43:36 -05:00
Corey Richardson
fab5624eb6 Tiny fixes to linked list section. 2013-12-10 09:43:36 -05:00
Corey Richardson
a44852a2d5 Update Owned to Send, show some types which aren't 2013-12-10 09:43:36 -05:00
Corey Richardson
888144c98d Function declaration takes pats, not exprs. 2013-12-10 09:43:36 -05:00
Corey Richardson
b5122c52ae Clarify newtype 2013-12-10 09:43:36 -05:00
Corey Richardson
d9eff8de8a Clarify arity 2013-12-10 09:43:36 -05:00
Corey Richardson
2750adb5d8 Inherited mutabilty clarification
Also no longer reference mutable fields
2013-12-10 09:43:36 -05:00
Corey Richardson
381c08bf69 loop -> continue 2013-12-10 09:43:36 -05:00
Corey Richardson
f006a10b1e Wildcard changes. 2013-12-10 09:43:35 -05:00
Corey Richardson
079ea00d23 Macro definition is feature gated. 2013-12-10 09:43:35 -05:00
Corey Richardson
eb8739f4f8 Fix tiny formatting error. 2013-12-10 09:43:35 -05:00
Corey Richardson
0f82cbd19a Clarify as, mention transmute. 2013-12-10 09:43:35 -05:00
Corey Richardson
d00a407e00 Clarify that strings aren't magical. 2013-12-10 09:43:35 -05:00
Corey Richardson
b6cf5f5af1 Fix tiny formatting error. 2013-12-10 09:43:35 -05:00
Corey Richardson
94e0a03f5d Add rustdoc documentation. 2013-12-10 09:43:33 -05:00
bors
487e58cca2 auto merge of #10882 : jhasse/rust/patch-1, r=metajack
typo
2013-12-10 05:26:35 -08:00
Corey Richardson
039a5933fb Fix grammar error. 2013-12-10 07:28:24 -05:00
Corey Richardson
d86f8b2fca Add a link to the wiki's package list and refer to git 2013-12-10 07:28:24 -05:00
Corey Richardson
8ae340a026 Note that Rust can be embedded. 2013-12-10 07:28:24 -05:00
Corey Richardson
61e8268645 Fix span. 2013-12-10 07:28:24 -05:00
Corey Richardson
8a8cccd4b6 Explain potentially confusing string example.
Reported be @ElBaha
2013-12-10 07:28:24 -05:00
Edward Z. Yang
b3e54d5991 Add some more commentary to FFI tutorial.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
2013-12-09 21:24:47 -08:00
Jan Niklas Hasse
6de5b7ab1e Add missing .com 2013-12-09 17:40:10 +01:00
Daniel Micay
c1eb20b5f8 rewrite part of the tutorial
This begins a rewrite of some sections the tutorial as an introduction
to concepts through the implementation of a simple data structure. I
think this would be a good way to introduce references, traits and many
other concepts too. For example, the section introducing alternatives to
ownership can demonstrate a persistent list.
2013-12-04 16:55:03 -05:00
bors
f1ef36ea2f auto merge of #10773 : jvns/rust/patch-1, r=cmr
The section on closure types was missing, so I added one. I'm new to Rust, so there are probably important things to say about closure types that I'm missing here.

I tested the example with the latest Rust nightly.
2013-12-02 23:32:33 -08:00
Julia Evans
94c02af873 Add section on closure types to manual 2013-12-02 14:39:11 -05:00
Alex Crichton
d4c40b519b Bring the linkage documentation up-to-date
This includes documentation for all the previous changes done to linking
in #10582. Additionally, this brings the list of feature-gates up-to-date with
the currently recognized list of features.
2013-12-02 11:10:40 -08:00
Alex Crichton
e338a4154b Add generation of static libraries to rustc
This commit implements the support necessary for generating both intermediate
and result static rust libraries. This is an implementation of my thoughts in
https://mail.mozilla.org/pipermail/rust-dev/2013-November/006686.html.

When compiling a library, we still retain the "lib" option, although now there
are "rlib", "staticlib", and "dylib" as options for crate_type (and these are
stackable). The idea of "lib" is to generate the "compiler default" instead of
having too choose (although all are interchangeable). For now I have left the
"complier default" to be a dynamic library for size reasons.

Of the rust libraries, lib{std,extra,rustuv} will bootstrap with an
rlib/dylib pair, but lib{rustc,syntax,rustdoc,rustpkg} will only be built as a
dynamic object. I chose this for size reasons, but also because you're probably
not going to be embedding the rustc compiler anywhere any time soon.

Other than the options outlined above, there are a few defaults/preferences that
are now opinionated in the compiler:

* If both a .dylib and .rlib are found for a rust library, the compiler will
  prefer the .rlib variant. This is overridable via the -Z prefer-dynamic option
* If generating a "lib", the compiler will generate a dynamic library. This is
  overridable by explicitly saying what flavor you'd like (rlib, staticlib,
  dylib).
* If no options are passed to the command line, and no crate_type is found in
  the destination crate, then an executable is generated

With this change, you can successfully build a rust program with 0 dynamic
dependencies on rust libraries. There is still a dynamic dependency on
librustrt, but I plan on removing that in a subsequent commit.

This change includes no tests just yet. Our current testing
infrastructure/harnesses aren't very amenable to doing flavorful things with
linking, so I'm planning on adding a new mode of testing which I believe belongs
as a separate commit.

Closes #552
2013-11-29 18:36:13 -08:00
Alex Crichton
ab387a6838 Register new snapshots 2013-11-28 20:27:56 -08:00
Corey Richardson
b50b162884 Be more strict about doc comments
Previously, `//// foo` and `/*** foo ***/` were accepted as doc comments. This
changes that, so that only `/// foo` and `/** foo ***/` are accepted. This
confuses many newcomers and it seems weird.

Also update the manual for these changes, and modernify the EBNF for comments.

Closes #10638
2013-11-27 18:00:50 -05:00
bors
35ebf03489 auto merge of #10312 : thestinger/rust/thread_local, r=alexcritchton
This provides a building block for fast thread-local storage. It does
not change the safety semantics of `static mut`.

Closes #10310
2013-11-26 13:32:43 -08:00