Commit Graph

30 Commits

Author SHA1 Message Date
Brian Anderson
fbc93082ec std: Rename slice::Vector to Slice
This required some contortions because importing both raw::Slice
and slice::Slice makes rustc crash.

Since `Slice` is in the prelude, this renaming is unlikely to
casue breakage.

[breaking-change]
2014-08-13 11:30:14 -07:00
Piotr Jawniak
36e1f2db30 Get rid of few warnings in tests 2014-07-21 09:55:04 -07:00
Patrick Walton
6f99a27886 librustc: Implement lifetime elision.
This implements RFC 39. Omitted lifetimes in return values will now be
inferred to more useful defaults, and an error is reported if a lifetime
in a return type is omitted and one of the two lifetime elision rules
does not specify what it should be.

This primarily breaks two uncommon code patterns. The first is this:

    unsafe fn get_foo_out_of_thin_air() -> &Foo {
        ...
    }

This should be changed to:

    unsafe fn get_foo_out_of_thin_air() -> &'static Foo {
        ...
    }

The second pattern that needs to be changed is this:

    enum MaybeBorrowed<'a> {
        Borrowed(&'a str),
        Owned(String),
    }

    fn foo() -> MaybeBorrowed {
        Owned(format!("hello world"))
    }

Change code like this to:

    enum MaybeBorrowed<'a> {
        Borrowed(&'a str),
        Owned(String),
    }

    fn foo() -> MaybeBorrowed<'static> {
        Owned(format!("hello world"))
    }

Closes #15552.

[breaking-change]
2014-07-19 13:10:58 -07:00
bors
8a308b167f auto merge of #15725 : aochagavia/rust/vec, r=alexcrichton
* Deprecated `to_owned` in favor of `to_vec`
* Deprecated `into_owned` in favor of `into_vec`

[breaking-change]
2014-07-18 03:46:23 +00:00
Adolfo Ochagavía
8107ef77f0 Rename functions in the CloneableVector trait
* Deprecated `to_owned` in favor of `to_vec`
* Deprecated `into_owned` in favor of `into_vec`

[breaking-change]
2014-07-17 16:35:48 +02:00
Nick Cameron
aa760a849e deprecate Vec::get 2014-07-17 12:08:31 +12:00
Felix S. Klock II
e64f594f10 Extend --pretty flowgraph=ID to include dataflow results in output.
Use one or more of the following `-Z` flag options to tell the
graphviz renderer to include the corresponding dataflow sets (after
the iterative constraint propagation reaches a fixed-point solution):

  * `-Z flowgraph-print-loans` : loans computed via middle::borrowck
  * `-Z flowgraph-print-moves` : moves computed via middle::borrowck::move_data
  * `-Z flowgraph-print-assigns` : assignments, via middle::borrowck::move_data
  * `-Z flowgraph-print-all` : all of the available sets are included.

Fix #15016.

----

This also adds a module, `syntax::ast_map::blocks`, that captures a
common abstraction shared amongst code blocks and procedure-like
things.  As part of this, moved `ast_map.rs` to subdir
`ast_map/mod.rs`, to follow our directory layout conventions.

(incorporated review feedback from huon, acrichto.)
2014-07-15 12:26:56 +02:00
Brian Anderson
fa2d220567 Update doc URLs for version bump 2014-07-11 11:21:57 -07:00
Alex Crichton
0c71e0c596 Register new snapshots
Closes #15544
2014-07-09 10:57:58 -07:00
Richo Healey
12c334a77b std: Rename the ToStr trait to ToString, and to_str to to_string.
[breaking-change]
2014-07-08 13:01:43 -07:00
Alex Crichton
e44c2b9bbc Add #[crate_name] attributes as necessary 2014-07-05 12:45:42 -07:00
Alex Crichton
ff1dd44b40 Merge remote-tracking branch 'origin/master' into 0.11.0-release
Conflicts:
	src/libstd/lib.rs
2014-07-02 11:08:21 -07:00
Steven Fackler
55cae0a094 Implement RFC#28: Add PartialOrd::partial_cmp
I ended up altering the semantics of Json's PartialOrd implementation.
It used to be the case that Null < Null, but I can't think of any reason
for an ordering other than the default one so I just switched it over to
using the derived implementation.

This also fixes broken `PartialOrd` implementations for `Vec` and
`TreeMap`.

