about summary refs log tree commit diff
path: root/src/libsyntax_ext
AgeCommit message (Collapse)AuthorLines
2018-05-26Add `Ident::as_str` helperVadim Petrochenkov-3/+3
2018-05-24Auto merge of #50971 - alexcrichton:no-stringify, r=petrochenkovbors-0/+1
rustc: Correctly pretty-print macro delimiters This commit updates the `Mac_` AST structure to keep track of the delimiters that it originally had for its invocation. This allows us to faithfully pretty-print macro invocations not using parentheses (e.g. `vec![...]`). This in turn helps procedural macros due to #43081. Closes #50840
2018-05-22rustc: Correctly pretty-print macro delimitersAlex Crichton-0/+1
This commit updates the `Mac_` AST structure to keep track of the delimiters that it originally had for its invocation. This allows us to faithfully pretty-print macro invocations not using parentheses (e.g. `vec![...]`). This in turn helps procedural macros due to #43081. Closes #50840
2018-05-23Rollup merge of #50846 - GuillaumeGomez:add-e0665, r=frewsxcvkennytm-6/+53
Add E0665
2018-05-21Remove rustc_serialize_exclude_nullManish Goregaokar-12/+2
2018-05-21Add E0665Guillaume Gomez-17/+53
2018-05-18Auto merge of #50307 - petrochenkov:keyhyg2, r=nikomatsakisbors-2/+6
Implement edition hygiene for keywords Determine "keywordness" of an identifier in its hygienic context. cc https://github.com/rust-lang/rust/pull/49611 I've resurrected `proc` as an Edition-2015-only keyword for testing purposes, but it should probably be buried again. EDIT: `proc` is removed again.
2018-05-17Pass crate editions to macro expansions, update testsVadim Petrochenkov-1/+4
2018-05-17Add edition to expansion infoVadim Petrochenkov-1/+2
2018-05-17Rollup merge of #50610 - estebank:fmt-str, r=KimundiMark Simulacrum-3/+6
Improve format string errors Point at format string position inside the formatting string: ``` error: invalid format string: unmatched `}` found --> $DIR/format-string-error.rs:21:22 | LL | let _ = format!("}"); | ^ unmatched `}` in format string ``` Explain that argument names can't start with an underscore: ``` error: invalid format string: invalid argument name `_foo` --> $DIR/format-string-error.rs:15:23 | LL | let _ = format!("{_foo}", _foo = 6usize); | ^^^^ invalid argument name in format string | = note: argument names cannot start with an underscore ``` Fix #23476. The more accurate spans will only be seen when using `format!` directly, when using `println!` the diagnostics machinery makes the span be the entire statement.
2018-05-17Auto merge of #50629 - Mark-Simulacrum:stage-step, r=alexcrichtonbors-18/+6
Switch to bootstrapping from 1.27 It's possible the Float trait could be removed from core, but I couldn't tell whether it was intended to be removed or not. @SimonSapin may be able to comment more here; we can presumably also do that in a follow up PR as this one is already quite large.
2018-05-17Switch to 1.26 bootstrap compilerMark Simulacrum-18/+6
2018-05-17Rename trans to codegen everywhere.Irina Popa-17/+17
2018-05-17Rollup merge of #50752 - GuillaumeGomez:more-error-code-in-libsyntax-ext, ↵kennytm-3/+58
r=frewsxcv Add missing error codes in libsyntax-ext asm
2018-05-15Add missing error codes in libsyntax-ext asmGuillaume Gomez-3/+58
2018-05-15Auto merge of #50011 - varkor:partialord-opt-ii, r=Manishearthbors-66/+101
Ensure derive(PartialOrd) is no longer accidentally exponential Previously, two comparison operations would be generated for each field, each of which could delegate to another derived PartialOrd. Now we use ordering and optional chaining to ensure each pair of fields is only compared once, addressing https://github.com/rust-lang/rust/issues/49650#issuecomment-379467572. Closes #49505. r? @Manishearth (sorry for changing it again so soon!) Close #50755
2018-05-10Improve format string errorsEsteban Küber-3/+6
- Point at format string position inside the formatting string - Explain that argument names can't start with an underscore
2018-05-09use fmt::Result where applicableAndre Bogus-1/+1
2018-05-06Fix assertion message generationShotaro Yamada-57/+4
2018-05-03Auto merge of #50413 - kennytm:rollup, r=kennytmbors-0/+5
Rollup of 12 pull requests Successful merges: - #50302 (Add query search order check) - #50320 (Fix invalid path generation in rustdoc search) - #50349 (Rename "show type declaration" to "show declaration") - #50360 (Clarify wordings of the `unstable_name_collision` lint.) - #50365 (Use two vectors in nearest_common_ancestor.) - #50393 (Allow unaligned reads in constants) - #50401 (Revert "Implement FromStr for PathBuf") - #50406 (Forbid constructing empty identifiers from concat_idents) - #50407 (Always inline simple BytePos and CharPos methods.) - #50416 (check if the token is a lifetime before parsing) - #50417 (Update Cargo) - #50421 (Fix ICE when using a..=b in a closure.) Failed merges:
2018-05-02forbid empty identifiers from concat_identsMichael Lamparski-0/+5
2018-05-02Remove Option from the return type of Attribute::name()Seiichi Uchida-6/+4
2018-04-26rustc_target: move in syntax::abi and flip dependency.Irina Popa-2/+4
2018-04-25Update comments to UFCS stylevarkor-11/+24
2018-04-25Use UFCSvarkor-11/+20
2018-04-25Fix handling of Nonevarkor-11/+11
2018-04-25Ensure derive(PartialOrd) is no longer accidentally exponentialvarkor-70/+83
Previously, two comparison operations would be generated for each field, each of which could delegate to another derived PartialOrd. Now we use ordering and optional chaining to ensure each pair of fields is only compared once.
2018-04-25Auto merge of #49986 - zofrex:better-derived-argument-names, r=Manishearthbors-39/+41
Provide better names for builtin deriving-generated attributes First attempt at fixing #49967 Not in love with any choices here, don't be shy if you aren't happy with anything :) I've tested that this produces nicer names in documentation, and that it no longer has issues conflicting with constants with the same name. (I guess we _could_ make a test for that... unsure if that would be valuable) In all cases I took the names from the methods as declared in the relevant trait. In some cases I had to prepend the names with _ otherwise there were errors about un-used variables. I'm uneasy with the inconsistency... do they all need to be like that? Is there a way to generate an alternate impl or use a different name (`_`?) in the cases where the arguments are not used? Lastly the gensym addition to Ident I implemented largely as suggested, but I want to point out it's a little circuitous (at least, as far as I understand it). `cx.ident_of(name)` is just `Ident::from_str`, so we create an Ident then another Ident from it. `Ident::with_empty_ctxt(Symbol::gensym(string))` may or may not be equivalent, I don't know if it's important to intern it _then_ gensym it. It seems like either we could use that, or if we do want a new method to make this convenient, it could be on Ident instead (`from_str_gensymed`?)
2018-04-24Gensym arguments for format macroJames Sanderson-7/+9
2018-04-19Fix some of the __names in the commentsJames Sanderson-13/+13
2018-04-19Gensym remaining identifiersJames Sanderson-5/+5
2018-04-19Don't prepend deriving-generated attributes with _James Sanderson-3/+3
2018-04-15Provide better names for builtin deriving-generated attributesJames Sanderson-14/+14
2018-04-15Auto merge of #49881 - varkor:partialord-opt, r=Manishearthbors-91/+212
Fix derive(PartialOrd) and optimise final field operation ```rust // Before (`lt` on 2-field struct) self.f1 < other.f1 || (!(other.f1 < self.f1) && (self.f2 < other.f2 || (!(other.f2 < self.f2) && (false) )) ) // After self.f1 < other.f1 || (!(other.f1 < self.f1) && self.f2 < other.f2 ) // Before (`le` on 2-field struct) self.f1 < other.f1 || (!(other.f1 < self.f1) && (self.f2 < other.f2 || (!(other.f2 < self.f2) && (true) )) ) // After self.f1 < other.f1 || (self.f1 == other.f1 && self.f2 <= other.f2 ) ``` (The big diff is mainly because of a past faulty rustfmt application that I corrected 😒) Fixes #49650 and fixes #49505.
2018-04-14Add tests and longer error explanationGuillaume Gomez-1/+24
2018-04-14Add error codes for libsyntax_extGuillaume Gomez-2/+41
2018-04-12Abstract cs_eq for partial_eqvarkor-50/+27
2018-04-12Improve the comment for cs_fold1varkor-2/+9
2018-04-12Update partial_ord codegen summaryvarkor-3/+10
2018-04-11Remove redundant operation in derive[PartialEq]varkor-28/+58
2018-04-11Optimise the last field operations in derive[PartialOrd]varkor-51/+72
2018-04-11Add cs_fold1 for better derivesvarkor-17/+92
2018-04-11Fix derive(PartialOrd) implementationvarkor-6/+10
2018-04-11Implementation of `#[repr(packed(n))]` RFC 1399.Cameron Hart-3/+7
2018-04-08Move deny(warnings) into rustbuildMark Simulacrum-1/+0
This permits easier iteration without having to worry about warnings being denied. Fixes #49517
2018-04-06Remove more duplicated spansVadim Petrochenkov-3/+4
2018-04-06Rename `ast::Variant_::name` into `ident` + Fix rebaseVadim Petrochenkov-7/+5
2018-04-06Use `Span::apply_mark` where possibleVadim Petrochenkov-9/+9
2018-04-06Get rid of `SpannedIdent`Vadim Petrochenkov-30/+13
2018-04-06Rename `PathSegment::identifier` to `ident`Vadim Petrochenkov-2/+2