about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
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-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-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
2015-12-30Custom help message for people trying to make macro publicest31-5/+15
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-30Auto merge of #30526 - Ms2ger:PathParameters, r=brsonbors-33/+34
2015-12-30Rebasing and review commentsNick Cameron-24/+18
2015-12-30RefactoringNick Cameron-35/+70
2015-12-30use structured errorsNick Cameron-369/+501
2015-12-30Structured diagnosticsNick Cameron-30/+253
2015-12-28Use a more efficient encoding for opaque data in RBML.Michael Woerister-7/+4
2015-12-26llvm: Add support for vectorcall (X86_VectorCall) conventionSteffen-0/+2
2015-12-23Minor fix to whitespace in libsyntaxErick Tryzelaar-2/+2
2015-12-23Auto merge of #30377 - Wafflespeanut:levenshtein, r=Manishearthbors-30/+37
fixes part of #30197
2015-12-22Stop re-exporting PathParameters's variants.Ms2ger-33/+34
2015-12-22Auto merge of #30417 - alexcrichton:better-detect-elf-tls, r=alexcrichtonbors-4/+18
Currently a compiler can be built with the `--disable-elf-tls` option for compatibility with OSX 10.6 which doesn't have ELF TLS. This is unfortunate, however, as a whole new compiler must be generated which can take some time. These commits add a new (feature gated) `cfg(target_thread_local)` annotation set by the compiler which indicates whether `#[thread_local]` is available for use. The compiler now interprets `MACOSX_DEPLOYMENT_TARGET` (a standard environment variable) to set this flag on OSX. With this we may want to start compiling our OSX nightlies with `MACOSX_DEPLOYMENT_TARGET` set to 10.6 which would allow the compiler out-of-the-box to generate 10.6-compatible binaries. For now the compiler still by default targets OSX 10.7 by allowing ELF TLS by default (e.g. if `MACOSX_DEPLOYMENT_TARGET` isn't set).
2015-12-21std: Use cfg(target_thread_local) in thread_local!Alex Crichton-1/+1
This transitions the standard library's `thread_local!` macro to use the freshly-added and gated `#[cfg(target_thread_local)]` attribute. This greatly simplifies the `#[cfg]` logic in play here, but requires that the standard library expose both the OS and ELF TLS implementation modules as unstable implementation details. The implementation details were shuffled around a bit but end up generally compiling to the same thing. Closes #26581 (this supersedes the need for the option) Closes #27057 (this also starts ignoring the option)