]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoRollup merge of #34536 - ollie27:rustdoc_module_impls, r=alexcrichton
Manish Goregaokar [Wed, 29 Jun 2016 15:51:23 +0000 (21:21 +0530)]
Rollup merge of #34536 - ollie27:rustdoc_module_impls, r=alexcrichton

rustdoc: Fix empty Implementations section on some module pages

These are caused by `DefaultImpl`s.

For example [`core::marker`](https://doc.rust-lang.org/nightly/core/marker/#impls).

8 years agoRollup merge of #34513 - ollie27:rustdoc_stripped, r=alexcrichton
Manish Goregaokar [Wed, 29 Jun 2016 15:51:23 +0000 (21:21 +0530)]
Rollup merge of #34513 - ollie27:rustdoc_stripped, r=alexcrichton

rustdoc: Fix a few stripping issues

We need to recurse into stripped modules to strip things like impl methods
but when doing so we must not add any items to the `retained` set.

For example this removes [`core::num::ParseFloatError::__description`](https://doc.rust-lang.org/nightly/core/num/struct.ParseFloatError.html#method.__description) and [`impl Clone for ThreadRng`](https://doc.rust-lang.org/nightly/std/clone/trait.Clone.html).

8 years agoRollup merge of #34499 - michaelwoerister:lldb-blacklist, r=alexcrichton
Manish Goregaokar [Wed, 29 Jun 2016 15:51:23 +0000 (21:21 +0530)]
Rollup merge of #34499 - michaelwoerister:lldb-blacklist, r=alexcrichton

Disable debuginfo tests for a given blacklist of LLDB versions

Anyone having trouble with most LLDB tests failing on OSX, please report your LLDB version here so I can add it to the blacklist.

Blacklisted versions so far:
* lldb-350.*

cc @rust-lang/tools
cc @tedhorst @indutny @jonathandturner (people from the original bug report)

Fixes #32520.

8 years agoRollup merge of #34497 - oli-obk:double_negation, r=eddyb
Manish Goregaokar [Wed, 29 Jun 2016 15:51:22 +0000 (21:21 +0530)]
Rollup merge of #34497 - oli-obk:double_negation, r=eddyb

Revert "skip double negation in const eval"

This reverts commit 735c018974e5570ea13fd887aa70a011a5b8e7b8.

fixes #34395

The original commit was based on a mis-understanding of the overflowing literal lint.

This needs to be ported to beta.

r? @eddyb

8 years agoRollup merge of #34495 - jseyfried:only_ident_macro_invocations, r=eddyb
Manish Goregaokar [Wed, 29 Jun 2016 15:51:22 +0000 (21:21 +0530)]
Rollup merge of #34495 - jseyfried:only_ident_macro_invocations, r=eddyb

Forbid type parameters and global paths in macro invocations

Fixes #28558.
This is a [breaking-change]. For example, the following would break:
```rust
macro_rules! m { () => { () } }
fn main() {
    m::<T>!(); // Type parameters are no longer allowed in macro invocations
    ::m!(); // Global paths are no longer allowed in macro invocations
}
```
Any breakage can be fixed by removing the type parameters or the leading `::` (respectively).

r? @eddyb

8 years agoRollup merge of #34467 - GuillaumeGomez:err-codes, r=brson
Manish Goregaokar [Wed, 29 Jun 2016 15:51:22 +0000 (21:21 +0530)]
Rollup merge of #34467 - GuillaumeGomez:err-codes, r=brson

Add new error codes and improve some explanations

r? @brson

cc @steveklabnik
cc @jonathandturner

8 years agoRollup merge of #34460 - dsprenkels:issue-33455, r=alexcrichton
Manish Goregaokar [Wed, 29 Jun 2016 15:51:21 +0000 (21:21 +0530)]
Rollup merge of #34460 - dsprenkels:issue-33455, r=alexcrichton

Add regression test for #33455

Closes #33455.

8 years agoRollup merge of #34459 - jseyfried:expansion_cleanup, r=nrc
Manish Goregaokar [Wed, 29 Jun 2016 15:51:21 +0000 (21:21 +0530)]
Rollup merge of #34459 - jseyfried:expansion_cleanup, r=nrc

Miscellaneous macro expansion cleanup and groundwork

r? @nrc

8 years agoRollup merge of #34446 - jseyfried:refactor_decorators, r=nrc
Manish Goregaokar [Wed, 29 Jun 2016 15:51:21 +0000 (21:21 +0530)]
Rollup merge of #34446 - jseyfried:refactor_decorators, r=nrc

Treat `MultiDecorator`s as a special case of `MultiModifier`s

This deals with #32950 by using @durka's [option 1](https://github.com/rust-lang/rust/pull/33769#issuecomment-221774136).
r? @nrc

8 years agoRollup merge of #34355 - jseyfried:paren_expression_ids_nonunique, r=nrc
Manish Goregaokar [Wed, 29 Jun 2016 15:51:21 +0000 (21:21 +0530)]
Rollup merge of #34355 - jseyfried:paren_expression_ids_nonunique, r=nrc

Give `ast::ExprKind::Paren` no-op expressions the same ids as their children.

Having `ast::ExprKind::Paren` expressions share ids with their children
 - reduces the number of unused `NodeId`s in the hir map and
 - guarantees that `tcx.map.expect_expr(ast_expr.id)` is the hir corresponding to `ast_expr`.

This fixes the bug from #34327, which was introduced in #33296 when I assumed the above guarantee.

r? @nrc

8 years agoGive `ast::ExprKind::Paren` no-op expressions the same node ids as their children.
Jeffrey Seyfried [Sun, 19 Jun 2016 02:00:11 +0000 (02:00 +0000)]
Give `ast::ExprKind::Paren` no-op expressions the same node ids as their children.

8 years agoRefactor away `parser.commit_stmt_expecting()`
Jeffrey Seyfried [Wed, 29 Jun 2016 06:40:05 +0000 (06:40 +0000)]
Refactor away `parser.commit_stmt_expecting()`

8 years agoTreat `MultiDecorator`s as a special case of `MultiModifier`s
Jeffrey Seyfried [Fri, 24 Jun 2016 03:25:37 +0000 (03:25 +0000)]
Treat `MultiDecorator`s as a special case of `MultiModifier`s

8 years agoDisallow `derive` on items with type macros
Jeffrey Seyfried [Fri, 24 Jun 2016 03:23:44 +0000 (03:23 +0000)]
Disallow `derive` on items with type macros

8 years agorustdoc: Fix empty Implementations section on some module pages
Oliver Middleton [Tue, 28 Jun 2016 21:50:44 +0000 (22:50 +0100)]
rustdoc: Fix empty Implementations section on some module pages

These are caused by `DefaultImpl`s.

8 years agoAuto merge of #34519 - alexcrichton:fix-nightlies, r=brson
bors [Tue, 28 Jun 2016 18:52:36 +0000 (11:52 -0700)]
Auto merge of #34519 - alexcrichton:fix-nightlies, r=brson

Try to fix the nightlies

They look to be failing right after the CMake PR landed. I've diagnosed and confirmed the first issue fixed, the second is a bit of a shot in the dark to see if it fixes things.

8 years agoAuto merge of #34525 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Tue, 28 Jun 2016 14:48:56 +0000 (07:48 -0700)]
Auto merge of #34525 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 13 pull requests

- Successful merges: #34080, #34287, #34328, #34406, #34415, #34442, #34462, #34471, #34475, #34479, #34517, #34518, #34524
- Failed merges: #33951

8 years agoRollup merge of #34524 - frewsxcv:std-io-sink, r=GuillaumeGomez
Guillaume Gomez [Tue, 28 Jun 2016 14:05:16 +0000 (16:05 +0200)]
Rollup merge of #34524 - frewsxcv:std-io-sink, r=GuillaumeGomez

Add doc example for `std::io::sink`.

None

8 years agoRollup merge of #34518 - frewsxcv:io-repeat, r=GuillaumeGomez
Guillaume Gomez [Tue, 28 Jun 2016 14:05:16 +0000 (16:05 +0200)]
Rollup merge of #34518 - frewsxcv:io-repeat, r=GuillaumeGomez

Add doc example for `std::io::repeat`.

None

8 years agoRollup merge of #34517 - frewsxcv:empty, r=GuillaumeGomez
Guillaume Gomez [Tue, 28 Jun 2016 14:05:16 +0000 (16:05 +0200)]
Rollup merge of #34517 - frewsxcv:empty, r=GuillaumeGomez

Minor rewrite of `std::io::empty` doc example.

None

8 years agoRollup merge of #34479 - ollie27:rustdoc_renamed_reexport_list, r=GuillaumeGomez
Guillaume Gomez [Tue, 28 Jun 2016 14:05:15 +0000 (16:05 +0200)]
Rollup merge of #34479 - ollie27:rustdoc_renamed_reexport_list, r=GuillaumeGomez

rustdoc: Fix inlined renamed reexports in import lists

Fixes #34473

8 years agoRollup merge of #34475 - frewsxcv:path-component, r=GuillaumeGomez
Guillaume Gomez [Tue, 28 Jun 2016 14:05:15 +0000 (16:05 +0200)]
Rollup merge of #34475 - frewsxcv:path-component, r=GuillaumeGomez

Expand `std::path::Component` documentation.

Indicate how it gets created and add an example.

8 years agoRollup merge of #34471 - GuillaumeGomez:fix_expl, r=steveklabnik
Guillaume Gomez [Tue, 28 Jun 2016 14:05:15 +0000 (16:05 +0200)]
Rollup merge of #34471 - GuillaumeGomez:fix_expl, r=steveklabnik

Fix E0269 error explanation

r? @steveklabnik

8 years agoRollup merge of #34462 - dns2utf8:leading_zeros, r=GuillaumeGomez
Guillaume Gomez [Tue, 28 Jun 2016 14:05:15 +0000 (16:05 +0200)]
Rollup merge of #34462 - dns2utf8:leading_zeros, r=GuillaumeGomez

Add example with leading zeros

I was searching for this format very long. So I added an example to the prominent section.

I was thinking of putting the keyword leading in the corresponding section as well, what do you think?

r? @steveklabnik

8 years agoRollup merge of #34442 - tatsuya6502:doc-book-ownership, r=steveklabnik
Guillaume Gomez [Tue, 28 Jun 2016 14:05:14 +0000 (16:05 +0200)]
Rollup merge of #34442 - tatsuya6502:doc-book-ownership, r=steveklabnik

[doc] Fix links in Ownership section of the book

- Add a missing link definition for `[i32]`.
- Like `[stack]` link is pointing to `...#the-stack`, append `#the-heap` to `[heap]` link.

8 years agoRollup merge of #34415 - ollie27:docs_float, r=steveklabnik
Guillaume Gomez [Tue, 28 Jun 2016 14:05:14 +0000 (16:05 +0200)]
Rollup merge of #34415 - ollie27:docs_float, r=steveklabnik

Use the correct types in float examples

r? @steveklabnik

8 years agoRollup merge of #34406 - frewsxcv:sleep-ex, r=alexcrichton
Guillaume Gomez [Tue, 28 Jun 2016 14:05:14 +0000 (16:05 +0200)]
Rollup merge of #34406 - frewsxcv:sleep-ex, r=alexcrichton

Add example for `std::thread::sleep`.

None

8 years agoRollup merge of #34328 - wuranbo:patch-1, r=steveklabnik
Guillaume Gomez [Tue, 28 Jun 2016 14:05:13 +0000 (16:05 +0200)]
Rollup merge of #34328 - wuranbo:patch-1, r=steveklabnik

Traits where syntax's extra usage example more clearly

r? @steveklabnik

8 years agoRollup merge of #34287 - durka:patch-26, r=steveklabnik
Guillaume Gomez [Tue, 28 Jun 2016 14:05:13 +0000 (16:05 +0200)]
Rollup merge of #34287 - durka:patch-26, r=steveklabnik

update reference for #29734

8 years agoRollup merge of #34080 - royalstream:royalstream-book-june4, r=steveklabnik
Guillaume Gomez [Tue, 28 Jun 2016 14:05:12 +0000 (16:05 +0200)]
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.

8 years agoAdd doc example for `std::io::sink`.
Corey Farwell [Tue, 28 Jun 2016 12:22:34 +0000 (08:22 -0400)]
Add doc example for `std::io::sink`.

8 years agogroundwork: create the `Resolver` earlier in phase 2
Jeffrey Seyfried [Wed, 22 Jun 2016 01:55:42 +0000 (01:55 +0000)]
groundwork: create the `Resolver` earlier in phase 2

8 years agogroundwork: refactor the interface that `resolve` exposes to `driver`
Jeffrey Seyfried [Wed, 22 Jun 2016 01:54:34 +0000 (01:54 +0000)]
groundwork: refactor the interface that `resolve` exposes to `driver`

8 years agocleanup: refactor away `ast::NodeIdAssigner`
Jeffrey Seyfried [Wed, 22 Jun 2016 01:16:56 +0000 (01:16 +0000)]
cleanup: refactor away `ast::NodeIdAssigner`

8 years agogroundwork: use `resolve_identifier` instead of `resolve_path` to classify ident...
Jeffrey Seyfried [Sun, 19 Jun 2016 22:32:51 +0000 (22:32 +0000)]
groundwork: use `resolve_identifier` instead of `resolve_path` to classify ident patterns

8 years agocleanup: use `DummyResult` to implement `MacroGenerable::dummy`
Jeffrey Seyfried [Fri, 17 Jun 2016 11:02:42 +0000 (11:02 +0000)]
cleanup: use `DummyResult` to implement `MacroGenerable::dummy`

8 years agocleanup: don't count attributes on an item in a statement position as on the statement
Jeffrey Seyfried [Tue, 14 Jun 2016 06:48:24 +0000 (06:48 +0000)]
cleanup: don't count attributes on an item in a statement position as on the statement

8 years agoMinor rewrite of `std::io::empty` doc example.
Corey Farwell [Tue, 28 Jun 2016 01:13:26 +0000 (21:13 -0400)]
Minor rewrite of `std::io::empty` doc example.

Remove unnecessary hidden `foo` function.
Demonstrate this emptiness of the resulting string.
Combine imports.

8 years agomk: Make some LLVM building support more robust
Alex Crichton [Tue, 28 Jun 2016 01:59:55 +0000 (18:59 -0700)]
mk: Make some LLVM building support more robust

* Implement the clean-llvm target for those cases where makefiles are being used
* Have all cross-compiled LLVMs depend on the **host** LLVM as they'll require
  the llvm-tablegen executable from there

8 years agorustbuild: Update how compiler-rt is called
Alex Crichton [Tue, 28 Jun 2016 01:53:17 +0000 (18:53 -0700)]
rustbuild: Update how compiler-rt is called

Looks like compiler-rt has been tweaked slightly during the last update,
propagate these changes to rustbuild as well.

8 years agoAdd doc example for `std::io::repeat`.
Corey Farwell [Tue, 28 Jun 2016 01:23:53 +0000 (21:23 -0400)]
Add doc example for `std::io::repeat`.

8 years agoAuto merge of #34424 - jseyfried:breaking_batch, r=Manishearth
bors [Mon, 27 Jun 2016 23:42:03 +0000 (16:42 -0700)]
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)

8 years agoUpdate `src/rustc/Cargo.lock`
Jeffrey Seyfried [Mon, 27 Jun 2016 23:40:04 +0000 (23:40 +0000)]
Update `src/rustc/Cargo.lock`

8 years agorustdoc: Fix a few stripping issues
Oliver Middleton [Mon, 27 Jun 2016 22:10:13 +0000 (23:10 +0100)]
rustdoc: Fix a few stripping issues

We need to recurse into stripped modules to strip things like impl methods
but when doing so we must not add any items to the `retained` set.

8 years agoDisable debuginfo tests for a given blacklist of LLDB versions
Michael Woerister [Mon, 27 Jun 2016 18:31:23 +0000 (14:31 -0400)]
Disable debuginfo tests for a given blacklist of LLDB versions

8 years agoFix `Cargo.toml`s
Jeffrey Seyfried [Mon, 27 Jun 2016 17:45:33 +0000 (17:45 +0000)]
Fix `Cargo.toml`s

8 years agoAuto merge of #34169 - scottcarr:dominator-cache, r=nikomatsakis
bors [Mon, 27 Jun 2016 18:12:25 +0000 (11:12 -0700)]
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`.

8 years agoAdd example for `std::thread::sleep`.
Corey Farwell [Wed, 22 Jun 2016 01:41:02 +0000 (21:41 -0400)]
Add example for `std::thread::sleep`.

8 years agoAuto merge of #34477 - ollie27:patch-1, r=GuillaumeGomez
bors [Mon, 27 Jun 2016 13:43:49 +0000 (06:43 -0700)]
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

8 years agoRevert "skip double negation in const eval"
Oliver Schneider [Mon, 27 Jun 2016 09:42:52 +0000 (11:42 +0200)]
Revert "skip double negation in const eval"

This reverts commit 735c018974e5570ea13fd887aa70a011a5b8e7b8.

8 years agoAuto merge of #34453 - frewsxcv:regress, r=sanxiyn
bors [Mon, 27 Jun 2016 08:10:49 +0000 (01:10 -0700)]
Auto merge of #34453 - frewsxcv:regress, r=sanxiyn

Add regression test for #24424.

Fixes https://github.com/rust-lang/rust/issues/24424.

8 years agoAuto merge of #34419 - eddyb:virtually-inexistent, r=Aatch
bors [Mon, 27 Jun 2016 05:24:03 +0000 (22:24 -0700)]
Auto merge of #34419 - eddyb:virtually-inexistent, r=Aatch

Don't translate vtable methods with Self: Sized bounds.

Fixes #34416.

8 years agoAdd regression test
Jeffrey Seyfried [Mon, 27 Jun 2016 03:17:55 +0000 (03:17 +0000)]
Add regression test

8 years agoForbid type parameters and global paths in macro invocations
Jeffrey Seyfried [Mon, 27 Jun 2016 03:15:06 +0000 (03:15 +0000)]
Forbid type parameters and global paths in macro invocations

8 years agoAuto merge of #34491 - eddyb:return-in-peace, r=nagisa
bors [Mon, 27 Jun 2016 02:02:12 +0000 (19:02 -0700)]
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.

8 years agoExpand `std::path::Component` documentation.
Corey Farwell [Sat, 25 Jun 2016 20:35:29 +0000 (16:35 -0400)]
Expand `std::path::Component` documentation.

Indicate how it gets created and add an example.

8 years agoRemove the return_address intrinsic.
Eduard Burtescu [Sun, 26 Jun 2016 22:47:28 +0000 (01:47 +0300)]
Remove the return_address intrinsic.

8 years agoAuto merge of #34450 - jseyfried:fix_include_path, r=nrc
bors [Sun, 26 Jun 2016 21:50:27 +0000 (14:50 -0700)]
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

8 years agoAuto merge of #34469 - frewsxcv:path-components, r=GuillaumeGomez
bors [Sun, 26 Jun 2016 05:06:35 +0000 (22:06 -0700)]
Auto merge of #34469 - frewsxcv:path-components, r=GuillaumeGomez

Indicate how the `std::path::Components` struct is created.

None

8 years agoAuto merge of #34468 - frewsxcv:doc-links, r=GuillaumeGomez
bors [Sun, 26 Jun 2016 02:24:29 +0000 (19:24 -0700)]
Auto merge of #34468 - frewsxcv:doc-links, r=GuillaumeGomez

Add hyperlinks to `std::fs` functions from `std::path`.

None

8 years agoRollup merge of #34436 - jseyfried:no_block_expr, r=eddyb
Jeffrey Seyfried [Sun, 26 Jun 2016 02:19:34 +0000 (02:19 +0000)]
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.

8 years agoRollup merge of #34339 - jseyfried:thin_vec, r=petrochenkov,Manishearth
Jeffrey Seyfried [Sun, 26 Jun 2016 02:18:04 +0000 (02:18 +0000)]
Rollup merge of #34339 - jseyfried:thin_vec, r=petrochenkov,Manishearth

Generalize and abstract `ThinAttributes` to `ThinVec<Attribute>`.

8 years agoRollup merge of #34316 - jseyfried:refactor_ast_stmt, r=eddyb
Jeffrey Seyfried [Sun, 26 Jun 2016 02:16:55 +0000 (02:16 +0000)]
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`.

8 years agoRollup merge of #33943 - jseyfried:libsyntax_cleanup, r=nrc
Jeffrey Seyfried [Sun, 26 Jun 2016 02:14:27 +0000 (02:14 +0000)]
Rollup merge of #33943 - jseyfried:libsyntax_cleanup, r=nrc

Miscellaneous low priority cleanup in `libsyntax`.

8 years agoRollup merge of #34385 - cgswords:tstream, r=nrc
Jeffrey Seyfried [Sat, 25 Jun 2016 22:35:30 +0000 (22:35 +0000)]
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).

