summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
AgeCommit message (Collapse)AuthorLines
2020-11-15Revert "Revert "resolve: Avoid "self-confirming" import resolutions in one ↵Mark Rousskov-2/+11
more case"" This reverts commit b20bce8ce54ea9d47c2e3eb0b17cbb6baf916ae2. It retains the test added in that commit as a check-pass test, intended to prevent future (unintentional) regressions.
2020-10-03Rollup merge of #77421 - petrochenkov:globtravel, r=nagisaJonas Schievink-11/+2
Revert "resolve: Avoid "self-confirming" import resolutions in one more case" And remove the assert that https://github.com/rust-lang/rust/pull/70236 tried to avoid instead. Closes https://github.com/rust-lang/rust/issues/74556.
2020-10-02resolve: prohibit anon const non-static lifetimesDavid Wood-0/+33
This commit modifies name resolution to emit an error when non-static lifetimes are used in anonymous constants when the `min_const_generics` feature is enabled. Signed-off-by: David Wood <david@davidtw.co>
2020-10-02Revert "resolve: Avoid "self-confirming" import resolutions in one more case"Vadim Petrochenkov-11/+2
2020-09-30Improve wording for external crate resolution errorCamelid-1/+1
I think it reads better this way.
2020-09-23/nightly/nightly-rustcErik Hofmayer-1/+1
2020-09-23Updated html_root_url for compiler cratesErik Hofmayer-1/+1
2020-09-21Rollup merge of #76888 - matthiaskrgr:clippy_single_match_2, r=Dylan-DPCecstatic-morse-5/+2
use if let instead of single match arm expressions use if let instead of single match arm expressions to compact code and reduce nesting (clippy::single_match)
2020-09-20Rollup merge of #76890 - matthiaskrgr:matches_simpl, r=lcnrRalf Jung-2/+2
use matches!() macro for simple if let conditions
2020-09-20use if let instead of single match arm expressions to compact code and ↵Matthias Krüger-5/+2
reduce nesting (clippy::single_match)
2020-09-18use matches!() macro for simple if let conditionsMatthias Krüger-2/+2
2020-09-17use strip_prefix over starts_with and manual slicing based on pattern length ↵Matthias Krüger-2/+2
(clippy::manual_strip)
2020-09-16Rollup merge of #76756 - matthiaskrgr:cl123ppy, r=Dylan-DPCTyler Mandry-1/+1
fix a couple of stylistic clippy warnings namely: clippy::redundant_pattern_matching clippy::redundant_pattern clippy::search_is_some clippy::filter_next clippy::into_iter_on_ref clippy::clone_on_copy clippy::needless_return
2020-09-15fix a couple of stylistic clippy warningsMatthias Krüger-1/+1
namely: clippy::redundant_pattern_matching clippy::redundant_pattern clippy::search_is_some clippy::filter_next clippy::into_iter_on_ref clippy::clone_on_copy clippy::needless_return
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-9/+23
* 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-13review, improve note spanBastian Kauschke-18/+16
2020-09-13allow concrete self types in constsBastian Kauschke-12/+26
2020-09-11Auto merge of #76499 - guswynn:priv_des, r=petrochenkovbors-29/+80
Give better diagnostic when using a private tuple struct constructor Fixes #75907 Some notes: 1. This required some deep changes, including removing a Copy impl for PatKind. If some tests fail, I would still appreciate review on the overall approach 2. this only works with basic patterns (no wildcards for example), and fails if there is any problems getting the visibility of the fields (i am not sure what the failure that can happen in resolve_visibility_speculative, but we check the length of our fields in both cases against each other, so if anything goes wrong, we fall back to the worse error. This could be extended to more patterns 3. this does not yet deal with #75906, but I believe it will be similar 4. let me know if you want more tests 5. doesn't yet at the suggestion that `@yoshuawuyts` suggested at the end of their issue, but that could be added relatively easily (i believe)
2020-09-11Give better diagnostic when using a private tuple struct constructorGus Wynn-29/+80
2020-09-10Attach `TokenStream` to `ast::Visibility`Aaron Hill-2/+2
A `Visibility` does not have outer attributes, so we only capture tokens when parsing a `macro_rules!` matcher
2020-09-10Attach `TokenStream` to `ast::Path`Aaron Hill-4/+8
2020-09-09Rollup merge of #76522 - matthiaskrgr:redundant_clone, r=jonas-schievinkTyler Mandry-1/+1
remove redundant clones (clippy::redundant_clone)
2020-09-09Rollup merge of #75984 - kornelski:typeormodule, r=matthewjasperTyler Mandry-1/+8
Improve unresolved use error message "use of undeclared type or module `foo`" doesn't mention that it could be a crate. This error can happen when users forget to add a dependency to `Cargo.toml`, so I think it's important to mention that it could be a missing crate. I've used a heuristic based on Rust's naming conventions. It complains about an unknown type if the ident starts with an upper-case letter, and crate or module otherwise. It seems to work very well. The expanded error help covers both an unknown type and a missing crate case.
2020-09-09remove redundant clonesMatthias Krüger-1/+1
(clippy::redundant_clone)
2020-09-01Rollup merge of #76143 - jyn514:duplicate-builtin-macros, r=petrochenkovTyler Mandry-5/+25
Give a better error message for duplicate built-in macros Minor follow-up to https://github.com/rust-lang/rust/pull/75176 giving a better error message for duplicate builtin macros. This would have made it a little easier to debug. r? @petrochenkov
2020-09-01Clarify message about unresolved useKornel-1/+8
2020-09-01Give a better error message for duplicate built-in macrosJoshua Nelson-5/+25
Previously, this would say no such macro existed, but this was misleading, since the macro _did_ exist, it was just already seen. - Say where the macro was previously defined - Add long-form error message
2020-08-30Suggest `if let x = y` when encountering `if x = y`Esteban Küber-1/+19
Detect potential cases where `if let` was meant but `let` was left out. Fix #44990.
2020-08-30mv compiler to compiler/mark-0/+16500