Commit Graph

693 Commits

Author SHA1 Message Date
Jeffrey Seyfried
c86c8d41a2 Perform node id assignment and macros_at_scope construction during
the `InvocationCollector` and `PlaceholderExpander` folds.
2016-09-13 09:40:28 +00:00
Jeffrey Seyfried
72a636975f Move macro resolution into librustc_resolve. 2016-09-13 09:40:26 +00:00
Jeffrey Seyfried
a9821e1658 Refactor ExtCtxt to use a Resolver instead of a MacroLoader. 2016-09-13 05:31:16 +00:00
Alex Burka
0a62676c73 fix "X is not a member of trait Y" span labels
The span labels for associated types and consts were hardcoded to `Foo`
rather than substituting the name of the trait.

This also normalizes the wording for associated methods', traits', and
consts' span labels.

Fixes #36428.
2016-09-13 03:13:13 +00: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
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
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
245a0c5530 item_like_imports: Make all visible items glob importable. 2016-09-01 22:30:26 +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
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
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
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
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
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
fbc322975f Refactor out finalize_import() from resolve_import(). 2016-08-18 03:31:10 +00:00
Jeffrey Seyfried
165b0b618c Check privacy in resolve_name_in_module. 2016-08-18 03:22:48 +00:00
Jeffrey Seyfried
7608bbdea8 Refactor resolve_module_path to take an Option<Span> instead of a Span. 2016-08-18 03:22:47 +00:00
Jeffrey Seyfried
05afe15d1f Refactor record_used: bool -> record_used: Option<Span>. 2016-08-18 03:22:47 +00:00
Jeffrey Seyfried
75c3fd89d4 Refactor away the field arenas of ModuleS. 2016-08-18 03:22:47 +00:00
Jeffrey Seyfried
bfc98f59a4 Refactor away module.resolve_name(). 2016-08-18 03:22:47 +00:00
Jeffrey Seyfried
89de52eff0 Add field current_vis to Resolver. 2016-08-18 03:22:43 +00:00
Jeffrey Seyfried
37154ca95d Refactor unresolved_imports -> indeterminate_imports. 2016-08-18 03:13:42 +00:00
Jeffrey Seyfried
c64cd86be8 Add field parent to ImportDirective. 2016-08-18 03:13:41 +00:00
Eduard-Mihai Burtescu
c3601d40ec Rollup merge of #35756 - crypto-universe:E0407, r=GuillaumeGomez
New output for E0407

Issue #35697 as a part of #35233.
r? @GuillaumeGomez
2016-08-18 06:12:23 +03:00
Eduard-Mihai Burtescu
71759ec52c Rollup merge of #35739 - circuitfox:E0403-update-error-format, r=jonathandturner
E0403 update error format

Fixes #35696

Part of #35233

r? @jonathandturner

Also did the bonus for this one.
2016-08-18 06:12:21 +03:00
crypto-universe
2179defa04 New output for E0407
Issue #35697 as a part of #35233.
r? @jonathandturner
2016-08-17 19:59:22 +02:00
Chris Stankus
6a1efbd08e Merge branch 'master' into E0403-update-error-format 2016-08-17 12:31:20 -05:00
Jonathan Turner
fbc62afba6 Rollup merge of #35726 - mikhail-m1:master2, r=jonathandturner
update E0409 to new error format

fixes #35699 as part of #35233.

r? @jonathandturner
2016-08-17 06:25:28 -07:00
Jonathan Turner
5fc58dcaff Rollup merge of #35722 - knight42:update-error-msg, r=jonathandturner
Updated E0394 & E0422 to new format

Fixes #35692 and #35700, as part of #35233.

r? @jonathandturner
2016-08-17 06:25:27 -07:00
Eduard Burtescu
c1cfd58cbd rustc: remove SelfSpace from ParamSpace. 2016-08-17 05:50:57 +03:00
Chris Stankus
f0ff2d32c8 E0403 update error format 2016-08-16 20:49:09 -05:00
Mikhail Modin
193b9ae86b update to new error format E0409 2016-08-16 22:13:09 +03:00
Knight
d2e78956c3 Updated E0422 to new error message 2016-08-17 03:02:25 +08:00
Eduard-Mihai Burtescu
812a8c1e33 Rollup merge of #35596 - crypto-universe:E0254_style_and_tests, r=jonathandturner
Add label to E0254