8 years agorustdoc: Fix inlined renamed reexports in import lists
Oliver Middleton [Sun, 26 Jun 2016 02:08:10 +0000 (03:08 +0100)]
rustdoc: Fix inlined renamed reexports in import lists

8 years agoAdd new error codes and improve some explanations
Guillaume Gomez [Sat, 25 Jun 2016 12:21:45 +0000 (14:21 +0200)]
Add new error codes and improve some explanations

8 years agoAuto merge of #34465 - frewsxcv:builder-name-example, r=GuillaumeGomez
bors [Sat, 25 Jun 2016 22:47:31 +0000 (15:47 -0700)]
Auto merge of #34465 - frewsxcv:builder-name-example, r=GuillaumeGomez

Add doc example for `std::thread::Builder::name`.

None

8 years agoRollup merge of #34403 - jonathandturner:move_liberror, r=alexcrichton
Jeffrey Seyfried [Sat, 25 Jun 2016 22:27:27 +0000 (22:27 +0000)]
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.

8 years agoRollup merge of #34368 - petrochenkov:astqpath, r=Manishearth
Jeffrey Seyfried [Sat, 25 Jun 2016 22:26:47 +0000 (22:26 +0000)]
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

8 years agoRollup merge of #34213 - josephDunne:trait_item_macros, r=jseyfried
Jeffrey Seyfried [Sat, 25 Jun 2016 22:05:08 +0000 (22:05 +0000)]
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.

