about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2016-01-31Add Illumos supportNikita Baksalyar-0/+2
2016-01-30Rollup merge of #31244 - tshepang:rustfmt-parse, r=nikomatsakisManish Goregaokar-49/+49
2016-01-29Auto merge of #31248 - ruud-v-a:fix-triple-ice, r=nrcbors-14/+18
This fixes #31238. r? @michaelsproul
2016-01-28Auto merge of #30411 - mitaa:multispan, r=nrcbors-380/+1133
This allows to render multiple spans on one line, or to splice multiple replacements into a code suggestion. fixes #28124
2016-01-28Avoid ICE if environment variable is not setRuud van Asseldonk-14/+18
Rustdoc could trigger a code path that relied on the $CFG_COMPILER_HOST_TRIPLE environment variable being set, causing an ICE if it was not. This fixes that, emitting an error instead of crashing.
2016-01-28Implement MultiSpan error reportingmitaa-380/+1133
This allows to render multiple spans on one line, or to splice multiple replacements into a code suggestion.
2016-01-27rustfmt syntax::parseTshepang Lekhonkhobe-49/+49
2016-01-27trpl: fix macro follow setsAlex Burka-0/+1
2016-01-27Auto merge of #31089 - fhahn:macro-ice, r=pnkfelixbors-30/+68
This is a work in progress PR that potentially should fix #29084, #28308, #25385, #28288, #31011. I think this may also adresse parts of #2887. The problem in this issues seems to be that when transcribing macro arguments, we just clone the argument Nonterminal, which still has to original spans. This leads to the unprintable spans. One solution would be to update the spans of the inserted argument to match the argument in the macro definition. So for [this testcase](https://github.com/rust-lang/rust/compare/master...fhahn:macro-ice?expand=1#diff-f7def7420c51621640707b6337726876R2) the error message would be displayed in the macro definition: src/test/compile-fail/issue-31011.rs:4:12: 4:22 error: attempted access of field `trace` on type `&T`, but no field with that name was found src/test/compile-fail/issue-31011.rs:4 if $ctx.trace { Currently I've added a very simple `update_span` function, which updates the span of the outer-most expression of a `NtExpr`, but this `update_span` function should be updated to handle all Nonterminals. But I'm pretty new to the macro system and would like to check if this approach makes sense, before doing that.
2016-01-27Avoid storing interolated token in Parser.last_tokenFlorian Hahn-7/+11
2016-01-27Turn interpolated_or_expr_span into a functionFlorian Hahn-28/+24
2016-01-26Auto merge of #31120 - alexcrichton:attribute-deny-warnings, r=brsonbors-1/+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-26Fix warnings during testsAlex Crichton-1/+0
The deny(warnings) attribute is now enabled for tests so we need to weed out these warnings as well.
2016-01-26Rollup merge of #31211 - Manishearth:pr-30765, r=nrcManish Goregaokar-2/+8
r? @eddyb or @nrc
2016-01-26Push try! to call site of interpolated_or_expr_span!Florian Hahn-17/+18
2016-01-26Add interpolated_or_expr_span macro and pass lo to newly added parse_dot_suffixFlorian Hahn-30/+38
2016-01-26Auto merge of #31160 - nxnfufunezn:ppwild-31073, r=eddybbors-8/+8
Fixes #31073 r? @eddyb
2016-01-26Use interpolated token span when building spans for bigger expressionsFlorian Hahn-35/+38
2016-01-26Set span for interpolated tokens correctlyFlorian Hahn-7/+18
2016-01-26Update expression span when transcribing macro argsFlorian Hahn-2/+17
closes #29084 closes #28308 closes #25385 closes #28288 closes #31011 closes #26480 closes #26093 closes #26094 closes #25386 closes #26237 closes #25793
2016-01-26Improve error message for let-in-expr-positionManish Goregaokar-2/+3
2016-01-26Make emitter handle DUMMY_SP correctlyManish Goregaokar-2/+2
2016-01-26Rollup merge of #31152 - durka:ty-follow-bracket, r=pnkfelixManish Goregaokar-1/+1
cc #31135 rust-lang/rfcs#1462 #30923 @retep998 r? @pnkfelix
2016-01-26Auto merge of #31065 - nrc:ident-correct, r=pnkfelixbors-58/+83
This PR adds some minor error correction to the parser - if there is a missing ident, we recover and carry on. It also makes compilation more robust so that non-fatal errors (which is still most of them, unfortunately) in parsing do not cause us to abort compilation. The effect is that a program with a missing or incorrect ident can get all the way to type checking.
2016-01-25Fix pretty_printer to print omitted type `_` markernxnfufunezn-8/+8
2016-01-25do not additionally note about unexpected identifier after unexpected letDaan Sprenkels-6/+5
error, by moving unexpected let check into the proper if-else clause
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-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