about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2013-10-03Rewrite lint passes with less visitor cruftAlex Crichton-23/+17
This purges about 500 lines of visitor cruft from lint passes. All lints are handled in a much more sane way at this point. The other huge bonus of this commit is that there are no more @-boxes in the lint passes, fixing the 500MB memory regression seen when the lint passes were refactored. Closes #8589
2013-10-02std: Swap {To,From}Primitive to use the 64bit as the unimplemented versionErick Tryzelaar-6/+6
One downside with this current implementation is that since BigInt's default is now 64 bit, we can convert larger BigInt's to a primitive, however the current implementation on 32 bit architectures does not take advantage of this fact.
2013-10-02syntax: swap from .span_fatal to .span_err in #[deriving(FromPrimitive)]Erick Tryzelaar-9/+21
2013-10-02syntax: Add #[deriving(FromPrimitive)] syntax extensionErick Tryzelaar-0/+152
Right now this only works for c-style enums.
2013-10-02auto merge of #9673 : huonw/rust/macros, r=catamorphismbors-78/+30
That is, only a single expression or item gets parsed, so if there are any extra tokens (e.g. the start of another item/expression) the user should be told, rather than silently dropping them. An example: macro_rules! foo { () => { println("hi"); println("bye); } } would expand to just `println("hi")`, which is almost certainly not what the programmer wanted. Fixes #8012.
2013-10-02auto merge of #9665 : alexcrichton/rust/snapshot, r=brsonbors-9/+16
Uses the new snapshots to kill the old `loop` and introduce the new `continue`.
2013-10-02syntax: indicate an error when a macro ignores trailing tokens.Huon Wilson-5/+30
That is, only a single expression or item gets parsed, so if there are any extra tokens (e.g. the start of another item/expression) the user should be told, rather than silently dropping them. An example: macro_rules! foo { () => { println("hi"); println("bye); } } would expand to just `println("hi")`, which is almost certainly not what the programmer wanted. Fixes #8012.
2013-10-02syntax: remove some dead code.Huon Wilson-73/+0
2013-10-01Migrate users of 'loop' to 'continue'Alex Crichton-9/+9
Closes #9467
2013-10-01Obsolete parsing 'loop' as 'continue'Alex Crichton-0/+7
2013-10-01auto merge of #9560 : pcwalton/rust/xc-tuple-structs, r=pcwaltonbors-2/+13
r? @thestinger
2013-10-01librustc: Inline cross-crate tuple struct constructorsPatrick Walton-2/+13
2013-10-01auto merge of #9519 : thestinger/rust/float, r=catamorphismbors-9/+2
It is simply defined as `f64` across every platform right now. A use case hasn't been presented for a `float` type defined as the highest precision floating point type implemented in hardware on the platform. Performance-wise, using the smallest precision correct for the use case greatly saves on cache space and allows for fitting more numbers into SSE/AVX registers. If there was a use case, this could be implemented as simply a type alias or a struct thanks to `#[cfg(...)]`. Closes #6592 The mailing list thread, for reference: https://mail.mozilla.org/pipermail/rust-dev/2013-July/004632.html
2013-10-01remove the `float` typeDaniel Micay-9/+2
It is simply defined as `f64` across every platform right now. A use case hasn't been presented for a `float` type defined as the highest precision floating point type implemented in hardware on the platform. Performance-wise, using the smallest precision correct for the use case greatly saves on cache space and allows for fitting more numbers into SSE/AVX registers. If there was a use case, this could be implemented as simply a type alias or a struct thanks to `#[cfg(...)]`. Closes #6592 The mailing list thread, for reference: https://mail.mozilla.org/pipermail/rust-dev/2013-July/004632.html
2013-10-01auto merge of #9633 : alexcrichton/rust/issue-9631, r=huonwbors-12/+16
Closes #9631
2013-10-01Fix usage of the old debug! macrosAlex Crichton-1/+1
2013-10-01Change the format! statics to be all-capsAlex Crichton-12/+16
This lets them get past the non_uppercase_statics lint mode (if it's turned on) Closes #9631
2013-10-01Fix typo with format migration: s/oldformat/oldfmt/.Huon Wilson-4/+4
2013-09-30syntax: Remove usage of fmt!Alex Crichton-340/+340
2013-09-30Prevent leakage of fmt! into the compilerAlex Crichton-49/+62
We're not outright removing fmt! just yet, but this prevents it from leaking into the compiler further (it's still turned on by default for all other code).
2013-09-30Expand tidy to prevent binaries from being checkedAlex Crichton-0/+0
Closes #9621
2013-09-29Remove all usage of @ast::CrateAlex Crichton-20/+20
2013-09-27auto merge of #9552 : brson/rust/0.9-pre, r=alexcrichtonbors-1/+1
2013-09-27auto merge of #9535 : alexcrichton/rust/no-format-default, r=thestingerbors-11/+8
As mentioned in #9456, the format! syntax extension would previously consider an empty format as a 'Unknown' format which could then also get coerced into a different style of format on another argument. This is unusual behavior because `{}` is a very common format and if you have `{0} {0:?}` you wouldn't expect them both to be coereced to the `Poly` formatter. This commit removes this coercion, but still retains the requirement that each argument has exactly one format specified for it (an empty format now counts as well). Perhaps at a later date we can add support for multiple formats of one argument, but this puts us in at least a backwards-compatible situation if we decide to do that.
2013-09-27Remove the notion of an "unknown format"Alex Crichton-11/+8
As mentioned in #9456, the format! syntax extension would previously consider an empty format as a 'Unknown' format which could then also get coerced into a different style of format on another argument. This is unusual behavior because `{}` is a very common format and if you have `{0} {0:?}` you wouldn't expect them both to be coereced to the `Poly` formatter. This commit removes this coercion, but still retains the requirement that each argument has exactly one format specified for it (an empty format now counts as well). Perhaps at a later date we can add support for multiple formats of one argument, but this puts us in at least a backwards-compatible situation if we decide to do that.
2013-09-27auto merge of #9550 : alexcrichton/rust/remove-printf, r=thestingerbors-22/+2
The 0.8 release was cut, down with printf!
2013-09-27auto merge of #9540 : alexcrichton/rust/more-rustdoc-improvements, r=brsonbors-4/+4
Commit messages have the details, mostly just knocking out more low-hanging-fruit type issues.
2013-09-26auto merge of #9525 : klutzy/rust/obsolete-span-fix, r=alexcrichtonbors-6/+9
2013-09-26auto merge of #9504 : brson/rust/continue, r=alexcrichtonbors-24/+39
2013-09-26Update version numbers to 0.9-preBrian Anderson-1/+1
2013-09-26auto merge of #9261 : alexcrichton/rust/logging, r=huonwbors-3/+9
This lifts various restrictions on the runtime, for example the character limit when logging a message. Right now the old debug!-style macros still involve allocating (because they use fmt! syntax), but the new debug2! macros don't involve allocating at all (unless the formatter for a type requires allocation.
2013-09-26Update the compiler to not use printf/printflnAlex Crichton-2/+2
2013-09-26Remove the printf{,ln}! macrosAlex Crichton-20/+0
These are deprecated in favor of print{,ln}!
2013-09-26Add 'continue' as a synonym for 'loop'Brian Anderson-24/+39
2013-09-26rustdoc: Render stability attributesAlex Crichton-1/+1
Closes #8965
2013-09-26rustdoc: Generate documentation for foreign itemsAlex Crichton-3/+3
This slurps up everything inside of an 'extern' block into the enclosing module in order to document them. The documentation must be on the items themselves, and they'll show up next to everything else on the module index pages. Closes #5953
2013-09-26syntax: Fix wrong span on trait fn visibilityklutzy-1/+2
Fixes #9348.
2013-09-26syntax: Fix wrong span on ObsoleteModeklutzy-4/+6
2013-09-26syntax: Fix wrong span on ObsoleteEmptyImplklutzy-1/+1
2013-09-25Refactor the logging system for fewer allocationsAlex Crichton-3/+9
This lifts various restrictions on the runtime, for example the character limit when logging a message. Right now the old debug!-style macros still involve allocating (because they use fmt! syntax), but the new debug2! macros don't involve allocating at all (unless the formatter for a type requires allocation.
2013-09-25rustdoc: Improve comment strippingAlex Crichton-15/+40
There is less implicit removal of various comment styles, and it also removes extraneous stars occasionally found in docblock comments. It turns out that the bug for getops was just a differently formatted block. Closes #9425 Closes #9417
2013-09-25rustdoc: Change all code-blocks with a scriptAlex Crichton-24/+24
find src -name '*.rs' | xargs sed -i '' 's/~~~.*{\.rust}/```rust/g' find src -name '*.rs' | xargs sed -i '' 's/ ~~~$/ ```/g' find src -name '*.rs' | xargs sed -i '' 's/^~~~$/ ```/g'
2013-09-25auto merge of #9481 : jbclements/rust/minor-cleanup, r=cmrbors-18/+62
Small stuff... might as well get it into the tree. One new test case, some issue # cleanup, remove some unused imports.
2013-09-25auto merge of #9432 : alexcrichton/rust/correct-item-visibility, r=pcwaltonbors-49/+9
This fixes private statics and functions from being usable cross-crates, along with some bad privacy error messages. This is a reopening of #8365 with all the privacy checks in privacy.rs instead of resolve.rs (where they should be anyway). These maps of exported items will hopefully get used for generating documentation by rustdoc Closes #8592
2013-09-24auto merge of #9335 : alexcrichton/rust/issue-7945, r=thestingerbors-21/+28
As documented in issue #7945, these literal identifiers are all accepted by rust today, but they should probably be disallowed (especially `'''`). This changes all escapable sequences to being *required* to be escaped. Closes #7945 I wanted to write the tests with more exact spans, but I think #9308 will be fixing that?
2013-09-24Disallow char literals which should be escapedAlex Crichton-21/+28
As documented in issue #7945, these literal identifiers are all accepted by rust today, but they should probably be disallowed (especially `'''`). This changes all escapable sequences to being *required* to be escaped. Closes #7945
2013-09-24added test case for tokenization of macro_rulesJohn Clements-0/+45
2013-09-24auto merge of #9336 : alexcrichton/rust/issue-7981, r=catamorphismbors-12/+13
Progress on #7981 This doesn't completely close the issue because `struct A;` is still allowed, and it's a much larger change to disallow that. I'm also not entirely sure that we want to disallow that. Regardless, punting that discussion to the issue instead.
2013-09-24renumbered due to bug shufflingJohn Clements-5/+5
2013-09-24Stop accepting 'impl ...;', require {} insteadAlex Crichton-12/+13
Progress on #7981