Skip to content

Rollup of 11 pull requests #25870

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8e039a8
Introduce TaggedDocsIterator and use it to implement reader::tagged_d…
Ms2ger May 22, 2015
37dd417
Return TaggedDocsIterator from reader::tagged_docs.
Ms2ger May 24, 2015
16334e5
Add a missing space to the Glossary page of TRPL
maxjacobson May 26, 2015
6c2b340
Improve docs for Vec::as_slice and as_mut_slice
mbrubeck May 27, 2015
d061a0f
floating-point types are machine types, not machine-dependent types
liigo May 28, 2015
2a63cc7
TRPL: Fix Unescaped URL
killercup May 28, 2015
0886b56
Return a TaggedDocsIterator from each_reexport.
Ms2ger May 27, 2015
d0e6396
Document #[repr] on non-C-like enums
May 20, 2015
977d40f
Improve Debug documentation
steveklabnik May 27, 2015
15ab481
removed lonely closing parenthesis
azerupi May 28, 2015
15aeea5
Corrected typo
azerupi May 28, 2015
177531e
Document issue tracker tags
May 27, 2015
19cb2a7
add newline before list in functions-and-methods
dcampbell24 Feb 14, 2015
0670651
Make adjancent code examples more similar
frewsxcv Feb 21, 2015
4d90b4d
Update let.md -- follow whitespace style guideline
dcampbell24 Mar 30, 2015
31a007a
remove extra space from "over" code as well
dcampbell24 Mar 30, 2015
d0744ba
Fix mistake: "to to" -> "to"
nliberg May 23, 2015
adac861
Fix link to newtypes page
nliberg May 23, 2015
4dc051d
Rollup merge of #25651 - bluss:doc-enum-repr, r=alexcrichton
steveklabnik May 29, 2015
0ff640c
Rollup merge of #25760 - Ms2ger:tagged_docs, r=Manishearth
steveklabnik May 29, 2015
420bb7a
Rollup merge of #25788 - maxjacobson:add-missing-space-to-glossary, r…
steveklabnik May 29, 2015
bee08ec
Rollup merge of #25830 - steveklabnik:debug_docs, r=alexcrichton
steveklabnik May 29, 2015
c859337
Rollup merge of #25832 - edunham:document-gh-issue-tags, r=alexcrichton
steveklabnik May 29, 2015
0ebda55
Rollup merge of #25838 - mbrubeck:doc-edit, r=steveklabnik
steveklabnik May 29, 2015
afc3a2e
Rollup merge of #25854 - liigo:patch-1, r=alexcrichton
steveklabnik May 29, 2015
f724d7d
Rollup merge of #25857 - killercup:patch-14, r=steveklabnik
steveklabnik May 29, 2015
47a5f3a
Rollup merge of #25864 - azerupi:patch-1, r=alexcrichton
steveklabnik May 29, 2015
6da2a76
Rollup merge of #25865 - azerupi:patch-2, r=alexcrichton
steveklabnik May 29, 2015
a9d9ff6
Rollup merge of #25866 - jooert:update_guidelines, r=steveklabnik
steveklabnik May 29, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 39 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ feature. We use the 'fork and pull' model described there.
Please make pull requests against the `master` branch.

All pull requests are reviewed by another person. We have a bot,
@rust-highfive, that will automatically assign a random person to review your request.
@rust-highfive, that will automatically assign a random person to review your
request.

If you want to request that a specific person reviews your pull request,
you can add an `r?` to the message. For example, Steve usually reviews
Expand Down Expand Up @@ -124,6 +125,10 @@ To save @bors some work, and to get small changes through more quickly, when
the other rollup-eligible patches too, and they'll get tested and merged at
the same time.

To find documentation-related issues, sort by the [A-docs label][adocs].

[adocs]: https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3AA-docs

## Issue Triage

Sometimes, an issue will stay open, even though the bug has been fixed. And
Expand All @@ -132,8 +137,40 @@ meantime.

It can be helpful to go through older bug reports and make sure that they are
still valid. Load up an older issue, double check that it's still true, and
leave a comment letting us know if it is or is not. The [least recently updated sort][lru] is good for finding issues like this.
leave a comment letting us know if it is or is not. The [least recently
updated sort][lru] is good for finding issues like this.

Contributors with sufficient permissions on the Rust repo can help by adding
labels to triage issues:

* Yellow, **A**-prefixed labels state which **area** of the project an issue
relates to.

* Magenta, **B**-prefixed labels identify bugs which **belong** elsewhere.