8 years agorustdoc: Fix search result layout for enum variants and struct fields
Oliver Middleton [Sat, 25 Jun 2016 22:24:10 +0000 (23:24 +0100)]
rustdoc: Fix search result layout for enum variants and struct fields

8 years agoAuto merge of #34410 - frewsxcv:code-like, r=apasel422
bors [Sat, 25 Jun 2016 20:01:31 +0000 (13:01 -0700)]
Auto merge of #34410 - frewsxcv:code-like, r=apasel422

Parameters in doc comment should be formatted code-like.

None

8 years agoFix E0269 error explanation
Guillaume Gomez [Sat, 25 Jun 2016 16:25:53 +0000 (18:25 +0200)]
Fix E0269 error explanation

8 years agoIndicate how the `std::path::Components` struct is created.
Corey Farwell [Sat, 25 Jun 2016 14:05:01 +0000 (10:05 -0400)]
Indicate how the `std::path::Components` struct is created.

8 years agoAuto merge of #34464 - Manishearth:rollup, r=Manishearth
bors [Sat, 25 Jun 2016 13:45:07 +0000 (06:45 -0700)]
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:

8 years agoAdd hyperlinks to `std::fs` functions from `std::path`.
Corey Farwell [Sat, 25 Jun 2016 13:26:41 +0000 (09:26 -0400)]
Add hyperlinks to `std::fs` functions from `std::path`.

