about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2016-01-25Update qquote.rs test case and make unexpected `let` error fatalDaan Sprenkels-6/+6
2016-01-25libsyntax: move check for keyword Let to a more logical spotDaan Sprenkels-6/+6
2016-01-25libsyntax: note that `let a = (let b = something)` is invalidDaan Sprenkels-0/+6
in parse_bottom_expr (parser.rs)
2016-01-24mk: Move from `-D warnings` to `#![deny(warnings)]`Alex Crichton-0/+1
This commit removes the `-D warnings` flag being passed through the makefiles to all crates to instead be a crate attribute. We want these attributes always applied for all our standard builds, and this is more amenable to Cargo-based builds as well. Note that all `deny(warnings)` attributes are gated with a `cfg(stage0)` attribute currently to match the same semantics we have today
2016-01-23add `[` to FOLLOW(ty) and FOLLOW(path)Alex Burka-1/+1
Following RFC 1462 (amending 550). Closes #31135.
2016-01-22Extended save-analysis to support generated code, alterned some spans in ↵Daniel Campbell-2/+23
format_args! and derive to maintain compatability
2016-01-22The war on abort_if_errorsNick Cameron-18/+23
2016-01-22Some basic error correction in the parser after a dotNick Cameron-42/+62
2016-01-20syntax: Fix encoding and decoding spansErick Tryzelaar-5/+20
The protocol for `serialize::{En,De}code` doesn't allow for two integers to be serialized next to each other. This switches the protocol to serializing `Span`s as a struct. rbml structs don't have any overhead, so the metadata shouldn't increase in size, but it allows the json format to be properly generated, albeit slightly more heavy than when it was just serializing a span as a u64. Closes #31025. s
2016-01-19Use different numbers of `#`s when expanding documentation commentsBarosl Lee-1/+15
Any documentation comments that contain raw-string-looking sequences may pretty-print invalid code when expanding them, as the current logic always uses the `r"literal"` form, without appending any `#`s. This commit calculates the minimum number of `#`s required to wrap a comment correctly and appends `#`s appropriately. Fixes #27489.
2016-01-16Auto merge of #30567 - steffengy:master, r=alexcrichtonbors-5/+21
Add support to use functions exported using vectorcall. This essentially only allows to pass a new LLVM calling convention from rust to LLVM. ```rust extern "vectorcall" fn abc(param: c_void); ``` references ---- http://llvm.org/docs/doxygen/html/CallingConv_8h_source.html https://msdn.microsoft.com/en-us/library/dn375768.aspx
2016-01-16libsyntax: accept only whitespace with the PATTERN_WHITE_SPACE propertyKevin Butler-29/+32
This aligns with unicode recommendations and should be stable for all future unicode releases. See http://unicode.org/reports/tr31/#R3. This renames `libsyntax::lexer::is_whitespace` to `is_pattern_whitespace` so potentially breaks users of libsyntax.
2016-01-15Rollup merge of #30787 - nikomatsakis:future-incompatible-lint, r=brsonManish Goregaokar-0/+18
There is now more structure to the report, so that you can specify e.g. an RFC/PR/issue number and other explanatory details. Example message: ``` type-parameter-invalid-lint.rs:14:8: 14:9 error: defaults for type parameters are only allowed on type definitions, like `struct` or `enum` type-parameter-invalid-lint.rs:14 fn avg<T=i32>(_: T) {} ^ type-parameter-invalid-lint.rs:14:8: 14:9 warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! type-parameter-invalid-lint.rs:14:8: 14:9 note: for more information, see PR 30742 <https://github.com/rust-lang/rust/pull/30724> type-parameter-invalid-lint.rs:11:9: 11:28 note: lint level defined here type-parameter-invalid-lint.rs:11 #![deny(future_incompatible)] ^~~~~~~~~~~~~~~~~~~ error: aborting due to previous error ``` r? @brson I would really like feedback also on the specific messages! Fixes #30746
2016-01-15Auto merge of #30763 - gchp:issue/30033, r=nagisabors-10/+15
This is achieved by adding the scan_back method. This method looks back through the source_text of the StringReader until it finds the target char, returning it's offset in the source. We use this method to find the offset of the opening single quote, and use that offset as the start of the error. Given this code: ```rust fn main() { let _ = 'abcd'; } ``` The compiler would give a message like: ``` error: character literal may only contain one codepoint: '; let _ = 'abcd'; ^~ ``` With this change, the message now displays: ``` error: character literal may only contain one codepoint: 'abcd'; let _ = 'abcd'; ^~~~~~~ ``` Fixes #30033
2016-01-14libsyntax: make matches_codepattern unicode awareKevin Butler-45/+57
2016-01-14libsyntax: use char::is_whitespace instead of custom implementationsKevin Butler-6/+2
Fixes #29590.
2016-01-15Add a testNick Cameron-1/+1
And fix bustage in make check
2016-01-15Implement JSON error emissionNick Cameron-28/+211
[breaking-change] syntax::errors::Handler::new has been renamed to with_tty_emitter Many functions which used to take a syntax::errors::ColorConfig, now take a rustc::session::config::ErrorOutputType. If you previously used ColorConfig::Auto as a default, you should now use ErrorOutputType::default().
2016-01-15Add an --output option for specifying an error emitterNick Cameron-1/+2
2016-01-15Add a JSON error emitterNick Cameron-0/+54
2016-01-14Display better snippet for invalid char literalGreg Chapple-10/+15
Given this code: fn main() { let _ = 'abcd'; } The compiler would give a message like: error: character literal may only contain one codepoint: '; let _ = 'abcd'; ^~ With this change, the message now displays: error: character literal may only contain one codepoint: 'abcd' let _ = 'abcd' ^~~~~~ Fixes #30033
2016-01-13Auto merge of #30813 - fhahn:fix-ice-semicolon-in-lifetime, r=nrcbors-4/+6
This PR fixes an ICE due to an DiagnosticsBuilder not being canceld or emitted. Ideally it would use `Handler::cancel`, but I did not manage to get a `&mut` reference to the diagnostics handler.
2016-01-13Auto merge of #30684 - tshepang:rustfmt-lexer-part2, r=nrcbors-511/+756
2016-01-12use fileline_ and not full span_ for the followon messagesNiko Matsakis-0/+7
2016-01-12re-instate comment that was mysteriously disappearedTshepang Lekhonkhobe-0/+1
2016-01-12Revamp the "future incompatible" section to clarify the situationNiko Matsakis-0/+11
better
2016-01-11add feature gate "abi_vectorcall" for the vectorcall calling conventionSteffen-5/+19
2016-01-11Rollup merge of #30694 - pnkfelix:issue-25658-real-first-follow, r=nrcSimonas Kazlauskas-20/+507
Proper first and follow sets for macro_rules future proofing implements first stage of RFC amendment 1384; see #30450
2016-01-11[breaking-change] remove negate_unsigned feature gateOliver Schneider-4/+1
2016-01-10Cancel parse_ty error in Parser::parse_generic_values_after_ltFlorian Hahn-4/+6
2016-01-07extending FOLLOW(NT) as specified in amendment.Felix S. Klock II-4/+7
See RFC amendment 1384: https://github.com/rust-lang/rfcs/pull/1384
2016-01-07macro_rules: proper FIRST/FOLLOW computations for checking macro_rules validity.Felix S. Klock II-16/+500
See RFC amendment 1384 and tracking issue 30450: https://github.com/rust-lang/rfcs/pull/1384 https://github.com/rust-lang/rust/issues/30450 Moved old check_matcher code into check_matcher_old combined the two checks to enable a warning cycle (where we will continue to error if the two checks agree to reject, accept if the new check says accept, and warn if the old check accepts but the new check rejects).
2016-01-07Auto merge of #30723 - nrc:macro-err-bug, r=Manishearthbors-2/+9
Fixes #30715
2016-01-06Rollup merge of #30729 - huonw:delete-bad-comment, r=sanxiynSteve Klabnik-3/+0
The fundamental problem of duplication was fixed in https://github.com/rust-lang/rust/pull/10891, but the comment was preserved. Closes https://github.com/rust-lang/rust/issues/9762.
2016-01-06Auto merge of #30654 - nrc:panictry, r=brsonbors-301/+306
The motivation (other than removing boilerplate) is that this is a baby step towards a parser with error recovery. [breaking-change] if you use any of the changed functions, you'll need to remove a try! or panictry!
2016-01-06Auto merge of #30532 - nikomatsakis:cross-item-dependencies, r=mwbors-0/+8
This is roughly the same as my previous PR that created a dependency graph, but that: 1. The dependency graph is only optionally constructed, though this doesn't seem to make much of a difference in terms of overhead (see measurements below). 2. The dependency graph is simpler (I combined a lot of nodes). 3. The dependency graph debugging facilities are much better: you can now use `RUST_DEP_GRAPH_FILTER` to filter the dep graph to just the nodes you are interested in, which is super help. 4. The tests are somewhat more elaborate, including a few known bugs I need to fix in a second pass. This is potentially a `[breaking-change]` for plugin authors. If you are poking about in tcx state or something like that, you probably want to add `let _ignore = tcx.dep_graph.in_ignore();`, which will cause your reads/writes to be ignored and not affect the dep-graph. After this, or perhaps as an add-on to this PR in some cases, what I would like to do is the following: - [x] Write-up a little guide to how to use this system, the debugging options available, and what the possible failure modes are. - [ ] Introduce read-only and perhaps the `Meta` node - [x] Replace "memoization tasks" with node from the map itself - [ ] Fix the shortcomings, obviously! Notably, the HIR map needs to register reads, and there is some state that is not yet tracked. (Maybe as a separate PR.) - [x] Refactor the dep-graph code so that the actual maintenance of the dep-graph occurs in a parallel thread, and the main thread simply throws things into a shared channel (probably a fixed-size channel). There is no reason for dep-graph construction to be on the main thread. (Maybe as a separate PR.) Regarding performance: adding this tracking does add some overhead, approximately 2% in my measurements (I was comparing the build times for rustdoc). Interestingly, enabling or disabling tracking doesn't seem to do very much. I want to poke at this some more and gather a bit more data -- in some tests I've seen that 2% go away, but on others it comes back. It's not entirely clear to me if that 2% is truly due to constructing the dep-graph at all. The next big step after this is write some code to dump the dep-graph to disk and reload it. r? @michaelwoerister
2016-01-05Add assert-dep-graph testing mechanism and testsNiko Matsakis-0/+8
2016-01-06Remove irrelevant commentHuon Wilson-3/+0
The fundamental problem of duplication was fixed in https://github.com/rust-lang/rust/pull/10891, but the comment was preserved. Closes https://github.com/rust-lang/rust/issues/9762.
2016-01-06Cancel an error before it panicsNick Cameron-2/+9
Fixes #30715
2016-01-04address review commentTshepang Lekhonkhobe-10/+2
2016-01-04Add test for "malformed macro lhs" and change back span_bug to span_fatalGuillaume Gomez-2/+2
2016-01-03fix "make tidy" failureTshepang Lekhonkhobe-1/+2
2016-01-03run rustfmt on syntax::parse::lexerTshepang Lekhonkhobe-513/+764
2016-01-02Grammar fixesJames Mantooth-5/+5
2015-12-31Rollup merge of #30565 - michaelwoerister:opaque_encoder, r=brsonSimonas Kazlauskas-7/+4
This PR changes the `emit_opaque` and `read_opaque` methods in the RBML library to use a space-efficient binary encoder that does not emit any tags and uses the LEB128 variable-length integer format for all numbers it emits. The space savings are nice, albeit a bit underwhelming, especially for dynamic libraries where metadata is already compressed. | RLIBs | NEW | OLD | |--------------|--------|-----------| |libstd | 8.8 MB | 10.5 MB | |libcore |15.6 MB | 19.7 MB | |libcollections| 3.7 MB | 4.8 MB | |librustc |34.0 MB | 37.8 MB | |libsyntax |28.3 MB | 32.1 MB | | SOs | NEW | OLD | |---------------|-----------|--------| | libstd | 4.8 MB | 5.1 MB | | librustc | 8.6 MB | 9.2 MB | | libsyntax | 7.8 MB | 8.4 MB | At least this should make up for the size increase caused recently by also storing MIR in crate metadata. Can this be a breaking change for anyone? cc @rust-lang/compiler
2015-12-31Auto merge of #30598 - est31:macro_export_help_note, r=Manishearthbors-5/+17
The current help message is too much about "normal" macros to be used as general message. Keep it for normal macros, and add custom help and error messages for macro definitions.
2015-12-31Cut out a bunch of Result and panictry! boilerplate from libsyntax.Nick Cameron-301/+306
[breaking-change] if you use any of the changed functions, you'll need to remove a try! or panictry!
2015-12-30Auto merge of #30375 - aaronkeen:issue_28777, r=eddybbors-6/+15
RESTRICTION_STMT_EXPR restriction to allow subsequent expressions to contain braces. https://github.com/rust-lang/rust/issues/28777
2015-12-30Limit line length to below 100 charsest31-2/+4
2015-12-30whitespace after colon, not beforeest31-1/+1