This issue #35513 is a part of #35233.
r? @jonathandturner
2016-08-14 20:29:50 +03:00
bors
8787a12334 Auto merge of #35592 - jonathandturner:rollup, r=jonathandturner
Rollup of 23 pull requests

- Successful merges: #35279, #35331, #35358, #35375, #35445, #35448, #35482, #35486, #35505, #35528, #35530, #35532, #35536, #35537, #35541, #35552, #35554, #35555, #35557, #35562, #35565, #35569, #35576
- Failed merges: #35395, #35415, #35563
2016-08-11 13:14:28 -07:00
crypto-universe
4209f948b1 Add label to E0254
This issue #35513 is a part of #35233.
r? @jonathandturner
2016-08-11 20:15:10 +02:00
Jonathan Turner
d3af9a38ed Fix tidy warning 2016-08-11 10:17:12 -07:00
Jonathan Turner
294ac7b561 Rollup merge of #35536 - hank-der-hafenarbeiter:E0433, r=jonathandturner
Updated E0433 to new error message. (no bonus)

Part of #35345
r? @jonathandturner
2016-08-11 06:33:59 -07:00
petrochenkov
08f0f7c54a Substitute private type aliases in rustdoc 2016-08-11 00:32:07 +03:00
Niko Matsakis
ae9c049cfc remove field that need not be public 2016-08-09 20:28:46 -04:00
hank-der-hafenarbeiter
ee076dd937 Updated E0433 to new error message. (no bonus) 2016-08-09 00:26:43 +02:00
bors
f5e7a5910d Auto merge of #35362 - medzin:E0252, r=GuillaumeGomez
Updated error message E0252

Fixes #35306 as part of #35233.

r? @GuillaumeGomez
2016-08-07 05:48:47 -07:00
Adam Medziński
f4dd1f9500 Updated error message E0252 2016-08-06 13:31:03 +02:00
bors
7bf54f90d6 Auto merge of #35116 - jseyfried:groundwork_for_new_import_semantics, r=nrc
resolve: diagnostics improvement and groundwork for RFC 1560

Fixes #35115, fixes #35135, and lays groundwork for #32213 (cc #35120).
r? @nrc
2016-08-05 14:42:42 -07:00
Ryan Scott
19e140b946 Update E0404 to new format. 2016-08-05 17:36:43 +09:00
Jeffrey Seyfried
0db8ca6ca2 nit: rename module_ -> module 2016-08-01 19:10:05 +00:00
Jeffrey Seyfried
6372a6d7c2 Improve diagnostics for pattern bindings that illegally shadow items.
Improve unused import detection.
2016-08-01 19:09:58 +00:00
Jeffrey Seyfried
07c706b57c Clean up resolver.record_use(). 2016-08-01 19:06:47 +00:00
Jeffrey Seyfried
b107a4e4f6 Refactor module.try_define_child(..) -> resolver.try_define(module, ..). 2016-08-01 19:06:45 +00:00
Jeffrey Seyfried
d6b10beb88 Make "type aliases cannot be used for traits" a note instead of a span_label. 2016-07-31 21:29:01 +00:00
Jeffrey Seyfried
93fd214d61 Clean up resolve_trait_reference. 2016-07-31 20:40:03 +00:00
Jeffrey Seyfried
46bd5d3fa0 Avoid emitting a unhelpful cascading resolution error. 2016-07-31 20:17:08 +00:00
Manish Goregaokar
8c6421fb17 Rollup merge of #35063 - jseyfried:avoid_importing_inaccessible_names, r=nrc
resolve: Exclude inaccessible names from single imports

If a single import resolves to an inaccessible name in some but not all namespaces, avoid importing the name in the inaccessible namespaces.

Currently, the inaccessible namespaces are imported but cause a privacy error when used.

r? @nrc
2016-07-30 13:44:46 +05:30
Jeffrey Seyfried
132bff9933 If a single import resolves to an inaccessible name in some but not all namespaces,
avoid importing the name in the inaccessible namespaces.