8 years agoRollup merge of #34449 - regexident:ast_docs, r=steveklabnik
Manish Goregaokar [Sat, 25 Jun 2016 08:46:21 +0000 (14:16 +0530)]
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/)

8 years agoRollup merge of #34445 - pyjarrett:lang_item_table_macro_rename, r=jseyfried
Manish Goregaokar [Sat, 25 Jun 2016 08:46:21 +0000 (14:16 +0530)]
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.

8 years agoRollup merge of #34438 - frewsxcv:joinhandle, r=GuillaumeGomez
Manish Goregaokar [Sat, 25 Jun 2016 08:46:20 +0000 (14:16 +0530)]
Rollup merge of #34438 - frewsxcv:joinhandle, r=GuillaumeGomez

Indicate how the `JoinHandle` struct is created.

None

8 years agoRollup merge of #34435 - sanxiyn:typo, r=apasel422
Manish Goregaokar [Sat, 25 Jun 2016 08:46:20 +0000 (14:16 +0530)]
Rollup merge of #34435 - sanxiyn:typo, r=apasel422

Fix typo in future incompatible lint

Found in release triage.

8 years agoRollup merge of #34414 - alfiedotwtf:patch-1, r=steveklabnik
Manish Goregaokar [Sat, 25 Jun 2016 08:46:20 +0000 (14:16 +0530)]
Rollup merge of #34414 - alfiedotwtf:patch-1, r=steveklabnik

