Commit Graph

2175 Commits

Author SHA1 Message Date
bors
2568a4d8c5 Auto merge of #24924 - carols10cents:grammar-improvements, r=pnkfelix
I'm interested in helping out with #16676 but more in the grammar than the reference-- here's my first chunk, more to come!! 🎉 

I did pull a bit *out* of the reference, though, that was more relevant to the grammar but wasn't moved over as part of #24729.

I'm looking at, e.g. https://github.com/rust-lang/rust/blob/master/src/libsyntax/ast.rs, as the source of truth, please let me know if I should be checking against something else instead/in addition.

r? @steveklabnik
2015-04-30 17:07:14 +00:00
bors
42bfeec53c Auto merge of #24842 - GBGamer:patch-3, r=steveklabnik
They now use the currently working syntax.

Also, I added two examples.
2015-04-30 10:13:05 +00:00
bors
b594036069 Auto merge of #24970 - Hech:master, r=steveklabnik 2015-04-30 07:12:25 +00:00
Hech
f8b63e867d docs: link fix 2015-04-29 17:30:46 -07:00
Alex Crichton
0cca57712d rollup merge of #24933: oli-obk/patch-1
compiler plugins are hosted unter "compiler-plugins.html" not "plugins.html"
2015-04-29 15:45:52 -07:00
Alex Crichton
dd12c8b46f rollup merge of #24931: jooert/patch-1
Since #24783, the style guidelines recommend that unit tests should live in a submodule `tests` rather than `test` to not clash with the possible use of libtest. This is especially important for benchmark tests as they require libtest. Fixes #24923.
2015-04-29 15:45:51 -07:00
Alex Crichton
8daf961a63 rollup merge of #24881: chris-morgan/issue-24872
Fixes #24872.
2015-04-29 15:45:41 -07:00
Alex Crichton
a24e036126 rollup merge of #24871: mbrubeck/doc-edit
r? @steveklabnik
2015-04-29 15:45:40 -07:00
Alex Crichton
18a0269d9d rollup merge of #24870: tshepang/reference-fix-brackets
Also, remove the other brackets, because they make the whole sentence look awkward.
2015-04-29 15:45:39 -07:00
Alex Crichton
256023a284 rollup merge of #24862: barometz/intro-push-err-fix
The error in the Brief Introduction shows the problematic line as "x.push(4)", while the example code uses a vector of strings.
2015-04-29 15:45:38 -07:00
Oliver Schneider
d6043d1e71 fix broken link
compiler plugins are hosted unter "compiler-plugins.html" not "plugins.html"
2015-04-29 11:41:00 +02:00
jooert
f99658d7c7 Adapt benchmark tests to unit test guidelines
Since #24783, the style guidelines recommend that unit tests should live in a submodule `tests` rather than `test` to not clash with the possible use of libtest. This is especially important for benchmark tests as they require libtest. Fixes #24923.
2015-04-29 10:36:43 +02:00
Carol Nichols
0ddee94cfe Move explanation that references lexical grammar to the grammar
Reword so that the references to things above/below are up to date and a
bit more specific.
2015-04-28 22:02:53 -04:00
Carol (Nichols || Goulding)
3e521bfd96 Add boolean literal to the grammar
To make this rule match the definition of Lit_ in
https://github.com/rust-lang/rust/blob/master/src/libsyntax/ast.rs
2015-04-28 21:46:49 -04:00
Toni Cárdenas
df1768d8eb TRPL: Tiny incoherence in UFCS example.
`Type` should be `Trait` to match the next example line.

r? @steveklabnik
2015-04-28 11:10:01 +02:00
Chris Morgan
928bd4fe10 Fix #24872, XSS in docs not found page. 2015-04-28 13:31:45 +10:00
Carol (Nichols || Goulding)
d715409736 Make item sections match item EBNF
`enum_item` appeared in the `item` list but did not have an associated section;
`const_item` had a section but did not appear in the list.
2015-04-27 22:02:16 -04:00
bors
857ef6e272 Auto merge of #23606 - quantheory:associated_const, r=nikomatsakis
Closes #17841.

