Commit Graph

3885 Commits

Author SHA1 Message Date
bors
2ab18ce6f7 Auto merge of #34660 - jseyfried:fix_parse_stmt, r=nrc
Fix bugs in macro-expanded statement parsing

Fixes #34543.

This is a [breaking-change]. For example, the following would break:
```rust
macro_rules! m { () => {
    println!("") println!("")
    //^ Semicolons are now required on macro-expanded non-braced macro invocations
    //| in statement positions.
    let x = 0
    //^ Semicolons are now required on macro-expanded `let` statements
    //| that are followed by more statements, so this would break.
    let y = 0 //< (this would still be allowed to reduce breakage in the wild)
}
fn main() { m!() }
```

r? @eddyb
2016-07-13 01:37:07 -07:00
Guillaume Gomez
23d5f5652c Rollup merge of #34770 - davidko:patch-1, r=steveklabnik
Fixed some typos

I believe these are typos?
2016-07-12 12:08:24 +02:00
Guillaume Gomez
e2e4b82356 Rollup merge of #34742 - abhijeetbhagat:master, r=steveklabnik
Update on struct expressions

Update doc for struct expressions (#32769)
2016-07-12 12:08:23 +02:00
Jeffrey Seyfried
337236870d Fix fallout. 2016-07-12 04:31:40 +00:00
David
81386cf277 Fixed some typos 2016-07-11 14:43:56 -07:00
abhi
f396cb42ee Update on struct expressions (check #32769) 2016-07-10 02:10:57 +05:30
Manish Goregaokar
88350bdf52 Rollup merge of #34699 - phlogisticfugu:master, r=steveklabnik
enhancewindows documentation in getting-started

- minor pronoun fix We -> You
- PATH troubleshooting
- dir output is vertical (but did not include timestamps)
- executables not in %PATH% require .\

r? @steveklabnik
2016-07-08 14:47:00 +05:30
Manish Goregaokar
1b06c00ddd Rollup merge of #34610 - wuranbo:patch-2, r=steveklabnik
doc: make the conditional-compilation example work

If not, the error `does not have these features: foo` confused.
r? @steveklabnik
2016-07-08 14:46:58 +05:30
bors
9b4e2a5b2d Auto merge of #34682 - CensoredUsername:clobber-docs, r=eddyb
Correct inline assembly clobber formatting.

Fixes the formatting for inline assembly clobbers used in the book.
As this causes llvm to silently ignore the clobber an error is also
added to catch cases in which the wrong formatting was used.
Additionally a test case is added to confirm that this error works.

This fixes #34458

Note: this is only one out of a few possible ways to fix the issue
depending on how the asm! macro formatting is wanted.

Additionally, it'd be nicer to have some kind of test or feedback
from llvm if the clobber constraints are valid, but I do not know
enough about llvm to say if or how this is possible.
2016-07-07 21:48:04 -07:00
Phlogistic Fugu
1f99c29c77 more windows documentation in getting-started
- minor pronoun fix We -> You
- PATH troubleshooting
- dir output is vertical (but did not include timestamps)
- executables not in %PATH% require .\
2016-07-07 01:19:05 -07:00
吴冉波
d30662f3e7 doc:remove useless conditional compilation feature 2016-07-07 10:34:33 +08:00
Steve Klabnik
8c3efd20e4 Rollup merge of #34667 - KaivoAnastetiks:fix/crate-documentation, r=Manishearth
Add a section about crate documentation.

Fixes #34329
?r @steveklabnik
2016-07-06 19:13:08 -04:00
Steve Klabnik
1b7bebf84d Rollup merge of #34626 - sylvestre:master, r=Manishearth
Fix typos
2016-07-06 19:13:07 -04:00
Steve Klabnik
80e5672f7e Rollup merge of #34625 - jaredmanning:patch-1, r=apasel422
Fix spacing in for loop enumeration example

Add a space between the comma and j in (i, j) to make it look nice.

This addresses my recent issue #34624.

😀
2016-07-06 19:13:07 -04:00
Steve Klabnik
04130595cc Rollup merge of #34621 - KaivoAnastetiks:fix/#33924, r=steveklabnik
Clarifies the meaning of the external mutability.
2016-07-06 19:13:07 -04:00
Steve Klabnik
05806aed66 Rollup merge of #34615 - rdotdk:master, r=Manishearth
update cargo doc link

updated proper link of cargo doc that contains details about list of options available in semantic versioninig for the dependencies section in Cargo.toml
2016-07-06 19:13:07 -04:00
Steve Klabnik
155f0ec5c9 Rollup merge of #33250 - durka:patch-19, r=steveklabnik
update documentation of tuple/unit structs

I made the "tuple structs are useless" editorializing a bit weaker and moved it to the end. Feel free to overrule me on that.

I also added an example of how to unpack a tuple struct with dot notation, because it came up on IRC.

`braced_empty_structs` is stable now, so I updated the example for unit-like structs to use that syntax. Should we show both ways?

cc @ubsan
r? @steveklabnik or @GuillaumeGomez
2016-07-06 19:13:05 -04:00
CensoredUsername
e32da12753 Correct inline assembly clobber formatting.
Fixes the formatting for inline assembly clobbers used in the book.
As this causes llvm to silently ignore the clobber an error is also
added to catch cases in which the wrong formatting was used.
Additionally a test case is added to confirm that this error works.
2016-07-06 15:02:49 +02:00
吴冉波
7f3068e52f typo nothings -> nothing 2016-07-06 13:52:40 +08:00
bors
731d375619 Auto merge of #34294 - alexandermerritt:book-nuls, r=steveklabnik
Correct use of 'nul' 'null' and capitalization in the book

r? @steveklabnik
2016-07-05 14:25:07 -07:00
Alex Burka
74e96299a2 show both forms of empty struct declaration 2016-07-05 13:46:06 -04:00
Kaivo Anastetiks
159d1ab540 Add a section about crate documentation. 2016-07-05 13:17:16 -04:00
Kaivo Anastetiks
6a85183e6f Replace it's by its. 2016-07-05 07:26:38 -04:00
bors
e7cf491d22 Auto merge of #34602 - Xmasreturns:patch-4, r=steveklabnik
Update glossary.md

Added a brief description of Combinators
2016-07-04 09:57:02 -07:00
bors
5e858f34df Auto merge of #34532 - jonmarkprice:master, r=steveklabnik
Book: Small grammatical and stylistic edits to book

I've been reading [the book](https://doc.rust-lang.org/book/) and noticed a few small grammatical and stylistic issues which I've rolled into this pull request.

I'm not sure if I should do so many small, unrelated edits in a single pull request but it seems like a lot of overhead for each small edit. Maybe one commit per edit but one pull request per file/section? Feedback is very much appreciated as this is my first pull request ever!

r? @steveklabnik rollup
2016-07-03 07:47:36 -07:00
Sylvestre Ledru
3fcb649277 Fix a few typos in the doc 2016-07-03 10:02:38 +02:00
Jared Manning
5dfd79a8e6 Fix spacing in for loop enumeration example
Add a space between the comma and j in (i, j) to make it look nice.
2016-07-03 03:01:18 -05:00
Kaivo Anastetiks
df93e18418 Clarifies the meaning of the external mutability. 2016-07-02 20:39:21 -04:00
Hariharan R
bdea705465 update cargo doc link
updated proper link of cargo doc that contains details about list of options available in semantic versioninig for the dependencies section in Cargo.toml
2016-07-02 20:36:41 +05:30
吴冉波
dd8151f5e2 doc: make the conditional-compilation example work
If not, the error `does not have these features: foo` confused. 
r? @steveklabnik
2016-07-02 15:19:09 +08:00
Jonathan L
2d7abe88bf Update glossary.md
Added a brief description of Combinators
2016-07-01 13:16:27 -07:00
Alexander Merritt
161ba12fad NULL not back-ticked 2016-06-29 10:17:12 -04:00
Jonathan Price
ec66b5addc used curly instead of straight quotes 2016-06-28 14:09:32 -05:00
Jonathan Price
763cec21f0 Merging my book edits recent commits. 2016-06-28 13:06:15 -05:00
Jonathan Price
8eb56e6988 took comment out of code block
no reason for a long comment in a code block when we could take it out, especially since it looks like it's using markdown (`struct`, `&` and `lvl`).
2016-06-28 11:39:24 -05:00
Jonathan Price
4f1f764548 fixed typo: term should be terms
two terms (input lifetime and output lifetime) so "term" needs to be plural.
2016-06-28 10:49:37 -05:00
Guillaume Gomez
86e4a034af 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.
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
Jonathan Price
15a0299299 many small grammatical and stylistic changes
grammatical: "Here's" should be "Here are", "rules" is plural.
stylistic: "rules for" is more idiomatic than "rules about".
grammatical: No verb in "One or the other"; changed to "It's one or the other".
code: added implied `fn main() { ... }` because it is referenced in "note: previous borrow ends here"
semantic: "But" seems like the wrong word here, there is now, contrast, only further explanation. "so", "thus" or "therefor" is clearer.
grammatical: Another misuse of "Here's", should be "Here are" (or possibly "Here're").
grammatical: "use" should be capitalized. All other subheadings capitalize the first word.
2016-06-27 18:06:40 -05:00
Jonathan Price
9dd5540540 "also ... as well" is redundant
Also "to access" is cleaner than "for accessing"
2016-06-27 16:52:39 -05:00
Jonathan Price
4a327e0e14 "errors with" is idiomatic in English 2016-06-27 16:49:58 -05:00
Jonathan Price
cae02fff6a fixed backquotes and awkward borrowing clause 2016-06-27 16:34:35 -05: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
Tatsuya Kawano
26096c84e3 [doc] Fix links in Ownership section of the book 2016-06-24 08:08:08 +08:00
Jonathan Turner
6ae3502134 Move errors from libsyntax to its own crate 2016-06-23 08:07:35 -04:00
Alfie John
eb17527039 Switched tense to clarify what is happening in the example 2016-06-23 06:20:29 +10:00
Guillaume Gomez
f39c4930b3 Rollup merge of #34378 - liigo:patch-10, r=Manishearth
diagnostics comes from different places now
2016-06-21 23:54:29 +02:00
Liigo Zhuang
7f4b75e173 diagnostics comes from different places now 2016-06-20 16:05:30 +08:00