about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2015-11-27Auto merge of #30064 - fhartwig:macro-suggestions, r=sanxiynbors-0/+88
Fixes #13677 This does the same sort of suggestion for misspelt macros that we already do for misspelt identifiers. Example. Compiling this program: ```rust macro_rules! foo { ($e:expr) => ( $e ) } fn main() { fob!("hello!"); } ``` gives the following error message: ``` /Users/mcp/temp/test.rs:7:5: 7:8 error: macro undefined: 'fob!' /Users/mcp/temp/test.rs:7 fob!("hello!"); ^~~ /Users/mcp/temp/test.rs:7:5: 7:8 help: did you mean `foo`? /Users/mcp/temp/test.rs:7 fob!("hello!"); ``` I had to move the levenshtein distance function into libsyntax for this. Maybe this should live somewhere else (some utility crate?), but I couldn't find a crate to put it in that is imported by libsyntax and the other rustc crates.
2015-11-27Introduce max_suggestion_distance function to avoid duplicating the heuristicFlorian Hartwig-4/+10
2015-11-26Added stmt_expr_attribute feature gateMarvin Löbel-63/+291
2015-11-26Some TLC for the MoveMap traitMarvin Löbel-56/+120
2015-11-26Fixed macro expander not folding attributes (though I'm not sure if that is ↵Marvin Löbel-16/+18
actually neccessary)
2015-11-26Moved and refactored ThinAttributesMarvin Löbel-130/+132
2015-11-26Add syntax support for attributes on expressions and all syntaxMarvin Löbel-312/+845
nodes in statement position. Extended #[cfg] folder to allow removal of statements, and of expressions in optional positions like expression lists and trailing block expressions. Extended lint checker to recognize lint levels on expressions and locals.
2015-11-26Fix spans for macrosKevin Yeh-3/+6
2015-11-26Add '!' to macro name suggestion, use fileline_help instead of span_helpFlorian Hartwig-1/+1
2015-11-26Auto merge of #30015 - petrochenkov:staged, r=brsonbors-3/+4
Closes https://github.com/rust-lang/rust/issues/30008 `#[stable]`, `#[unstable]` and `#[rustc_deprecated]` are now guarded by `#[feature(staged_api)]` r? @brson
2015-11-26Add suggestion of similar macro names to `macro undefined` error messageFlorian Hartwig-0/+82
2015-11-25Fix "Cannot fill in a NT" ICEJonas Schievink-12/+23
2015-11-25Remove all uses of `#[staged_api]`Vadim Petrochenkov-1/+1
2015-11-25Remove `#[staged_api]`Vadim Petrochenkov-2/+3
2015-11-25Auto merge of #30011 - jonas-schievink:macro-context, r=nrcbors-10/+10
Fixes #22425 Also fixes #30007, since it's just a change from `true` to `false`.
2015-11-24Remove "this"Jonas Schievink-1/+1
2015-11-24Rollup merge of #30004 - michaelwoerister:primitive-ty-to-str, r=alexcrichtonSteve Klabnik-29/+23
Good candidate for a rollup, this one.
2015-11-24Auto merge of #30000 - Manishearth:unreachable-call, r=nrcbors-4/+4
Fixes #1889
2015-11-24Fix unreachable code in libsyntaxManish Goregaokar-4/+4
2015-11-23Auto merge of #29952 - petrochenkov:depr, r=brsonbors-8/+10
Part of https://github.com/rust-lang/rust/issues/29935 The deprecation lint is still called "deprecated", so people can continue using `#[allow(deprecated)]` and similar things.
2015-11-23Print the macro context name on incomplete parseJonas Schievink-10/+10
Fixes #22425 Also fixes #30007, since it's just a change from `true` to `false`.
2015-11-23Avoid some code duplication around getting names of numeric types.Michael Woerister-29/+23
2015-11-22Look up macro names as well when suggesting replacements for function ↵Manish Goregaokar-18/+28
resolve errors fixes #5780
2015-11-20Rename #[deprecated] to #[rustc_deprecated]Vadim Petrochenkov-8/+10
2015-11-20add feature gate `const_indexing`Oliver Schneider-0/+6
tracking issue is #29947
2015-11-18Rework the `IdVisitor` so that it only visits item contents (and doesn'tNiko Matsakis-18/+10
visit nested items). This is what all clients wanted anyhow.
2015-11-18Add some unicode aliases for ".Huon Wilson-0/+17
2015-11-17Auto merge of #29887 - sanxiyn:match-ref-pats, r=sfacklerbors-57/+57
2015-11-17Auto merge of #29766 - oli-obk:impl_item, r=nikomatsakisbors-38/+37
[breaking change] I'm not sure if those renames are ok. [TokenType::Tt* to TokenType::*](https://github.com/rust-lang/rust/pull/29582) was obvious, but for all those Item-enums it's less obvious to me what the right way forward is due to the underscore.
2015-11-17Fix match_ref_pats flagged by ClippySeo Sanghyeon-57/+57
2015-11-17Auto merge of #29837 - Wafflespeanut:unicode_chars, r=Manishearthbors-1/+193
fixes #25957
2015-11-17Detect confusing unicode characters and show the alternativeRavi Shankar-1/+193
2015-11-16rename `ast::ImplItem_::*ImplItem` to `ast::ImplItemKind::*`Oliver Schneider-38/+37
2015-11-16Auto merge of #29828 - sanxiyn:check-macro, r=nrcbors-49/+63
Fix #27409.
2015-11-14Check macro definition and do not expand invalid macrosSeo Sanghyeon-3/+22
2015-11-14Reindent codeSeo Sanghyeon-22/+22
2015-11-14Store TokenTree in MacroRulesMacroExpanderSeo Sanghyeon-28/+23
2015-11-13Move the panicking parse functions out of the parserKyle Mayes-50/+52
Since these functions are only used by the AST quoting syntax extensions, they should be there instead of in the parser.
2015-11-13Auto merge of #29761 - eefriedman:rename-nopanic, r=sanxiynbors-87/+87
Just `sed s/_nopanic//g`. Hopefully makes libsyntax a bit more readable.
2015-11-12Auto merge of #29807 - nrc:op_span, r=brsonbors-1/+1
cc @nagisa
2015-11-13Fix a bad span for binopsNick Cameron-1/+1
2015-11-12Auto merge of #29780 - KyleMayes:quote-ext, r=nrcbors-1/+86
This is my first code contribution to Rust, so I'm sure there are some issues with the changes I've made. I've added the `quote_arg!`, `quote_block!`, `quote_path!`, and `quote_meta_item!` quasiquoting macros. From my experience trying to build AST in compiler plugins, I would like to be able to build any AST piece with a quasiquoting macro (e.g., `quote_struct_field!` or `quote_variant!`) and then use those AST pieces in other quasiquoting macros, but this pull request just adds some of the low-hanging fruit. I'm not sure if these additions are desirable, and I'm sure these macros can be implemented in an external crate if not.
2015-11-12Auto merge of #29544 - Ryman:reduce_doc_warnings, r=steveklabnikbors-17/+24
Did this alphabetically, so I didn't see [how `std` was doing things](https://dxr.mozilla.org/rust/source/src/libstd/lib.rs#215) till I was nearly finished. If you prefer to add crate-level-whitelists like std instead of test-level, I can rebase with that strategy. A number of these commits can probably be dropped as the crates don't have much to test, and are deprecated. Let me know which if any to drop! (can also squash after review if desired) r? @steveklabnik
2015-11-12libsyntax: deny warnings in doctestsKevin Butler-17/+24
2015-11-12Add -Zinput-statsNick Cameron-1/+174
Emits loc, and node count - before and after expansion. E.g., ``` rustc: x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore Lines of code: 32060 Pre-expansion node count: 120205 Post-expansion node count: 482749 ```
2015-11-11libsyntax: Add more quasiquoting macrosKyle Mayes-1/+86
2015-11-11Auto merge of #29744 - sanxiyn:modernize, r=nrcbors-30/+30
2015-11-11Auto merge of #29727 - alexcrichton:debug-unused-result, r=sfacklerbors-4/+21
This should help avoid triggering the unused_results lint which can frequently be turned on. Closes #29710
2015-11-10Rename _nopanic methods to remove the suffix.Eli Friedman-87/+87
Just `sed s/_nopanic//g`. Hopefully makes libsyntax a bit more readable.
2015-11-10Auto merge of #29725 - aturon:lang-features, r=huonwbors-45/+59
This commit adds issue numbers to the vast majority of active feature gates. The few that are left without issues are rustc/runtime-internal features that are essentially private APIs. Closes #28244 r? @huonw