The majority of the work should be done, e.g. trait and inherent impls, different forms of UFCS syntax, defaults, and cross-crate usage. It's probably enough to replace the constants in `f32`, `i8`, and so on, or close to good enough.

There is still some significant functionality missing from this commit:

 - ~~Associated consts can't be used in match patterns at all. This is simply because I haven't updated the relevant bits in the parser or `resolve`, but it's *probably* not hard to get working.~~
 - Since you can't select an impl for trait-associated consts until partway through type-checking, there are some problems with code that assumes that you can check constants earlier. Associated consts that are not in inherent impls cause ICEs if you try to use them in array sizes or match ranges. For similar reasons, `check_static_recursion` doesn't check them properly, so the stack goes ka-blooey if you use an associated constant that's recursively defined. That's a bit trickier to solve; I'm not entirely sure what the best approach is yet.
 - Dealing with consts associated with type parameters will raise some new issues (e.g. if you have a `T: Int` type parameter and want to use `<T>::ZERO`). See rust-lang/rfcs#865.
 - ~~Unused associated consts don't seem to trigger the `dead_code` lint when they should. Probably easy to fix.~~

Also, this is the first time I've been spelunking in rustc to such a large extent, so I've probably done some silly things in a couple of places.
2015-04-27 16:45:21 +00:00
Matt Brubeck
d8797b090f [reference] Fix a typo in 3.4 Whitespace 2015-04-27 09:31:49 -07:00
Tshepang Lekhonkhobe
f6c673e9f0 reference: add missing bracket
Also, remove the other brackets, because they make the whole sentence
look awkward.
2015-04-27 16:53:25 +02:00
Steve Klabnik
1b18da4a46 Rollup merge of #24867 - tshepang:patch-3, r=steveklabnik 2015-04-27 10:26:20 -04:00
Steve Klabnik
0c3514253c Rollup merge of #24866 - tshepang:vec-intro, r=steveklabnik 2015-04-27 10:26:20 -04:00
Steve Klabnik
188f3eb8f5 Rollup merge of #24863 - dhardy:patch-1, r=steveklabnik
Remove the name "multi-line string literal" since the rule appears to affect each line-break individually rather than the whole string literal. Re-word, and remove the stray reference to raw strings.
2015-04-27 10:26:19 -04:00
Tshepang Lekhonkhobe
14a6a9f5e2 reference: block-comment -> block comment 2015-04-27 15:42:46 +02:00
Manish Goregaokar
38042d1e18 trpl: clarify lib.rs vs main.rs 2015-04-27 18:42:19 +05:30
Tshepang Lekhonkhobe
7335c9f48f book: improve Vec intro 2015-04-27 14:11:27 +02:00
Diggory Hardy
cf650a2174 Update reference.md: floating-point section
Clarify type inference of floating-point literals
2015-04-27 12:24:47 +01:00
Diggory Hardy
709f3c5130 Update reference.md: string literals section
Remove the name "multi-line string literal" since the rule appears to affect each line-break individually rather than the whole string literal. Re-word, and remove the stray reference to raw strings.
2015-04-27 11:39:42 +01:00
Dominic van Berkel
9ddfbb1ae2 Adjusted intro error to match code
The error in the Brief Introduction shows the problematic line as "x.push(4)", while the example code uses a vector of strings.
2015-04-27 12:21:26 +02:00
Nicholas
766c1bc992 Fix the errors 2015-04-26 19:44:44 -07:00
diwic
d2d8898423 book: Fix broken link to unsafe chapter 2015-04-26 20:32:14 +02:00
Nicholas
a70b2ed826 Outputs no longer have to be mutable 2015-04-26 10:34:28 -07:00
Nicholas
3d0ad46eea Fix the inline assembly examples
They now use the currently working syntax.
2015-04-26 10:26:56 -07:00
bors
61a5e46726 Auto merge of #24825 - rkruppe:reference-audit, r=steveklabnik
Transplant the relevant changes (turns out to be all of them) to `grammar.md`, and remove all grammar talk from `reference.md`. Sorry for the chaos.