Currently, the inaccessible namespaces are imported but cause a privacy error when used.
2016-07-27 05:17:04 +00:00
Vadim Petrochenkov
d7a968eb1c Fix ICE happening when unresolved imports are used in patterns 2016-07-21 21:19:16 +03:00
Jeffrey Seyfried
44575f708a Rename mtwt to hygiene 2016-07-17 17:12:35 +00:00
Jeffrey Seyfried
76ed445622 Clean up and encapsulate syntax::ext::mtwt 2016-07-17 17:12:32 +00:00
Jeffrey Seyfried
c83e31e7c9 Include the MacroDefinition rib in the label ribs. 2016-07-15 05:16:21 +00:00
Jeffrey Seyfried
0701571fe7 Implement macro_rules! placeholders and the macro scope map 2016-07-14 01:34:37 +00:00
Jeffrey Seyfried
a15dfca54f Instead of renaming, treat differently marked identifiers as unequal 2016-07-14 01:34:31 +00:00
Jeffrey Seyfried
195a27faab Move node id assigning into resolve 2016-07-14 01:30:19 +00:00
petrochenkov
d27e55c5d8 Stabilize FnOnce::Output + Fix rebase 2016-07-08 13:35:17 +03:00
Vadim Petrochenkov
eb32440d45 Do not generate Def::Err in bindings
Instead of Def::Err erroneous bindings can get usual definitions that doesn't require special cases later on and have less chances to generate ICE.
2016-07-08 12:42:57 +03:00
Vadim Petrochenkov
d3c94b25cb Don't generate Def::Err if it's not stored in def_map immediately 2016-07-08 12:36:45 +03:00
bors
b4e11c2af8 Auto merge of #34655 - jseyfried:improve_resolver_api, r=nrc
Add to `resolve`'s public API

This adds a public method `with_module_lexical_scope` to `Resolver` to allow users to resolve a path in the lexical scope of an arbitrary module.
r? @nrc
2016-07-06 23:18:23 -07:00
Steve Klabnik
26821a6f88 Rollup merge of #34636 - tshepang:shorten, r=GuillaumeGomez
doc: fix and shorten comment
2016-07-06 19:13:08 -04:00
Jeffrey Seyfried
58dd06d9e5 Add FIXME comment 2016-07-05 22:38:41 +00:00
Jeffrey Seyfried
6e0bd44fa3 Add method with_module_lexical_scope to Resolver. 2016-07-05 08:50:43 +00:00
Tshepang Lekhonkhobe
5efc780e14 doc: fix and shorten comment 2016-07-03 22:03:45 +02:00
Jeffrey Seyfried
d1e3d6272e Add the after_expand entry point between import resolution and the rest of name resolution 2016-07-01 00:07:32 +00:00
Manish Goregaokar
8e2598c3d2 Rollup merge of #34542 - jseyfried:fix_recursive_modules, r=nrc
Fix non-termination on recursive module re-exports in extern crates