RFC: 0028-partial-cmp
2014-06-29 21:42:09 -07:00
Arjan Topolovec
8fce20c2cb Implementation of common traits for MaybeOwnedVector 2014-06-28 20:28:04 +02:00
Alex Crichton
aa1163b92d Update to 0.11.0 2014-06-27 12:50:16 -07:00
Brian Anderson
77657baf2c Mark all crates except std as experimental 2014-06-17 22:13:36 -07:00
Alex Crichton
3316b1eb7c rustc: Remove ~[T] from the language
The following features have been removed

* box [a, b, c]
* ~[a, b, c]
* box [a, ..N]
* ~[a, ..N]
* ~[T] (as a type)
* deprecated_owned_vector lint

All users of ~[T] should move to using Vec<T> instead.
2014-06-11 15:02:17 -07:00
Richo Healey
1f1b2e42d7 std: Rename strbuf operations to string
[breaking-change]
2014-05-27 12:59:31 -07:00
Richo Healey
553074506e core: rename strbuf::StrBuf to string::String
[breaking-change]
2014-05-24 21:48:10 -07:00
bors
02117dd1bc auto merge of #14357 : huonw/rust/spelling, r=pnkfelix
The span on a inner doc-comment would point to the next token, e.g. the span for the `a` line points to the `b` line, and the span of `b` points to the `fn`.

```rust
//! a
//! b

fn bar() {}
```
2014-05-22 20:56:18 -07:00
Huon Wilson
37bd466e58 Spelling/doc formatting fixes. 2014-05-22 22:55:37 +10:00
Alex Crichton
799ddba8da Change static.rust-lang.org to doc.rust-lang.org
The new documentation site has shorter urls, gzip'd content, and index.html
redirecting functionality.
2014-05-21 19:55:39 -07:00
Patrick Walton
e786a745b5 libgraphviz: Remove all uses of ~str from libgraphviz. 2014-05-14 18:29:12 -07:00
Brian Anderson
c1da4f875f Add the patch number to version strings. Closes #13289 2014-05-12 19:52:29 -07:00
bors
26632d541c auto merge of #13976 : pnkfelix/rust/fsk-fix-13965, r=alexcrichton
Fix #13965.

This commit adopts the second strategy I outlined in #13965, where the bulk of the code is still "smoke tested" (in the sense that rustdoc attempts to run it, sending all of the generated output into a locally allocated `MemWriter`).  The part of the code that is ignored (but included in the presentation) is isolated to a three-line `main` function that invokes the core rendering routine.

In the generated rustdoc output, this leads to a small break between the two code blocks, but I do not think this is a large issue.
2014-05-07 22:01:37 -07:00
Patrick Walton
090040bf40 librustc: Remove ~EXPR, ~TYPE, and ~PAT from the language, except
for `~str`/`~[]`.

Note that `~self` still remains, since I forgot to add support for
`Box<self>` before the snapshot.

How to update your code:

* Instead of `~EXPR`, you should write `box EXPR`.

* Instead of `~TYPE`, you should write `Box<Type>`.

* Instead of `~PATTERN`, you should write `box PATTERN`.

[breaking-change]
2014-05-06 23:12:54 -07:00
Felix S. Klock II
a22413b46a Revise doc-comments for graphviz to avoid generating files from rustdoc runs.
Fix #13965.

There is a dance here between the `main` that actually runs versus the
`main` that is printed in the output documentation.  We don't run the
latter `main`, but we do at least compile (and thus type-check) it.
It is still the responsibility of the documenter to ensure that the
signatures of `fn render` are kept in sync across the blocks.
2014-05-07 00:52:27 +02:00
Felix S. Klock II
67307d4e08 Placate rustdocs testable-by-default code blocks. 2014-05-05 14:31:06 +02:00
Felix S. Klock II
4a122a3185 Updated maybe_owned_vec with review feedback.
Namely:

 * Added conversion traits both to and from the various vector types,
   analogous to how `str::MaybeOwned` works with `str::IntoMaybeOwned`
   and `str::Str`.  This led me to add the `FixedLen` variant of
   `MaybeOwnedVector` for interoperability with `std::slice`.

 * Revised client example code to make use of `into_maybe_owned`

 * Added implementations of `Show` and `CloneableVector` for
   `MaybeOwnedVector`.

 * As suggested by kballard, added `into_vec` method that is analogous
   to `CloneableVector::into_owned` except it produces a `Vec` rather
   than a `~[T]`.
2014-05-02 17:45:17 +02:00
Felix S. Klock II
b7374182f7 Add a graphviz crate for making .dot files to layout and render graphs. 2014-05-02 17:45:09 +02:00