Commit Graph

7428 Commits

Author SHA1 Message Date
varkor
6015edf9af Remove name from GenericParamKind::Lifetime 2018-06-20 12:23:08 +01:00
varkor
80dbe58efc Use ParamBounds in WhereRegionPredicate 2018-06-20 12:23:07 +01:00
varkor
aed530a457 Lift bounds into GenericParam 2018-06-20 12:22:46 +01:00
varkor
a5328bc17b Simply joint lifetime/type iteration 2018-06-20 12:21:52 +01:00
varkor
8bccfe7a52 Refactor counting methods 2018-06-20 12:21:52 +01:00
varkor
3bcb006fd9 Rename structures in ast 2018-06-20 12:21:52 +01:00
varkor
c65454850f Remove AngleBracketedArgs impl 2018-06-20 12:21:08 +01:00
varkor
e1d888c722 Remove methods from ast::GenericParam and ast::Generics 2018-06-20 12:21:08 +01:00
varkor
2c6ff2469a Refactor ast::GenericParam as a struct 2018-06-20 12:21:08 +01:00
varkor
82dba3d419 Refactor hir::GenericParam as a struct 2018-06-20 12:21:07 +01:00
varkor
d643946550 Rename ast::GenericParam and ast::GenericArg
It's so confusing to have everything having the same name, at least while refactoring.
2018-06-20 12:19:04 +01:00
varkor
f9d0968906 Make method and variable names more consistent 2018-06-20 12:19:04 +01:00
varkor
76c0d68745 Rename "parameter" to "arg" 2018-06-20 12:19:04 +01:00
varkor
3e89753283 Rename PathParameter(s) to GenericArg(s) 2018-06-20 12:19:04 +01:00
varkor
1ed60a9173 Rename *Parameter to *Param 2018-06-20 12:19:04 +01:00
varkor
494859e8dd Consolidate PathParameters and AngleBracketedParameterData 2018-06-20 12:19:03 +01:00
bors
ed39523406 Auto merge of #51278 - EPashkin:fix_mod_with_multilevel_paths_on_windows, 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-19 02:17:52 +00:00
bors
9181741ede Auto merge of #51549 - PSeitz:patch-1, r=kennytm
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-17 14:05:43 +00:00
bors
594b05dd97 Auto merge of #51425 - QuietMisdreavus:thats-def-a-namespace-there, 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-17 09:48:10 +00:00
bors
61ba018093 Auto merge of #51562 - SimonSapin:transparent, r=cramertj
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-16 10:59:40 +00:00
PSeitz
b1c0857f62 Follow up on https://github.com/rust-lang/rust/pull/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-16 08:00:14 +02:00
bors
967c1f3be1 Auto merge of #50296 - cmdd:master, r=nikomatsakis
Add error message for using >= 65535 hashes for raw string literal escapes

Fixes #50111.
2018-06-15 19:05:25 +00:00
QuietMisdreavus
122b5b47c2 create multiple HIR items for a use statement 2018-06-14 17:47:28 -05:00
bors
b68432d560 Auto merge of #51521 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
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-12 17:37:12 +00:00
Mark Rousskov
398e570891
Rollup merge of #51510 - Havvy:diagnostic-list, r=GuillaumeGomez
Long diagnostic for E0538

r? @GuillaumeGomez
2018-06-12 11:22:54 -06:00
Mark Rousskov
1e06b1757c
Rollup merge of #51502 - jebrosen:pub_parse_methods, r=Mark-Simulacrum
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-12 11:22:53 -06:00
bors
ef8cb40c9c Auto merge of #51519 - ExpHP:issue-51331-b, r=petrochenkov
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-12 15:23:28 +00:00
Michael Lamparski
a20c177827 add fold::Folder::fold_qpath 2018-06-12 08:06:22 -04:00
bors
a1aae290d5 Auto merge of #51508 - PSeitz:master, r=Mark-Simulacrum
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-12 11:06:09 +00:00
Simon Sapin
e2aef92c19 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-12 06:49:07 +02:00
bors
1abb4ef636 Auto merge of #51498 - topecongiro:pub-parse_ident, r=petrochenkov
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-12 02:48:10 +00:00
Havvy
e9e0ca0382 Slightly better summary for E0538 2018-06-11 17:21:15 -07:00
Havvy
45748256ef Long diagnostic for E0538 2018-06-11 15:49:54 -07:00
Simon Sapin
999690ce5d Stabilize the #[global_allocator] attribute
Fixes https://github.com/rust-lang/rust/issues/27389
2018-06-11 13:48:56 -07:00
PSeitz
6fd9ede0cd
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-11 21:19:12 +02:00
jeb
7e56261fcb Make parse_seq_to_end and parse_path public 2018-06-11 10:40:58 -06:00
bors
0b7c9e756e Auto merge of #51490 - Havvy:diagnostic-list, r=GuillaumeGomez
Long diagnostic for E0541

r? @GuillaumeGomez
2018-06-11 15:28:44 +00:00
Seiichi Uchida
ed74b0b016 Make parse_ident public 2018-06-11 23:04:11 +09:00
Havvy
cf3fcab973 More E0541 long diagnostic wording tweaks 2018-06-11 03:51:04 -07:00
bors
13f8d073fe Auto merge of #51480 - dtolnay:lifetime, r=kennytm
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-11 10:43:20 +00:00
Havvy
0c91bd200e Make tidy happy 2018-06-11 03:04:08 -07:00
Havvy
2d7b046d71 Fix typos in previous commit 2018-06-11 02:44:55 -07:00
Havvy
f7df1f38dd Long diagnostic for E0541 2018-06-11 01:52:12 -07:00
David Tolnay
987020846c
Enable fall through past $:lifetime matcher 2018-06-10 14:39:16 -07:00
bors
a805a2a5eb Auto merge of #50205 - topecongiro:include-parens-to-type-parameter, 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-10 20:09:22 +00:00
Seiichi Uchida
699be41809 Simplify an error handling in the parser 2018-06-10 10:37:38 +09:00
Seiichi Uchida
78a19d9b88 Include parens to type parameter 2018-06-10 10:37:38 +09:00
Mark Simulacrum
60058e5dbe Crate-ify and delete unused code in syntax::parse 2018-06-09 16:57:19 -06:00
bors
61d88318aa Auto merge of #51068 - Crazycolorz5:pluseqsplitting, r=petrochenkov
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-09 17:46:36 +00:00
Mark Rousskov
d68098a43e
Rollup merge of #51298 - Dylan-DPC:stabilise/termination-test, r=nikomatsakis
Stabilize unit tests with non-`()` return type

References #48854
2018-06-08 17:20:59 -06:00