Fixes #33776.
r? @nrc
2016-06-29 21:21:24 +05:30
Jeffrey Seyfried
232783c914 Fix infinite loop on recursive module exports in an extern crate 2016-06-28 23:03:56 +00:00
Jeffrey Seyfried
e58963d3e4 groundwork: create the Resolver earlier in phase 2 2016-06-28 05:28:27 +00:00
Jeffrey Seyfried
ec0c150152 groundwork: refactor the interface that resolve exposes to driver 2016-06-28 05:28:26 +00:00
Jeffrey Seyfried
4a13bcb4fb groundwork: use resolve_identifier instead of resolve_path to classify ident patterns 2016-06-28 05:28:23 +00:00
Jeffrey Seyfried
8748cd92d0 Rollup merge of #34316 - jseyfried:refactor_ast_stmt, r=eddyb
Refactor away `ast::Decl`, refactor `ast::Stmt`, and rename `ast::ExprKind::Again` to `ast::ExprKind::Continue`.
2016-06-26 02:17:27 +00:00
Jeffrey Seyfried
33ea1e330c Rollup merge of #33943 - jseyfried:libsyntax_cleanup, r=nrc
Miscellaneous low priority cleanup in `libsyntax`.
2016-06-26 02:15:04 +00:00
Jeffrey Seyfried
d3ae56d755 Rollup merge of #34403 - jonathandturner:move_liberror, r=alexcrichton
This PR refactors the 'errors' part of libsyntax into its own crate (librustc_errors).  This is the first part of a few refactorings to simplify error reporting and potentially support more output formats (like a standardized JSON output and possibly an --explain mode that can work with the user's code), though this PR stands on its own and doesn't assume further changes.

As part of separating out the errors crate, I have also refactored the code position portion of codemap into its own crate (libsyntax_pos).  While it's helpful to have the common code positions in a separate crate for the new errors crate, this may also enable further simplifications in the future.
2016-06-25 22:35:09 +00:00
Jeffrey Seyfried
4e2e31c118 Rollup merge of #34368 - petrochenkov:astqpath, r=Manishearth
The AST part of https://github.com/rust-lang/rust/pull/34365

plugin-[breaking-change] cc https://github.com/rust-lang/rust/issues/31645
2016-06-25 22:35:06 +00:00
Jeffrey Seyfried
f0310e061b Rollup merge of #34213 - josephDunne:trait_item_macros, r=jseyfried
**syntax-[breaking-change]** cc #31645
New `TraitItemKind::Macro` variant

This change adds support for macro expansion inside trait items by adding the new `TraitItemKind::Macro` and associated parsing code.
2016-06-25 22:35:01 +00:00
Jonathan Turner
6ae3502134 Move errors from libsyntax to its own crate 2016-06-23 08:07:35 -04:00
Vadim Petrochenkov
f903c97959 Merge PatKind::QPath into PatKind::Path in AST 2016-06-20 23:39:02 +03:00
Guillaume Gomez
8637b4b034 Remove unused functions calls and unused E0406 2016-06-18 17:02:41 +02:00
Jeffrey Seyfried
f0b21c2d1e Rename ast::ExprKind::Again -> ast::ExprKind::Continue 2016-06-17 05:21:25 +00:00
Jeffrey Seyfried
0644aba0b3 Remove the type parameter from syntax::visit::Visitor 2016-06-14 07:40:32 +00:00
Joseph Dunne
dc3d878e0f Add support for macro expansion inside trait items 2016-06-13 21:46:43 +01:00
Vadim Petrochenkov
6d7b35bd98 Address review comments + fix rebase 2016-06-10 01:06:37 +03:00
Vadim Petrochenkov
ee4e55398b Introduce TyCtxt::expect_def/expect_resolution helpers and use them where possible 2016-06-10 01:03:54 +03:00
Vadim Petrochenkov
4c30f6405c Move the hack with fake partial resolution for <A>::B from typeck to resolve 2016-06-10 01:03:54 +03:00
Vadim Petrochenkov
91b9dabdeb resolve: Rewrite resolve_pattern 2016-06-10 01:03:54 +03:00
Jeffrey Seyfried
49de80d7ea Refactor away the prelude injection pass 2016-06-07 00:31:42 +00:00
Jeffrey Seyfried
0f37edb758 Refactor away method resolve_name_in_lexical_scope of ModuleS 2016-06-06 21:51:11 +00:00
bors
0646e8ae6e Auto merge of #33878 - GuillaumeGomez:improve_helps, r=jonathandturner
Improve help messages for E0425

Fixes #33876.

r? @Manishearth

cc @steveklabnik
cc @jonathandturner
2016-06-02 18:10:37 -07:00
ggomez
f4e6f3c186 Improve help messages for E0425 2016-06-02 13:58:21 +02:00
Daan Sprenkels
cde0f94a52 librustc_resolve: make sure pattern def gets recorded if resolve_path returns Err(true)
In 1a374b8, (pr #33046) fixed the error reporting of a specific
case, but the change that was introduced did not make sure that
`record_def` was called in all cases, which lead to an ICE in [1].
This change restores the original `else` case, but keeps the changes
that were committed in 1a374b8.

This commit fixes issue #33293.

[1] `rustc::middle::mem_categorization::MemCategorizationContext::cat_pattern_`
2016-05-30 18:31:01 +02:00
Manish Goregaokar
7905452f08 Rollup merge of #33644 - petrochenkov:selfast, r=nrc
The AST part of https://github.com/rust-lang/rust/pull/33505.
https://github.com/rust-lang/rust/pull/33505 isn't landed yet, so this PR is based on top of it.

r? @nrc

plugin-[breaking-change] cc #31645 @Manishearth
2016-05-27 09:57:11 +05:30
Manish Goregaokar
35785712cd Rollup merge of #33639 - petrochenkov:dotdot, r=nmatsakis
cc https://github.com/rust-lang/rust/issues/33627
r? @nikomatsakis

plugin-[breaking-change] cc https://github.com/rust-lang/rust/issues/31645 @Manishearth
2016-05-27 09:57:00 +05:30
Manish Goregaokar
a70880fea9 Rollup merge of #33351 - birkenfeld:loop-label-spans, r=pnkfelix
This makes the \"shadowing labels\" warning *not* print the entire loop as a span, but only the lifetime.

Also makes #31719 go away, but does not fix its root cause (the span of the expanded loop is still wonky, but not used anymore).
2016-05-27 09:56:47 +05:30
Vadim Petrochenkov
d69aeaf662 Implement .. in tuple (struct) patterns 2016-05-26 11:11:58 +03:00
Vadim Petrochenkov
dcea4b2626 Fix rebase 2016-05-25 22:17:58 +03:00
bors
487de42083 Auto merge of #33615 - GuillaumeGomez:field_static_method, r=pnkfelix
Don't suggest using fields in a static method

Fixes #33613.

cc @LeoTestard
2016-05-24 21:52:02 -07:00
Georg Brandl
2e812e10f4 syntax/hir: give loop labels a span
This makes the "shadowing labels" warning *not* print the entire loop
as a span, but only the lifetime.

Also makes #31719 go away, but does not fix its root cause (the span
of the expanded loop is still wonky, but not used anymore).
2016-05-24 14:22:14 +02:00
ggomez
145747ebfc Don't suggest using fields in a static method 2016-05-23 01:18:06 +02:00
Niko Matsakis
7734308f89 ignore dep-graph in resolve and lower_crate
This got removed at some point, it seems.
2016-05-18 10:11:35 -04:00
Vadim Petrochenkov
79b343d87c lowering: Rename identifiers only when necessary
Do not rename invalid identifiers, they stop being invalid after renaming
2016-05-16 22:25:08 +03:00
Vadim Petrochenkov
aad347c4f7 Remove hir::Ident 2016-05-16 22:25:08 +03:00
bors
e87cd7e380 Auto merge of #33505 - petrochenkov:self, r=nrc
Remove ExplicitSelf from HIR

`self` argument is already kept in the argument list and can be retrieved from there if necessary, so there's no need for the duplication.
The same changes can be applied to AST, I'll make them in the next breaking batch.
The first commit also improves parsing of method declarations and fixes https://github.com/rust-lang/rust/issues/33413.

r? @eddyb
2016-05-15 23:14:52 -07:00
bors
5ebe41835f Auto merge of #33619 - jonathandturner:improve_structured_errors, r=nikomatsakis
Batch of improvements to errors for new error format

This is a batch of improvements to existing errors to help get the most out of the new error format.

* Added labels to primary spans (^^^) for a set of errors that didn't currently have them
* Highlight the source blue under the secondary notes for better readability
* Move some of the "Note:" into secondary spans+labels
* Fix span_label to take &mut instead, which makes it work the same as other methods in that set
2016-05-15 15:08:46 -07:00
Vadim Petrochenkov
766f9b5a2f Remove ExplicitSelf from HIR 2016-05-14 13:26:40 +03:00
Manish Goregaokar
8845592514 Rollup merge of #33572 - nagisa:assoc-const-types, r=eddyb
Support references to outer type params for assoc consts

Fixes #28809

r? @eddyb
2016-05-14 11:57:48 +02:00
Jonathan Turner
6793cace06 Address nit 2016-05-13 12:57:34 -07:00
Jonathan Turner
1b6afd1e42 Update errors to use new error format 2016-05-12 16:48:59 -07:00
Jonathan Turner
104fe1c4db Updating a few more errors with labels 2016-05-12 16:39:19 -07:00
Niko Matsakis
aa00e3a552 re-introduce a cache for ast-ty-to-ty
It turns out that `ast_ty_to_ty` is supposed to be updating the `def`
after it finishes, but at some point in the past it stopped doing
so. This was never noticed because of the `ast_ty_to_ty_cache`, but that
cache was recently removed. This PR fixes the code to update the def
properly, but apparently that is not quite enough to make the operation
idempotent, so for now we reintroduce the cache too.

Fixes #33425.
2016-05-12 14:23:26 -04:00
Simonas Kazlauskas
fd70788e6d Do not use const Rib for associated constants 2016-05-12 00:31:43 +03:00
Eduard Burtescu
3a3013613a rustc: Remove the unnecessary ast_ty_to_ty_cache. 2016-05-11 04:14:58 +03:00
bors
d6588097d4 Auto merge of #33471 - birkenfeld:issue-33464, r=jseyfried
resolve: do not modify span of non-importable name

This span modification is probably leftover from a time when import spans were assigned differently.

With this change, error spans for the following are properly reported:

```
use abc::one_el;
use abc::{a, bbb, cccccc};
use a_very_long_name::{el, el2};
```

before (spans only):
```
x.rs:3 use abc::one_el;
           ^~~
x.rs:4 use abc::{a, bbb, cccccc};
                 ^~~
x.rs:4 use abc::{a, bbb, cccccc};
                    ^~~
x.rs:4 use abc::{a, bbb, cccccc};
                         ^~~
(internal compiler error: unprintable span)
(internal compiler error: unprintable span)
```

after:
```
x.rs:3 use abc::one_el;
           ^~~~~~~~~~~
x.rs:4 use abc::{a, bbb, cccccc};
                 ^
x.rs:4 use abc::{a, bbb, cccccc};
                    ^~~
x.rs:4 use abc::{a, bbb, cccccc};
                         ^~~~~~
x.rs:5 use a_very_long_name::{el, el2};
                              ^~
x.rs:5 use a_very_long_name::{el, el2};
                                  ^~~
```

Fixes: #33464
2016-05-10 05:22:17 -07:00
Georg Brandl
b62e7ff18d resolve: do not modify span of non-importable name
This span modification is probably leftover from a time when
import spans were assigned differently.

With this change, error spans for the following are properly reported:

```
use abc::one_el;
use abc::{a, bbb, cccccc};
use a_very_long_name::{el, el2};
```

before (spans only):
```
x.rs:3 use abc::one_el;
           ^~~
x.rs:4 use abc::{a, bbb, cccccc};
                 ^~~
x.rs:4 use abc::{a, bbb, cccccc};
                    ^~~
x.rs:4 use abc::{a, bbb, cccccc};
                         ^~~
(internal compiler error: unprintable span)
(internal compiler error: unprintable span)
```

after:
```
x.rs:3 use abc::one_el;
           ^~~~~~~~~~~
x.rs:4 use abc::{a, bbb, cccccc};
                 ^
x.rs:4 use abc::{a, bbb, cccccc};
                    ^~~
x.rs:4 use abc::{a, bbb, cccccc};
                         ^~~~~~
x.rs:5 use a_very_long_name::{el, el2};
                              ^~
x.rs:5 use a_very_long_name::{el, el2};
                                  ^~~
```

Fixes: #33464
2016-05-10 08:35:37 +02:00
bors
a4d2424cc3 Auto merge of #33443 - jseyfried:resolve_ast, r=nrc
Perform name resolution before and during ast->hir lowering

This PR performs name resolution before and during ast->hir lowering instead of in phase 3.
r? @nrc
2016-05-09 21:31:55 -07:00
Jeffrey Seyfried
6710eef6b2 Refactor hir::lowering::Resolver 2016-05-09 10:27:24 +00:00
Manish Goregaokar
84843b73dc
Merge E0410 into E0408 2016-05-08 23:36:40 -07:00
Jeffrey Seyfried
e5a0dd7c6e Resolve paths generated in the ast->hir lowerer 2016-05-09 02:31:06 +00:00
Jeffrey Seyfried
983b4d3925 Refactor the interface that resolve exposes to driver 2016-05-09 02:31:06 +00:00
Jeffrey Seyfried
8428447253 Move resolution to before lowering 2016-05-09 02:31:04 +00:00
Jeffrey Seyfried
a988c9a839 Refactor Resolver field def_map from RefCell<DefMap> to DefMap 2016-05-09 00:48:48 +00:00
Jeffrey Seyfried
8c2fa93e81 Remove a use of ast_map.span_if_local() in resolve 2016-05-09 00:48:44 +00:00