Switched tense to clarify what is happening in the example

8 years agoRollup merge of #34411 - Vogtinator:patch-1, r=sanxiyn
Manish Goregaokar [Sat, 25 Jun 2016 08:46:20 +0000 (14:16 +0530)]
Rollup merge of #34411 - Vogtinator:patch-1, r=sanxiyn

Fix typo in bootstrap README

"boostrap" instead of "bootstrap"

8 years agoRollup merge of #34379 - liigo:patch-11, r=GuillaumeGomez
Manish Goregaokar [Sat, 25 Jun 2016 08:46:19 +0000 (14:16 +0530)]
Rollup merge of #34379 - liigo:patch-11, r=GuillaumeGomez

Improve diagnostics E0425: `use` (public) name

E0425: unresolved name

8 years agoAdd regression test for #24424.
Corey Farwell [Fri, 24 Jun 2016 14:16:03 +0000 (10:16 -0400)]
Add regression test for #24424.

Fixes https://github.com/rust-lang/rust/issues/24424.

8 years agoAdd doc example for `std::thread::Builder::name`.
Corey Farwell [Sat, 25 Jun 2016 11:22:19 +0000 (07:22 -0400)]
Add doc example for `std::thread::Builder::name`.

8 years agoAuto merge of #34452 - frewsxcv:unwrap-or, r=alexcrichton
bors [Sat, 25 Jun 2016 06:14:12 +0000 (23:14 -0700)]
Auto merge of #34452 - frewsxcv:unwrap-or, r=alexcrichton

