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]
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]
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.)
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
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.
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() {}
```
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.
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]
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.
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]`.