summary refs log tree commit diff
path: root/src/test/ui/resolve
AgeCommit message (Collapse)AuthorLines
2020-07-06Rollup merge of #73953 - JohnTitor:audit-hidden-sugg, r=estebankManish Goregaokar-1/+49
Audit hidden/short code suggestions Should fix #73641. Audit uses of `span_suggestion_short` and `tool_only_span_suggestion` (`span_suggestion_hidden` is already tested with `run-rustfix`). Leave some FIXMEs for futher improvements/fixes. r? @estebank
2020-07-02resolve: disallow label use through closure/asyncDavid Wood-4/+9
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-07-02Audit uses of `tool_only_span_suggestion`Yuki Okushi-1/+13
2020-07-02Audit uses of `span_suggestion_short`Yuki Okushi-0/+36
2020-06-23Add re-exports to use suggestionsDan Aloni-5/+7
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-21Prefer accessible paths in 'use' suggestionsDan Aloni-4/+1
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-09Remove noisy suggestion of hash_map #72642Ayush Kumar Mishra-9/+3
Fixed failing test-cases Remove noisy suggestion of hash_map #72642 Fixed failing test-cases
2020-06-07Free `default()` forwarding to `Default::default()`Ilya Bobyr-1/+10
When creating default values a trait method needs to be called with an explicit trait name. `Default::default()` seems redundant. A free function on the other hand, when imported directly, seems to be a better API, as it is just `default()`. When implementing the trait, a method is still required.
2020-06-02Improve E0433, so that it suggests missing importsPatryk Wychowaniec-0/+49
2020-05-31Add descriptions for all queriesMatthew Jasper-12/+12
2020-05-09adjust testsRalf Jung-2/+3
2020-05-07reword "possible candidate" import suggestionAndy Russell-23/+23
2020-05-05Ignore SGX on a few ui testsMohsen Zohrevandi-1/+3
2020-04-26Tweak some suggestions in `rustc_resolve`Esteban Küber-3/+15
2020-04-16ty: convert `ErrorHandled::Reported` to `ConstKind::Error`.Eduard-Mihai Burtescu-14/+3
2020-04-11rustc: Add a warning count upon completionRoccoDev-1/+1
2020-04-03def_collector, visit_fn: account for no bodyMazdak Farrokhzad-0/+85
2020-04-02tests: remove ignore directives from tests that mention core/alloc/std spans.Eduard-Mihai Burtescu-12/+8
2020-03-24Rollup merge of #70077 - Aaron1011:feature/new-def-path-ident, r=petrochenkovMazdak Farrokhzad-1/+4
Store idents for `DefPathData` into crate metadata Previously, we threw away the `Span` associated with a definition's identifier when we encoded crate metadata, causing us to lose location and hygiene information. We now store the identifier's `Span` in a side table, which gets encoded into the crate metadata. When we decode items from the metadata, we combine the name and span back into an `Ident`. This improves the output of several tests, which previously had messages suppressed due to dummy spans. This is a prerequisite for #68686, since throwing away a `Span` means that we lose hygiene information.
2020-03-24Rollup merge of #69981 - oli-obk:const_blocks, r=eddybMazdak Farrokhzad-2/+13
Evaluate repeat expression lengths as late as possible Fixes #68567 r? @varkor
2020-03-23Evaluate repeat expression lengths as late as possibleOliver Scherer-2/+13
2020-03-23Rollup merge of #69942 - estebank:sized-verbose-sugg, r=matthewjasperMazdak Farrokhzad-23/+34
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-22Store idents for `DefPathData` into crate metadataAaron Hill-1/+4
Previously, we threw away the `Span` associated with a definition's identifier when we encoded crate metadata, causing us to lose location and hygiene information. We now store the identifier's `Span` in the crate metadata. When we decode items from the metadata, we combine the name and span back into an `Ident`. This improves the output of several tests, which previously had messages suppressed due to dummy spans. This is a prerequisite for #68686, since throwing away a `Span` means that we lose hygiene information.
2020-03-22Normalize wording of privacy access labelsEsteban Küber-11/+16
2020-03-22Increase verbosity when suggesting subtle code changesEsteban Küber-12/+18
2020-03-21Bless testsLeSeulArtichaut-62/+28
2020-03-14resolve: Fix regression in resolution of raw keywords in pathsVadim Petrochenkov-0/+14
2020-03-04resolve, inconsistent binding mode: tweak wording.Mazdak Farrokhzad-49/+50
2020-02-28Rollup merge of #69539 - Centril:fix-69401, r=petrochenkovMazdak Farrokhzad-0/+15
late resolve, visit_fn: bail early if there's no body. Fixes https://github.com/rust-lang/rust/issues/69401 which was injected by https://github.com/rust-lang/rust/commit/b2c6eeb713d4cf9b35b7dda6ff2b0274e7f24684 in https://github.com/rust-lang/rust/pull/68788. r? @petrochenkov
2020-02-28Rollup merge of #69452 - Centril:typeck-pat, r=estebankMazdak Farrokhzad-5/+22
typeck: use `Pattern` obligation cause more for better diagnostics r? @estebank
2020-02-28late resolve, visit_fn: bail early if there's no body.Mazdak Farrokhzad-0/+15
2020-02-26Rollup merge of #67637 - Mark-Simulacrum:primitive-mod, r=dtolnayDylan DPC-0/+5
Add primitive module to libcore This re-exports the primitive types from libcore at `core::primitive` to allow macro authors to have a reliable location to use them from. Fixes #44865
2020-02-25check_pat_path: use pattern_causeMazdak Farrokhzad-1/+3
2020-02-25improve or-pattern type consistency diagnosticsMazdak Farrokhzad-4/+19
2020-02-11On mismatched argument count point at argumentsEsteban Küber-3/+5
2020-02-06Add primitive module to libcore/stdMark Rousskov-0/+5
This re-exports the primitive types from libcore at `core::primitive` to allow macro authors to have a reliable location to use them from.
2020-02-02Wording changes to object unsafe trait errorsEsteban Küber-1/+1
Stemming from the thread at https://twitter.com/indygreg/status/1223279056398929920
2020-02-02Point at arguments or output when fn obligations come from them, or ident ↵Esteban Küber-2/+2
when they don't
2020-02-02Do not suggest things named underscoreYuki Okushi-0/+30
2020-01-16resolve: Point at the private item definitions in privacy errorsVadim Petrochenkov-10/+70
2020-01-12Update `output-default.json` and rustdoc testvarkor-1/+1
2020-01-12Appease tidyvarkor-1/+2
2020-01-12Diagnostics should not end with a full stopvarkor-3/+3
2020-01-10Ignore platforms that can't point to stdEsteban Küber-8/+12
2020-01-10Use `def_span` to minimize definition span to first line when possibleEsteban Küber-10/+4
2020-01-10Point at the span for the definition of crate foreign ADTsEsteban Küber-2/+13
2020-01-03tweak wording of mismatched delimiter errorsAndy Russell-9/+9
2019-12-30refactor and fix this-expression-has-type noteMazdak Farrokhzad-0/+8
2019-12-11resolve: Always resolve visibilities on impl itemsVadim Petrochenkov-0/+34
2019-11-21Point at type in `let` assignment on type errorsEsteban Küber-12/+15