Use `Option::expect` instead of `unwrap_or_else` with `panic!`.

None

8 years agoAuto merge of #34441 - tbu-:pr_dont_ignore_errors, r=alexcrichton
bors [Sat, 25 Jun 2016 01:28:23 +0000 (18:28 -0700)]
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.

8 years agoAdd example with leading zeros
Stefan Schindler [Fri, 24 Jun 2016 23:59:14 +0000 (01:59 +0200)]
Add example with leading zeros

8 years agoreexport errors from syntax. fix failing cfail test
Jonathan Turner [Fri, 24 Jun 2016 23:10:15 +0000 (19:10 -0400)]
reexport errors from syntax. fix failing cfail test

8 years agoAuto merge of #34401 - GuillaumeGomez:err-codes, r=brson
bors [Fri, 24 Jun 2016 22:42:13 +0000 (15:42 -0700)]
Auto merge of #34401 - GuillaumeGomez:err-codes, r=brson

Add error code flags

r? @brson

cc @steveklabnik
cc @jonathandturner

8 years agoadd regression test for #33455
Daan Sprenkels [Fri, 24 Jun 2016 21:31:00 +0000 (23:31 +0200)]
add regression test for #33455

8 years agoAuto merge of #34439 - ollie27:rustdoc_panic_fix, r=alexcrichton
bors [Fri, 24 Jun 2016 19:57:29 +0000 (12:57 -0700)]
Auto merge of #34439 - ollie27:rustdoc_panic_fix, r=alexcrichton

