about summary refs log tree commit diff
path: root/src/test/ui/privacy
AgeCommit message (Collapse)AuthorLines
2021-10-18Auto merge of #89124 - cjgillot:owner-info, r=michaelwoeristerbors-14/+2
Index and hash HIR as part of lowering Part of https://github.com/rust-lang/rust/pull/88186 ~Based on https://github.com/rust-lang/rust/pull/88880 (see merge commit).~ Once HIR is lowered, it is later indexed by the `index_hir` query and hashed for `crate_hash`. This PR moves those post-processing steps to lowering itself. As a side objective, the HIR crate data structure is refactored as an `IndexVec<LocalDefId, Option<OwnerInfo<'hir>>>` where `OwnerInfo` stores all the relevant information for an HIR owner. r? `@michaelwoerister` cc `@petrochenkov`
2021-10-15Bless testsCameron Steffen-80/+80
2021-10-10Bless ui tests.Camille GILLOT-14/+2
2021-09-30Bless tests.Camille GILLOT-2/+14
2021-09-15Move some tests to more reasonable directoriesCaio-0/+62
2021-08-14Auto merge of #87600 - JohnTitor:classify-ui-tests, r=petrochenkovbors-0/+40
Move some UI tests to more suitable subdirs The classifui result: https://gist.github.com/JohnTitor/c9e00840990b5e4a8fc562ec3571e427/e06c42226c6038da91e403c33b9947843420cf44 Some notes: - backtrace-debuginfo.rs: previously I skipped this, I'm still not sure what the best dir is. Any ideas? - estr-subtyping.rs: Seems a quite old test so removed, shouldn't? - deref-suggestion.rs: moved to inference as `suggestions` is not an ideal dir. - issue-43023.rs: a bit misclassified, moved to `derives` cc #73494 r? `@petrochenkov`
2021-08-11Modify structured suggestion outputEsteban Küber-9/+11
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2021-08-10Move some UI tests to more suitable subdirsYuki Okushi-0/+40
2021-08-04Remove trailing whitespace from error messagesFabian Wolff-27/+27
2021-07-27Remove min_tait and full_tait stderr dangling filesSantiago Pastorino-136/+0
2021-07-27Make all tests use type_alias_impl_trait feature instead of minSantiago Pastorino-6/+70
2021-07-27Use type_alias_impl_trait instead of min in compiler and libSantiago Pastorino-38/+18
2021-07-19Various diagnostics clean ups/tweaksEsteban Küber-0/+45
* Always point at macros, including derive macros * Point at non-local items that introduce a trait requirement * On private associated item, point at definition
2021-05-12Show macro name in 'this error originates in macro' messageAaron Hill-80/+80
When there are multiple macros in use, it can be difficult to tell which one was responsible for producing an error.
2021-04-25Improve diagnostics for function passed when a type was expected.Hameer Abbasi-0/+9
2021-04-03Remove redundant `ignore-tidy-linelength` annotationsSimon Jakobi-32/+30
This is step 2 towards fixing #77548. In the codegen and codegen-units test suites, the `//` comment markers were kept in order not to affect any source locations. This is because these tests cannot be automatically `--bless`ed.
2021-03-17Rollup merge of #83092 - petrochenkov:qspan, r=estebankYuki Okushi-2/+2
More precise spans for HIR paths `Ty::assoc_item` is lowered to `<Ty>::assoc_item` in HIR, but `Ty` got span from the whole path. This PR fixes that, and adjusts some diagnostic code that relied on `Ty` having the whole path span. This is a pre-requisite for https://github.com/rust-lang/rust/pull/82868 (we cannot report suggestions like `Tr::assoc` -> `<dyn Tr>::assoc` with the current imprecise spans). r? ````@estebank````
2021-03-15More precise spans for HIR pathsVadim Petrochenkov-2/+2
2021-03-15Replace `type_alias_impl_trait` by `min_type_alias_impl_trait` with no ↵Oli Scherer-9/+103
actual changes in behaviour This makes `type_alias_impl_trait` not actually do anything anymore
2021-02-10resolve: Remove visibility hacks for enum variants and trait itemsVadim Petrochenkov-40/+68
Special treatment like this was necessary before `pub(restricted)` had been implemented and only two visibilities existed - `pub` and non-`pub`. Now it's no longer necessary and the desired behavior follows from `pub(restricted)`-style visibilities naturally assigned to enum variants and trait items.
2021-01-16Move some tests to more reasonable directories - 2Caio-0/+155
Address comments Update limits
2021-01-13Update tests for extern block lintingMark Rousskov-3/+3
2020-12-29Remove `compile-fail` test suiteVadim Petrochenkov-0/+85
2020-11-23Rename `optin_builtin_traits` to `auto_traits`Camelid-2/+2
They were originally called "opt-in, built-in traits" (OIBITs), but people realized that the name was too confusing and a mouthful, and so they were renamed to just "auto traits". The feature flag's name wasn't updated, though, so that's what this PR does. There are some other spots in the compiler that still refer to OIBITs, but I don't think changing those now is worth it since they are internal and not particularly relevant to this PR. Also see <https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/opt-in.2C.20built-in.20traits.20(auto.20traits).20feature.20name>.
2020-11-16improve error message for const ty param mismatchBastian Kauschke-44/+24
2020-10-25Merge remote-tracking branch 'upstream/master' into box-allocTim Diekmann-49/+49
2020-10-19Calculate visibilities once in resolveVadim Petrochenkov-49/+49
Then use them through a query based on resolver outputs
2020-10-07Support custom allocators in `Box`Tim Diekmann-9/+9
Remove `Box::leak_with_alloc` Add leak-test for box with allocator Rename `AllocErr` to `AllocError` in leak-test Add `Box::alloc` and adjust examples to use the new API
2020-10-06Fix tests from rebaseMatthew Jasper-13/+8
2020-10-06Separate bounds and predicates for associated/opaque typesMatthew Jasper-48/+25
2020-09-11Improve E0118 descriptionaticu-7/+9
2020-09-02pretty: trim paths of unique symbolsDan Aloni-194/+194
If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path and print only the name. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere. This adds a new '-Z trim-diagnostic-paths=false' option to control this feature. On the good path, with no diagnosis printed, we should try to avoid issuing this query, so we need to prevent trimmed_def_paths query on several cases. This change also relies on a previous commit that differentiates between `Debug` and `Display` on various rustc types, where the latter is trimmed and presented to the user and the former is not.
2020-08-22Use smaller def span for functionsAaron Hill-32/+32
Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-08-10Do not suggest similarly named enclosing itemEsteban Küber-3/+1
2020-08-05Handle fieldless tuple structs in diagnostic codeAaron Hill-0/+25
Fixes #75062
2020-06-21Prefer accessible paths in 'use' suggestionsDan Aloni-30/+6
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-11Stop special casing top level TAITMatthew Jasper-20/+14
2020-05-07reword "possible candidate" import suggestionAndy Russell-6/+6
2020-04-11rustc: Add a warning count upon completionRoccoDev-3/+3
2020-04-07Do not suggest adding type param when `use` is already suggestedEsteban Küber-4/+0
Fix #70365, cc #70572.
2020-03-27Rollup merge of #70344 - Centril:hir-pretty, r=eddybDylan DPC-5/+5
Decouple `rustc_hir::print` into `rustc_hir_pretty` High level summary: - The HIR pretty printer, `rustc_hir::print` is moved into a new crate `rustc_hir_pretty`. - `rustc_ast_pretty` and `rustc_errors` are dropped as `rustc_hir` dependencies. - The dependence on HIR pretty is generally reduced, leaving `rustc_save_analysis`, `rustdoc`, `rustc_metadata`, and `rustc_driver` as the remaining clients. The main goal here is to reduce `rustc_hir`'s dependencies and its size such that it can start and finish earlier, thereby working towards https://github.com/rust-lang/rust/issues/65031. r? @Zoxc
2020-03-26wip pacify the merciless ui testsNiko Matsakis-1/+1
2020-03-26introduce `negative_impls` feature gate and documentNiko Matsakis-4/+6
They used to be covered by `optin_builtin_traits` but negative impls are now applicable to all traits, not just auto traits. This also adds docs in the unstable book for the current state of auto traits.
2020-03-24rustc_typeck: remove rustc_hir_pretty usageMazdak Farrokhzad-5/+5
2020-03-24Rollup merge of #69740 - mark-i-m:describe-it-3, r=eddybMazdak Farrokhzad-2/+2
Replace some desc logic in librustc_lint with article_and_desc r? @eddyb @Centril @matthewjasper Followup to https://github.com/rust-lang/rust/pull/69674 Blocked on #69498
2020-03-23Rollup merge of #69942 - estebank:sized-verbose-sugg, r=matthewjasperMazdak Farrokhzad-229/+229
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-22Use more targetted span for error labelEsteban Küber-10/+10
2020-03-22Normalize wording of privacy access labelsEsteban Küber-212/+212
2020-03-22Add span label to primary error spanEsteban Küber-12/+12
2020-03-21convert a couple more errorsmark-2/+2