* Green, **E**-prefixed labels explain the level of **experience** necessary
to fix the issue.

* Red, **I**-prefixed labels indicate the **importance** of the issue. The
[I-nominated][inom] label indicates that an issue has been nominated for
prioritizing at the next triage meeting.

* Orange, **P**-prefixed labels indicate a bug's **priority**. These labels
are only assigned during triage meetings, and replace the [I-nominated][inom]
label.

* Blue, **T**-prefixed bugs denote which **team** the issue belongs to.

* Dark blue, **beta-** labels track changes which need to be backported into
the beta branches.

* The purple **metabug** label marks lists of bugs collected by other
categories.

If you're looking for somewhere to start, check out the [E-easy][eeasy] tag.

[inom]: https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3AI-nominated
[eeasy]: https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3AE-easy
[lru]: https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-asc

## Out-of-tree Contributions
Expand Down
17 changes: 9 additions & 8 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1892,12 +1892,13 @@ interpreted:

On `enum`s:

- `repr` - on C-like enums, this sets the underlying type used for
representation. Takes one argument, which is the primitive
type this enum should be represented for, or `C`, which specifies that it
should be the default `enum` size of the C ABI for that platform. Note that
enum representation in C is undefined, and this may be incorrect when the C
code is compiled with certain flags.
- `repr` - this sets the underlying type used for representation of the
discriminant. Takes one argument, which is the primitive type this enum
should be represented as, or `C`, which specifies that it should be the
default `enum` size of the C ABI for that platform. Note that enum
representation in C is implementation defined, and this may be incorrect when
the C code is compiled with certain flags. The representation attribute
inhibits elision of the enum discriminant in layout optimizations.

On `struct`s:

Expand Down Expand Up @@ -3255,8 +3256,8 @@ User-defined types have limited capabilities.
The primitive types are the following:

* The boolean type `bool` with values `true` and `false`.
* The machine types.
* The machine-dependent integer and floating-point types.
* The machine types (integer and floating-point).
* The machine-dependent integer types.

#### Machine types

Expand Down
1 change: 1 addition & 0 deletions src/doc/style/features/functions-and-methods/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ for any operation that is clearly associated with a particular
type.

Methods have numerous advantages over functions:

* They do not need to be imported or qualified to be used: all you
need is a value of the appropriate type.
* Their invocation performs autoborrowing (including mutable borrows).
Expand Down
2 changes: 1 addition & 1 deletion src/doc/style/features/functions-and-methods/input.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ fn foo(a: u8) { ... }
Note that
[`ascii::Ascii`](http://static.rust-lang.org/doc/master/std/ascii/struct.Ascii.html)
is a _wrapper_ around `u8` that guarantees the highest bit is zero; see
[newtype patterns]() for more details on creating typesafe wrappers.
[newtype patterns](../types/newtype.md) for more details on creating typesafe wrappers.

Static enforcement usually comes at little run-time cost: it pushes the
costs to the boundaries (e.g. when a `u8` is first converted into an
Expand Down
8 changes: 4 additions & 4 deletions src/doc/style/features/let.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Prefer

```rust
let foo = match bar {
Baz => 0,
Baz => 0,
Quux => 1
};
```
Expand All @@ -44,7 +44,7 @@ over
```rust
let foo;
match bar {
Baz => {
Baz => {
foo = 0;
}
Quux => {
Expand All @@ -61,8 +61,8 @@ conditional expression.
Prefer

```rust
s.iter().map(|x| x * 2)
.collect::<Vec<_>>()
let v = s.iter().map(|x| x * 2)
.collect::<Vec<_>>();
```

over
Expand Down
2 changes: 1 addition & 1 deletion src/doc/style/ownership/builders.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ If `T` is such a data structure, consider introducing a `T` _builder_:
value. When possible, choose a better name: e.g. `Command` is the builder for
`Process`.
2. The builder constructor should take as parameters only the data _required_ to
to make a `T`.
make a `T`.
3. The builder should offer a suite of convenient methods for configuration,
including setting up compound inputs (like slices) incrementally.
These methods should return `self` to allow chaining.
Expand Down
2 changes: 1 addition & 1 deletion src/doc/trpl/conditional-compilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ These can nest arbitrarily:
As for how to enable or disable these switches, if you’re using Cargo,
they get set in the [`[features]` section][features] of your `Cargo.toml`:

[features]: http://doc.crates.io/manifest.html#the-[features]-section
[features]: http://doc.crates.io/manifest.html#the-%5Bfeatures%5D-section

```toml
[features]
Expand Down
2 changes: 1 addition & 1 deletion src/doc/trpl/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ In the example above `x` and `y` have arity 2. `z` has arity 3.

When a compiler is compiling your program, it does a number of different
things. One of the things that it does is turn the text of your program into an
‘abstract syntax tree’, or‘AST’. This tree is a representation of the
‘abstract syntax tree’, or ‘AST’. This tree is a representation of the
structure of your program. For example, `2 + 3` can be turned into a tree:

```text
Expand Down
2 changes: 1 addition & 1 deletion src/doc/trpl/method-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Functions are great, but if you want to call a bunch of them on some data, it
can be awkward. Consider this code:

```rust,ignore
baz(bar(foo)));
baz(bar(foo));
```

We would read this left-to right, and so we see ‘baz bar foo’. But this isn’t the
Expand Down
2 changes: 1 addition & 1 deletion src/doc/trpl/traits.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ fn bar<T, K>(x: T, y: K) where T: Clone, K: Clone + Debug {

fn main() {
foo("Hello", "world");
bar("Hello", "workd");
bar("Hello", "world");
}
```

Expand Down
6 changes: 5 additions & 1 deletion src/libcollections/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,14 +440,18 @@ impl<T> Vec<T> {
}

/// Extracts a slice containing the entire vector.
///
/// Equivalent to `&s[..]`.
#[inline]
#[unstable(feature = "convert",
reason = "waiting on RFC revision")]
pub fn as_slice(&self) -> &[T] {
self
}

