Commit Graph

842 Commits

Author SHA1 Message Date
bors
f707582a43 Auto merge of #36289 - euclio:self-suggestion, r=jseyfried
resolve: Suggest `use self` when import resolves

Improves errors messages by replacing "Maybe a missing `extern crate`" messages
with "Did you mean `self::...`" when the `self` import would succeed.

Fixes #34191.

Thank you for the help @jseyfried!
2016-09-07 05:59:50 -07:00
Jeffrey Seyfried
ff3a644951 Add struct AmbiguityError. 2016-09-06 03:52:36 +00:00
Jeffrey Seyfried
888a968139 Add field used: Cell<bool> to variant NameBindingKind::Import. 2016-09-06 03:43:46 +00:00
Jeffrey Seyfried
32674b3f1a Avoid false positive unused import warnings. 2016-09-06 03:43:20 +00:00
Andy Russell
288e7caf19 show self suggestion when items are in the block 2016-09-05 23:08:21 -04:00
Andy Russell
41ee2e9124 resolve: Suggest use self when import resolves
Improves errors messages by replacing "Maybe a missing `extern crate`" messages
with "Did you mean `self::...`" when the `self` import would succeed.
2016-09-05 21:48:02 -04:00
Vadim Petrochenkov
e05e74ac83 Replace _, _ with .. 2016-09-04 12:30:33 +03:00
Vadim Petrochenkov
6f7e51e49b Replace _, _, _ with .. 2016-09-04 12:27:01 +03:00
Vadim Petrochenkov
641d8e9e4c Some better support for unions through the compiler 2016-09-03 13:39:34 +03:00
Vadim Petrochenkov
35d52a003b Add unions to definition map 2016-09-03 13:37:25 +03:00
Jeffrey Seyfried
90ce504c1c Address comments. 2016-09-02 00:35:16 +00:00
Jeffrey Seyfried
4f5616e3c4 Avoid cascading name resolution errors caused by an ambiguous module. 2016-09-01 22:30:29 +00:00
Jeffrey Seyfried
32a0cfeb48 Avoid reporting multiple ambiguity errors for a single use of a name. 2016-09-01 22:30:28 +00:00
Jeffrey Seyfried
681a14f29b item_like_imports: Allow unused ambiguous glob imports. 2016-09-01 22:30:27 +00:00
Jeffrey Seyfried
f582fa327e item_like_imports: Allow multiple glob imports of the same item. 2016-09-01 22:30:26 +00:00
Jeffrey Seyfried
245a0c5530 item_like_imports: Make all visible items glob importable. 2016-09-01 22:30:26 +00:00
Jeffrey Seyfried
097b6d62fc item_like_imports: Allow glob imports with a given visibility
to reexport some (but not all) names with less visibility.
2016-09-01 22:30:25 +00:00
Jeffrey Seyfried
c56a5afd4d item_like_imports: Allow single imports with a given visibility
to reexport some (but not all) namespaces with less visibility.
2016-09-01 22:30:24 +00:00
Jeffrey Seyfried
aad1f3cbf3 item_like_imports: Allow glob imports to be shadowed by items and single imports. 2016-09-01 22:30:24 +00:00
Jeffrey Seyfried
efc0bea687 item_like_imports: Treat private imports like private items. 2016-09-01 22:30:21 +00:00
Jeffrey Seyfried
5ba22c0ed6 Add item_like_imports feature. 2016-09-01 22:29:50 +00:00
Jeffrey Seyfried
513e955a18 Add field dummy_binding to Resolver. 2016-09-01 22:29:30 +00:00
Jeffrey Seyfried
95528d1a98 Refactor away resolver.current_vis and add module.normal_ancestor_id. 2016-09-01 22:29:29 +00:00
Jeffrey Seyfried
1e4c8173e1 Improve diagnostics and remove dead code. 2016-09-01 22:29:28 +00:00
Jeffrey Seyfried
87ae68c1d6 Refactor binding.def() to return a Def instead of an Option<Def>. 2016-09-01 22:29:27 +00:00
Jeffrey Seyfried
691d10c3c9 Rename new_binding -> binding. 2016-09-01 22:29:27 +00:00
Jeffrey Seyfried
5dc1196191 Refactor away binding.is_pseudo_public(). 2016-09-01 22:29:26 +00:00
Jonathan Turner
c75fd78de3 Rollup merge of #35773 - EugeneGonzalez:master, r=jonathandturner
Change E0259 to the new error format

Fixes #35514 as part of #35233.

Sorry about creating a new PR I was having a lot of troubles squashing the commit because I didn't properly branch the new feature.

r? @GuillaumeGomez
2016-08-31 13:53:33 -07:00
Jonathan Turner
93c5d6cfd7 Rollup merge of #36141 - GuillaumeGomez:err_codes, r=jonathandturner
Err codes

r? @jonathandturner
2016-08-31 06:29:11 -07:00
Eugene R Gonzalez
d4ca5613a0 Change E0259 to the new error format
Fixed E0259 unit test

Added name of conflict to E0259's note
2016-08-30 21:28:50 -04:00
ggomez
150599d01d Add E0530 error explanation 2016-08-30 18:20:14 +02:00
bors
4473130f4e Auto merge of #36126 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 16 pull requests

