Commit Graph

54390 Commits

Author SHA1 Message Date
Guillaume Gomez
5d6b41f3bc Rollup merge of #34406 - frewsxcv:sleep-ex, r=alexcrichton
Add example for `std:🧵:sleep`.

None
2016-06-28 16:05:14 +02:00
Guillaume Gomez
47ef866f43 Rollup merge of #34328 - wuranbo:patch-1, r=steveklabnik
Traits where syntax's extra usage example more clearly

r? @steveklabnik
2016-06-28 16:05:13 +02:00
Guillaume Gomez
be1c2b9c8c Rollup merge of #34287 - durka:patch-26, r=steveklabnik
update reference for #29734
2016-06-28 16:05:13 +02:00
Guillaume Gomez
cea2438834 Rollup merge of #34080 - royalstream:royalstream-book-june4, r=steveklabnik
Syntax coloring and more compact diagram

Two cosmetic improvements:
- New content was added a few days ago to the **Closures** chapter but it was missing rust's syntax coloring.
- Also, in the **Crates and Modules** chapter, a diagram was improved to be more symmetric and to take less space.
2016-06-28 16:05:12 +02:00
bors
ea0dc92972 Auto merge of #34424 - jseyfried:breaking_batch, r=Manishearth
Batch up libsyntax breaking changes

Batch of the following syntax-[breaking-change] changes:
 - #34213: Add a variant `Macro` to `TraitItemKind`
 - #34368: Merge the variant `QPath` of `PatKind` into the variant `PatKind::Path`
 - #34385: Move `syntax::ast::TokenTree` into a new module `syntax::tokenstream`
 - #33943:
  - Remove the type parameter from `visit::Visitor`
  - Remove `attr::WithAttrs` -- use `attr::HasAttrs` instead.
  - Change `fold_tt`/`fold_tts` to take token trees by value and avoid wrapping token trees in `Rc`.
  - Remove the field `ctxt` of `ast::Mac_`
  - Remove inherent method `attrs()` of types -- use the method `attrs` of `HasAttrs` instead.
 - #34316:
  - Remove `ast::Decl`/`ast::DeclKind` and add variants `Local` and `Item` to `StmtKind`.
  - Move the node id for statements from the `StmtKind` variants to a field of `Stmt` (making `Stmt` a struct instead of an alias for `Spanned<StmtKind>`)
  - Rename `ast::ExprKind::Again` to `Continue`.
 - #34339: Generalize and abstract `ThinAttributes` to `ThinVec<Attribute>`
  - Use `.into()` in convert between `Vec<Attribute>` and `ThinVec<Attribute>`
  - Use autoderef instead of `.as_attr_slice()`
 - #34436: Remove the optional expression from `ast::Block` and instead use a `StmtKind::Expr` at the end of the statement list.
 - #34403: Move errors into a separate crate (unlikely to cause breakage)
2016-06-27 16:42:03 -07:00
Jeffrey Seyfried
360dcae419 Update src/rustc/Cargo.lock 2016-06-27 23:40:04 +00:00
Jeffrey Seyfried
542ba8c5f7 Fix Cargo.tomls 2016-06-27 18:30:46 +00:00
bors
a0f572e98b Auto merge of #34169 - scottcarr:dominator-cache, r=nikomatsakis
[MIR] Add Dominators to MIR and Add Graph Algorithms

~~This PR assumes PR #34149 lands.~~

Add generic graph algorithms to rustc_data_structures.

Add dominators and successors to the ~~cache (that currently only holds predecessors).~~ `Mir`.
2016-06-27 11:12:25 -07:00
Corey Farwell
a7b9e5441b Add example for std:🧵:sleep. 2016-06-27 13:06:20 -04:00
bors
126af085be Auto merge of #34477 - ollie27:patch-1, r=GuillaumeGomez
rustdoc: Fix search result layout for enum variants and struct fields

This was broken in #34234.