/// Deprecated: use `&mut s[..]` instead.
/// Extracts a mutable slice of the entire vector.
///
/// Equivalent to `&mut s[..]`.
#[inline]
#[unstable(feature = "convert",
reason = "waiting on RFC revision")]
Expand Down
44 changes: 44 additions & 0 deletions src/libcore/fmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,50 @@ impl<'a> Display for Arguments<'a> {

/// Format trait for the `:?` format. Useful for debugging, all types
/// should implement this.
///
/// Generally speaking, you should just `derive` a `Debug` implementation.
///
/// # Examples
///
/// Deriving an implementation:
///
/// ```
/// #[derive(Debug)]
/// struct Point {
/// x: i32,
/// y: i32,
/// }
///
/// let origin = Point { x: 0, y: 0 };
///
/// println!("The origin is: {:?}", origin);
/// ```
///
/// Manually implementing:
///
/// ```
/// use std::fmt;
///
/// struct Point {
/// x: i32,
/// y: i32,
/// }
///
/// impl fmt::Debug for Point {
/// fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
/// write!(f, "({}, {})", self.x, self.y)
/// }
/// }
///
/// let origin = Point { x: 0, y: 0 };
///
/// println!("The origin is: {:?}", origin);
/// ```
///
/// There are a number of `debug_*` methods on `Formatter` to help you with manual
/// implementations, such as [`debug_struct`][debug_struct].
///
/// [debug_struct]: ../std/fmt/struct.Formatter.html#method.debug_struct
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_on_unimplemented = "`{Self}` cannot be formatted using `:?`; if it is \
defined in your crate, add `#[derive(Debug)]` or \
Expand Down
34 changes: 20 additions & 14 deletions src/librbml/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,23 +436,29 @@ pub mod reader {
}
}

pub fn tagged_docs<F>(d: Doc, tg: usize, mut it: F) -> bool where
F: FnMut(Doc) -> bool,
{
let mut pos = d.start;
while pos < d.end {
let elt_tag = try_or!(tag_at(d.data, pos), false);
let elt_size = try_or!(tag_len_at(d.data, elt_tag), false);
pos = elt_size.next + elt_size.val;
if elt_tag.val == tg {
let doc = Doc { data: d.data, start: elt_size.next,
end: pos };
if !it(doc) {
return false;
pub fn tagged_docs<'a>(d: Doc<'a>, tag: usize) -> TaggedDocsIterator<'a> {
TaggedDocsIterator {
iter: docs(d),
tag: tag,
}
}

pub struct TaggedDocsIterator<'a> {
iter: DocsIterator<'a>,
tag: usize,
}

impl<'a> Iterator for TaggedDocsIterator<'a> {
type Item = Doc<'a>;

fn next(&mut self) -> Option<Doc<'a>> {
while let Some((tag, doc)) = self.iter.next() {
if tag == self.tag {
return Some(doc);
}
}
None
}
return true;
}

pub fn with_doc_data<T, F>(d: Doc, f: F) -> T where
Expand Down
Loading