- Successful merges: #35418, #35759, #35862, #35863, #35895, #35962, #35977, #35993, #35997, #36054, #36056, #36060, #36086, #36100, #36103, #36125
- Failed merges: #35771, #35810
2016-08-30 06:01:39 -07:00
bors
71ee82a8aa Auto merge of #36066 - jseyfried:rollup, r=Manishearth
Batch up libsyntax breaking changes

Batch of the following syntax-[breaking-change] changes:
 - #35591: Add a field `span: Span` to `ast::Generics`.
 - #35618: Remove variant `Mod` of `ast::PathListItemKind` and refactor the remaining variant `ast::PathListKind::Ident` to a struct `ast::PathListKind_`.
 - #35480: Change uses of `Constness` in the AST to `Spanned<Constness>`.
  - c.f. `MethodSig`, `ItemKind`
 - #35728: Refactor `cx.pat_enum()` into `cx.pat_tuple_struct()` and `cx.pat_path()`.
 - #35850: Generalize the elements of lists in attributes from `MetaItem` to a new type `NestedMetaItem` that can represent a `MetaItem` or a literal.
 - #35917: Remove traits `AttrMetaMethods`, `AttributeMethods`, and `AttrNestedMetaItemMethods`.
  - Besides removing imports of these traits, this won't cause fallout.
 - Add a variant `Union` to `ItemKind` to future proof for `union` (c.f. #36016).
 - Remove inherent methods `attrs` and `fold_attrs` of `Annotatable`.
  - Use methods `attrs` and `map_attrs` of `HasAttrs` instead.

r? @Manishearth
2016-08-30 00:36:19 -07:00
Mohit Agarwal
d6fc2baa11
Update E0260 to new error format
Updates #35515.
Part of #35233.

r? @jonathandturner
2016-08-29 16:20:08 +05:30
Jeffrey Seyfried
4fe94e0be6 Future proof the AST for union. 2016-08-29 05:20:40 +00:00
Jeffrey Seyfried
37f30173a0 Rollup merge of #35618 - jseyfried:ast_view_path_refactor, r=eddyb
Refactor `PathListItem`s

This refactors away variant `Mod` of `ast::PathListItemKind` and refactors the remaining variant `Ident` to a struct `ast::PathListItem_`.
2016-08-28 10:31:24 +00:00
Jonas Schievink
144e576c87 Use FnvHashMap in more places
* A step towards #34902
* More stable error messages in some places related to crate loading
* Possible slight performance improvements since all `HashMap`s
  replaced had small keys where `FnvHashMap` should be faster
  (although I didn't measure)
2016-08-27 15:20:45 +02:00
Jonathan Turner
0c84ac124a Rollup merge of #35858 - shyaamsundhar:patch-1, r=GuillaumeGomez
E0435, E0437 & E0438 New Error Format

Part of #35801 , #35802 and #35803
r? @GuillaumeGomez

Hi! Please review the changes.
2016-08-22 15:34:21 -07:00
Jonathan Turner
cc51d1c21d Rollup merge of #35841 - kyrias:new-error-E0424, r=GuillaumeGomez
Update E0424 to the new error format

Fixes #35797.
Part of #35233.

r? @GuillaumeGomez
2016-08-22 15:34:20 -07:00
Jonathan Turner
ae83225afc Rollup merge of #35835 - crypto-universe:E0426, r=jonathandturner
New format for E0426

Issue #35799 as a part of issue #35233
r? jonathandturner
2016-08-22 15:34:20 -07:00
Knight
8fdc531446 Updated E0423 to new format 2016-08-22 13:57:37 +08:00
Knight
a4c6307a15 Updated E0432 to new format 2016-08-22 13:57:10 +08:00
Jeffrey Seyfried
98ce875b58 Refactor away variant ast::PathListItemKind::Mod
and refactor `ast::PathListItemKind::Ident` -> `ast::PathListItem_`.
2016-08-21 22:59:36 +00:00
bors
1576de0ce6 Auto merge of #35776 - jseyfried:more_groundwork, r=nrc
resolve: More groundwork for `item_like_imports` (RFC 1560)

r? @nrc
2016-08-21 11:03:48 -07:00
Shyam Sundar B
738b91e997 Update lib.rs
Update lib.rs
Update lib.rs
Update E0438.rs
Update E0437.rs
Update E0435.rs
2016-08-21 18:43:58 +05:30
Johannes Löthberg
ff44f088d7 Update E0424 to the new error format
Fixes #35797.

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
2016-08-20 22:05:51 +02:00
crypto-universe
5d02b03059 New format for E0426
Issue #35799 as a part of issue #35233
?r jonathandturner
2016-08-19 22:31:31 +02:00
trixnz
3b64cf669c Update E0428 to new format 2016-08-19 19:19:34 +02:00
Jeffrey Seyfried
a6e8f3ba83 Add type Determinacy. 2016-08-18 08:09:24 +00:00
Jeffrey Seyfried
cc079c3af2 Refactor away ImportResolvingError. 2016-08-18 08:09:24 +00:00