about summary refs log tree commit diff
path: root/src/librustc_resolve
AgeCommit message (Collapse)AuthorLines
2019-10-15Don't use `gensym_if_underscore` to resolve `_` bindingsMatthew Jasper-63/+91
Instead add a disambiguator to the keys used for distinguishing resolutions.
2019-10-14rustc_metadata: Remove resolutions for extern crate items from `CStore`Vadim Petrochenkov-1/+5
Use a more traditional scheme with providing them as a resolver output
2019-10-14rustc_metadata: Crate loader is immutableVadim Petrochenkov-2/+2
2019-10-14rustc_metadata: Privatize private code and remove dead codeVadim Petrochenkov-4/+3
2019-10-14Rollup merge of #65363 - Centril:less-pprust, r=Mark-SimulacrumMazdak Farrokhzad-6/+12
Remove implicit dependencies on syntax::pprust Part of https://github.com/rust-lang/rust/pull/65324. The main goal here is to facilitate the eventual move of pprust out from libsyntax and because an AST definition typically should not depend on its pretty printer. r? @estebank
2019-10-13Add long error explanation for E0574Guillaume Gomez-1/+50
2019-10-13Rollup merge of #65250 - da-x:ctor-in-error-msgs, r=petrochenkovMazdak Farrokhzad-11/+23
resolve: fix error title regarding private constructors One reason is that constructors can be private while their types can be public. Idea credit to @petrochenkov, discussed at #65153
2019-10-13ast: remove implicit pprust dependency via Display.Mazdak Farrokhzad-6/+12
Instead just use `pprust::path_to_string(..)` where needed. This has two benefits: a) The AST definition is now independent of printing it. (Therefore we get closer to extracting a data-crate.) b) Debugging should be easier as program flow is clearer.
2019-10-11Rollup merge of #65283 - petrochenkov:softstab2, r=estebankTyler Mandry-1/+6
stability: Do not use `buffer_lint` after lowering to HIR Fixes https://github.com/rust-lang/rust/issues/65253
2019-10-11resolve: shorten wording on private constructor errorDan Aloni-1/+1
2019-10-11resolve: fix error title regarding private constructorsDan Aloni-10/+22
The constructor is private, not the type. Idea credit to @petrochenkov, discussed at #65153
2019-10-11Auto merge of #64716 - jonhoo:stabilize-mem-take, r=SimonSapinbors-1/+0
Stabilize mem::take (mem_take) Tracking issue: https://github.com/rust-lang/rust/issues/61129 r? @matklad
2019-10-10stability: Do not use `buffer_lint` after lowering to HIRVadim Petrochenkov-1/+6
2019-10-10Auto merge of #65153 - da-x:issue-58017, r=petrochenkovbors-26/+24
Improve message when attempting to instantiate tuple structs with private fields Fixes #58017, fixes #39703. ``` error[E0603]: tuple struct `Error` is private --> main.rs:22:16 | 2 | pub struct Error(usize, pub usize, usize); | ----- ----- field is private | | | field is private ... 22 | let x = a::Error(3, 1, 2); | ^^^^^ | = note: a tuple struct constructor is private if any of its fields is private ```
2019-10-10Auto merge of #65140 - petrochenkov:disapp, r=nikomatsakisbors-1/+0
resolve: Remove an incorrect assert Fixes https://github.com/rust-lang/rust/issues/64803.
2019-10-09resolve: Use field spans for reporting the private constructor errorVadim Petrochenkov-18/+12
2019-10-09resolve: Keep field spans for diagnosticsVadim Petrochenkov-8/+12
2019-10-09self-profiling: Add events for everything except trait selection.Michael Woerister-0/+3
2019-10-08Stabilize mem::take (mem_take)Jon Gjengset-1/+0
Tracking issue: https://github.com/rust-lang/rust/issues/61129
2019-10-08Rollup merge of #65133 - ↵Mazdak Farrokhzad-178/+161
davidtwco:issue-65035-static-with-generic-in-foreign-mod, r=petrochenkov typeck: prohibit foreign statics w/ generics Fixes #65035 and fixes #65025. This PR modifies resolve to disallow foreign statics that have generics. `improper_ctypes` is not written to support type parameters, as these are normally disallowed before the lint is run. Thus, type parameters in foreign statics must be prohibited before the lint. The only other case where this *could* have occured is in functions, but typeck prohibits this with a "foreign items may not have type parameters" error - a similar error did not exist for statics, because statics cannot have type parameters, but they can use any type parameters that are in scope (which isn't the case for functions).
2019-10-08resolve: prohibit foreign statics w/ genericsDavid Wood-178/+161
This commit modifies resolve to disallow foreign statics that use parent generics. `improper_ctypes` is not written to support type parameters, as these are normally disallowed before the lint is run. Thus, type parameters in foreign statics must be prohibited before the lint. The only other case where this *could* have occured is in functions, but typeck prohibits this with a "foreign items may not have type parameters" error - a similar error did not exist for statics, because statics cannot have type parameters, but they can use any type parameters that are in scope (which isn't the case for functions). Signed-off-by: David Wood <david@davidtw.co>
2019-10-06Auto merge of #65043 - Aaron1011:fix/reexport-determinism, r=petrochenkovbors-15/+5
Make re-export collection deterministic Fixes https://github.com/rust-lang/rust/issues/65036 Previously, we were using an `FxHashMap` to collect module re-exports. However, re-exports end up getting serialized into crate metadata, which means that metadata generation was non-deterministic. This resulted in spurious error messages changes (e.g. PR #64906) due to pretty-printing implicitly depending on the order of re-exports when computing the proper path to show to the user. See #65042 for a long-term strategy to detect this kind of issue
2019-10-05Rollup merge of #64708 - SimonSapin:option-deref, r=CentrilTyler Mandry-1/+0
Stabilize `Option::as_deref` and `Option::as_deref_mut` The tracking issue https://github.com/rust-lang/rust/issues/50264 still has unresolved question for the corresponding `Result` methods.
2019-10-05resolve: Remove an incorrect assertVadim Petrochenkov-1/+0
2019-10-05Remove `for_each_child_stable`Aaron Hill-14/+3
Now that `Resolutions` has a deterministic iteration order, it's no longer necessary to sort its entries before iterating over them
2019-10-05Make re-export collection deterministicAaron Hill-1/+2
Previously, we were using an `FxHashMap` to collect module re-exports. However, re-exports end up getting serialized into crate metadata, which means that metadata generation was non-deterministic. This resulted in spurious error messages changes (e.g. PR #64906) due to pretty-printing implicitly depending on the order of re-exports when computing the proper path to show to the user. See #65042 for a long-term strategy to detect this kind of issue
2019-10-03Allocate a new diagnostic for defaulted type parameters cannot use `Self`Felix S. Klock II-6/+40
(Without this commit, you still get an error (a very similar one, at that), but it complains about use of forward declaration, which is confusing since people do not necessarily think of `Self` as being declared at all.) Update: incorporate review feedback.
2019-10-03The crux of the bug fix.Felix S. Klock II-0/+13
Update: review feedback Update: placate tidy
2019-09-29Rollup merge of #64691 - estebank:unexpected-variant, r=CentrilMazdak Farrokhzad-8/+14
Point at definition when misusing ADT When given `struct Foo(usize)` and using it as `Foo {}` or `Foo`, point at `Foo`'s definition in the error.
2019-09-28Auto merge of #64455 - GuillaumeGomez:long-error-explanation-E0531, r=Centrilbors-1/+45
Add Long error explanation for E0531 Part of #61137.
2019-09-26Rename `MetaItem.node` to `MetaItem.kind`varkor-1/+1
2019-09-26Rename `ForeignItem.node` to `ForeignItem.kind`varkor-3/+3
2019-09-26Rename `Item.node` to `Item.kind`varkor-9/+9
2019-09-26Rename `Stmt.node` to `Stmt.kind`varkor-3/+3
2019-09-26Rename `Ty.node` to `Ty.kind`varkor-8/+8
2019-09-26Rename `TraitItem.node` to `TraitItem.kind`varkor-4/+4
2019-09-26Rename `ImplItem.node` to `ImplItem.kind`varkor-2/+2
2019-09-26Rename `Pat.node` to `Pat.kind`varkor-5/+5
2019-09-26Rename `Expr.node` to `Expr.kind`varkor-11/+11
For both `ast::Expr` and `hir::Expr`.
2019-09-25Add long error explanation for E0531Guillaume Gomez-1/+45
2019-09-24Rollup merge of #64702 - sinkuu:deps, r=jonas-schievinkMazdak Farrokhzad-1/+0
Remove unused dependencies
2019-09-23Stabilize Option::deref and Option::deref_mutSimon Sapin-1/+0
The tracking issue https://github.com/rust-lang/rust/issues/50264 still has unresolved question for the corresponding `Result` methods.
2019-09-23Remove unused dependenciesShotaro Yamada-1/+0
2019-09-22Point at definition when misusing ADTEsteban Küber-8/+14
When given `struct Foo(usize)` and using it as `Foo {}` or `Foo`, point at `Foo`'s definition in the error.
2019-09-22reduce visibility of a bunch of stuff in ext::ttAleksey Kladov-2/+2
2019-09-21Rollup merge of #64660 - guanqun:unify-errors-for-tuple-struct, r=estebankMazdak Farrokhzad-0/+6
unify errors for tuple/struct variants fix #63983
2019-09-21unify errors for tuple/struct variantsGuanqun Lu-0/+6
fix #63983
2019-09-21Rollup merge of #64632 - guanqun:patch-1, r=jonas-schievinkMazdak Farrokhzad-1/+1
remove the extra comma after the match arm This would follow the same coding style as all the other match arms in this file.
2019-09-21remove the extra comma after the match armguanqun-1/+1
This would follow the same coding style as all the other match arms in this file.
2019-09-20factor out pluralisation remains after #64280gaolei-3/+5