The second commit, further below, goes over the comments and whitespace sections.

r? @steveklabnik
2015-04-26 03:34:38 +00:00
bors
20adc9533d Auto merge of #24815 - heejongahn:master, r=steveklabnik
At https://doc.rust-lang.org/book/vectors.html, there should be a link to
Generics page but the link address is ommitted and thus link is not functioning
well. So I added a link definition to the vectors.md.

r? @steveklabnik
2015-04-26 01:37:58 +00:00
Robin Kruppe
0ea193def9 Reference audit: comments and whitespace sections 2015-04-26 02:02:13 +02:00
Robin Kruppe
85ee89ae70 Redo PR #24811 properly
Transplant the grammar-related changes to grammar.md,
and remove all grammar talk from reference.md
2015-04-25 22:56:00 +02:00
Heejong Ahn
9a2a06cf43 Added a link address to Vectors page of the book
At https://doc.rust-lang.org/book/vectors.html, there should be a link to
Generics page but the link address is ommitted and thus link is not functioning
well. So I added a link definition to the vectors.md.

r? @steveklabnik
2015-04-26 02:04:38 +09:00
Manish Goregaokar
9316b0382b Rollup merge of #24812 - jest:master, r=steveklabnik
Conflicts:
	src/doc/trpl/variable-bindings.md
2015-04-25 21:22:03 +05:30
Manish Goregaokar
007c81b83d Rollup merge of #24811 - rkruppe:reference-audit, r=steveklabnik
Mention `non_ascii_idents` feature gate and remove unused productions.

r? @steveklabnik
2015-04-25 21:18:47 +05:30
Manish Goregaokar
23782ad9a8 Rollup merge of #24809 - conradkleinespel:master, r=Manishearth
The reference has broken links. This should fix it.
2015-04-25 21:18:47 +05:30
Manish Goregaokar
cfe08b74bf Rollup merge of #24806 - FuGangqiang:doc, r=Manishearth 2015-04-25 21:18:47 +05:30
Przemysław Wesołek
2c2abe9a75 A number of spell-checking corrections. 2015-04-25 16:48:44 +02:00
bors
83263b48c3 Auto merge of #24803 - SkylerLipthay:patch-2, r=huonw
The description of the syntax for single byte literals is missing the preceding `b` distinction.
2015-04-25 13:10:33 +00:00
Robin Kruppe
702f17566c Audit reference manual: 3.2 Special unicode productions
Mention non_ascii_idents feature gate and remove unused productions
2015-04-25 14:38:23 +02:00
Conrad Kleinespel
b66f858e8f fix compiler plugins path in doc/reference.md 2015-04-25 13:43:26 +02:00
bors
e3d00a4980 Auto merge of #24783 - jooert:unittestguidelines, r=alexcrichton
Changes the style guidelines regarding unit tests to recommend using a sub-module named "tests" instead of "test" for unit tests as "test" might clash with imports of libtest (see #23870, #24030 and http://users.rust-lang.org/t/guidelines-naming-of-unit-test-module/1078 for previous discussions).

r? @alexcrichton
2015-04-25 09:55:06 +00:00
FuGangqiang
46462c7b5f fix doc 2015-04-25 16:30:25 +08:00
Skyler
b6dd0197f3 Reference manual 3.5.2.3.1
The description of the syntax for single byte literals is missing the preceding `b` distinction.
2015-04-24 23:26:56 -07:00
Michael Rosenberg
23b1d172a8 More small syntax changes in reference.md 2015-04-24 22:56:32 -04:00