rustdoc: Fix panic caused by doc(hidden) trait methods

Fixes: #34423
r? @alexcrichton

8 years agoFix codemap tests to not double import
Jonathan Turner [Fri, 24 Jun 2016 17:20:23 +0000 (13:20 -0400)]
Fix codemap tests to not double import

8 years agoAdd examples in docs for `JoinHandle`.
Corey Farwell [Fri, 24 Jun 2016 12:12:58 +0000 (08:12 -0400)]
Add examples in docs for `JoinHandle`.

8 years agoImprove `syntax::ast::*` type docs (examples, etc)
Vincent Esche [Fri, 24 Jun 2016 11:14:34 +0000 (13:14 +0200)]
Improve `syntax::ast::*` type docs (examples, etc)

8 years agoAuto merge of #34425 - tbu-:pr_len_instead_of_size_hint, r=alexcrichton
bors [Fri, 24 Jun 2016 16:03:54 +0000 (09:03 -0700)]
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`.

8 years agoReexport syntax_pos in codemap and fix some cfail tests
Jonathan Turner [Fri, 24 Jun 2016 13:05:28 +0000 (09:05 -0400)]
Reexport syntax_pos in codemap and fix some cfail tests

8 years agoUse `Option::expect` instead of `unwrap_or_else` with `panic!`.
Corey Farwell [Fri, 24 Jun 2016 12:19:22 +0000 (08:19 -0400)]
Use `Option::expect` instead of `unwrap_or_else` with `panic!`.

8 years agoIndicate how the `JoinHandle` struct is created.
Corey Farwell [Thu, 23 Jun 2016 22:16:37 +0000 (18:16 -0400)]
Indicate how the `JoinHandle` struct is created.