For example:
[before](https://doc.rust-lang.org/nightly/std/?search=cow%3A%3Aborrowed) [after](https://ollie27.github.io/rust_doc_test/std/?search=cow%3A%3Aborrowed)
[before](https://doc.rust-lang.org/nightly/std/?search=range%3A%3Astart) [after](https://ollie27.github.io/rust_doc_test/std/?search=range%3A%3Astart)

cc @GuillaumeGomez
2016-06-27 06:43:49 -07:00
bors
f019e381fe Auto merge of #34453 - frewsxcv:regress, r=sanxiyn
Add regression test for #24424.

Fixes https://github.com/rust-lang/rust/issues/24424.
2016-06-27 01:10:49 -07:00
bors
b42884fc64 Auto merge of #34419 - eddyb:virtually-inexistent, r=Aatch
Don't translate vtable methods with Self: Sized bounds.

Fixes #34416.
2016-06-26 22:24:03 -07:00
bors
af2fe634bf Auto merge of #34491 - eddyb:return-in-peace, r=nagisa
Remove the return_address intrinsic.

This intrinsic to get the return pointer was introduced in #16248 / #16081 by @pcwalton for Servo.
However, as explained in #34227, it's impossible to ensure it's used correctly, and it broke with `-Zorbit`.

Servo's usage is being replaced in servo/servo#11872, and I expect nobody else to have abused it.
But I've also started a crater run, just in case this is a `[breaking-change]` for anyone else.
2016-06-26 19:02:12 -07:00
Eduard Burtescu
b30134dbc3 Remove the return_address intrinsic. 2016-06-27 01:47:28 +03:00
bors
3059bb9e38 Auto merge of #34450 - jseyfried:fix_include_path, r=nrc
Revert a change to the relative path for macro-expanded `include!`s

Fixes #34431 (c.f. discussion in that issue).
r? @nrc
2016-06-26 14:50:27 -07:00
bors
15e8a67c47 Auto merge of #34469 - frewsxcv:path-components, r=GuillaumeGomez
Indicate how the `std::path::Components` struct is created.

None
2016-06-25 22:06:35 -07:00
bors
c12eb1d7a2 Auto merge of #34468 - frewsxcv:doc-links, r=GuillaumeGomez
Add hyperlinks to `std::fs` functions from `std::path`.

None
2016-06-25 19:24:29 -07:00
Jeffrey Seyfried
9bb3ea0feb Rollup merge of #34436 - jseyfried:no_block_expr, r=eddyb
To allow these braced macro invocation, this PR removes the optional expression from `ast::Block` and instead uses a `StmtKind::Expr` at the end of the statement list.

Currently, braced macro invocations in blocks can expand into statements (and items) except when they are last in a block, in which case they can only expand into expressions.

For example,
```rust
macro_rules! make_stmt {
    () => { let x = 0; }
}

fn f() {
    make_stmt! {} //< This is OK...
    let x = 0; //< ... unless this line is commented out.
}
```

Fixes #34418.
2016-06-26 02:20:14 +00:00
Jeffrey Seyfried
8eddf02800 Rollup merge of #34339 - jseyfried:thin_vec, r=petrochenkov,Manishearth
Generalize and abstract `ThinAttributes` to `ThinVec<Attribute>`.
2016-06-26 02:18:43 +00:00
Jeffrey Seyfried
8748cd92d0 Rollup merge of #34316 - jseyfried:refactor_ast_stmt, r=eddyb
Refactor away `ast::Decl`, refactor `ast::Stmt`, and rename `ast::ExprKind::Again` to `ast::ExprKind::Continue`.
2016-06-26 02:17:27 +00:00
Jeffrey Seyfried
33ea1e330c Rollup merge of #33943 - jseyfried:libsyntax_cleanup, r=nrc
Miscellaneous low priority cleanup in `libsyntax`.
2016-06-26 02:15:04 +00:00
Jeffrey Seyfried
82a15a6a0a Rollup merge of #34385 - cgswords:tstream, r=nrc
syntax-[breaking-change] cc #31645
(Only breaking because ast::TokenTree is now tokenstream::TokenTree.)

This pull request refactors TokenTrees into their own file as src/libsyntax/tokenstream.rs, moving them out of src/libsyntax/ast.rs, in order to prepare for an accompanying TokenStream implementation (per RFC 1566).
2016-06-26 02:11:59 +00:00
bors
2cfd91d0ce Auto merge of #34465 - frewsxcv:builder-name-example, r=GuillaumeGomez
Add doc example for `std:🧵:Builder::name`.

None
2016-06-25 15:47:31 -07:00
Jeffrey Seyfried
d3ae56d755 Rollup merge of #34403 - jonathandturner:move_liberror, r=alexcrichton
This PR refactors the 'errors' part of libsyntax into its own crate (librustc_errors).  This is the first part of a few refactorings to simplify error reporting and potentially support more output formats (like a standardized JSON output and possibly an --explain mode that can work with the user's code), though this PR stands on its own and doesn't assume further changes.

As part of separating out the errors crate, I have also refactored the code position portion of codemap into its own crate (libsyntax_pos).  While it's helpful to have the common code positions in a separate crate for the new errors crate, this may also enable further simplifications in the future.
2016-06-25 22:35:09 +00:00
Jeffrey Seyfried
4e2e31c118 Rollup merge of #34368 - petrochenkov:astqpath, r=Manishearth
The AST part of https://github.com/rust-lang/rust/pull/34365

plugin-[breaking-change] cc https://github.com/rust-lang/rust/issues/31645
2016-06-25 22:35:06 +00:00
Jeffrey Seyfried
f0310e061b Rollup merge of #34213 - josephDunne:trait_item_macros, r=jseyfried
**syntax-[breaking-change]** cc #31645
New `TraitItemKind::Macro` variant

This change adds support for macro expansion inside trait items by adding the new `TraitItemKind::Macro` and associated parsing code.
2016-06-25 22:35:01 +00:00
Oliver Middleton
27e4ecd721 rustdoc: Fix search result layout for enum variants and struct fields 2016-06-25 23:24:10 +01:00
bors
91c0d04943 Auto merge of #34410 - frewsxcv:code-like, r=apasel422
Parameters in doc comment should be formatted code-like.

None
2016-06-25 13:01:31 -07:00
Corey Farwell
f300fafccd Indicate how the std::path::Components struct is created. 2016-06-25 10:05:01 -04:00
bors
b8214dc6c6 Auto merge of #34464 - Manishearth:rollup, r=Manishearth
Rollup of 8 pull requests

- Successful merges: #34379, #34406, #34411, #34414, #34435, #34438, #34445, #34449
- Failed merges:
2016-06-25 06:45:07 -07:00
Corey Farwell
c55f0922aa Add hyperlinks to std::fs functions from std::path. 2016-06-25 09:26:41 -04:00
Manish Goregaokar
77b6a647bc Rollup merge of #34449 - regexident:ast_docs, r=steveklabnik
Improve `syntax::ast::*` type docs (examples, etc)

An attempt at making the public types in `syntax::ast` a bit more approachable.

[#rust-doc-days](https://facility9.com/2016/06/announcing-rust-doc-days/)
2016-06-25 18:16:40 +05:30
Manish Goregaokar
c6856d964f Rollup merge of #34445 - pyjarrett:lang_item_table_macro_rename, r=jseyfried
Renames "lets_do_this" macro more appropriately.

The macro gets used to create a mapping of identifiers to names and their
associated functions. Since it creates a table of language items, let's rename
it in a similar manner to how vec! creates a vec.
2016-06-25 18:16:40 +05:30
Manish Goregaokar
80b352c892 Rollup merge of #34438 - frewsxcv:joinhandle, r=GuillaumeGomez
Indicate how the `JoinHandle` struct is created.

None
2016-06-25 18:16:40 +05:30
Manish Goregaokar
bb12a53059 Rollup merge of #34435 - sanxiyn:typo, r=apasel422
Fix typo in future incompatible lint

Found in release triage.
2016-06-25 18:16:40 +05:30
Manish Goregaokar
1ac83cf031 Rollup merge of #34414 - alfiedotwtf:patch-1, r=steveklabnik
Switched tense to clarify what is happening in the example
2016-06-25 18:16:39 +05:30
Manish Goregaokar
1f7a71b2b7 Rollup merge of #34411 - Vogtinator:patch-1, r=sanxiyn
Fix typo in bootstrap README

"boostrap" instead of "bootstrap"
2016-06-25 18:16:39 +05:30
Manish Goregaokar
865a32860f Rollup merge of #34379 - liigo:patch-11, r=GuillaumeGomez
Improve diagnostics E0425: `use` (public) name

E0425: unresolved name
2016-06-25 18:16:39 +05:30
Corey Farwell
0abee313c6 Add regression test for #24424.
Fixes https://github.com/rust-lang/rust/issues/24424.
2016-06-25 07:31:05 -04:00
Corey Farwell
fd388d40ed Add doc example for std:🧵:Builder::name. 2016-06-25 07:22:19 -04:00
bors
35004b42bc Auto merge of #34452 - frewsxcv:unwrap-or, r=alexcrichton
Use `Option::expect` instead of `unwrap_or_else` with `panic!`.

None
2016-06-24 23:14:12 -07:00
bors
c128e9bb2e Auto merge of #34441 - tbu-:pr_dont_ignore_errors, r=alexcrichton
Don't ignore errors of syscalls in std::sys::unix::fd

If any of these syscalls fail, it indicates a programmer error that
should not be silently ignored.
2016-06-24 18:28:23 -07:00
Jonathan Turner
bc1400600b reexport errors from syntax. fix failing cfail test 2016-06-24 19:10:15 -04:00
bors
d011290e39 Auto merge of #34401 - GuillaumeGomez:err-codes, r=brson
Add error code flags

r? @brson

cc @steveklabnik
cc @jonathandturner
2016-06-24 15:42:13 -07:00
bors
dc9112f65b Auto merge of #34439 - ollie27:rustdoc_panic_fix, r=alexcrichton
rustdoc: Fix panic caused by doc(hidden) trait methods

Fixes: #34423

r? @alexcrichton
2016-06-24 12:57:29 -07:00
Jonathan Turner
9f2a50785b Fix codemap tests to not double import 2016-06-24 13:20:23 -04:00
Corey Farwell
5e9b75e2dd Add examples in docs for JoinHandle. 2016-06-24 12:25:26 -04:00
Vincent Esche
32ef89061e Improve syntax::ast::* type docs (examples, etc) 2016-06-24 18:24:45 +02:00
bors
4b89debc7b Auto merge of #34425 - tbu-:pr_len_instead_of_size_hint, r=alexcrichton
Use `len` instead of `size_hint` where appropiate

This makes it clearer that we're not just looking for a lower bound but
rather know that the iterator is an `ExactSizeIterator`.
2016-06-24 09:03:54 -07:00
Jonathan Turner
f5259ab955 Reexport syntax_pos in codemap and fix some cfail tests 2016-06-24 09:05:28 -04:00