about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src/diagnostics.rs
AgeCommit message (Collapse)AuthorLines
2021-03-27resolve: Partially unify early and late scope-relative ident resolutionVadim Petrochenkov-2/+2
2021-03-23Some refactoringvarkor-2/+2
2021-02-06Rollup merge of #81680 - camsteffen:primty, r=oli-obkJonas Schievink-3/+3
Refactor `PrimitiveTypeTable` for Clippy I removed `PrimitiveTypeTable` and added `PrimTy::ALL` and `PrimTy::from_name` in its place. This allows Clippy to use `PrimTy::from_name` for the `builtin_type_shadow` lint, and a `const` list of primitive types is deleted from Clippy code (the goal). All changes should be a little faster, if anything.
2021-02-05Small refactor with Iterator::reduceCameron Steffen-3/+2
2021-02-03Refactor out PrimitiveTypeTableCameron Steffen-3/+3
2021-01-29fix typoHenry Boisdequin-1/+1
2021-01-17resolve: Reject ambiguity built-in attr vs different built-in attrVadim Petrochenkov-1/+1
2021-01-10Auto merge of #80782 - petrochenkov:viscopes, r=matthewjasperbors-1/+2
resolve: Scope visiting doesn't need an `Ident` Resolution scope visitor (`fn visit_scopes`) currently takes an `Ident` parameter, but it doesn't need a full identifier, or even its span, it only needs the `SyntaxContext` part. The `SyntaxContext` part is necessary because scope visitor has to jump to macro definition sites, so it has to be directed by macro expansion information somehow. I think it's clearer to pass only the necessary part. Yes, usually visiting happens as a part of an identifier resolution, but in cases like collecting traits in scope (#80765) or collecting typo suggestions that's not the case. r? `@matthewjasper`
2021-01-07Use correct span for structured suggestionEsteban Küber-8/+18
On structured suggestion for `let` -> `const` and `const` -> `let`, use a proper `Span` and update tests to check the correct application. Follow up to #80012.
2021-01-07resolve: Scope visiting doesn't need an `Ident`Vadim Petrochenkov-1/+2
2021-01-07Add pointing const identifier when emitting E0435Daiki Ihara-1/+7
2020-11-24Move lev_distance to rustc_ast, make non-genericArlie Davis-2/+2
rustc_ast currently has a few dependencies on rustc_lexer. Ideally, an AST would not have any dependency its lexer, for minimizing unnecessarily design-time dependencies. Breaking this dependency would also have practical benefits, since modifying rustc_lexer would not trigger a rebuild of rustc_ast. This commit does not remove the rustc_ast --> rustc_lexer dependency, but it does remove one of the sources of this dependency, which is the code that handles fuzzy matching between symbol names for making suggestions in diagnostics. Since that code depends only on Symbol, it is easy to move it to rustc_span. It might even be best to move it to a separate crate, since other tools such as Cargo use the same algorithm, and have simply contain a duplicate of the code. This changes the signature of find_best_match_for_name so that it is no longer generic over its input. I checked the optimized binaries, and this function was duplicated at nearly every call site, because most call sites used short-lived iterator chains, generic over Map and such. But there's no good reason for a function like this to be generic, since all it does is immediately convert the generic input (the Iterator impl) to a concrete Vec<Symbol>. This has all of the costs of generics (duplicated method bodies) with no benefit. Changing find_best_match_for_name to be non-generic removed about 10KB of code from the optimized binary. I know it's a drop in the bucket, but we have to start reducing binary size, and beginning to tame over-use of generics is part of that.
2020-11-24Swap note for helpmendess-1/+1
2020-11-24Requested changesmendess-1/+1
2020-11-24Add note to use nightly when using expr in const genericsmendess-0/+1
2020-11-20update bug message for cgBastian Kauschke-1/+1
2020-11-19resolve: Introduce a separate `NonMacroAttrKind` for legacy derive helpersVadim Petrochenkov-1/+1
2020-11-13Auto merge of #78826 - petrochenkov:mrscopes2, r=eddybbors-1/+1
resolve: Collapse `macro_rules` scope chains on the fly Otherwise they grow too long and you have to endlessly walk through them when resolving macros or imports. Addresses https://rust-lang.zulipchat.com/#narrow/stream/247081-t-compiler.2Fperformance/topic/Slow.20Builtin.20Derives/near/215750815
2020-11-08rustc_resolve: Use `#![feature(format_args_capture)]`Vadim Petrochenkov-37/+11
2020-11-07resolve: Collapse `macro_rules` scope chains on the flyVadim Petrochenkov-1/+1
2020-10-30Add back missing commentsJoshua Nelson-0/+1
2020-10-30Fix even more clippy warningsJoshua Nelson-18/+7
2020-10-17Rollup merge of #75209 - Hirrolot:suggest-macro-imports, r=estebankYuki Okushi-0/+11
Suggest imports of unresolved macros Closes https://github.com/rust-lang/rust/issues/75191.
2020-10-12A little rewordingEthan Brierley-1/+1
Co-authored-by: varkor <github@varkor.com>
2020-10-12Remove a little jargon from errorEthan Brierley-1/+1
Co-authored-by: varkor <github@varkor.com>
2020-10-12Make error help clearerEthan Brierley-1/+1
Co-authored-by: varkor <github@varkor.com>
2020-10-11`min_const_generics` diagnostics improvementsEthan Brierley-14/+7
2 3
2020-10-03Replace "non trivial" with "non-trivial"varkor-1/+1
2020-09-30Don't suggest macros that out of scopeTemirkhan Myrzamadi-2/+9
2020-09-30Suggest imports of unresolved macrosTemirkhan Myrzamadi-0/+4
2020-09-15Remove redundant `&format!`.Hameer Abbasi-3/+1
Co-authored-by: Bastian Kauschke <bastian_kauschke@hotmail.de>
2020-09-15This commit introduces the following changes:Hameer Abbasi-4/+14
* Change error message for type param in a const expression when using min_const_generics * Change ParamInNonTrivialAnonConst to contain an extra bool used for distinguishing whether the passed-in symbol is a type or a value.
2020-09-13allow concrete self types in constsBastian Kauschke-1/+1
2020-09-10Attach `TokenStream` to `ast::Path`Aaron Hill-1/+1
2020-08-30mv compiler to compiler/mark-0/+1678