about summary refs log tree commit diff
path: root/src/librustc_resolve/diagnostics.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-1678/+0
2020-08-17rust_ast::ast => rustc_astUjjwal Sharma-1/+1
2020-08-15replaced log with tracingGurpreet Singh-1/+1
2020-08-10Do not suggest similarly named enclosing itemEsteban Küber-13/+34
2020-08-08Auto merge of #74877 - lcnr:min_const_generics, r=oli-obkbors-0/+17
Implement the `min_const_generics` feature gate Implements both https://github.com/rust-lang/lang-team/issues/37 and https://github.com/rust-lang/compiler-team/issues/332. Adds the new feature gate `#![feature(min_const_generics)]`. This feature gate adds the following limitations to using const generics: - generic parameters must only be used in types if they are trivial. (either `N` or `{ N }`) - generic parameters must be either integers, `bool` or `char`. We do allow arbitrary expressions in associated consts though, meaning that the following is allowed, even if `<[u8; 0] as Foo>::ASSOC` is not const evaluatable. ```rust trait Foo { const ASSOC: usize; } impl<const N: usize> Foo for [u8; N] { const ASSOC: usize = 64 / N; } ``` r? @varkor cc @eddyb @withoutboats
2020-08-05forbid generic params in complex constsBastian Kauschke-0/+17
2020-08-05Handle fieldless tuple structs in diagnostic codeAaron Hill-4/+3
Fixes #75062
2020-07-27forbid generic params inside of anon consts in ty defaultsBastian Kauschke-0/+11
2020-07-27name `ParamInTyOfConstArg`Bastian Kauschke-1/+1
2020-07-18rustc_metadata: Make crate loading fully speculativeVadim Petrochenkov-3/+1
2020-07-16update help messageBastian Kauschke-2/+5
2020-07-16forbid generic params in the type of const paramsBastian Kauschke-0/+10
2020-07-15Remove lots of `Symbol::as_str()` calls.Nicholas Nethercote-1/+1
In various ways, such as changing functions to take a `Symbol` instead of a `&str`.
2020-07-15Add and use more static symbols.Nicholas Nethercote-3/+2
Note that the output of `unpretty-debug.stdout` has changed. In that test the hash values are normalized from a symbol numbers to small numbers like "0#0" and "0#1". The increase in the number of static symbols must have caused the original numbers to contain more digits, resulting in different pretty-printing prior to normalization.
2020-07-09Rollup merge of #74188 - estebank:tweak-ascription-typo-heuristic, ↵Manish Goregaokar-35/+33
r=petrochenkov Tweak `::` -> `:` typo heuristic and reduce verbosity Do not trigger on correct type ascription expressions with trailing operators and _do_ trigger on likely path typos where a turbofish is used. On likely path typos, remove note explaining type ascription. Clean up indentation. r? @petrochenkov
2020-07-09Reduce indentationEsteban Küber-35/+33
2020-07-02resolve: disallow label use through closure/asyncDavid Wood-10/+68
This commit modifies resolve to disallow `break`/`continue` to labels through closures or async blocks. This doesn't make sense and should have been prohibited anyway. Signed-off-by: David Wood <david@davidtw.co>
2020-06-24Rollup merge of #73652 - da-x:add-reexported-to-use-suggestions, r=petrochenkovDylan DPC-8/+20
Add re-exports to use suggestions In the following example, an inaccessible path is suggested via `use foo::bar::X;` whereas an accessible public exported path can be suggested instead. ```rust mod foo { mod bar { pub struct X; } pub use self::bar::X; } fn main() { X; } ``` This fixes the issue.
2020-06-23Rollup merge of #73587 - marmeladema:hir-id-ification-final, r=petrochenkovManish Goregaokar-4/+4
Move remaining `NodeId` APIs from `Definitions` to `Resolver` Implements https://github.com/rust-lang/rust/pull/73291#issuecomment-643515557 TL;DR: it moves all fields that are only needed during name resolution passes into the `Resolver` and keep the rest in `Definitions`. This effectively enforces that all references to `NodeId`s are gone once HIR lowering is completed. After this, the only remaining work for #50928 should be to adjust the dev guide. r? @petrochenkov
2020-06-23Review fixesDan Aloni-2/+7
2020-06-23Add re-exports to use suggestionsDan Aloni-8/+15
In the following example, an inaccessible path is suggested via `use foo::bar::X;` whereas an accessible public exported path can be suggested instead. ``` mod foo { mod bar { pub struct X; } pub use self::bar::X; } fn main() { X; } ``` This fixes the issue.
2020-06-21Move remaining `NodeId` APIs from `Definitions` to `Resolver`marmeladema-4/+4
2020-06-21Prefer accessible paths in 'use' suggestionsDan Aloni-22/+43
This fixes an issue with the following sample: mod foo { mod inaccessible { pub struct X; } pub mod avail { pub struct X; } } fn main() { X; } Instead of suggesting both `use crate::foo::inaccessible::X;` and `use crate::foo::avail::X;`, it should only suggest the latter. It is done by trimming the list of suggestions from inaccessible paths if accessible paths are present. Visibility is checked with `is_accessible_from` now instead of being hard-coded. - Some tests fixes are trivial, and others require a bit more explaining, here are my comments: src/test/ui/issues/issue-35675.stderr: Only needs to make the enum public to have the suggestion make sense. src/test/ui/issues/issue-42944.stderr: Importing the tuple struct won't help because its constructor is not visible, so the attempted constructor does not work. In that case, it's better not to suggest it. The case where the constructor is public is covered in `issue-26545.rs`.
2020-06-10Rollup merge of #73023 - ayushmishra2005:remove_noisy_suggestion, r=davidtwcoDylan DPC-1/+3
Remove noisy suggestion of hash_map Remove noisy suggestion of hash_map #72642 fixes #72642
2020-06-10Rollup merge of #72789 - petrochenkov:impcand, r=davidtwcoDylan DPC-1/+9
resolve: Do not suggest imports from the same module in which we are resolving Based on the idea from https://github.com/rust-lang/rust/pull/72623.
2020-06-09Remove noisy suggestion of hash_map #72642Ayush Kumar Mishra-1/+3
Fixed failing test-cases Remove noisy suggestion of hash_map #72642 Fixed failing test-cases
2020-06-02Improve E0433, so that it suggests missing importsPatryk Wychowaniec-4/+7
2020-05-30resolve: Do not suggest imports from the same module in which we are resolvingVadim Petrochenkov-2/+6
2020-05-30resolve: Pass parent scope to the function providing import suggestionsVadim Petrochenkov-0/+4
2020-05-19Alter wording for `use foo::self` helpmibac138-2/+2
2020-05-19Suggest fixes for `use foo::self`mibac138-7/+34
2020-05-08Remove ast::{Ident, Name} reexports.Camille GILLOT-2/+2
2020-05-07reword "possible candidate" import suggestionAndy Russell-8/+11
2020-05-02fix rustdoc warningsTshepang Lekhonkhobe-2/+2
2020-04-18remove build warningsTshepang Lekhonkhobe-3/+3
Code blocks that are not annotated are assumed to be Rust
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-2/+2
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-2/+2
2020-03-25Rename `def_span` to `guess_head_span`Esteban Küber-3/+3
2020-03-23Rollup merge of #69942 - estebank:sized-verbose-sugg, r=matthewjasperMazdak Farrokhzad-1/+1
Increase verbosity when suggesting subtle code changes Do not suggest changes that are actually quite small inline, to minimize the likelihood of confusion. Fix #69243.
2020-03-23Rollup merge of #70227 - LeSeulArtichaut:typo-def, r=CentrilMazdak Farrokhzad-1/+1
Only display definition when suggesting a typo Closes #70206 r? @Centril
2020-03-22Normalize wording of privacy access labelsEsteban Küber-1/+1
2020-03-22don't create variable bindings just to return the bound value immediately ↵Matthias Krüger-2/+1
(clippy::let_and_return)
2020-03-21Only display definition on typoLeSeulArtichaut-1/+1
2020-03-18Rollup merge of #69920 - Centril:hir-cleanup, r=ZoxcMazdak Farrokhzad-1/+1
Remove some imports to the rustc crate - When we have `NestedVisitorMap::None`, we use `type Map = dyn intravisit::Map<'v>;` instead of the actual map. This doesn't actually result in dynamic dispatch (in the future we may want to use an associated type default to simplify the code). - Use `rustc_session::` imports instead of `rustc::{session, lint}`. r? @Zoxc
2020-03-17Rollup merge of #69811 - petrochenkov:privdiag2, r=estebankMazdak Farrokhzad-36/+68
resolve: Print import chains on privacy errors A part of https://github.com/rust-lang/rust/pull/67951 that doesn't require hacks. r? @estebank
2020-03-16use direct imports for `rustc::{lint, session}`.Mazdak Farrokhzad-1/+1
2020-03-16hygiene: `modern` -> `normalize_to_macros_2_0`Vadim Petrochenkov-1/+1
`modern_and_legacy` -> `normalize_to_macro_rules`
2020-03-16resolve: `Legacy(Scope,Binding)` -> `MacroRules(Scope,Binding)`Vadim Petrochenkov-5/+7
2020-03-11Add the "consider importing it directly" label to public imports as wellVadim Petrochenkov-1/+1
2020-03-11resolve: Print import chains on privacy errorsVadim Petrochenkov-12/+49