about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2018-06-19Add code to `invalid ABI` errorEsteban Küber-5/+9
2018-06-19Do not consume semicolon twice while parsing local statementSeiichi Uchida-1/+1
2018-06-19Auto merge of #51278 - EPashkin:fix_mod_with_multilevel_paths_on_windows, ↵bors-1/+13
r=nikomatsakis Fix processing mod with multi-level path on Windows Fix error in [rustfmt](https://github.com/rust-lang-nursery/rustfmt/issues/1754) because libsyntax can not handle `mod` with multilevel path on Windows. Alternative is do almost same in https://github.com/rust-lang/rust/blob/master/src/libstd/sys/windows/fs.rs#L717 to allow work on paths with different separators, Ex. "\\\\?\\c:\\windows/temp"
2018-06-17Auto merge of #51549 - PSeitz:patch-1, r=kennytmbors-2/+2
Follow up to #51508, make parse_block public instead parse_block_expr This is an follow up to #51508 I mistakenly made parse_block_expr public instead of parse_block. This fixes this.
2018-06-17Auto merge of #51425 - QuietMisdreavus:thats-def-a-namespace-there, ↵bors-13/+18
r=petrochenkov refactor: create multiple HIR items for imports When lowering `use` statements into HIR, they get a `Def` of the thing they're pointing at. This is great for things that need to know what was just pulled into scope. However, this is a bit misleading, because a `use` statement can pull things from multiple namespaces if their names collide. This is a problem for rustdoc, because if there are a module and a function with the same name (for example) then it will only document the module import, because that's that the lowered `use` statement points to. The current version of this PR does the following: * Whenever the resolver comes across a `use` statement, it loads the definitions into a new `import_map` instead of the existing `def_map`. This keeps the resolutions per-namespace so that all the target definitions are available. * When lowering `use` statements, it looks up the resolutions in the `import_map` and creates multiple `Item`s if there is more than one resolution. * To ensure the `NodeId`s are properly tracked in the lowered module, they need to be created in the AST, and pulled out as needed if multiple resolutions are available. Fixes https://github.com/rust-lang/rust/issues/34843
2018-06-16Auto merge of #51562 - SimonSapin:transparent, r=cramertjbors-8/+2
Stabilize #[repr(transparent)] Tracking issue FCP: https://github.com/rust-lang/rust/issues/43036#issuecomment-394094318 Reference PR: https://github.com/rust-lang-nursery/reference/pull/353
2018-06-16Follow up on https://github.com/rust-lang/rust/pull/51508, make parse_block ↵PSeitz-2/+2
public instead parse_block_expr This is an follow up to #51508 I mistakenly made parse_block_expr public instead of parse_block. This fixes this.
2018-06-15Auto merge of #50296 - cmdd:master, r=nikomatsakisbors-0/+14
Add error message for using >= 65535 hashes for raw string literal escapes Fixes #50111.
2018-06-14create multiple HIR items for a use statementQuietMisdreavus-13/+18
2018-06-12update wording, do not change parserNiko Matsakis-1/+1
2018-06-12Auto merge of #51521 - Mark-Simulacrum:rollup, r=Mark-Simulacrumbors-3/+32
Rollup of 3 pull requests Successful merges: - #51261 (Updated RELEASES.md for 1.27.0) - #51502 (Make parse_seq_to_end and parse_path public) - #51510 (Long diagnostic for E0538) Failed merges:
2018-06-12Rollup merge of #51510 - Havvy:diagnostic-list, r=GuillaumeGomezMark Rousskov-1/+30
Long diagnostic for E0538 r? @GuillaumeGomez
2018-06-12Rollup merge of #51502 - jebrosen:pub_parse_methods, r=Mark-SimulacrumMark Rousskov-2/+2
Make parse_seq_to_end and parse_path public (see SergioBenitez/Rocket#660, rust-lang/rust#51265) Rocket currently uses `parse_seq_to_end` and `parse_path` in its codegen macros. Assuming I tested correctly, this is the minimal set of methods that are currently necessary to build Rocket again. I would be happy to add documentation of this and Rocket's other usages, if desired.
2018-06-12Auto merge of #51519 - ExpHP:issue-51331-b, r=petrochenkovbors-25/+24
Fix for $crate var normalization in proc macro for externally defined macros Fixes #51331, a bug that has existed in at least *some* form for a year and a half. The PR includes the addition of a `fold_qpath` method to `syntax::fold::Folder`. Overriding this method is useful for folds that modify paths in a way that invalidates indices (insertion or removal of a component), as it provides the opportunity to update `qself.position` in `<A as B>::C` paths. I added it because the bugfix is messy without it. (unfortunately, grepping around the codebase, I did not see anything else that could use it.)
2018-06-12add fold::Folder::fold_qpathMichael Lamparski-25/+24
2018-06-12Auto merge of #51508 - PSeitz:master, r=Mark-Simulacrumbors-2/+2
Make span_fatal and parse_block public span_fatal and parse_block were made private in #51265. These methods are used in stainless. Related #51498 #51504
2018-06-12Stabilize #[repr(transparent)]Simon Sapin-8/+2
Tracking issue FCP: https://github.com/rust-lang/rust/issues/43036#issuecomment-394094318 Reference PR: https://github.com/rust-lang-nursery/reference/pull/353
2018-06-12Auto merge of #51498 - topecongiro:pub-parse_ident, r=petrochenkovbors-1/+1
Make parse_ident public `parse_ident` was made private in #51265. In rustfmt the method is used to create a custom parser for macro call.
2018-06-11Slightly better summary for E0538Havvy-1/+1
2018-06-11Long diagnostic for E0538Havvy-1/+30
2018-06-11Stabilize the #[global_allocator] attributeSimon Sapin-7/+3
Fixes https://github.com/rust-lang/rust/issues/27389
2018-06-11Make span_fatal and parse_block publicPSeitz-2/+2
span_fatal and parse_block were made private in #51265. These methods are used in stainless. Related #51498 #51504
2018-06-11Make parse_seq_to_end and parse_path publicjeb-2/+2
2018-06-11Auto merge of #51490 - Havvy:diagnostic-list, r=GuillaumeGomezbors-1/+32
Long diagnostic for E0541 r? @GuillaumeGomez
2018-06-11Make parse_ident publicSeiichi Uchida-1/+1
2018-06-11More E0541 long diagnostic wording tweaksHavvy-3/+3
2018-06-11Auto merge of #51480 - dtolnay:lifetime, r=kennytmbors-0/+8
Enable fall through past $:lifetime matcher ```rust macro_rules! is_lifetime { ($lifetime:lifetime) => { true }; ($other:tt) => { false }; } fn main() { println!("{}", is_lifetime!('lifetime)); println!("{}", is_lifetime!(@)); } ``` Before this fix, the `is_lifetime!` invocation would fail to compile with: ``` error: expected a lifetime, found `@` --> src/main.rs:8:33 | 8 | println!("{}", is_lifetime!(@)); | ^ ``` Fixes #50903. Fixes #51477. r? @kennytm
2018-06-11Make tidy happyHavvy-7/+8
2018-06-11Fix typos in previous commitHavvy-1/+3
2018-06-11Long diagnostic for E0541Havvy-1/+29
2018-06-10Enable fall through past $:lifetime matcherDavid Tolnay-0/+8
2018-06-10Auto merge of #50205 - topecongiro:include-parens-to-type-parameter, ↵bors-8/+9
r=petrochenkov Include parens to type parameter The motivation of this PR is to fix a bug in rustfmt (cc https://github.com/rust-lang-nursery/rustfmt/issues/2630).
2018-06-10Simplify an error handling in the parserSeiichi Uchida-6/+2
2018-06-10Include parens to type parameterSeiichi Uchida-2/+7
2018-06-09Crate-ify and delete unused code in syntax::parseMark Simulacrum-365/+191
2018-06-09Auto merge of #51068 - Crazycolorz5:pluseqsplitting, r=petrochenkovbors-10/+51
parser: Split `+=` into `+` and `=` where `+` is explicitly requested (such as generics) Added functions in tokens to check whether a token leads with `+`. Used them when parsing to allow for token splitting of `+=` into `+` and `=`. Fixes https://github.com/rust-lang/rust/issues/47856
2018-06-08Rollup merge of #51298 - Dylan-DPC:stabilise/termination-test, r=nikomatsakisMark Rousskov-37/+11
Stabilize unit tests with non-`()` return type References #48854
2018-06-08Rollup merge of #51099 - Crazycolorz5:expectedcloseparen, r=estebankMark Rousskov-2/+7
Fix Issue 38777 When looking through for a closing bracket in the loop condition, adds them to expecteds. https://github.com/rust-lang/rust/issues/38777
2018-06-08provide error message when using more than 65535 hash symbols for raw stringsDavid Cao-0/+14
2018-06-08rename `irrefutable_let_pattern` to `irrefutable_let_patterns`Niko Matsakis-1/+1
2018-06-08Rollup merge of #51417 - pietroalbini:revert-49719, r=nikomatsakiskennytm-22/+67
Revert #49719 This also needs to be backported into beta. Fixes #51416. r? @nikomatsakis
2018-06-08Rollup merge of #51283 - ↵kennytm-3/+40
kennytm:fix-51279-preempt-the-warning-song-and-dance, r=nikomatsakis Deny #[cfg] and #[cfg_attr] on generic parameters. Fix #51279. Attributes on generic parameters are not expanded, meaning `#[cfg]`, `#[cfg_attr]` and attribute proc macros are entirely ignored on them. This PR makes using the first two attributes an error, because if they are correctly expanded will affect the AST and change code behavior. I'm beta-nominating this, because generic parameter attributes are stabilizing in 1.27, and if we did not reserve their usage, we may never be able to repurpose the meaning of these attributes in the Rust 2015 edition.
2018-06-07Revert "Auto merge of #49719 - mark-i-m:no_sep, r=petrochenkov"Pietro Albini-22/+67
This reverts commit d6ba1b9b021c408fcad60ee52acf8af5e1b2eb00, reversing changes made to 8de5353f75dcde04abe947e0560dc5edd861cf3a.
2018-06-06Allowing attributes to be on if let statementsSebastian Malton-1/+1
2018-06-07add an explanatory commentNiko Matsakis-0/+5
2018-06-06Auto merge of #51201 - estebank:dotdot, r=petrochenkovbors-69/+135
Accept `..` in incorrect position to avoid further errors We currently give a specific message when encountering a `..` anywhere other than the end of a pattern. Modify the parser to accept it (while still emitting the error) so that we don't also trigger "missing fields in pattern" errors afterwards. Add suggestions to either remove trailing `,` or moving the `..` to the end. Follow up to #49268.
2018-06-06append unused variables with _dylan_DPC-3/+3
2018-06-05remove redundant match branchdylan_DPC-1/+0
2018-06-05flag changed to nonedylan_DPC-1/+1
2018-06-05Account for comma in suggestionEsteban Küber-1/+1