about summary refs log tree commit diff
path: root/src/test/ui/privacy/restricted
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-302/+0
2022-07-01Shorten def_span for more items.Camille GILLOT-3/+3
2022-06-01Rollup merge of #97264 - ↵Matthias Krüger-0/+2
TaKO8Ki:suggest-extern-crate-when-failing-to-resolve-use-crate, r=estebank Suggest `extern crate foo` when failing to resolve `use foo` closes #97095 r? ``@estebank``
2022-05-25suggest `extern crate foo` when failing to resolve `use foo`Takayuki Maeda-0/+2
fix ci error
2022-05-21Remove `crate` visibility modifier in libs, testsJacob Pratt-16/+12
2022-04-11fix a bad error message for `relative paths are not supported in ↵Takayuki Maeda-2/+2
visibilities` error
2021-08-04Remove trailing whitespace from error messagesFabian Wolff-2/+2
2021-07-19Various diagnostics clean ups/tweaksEsteban Küber-0/+16
* Always point at macros, including derive macros * Point at non-local items that introduce a trait requirement * On private associated item, point at definition
2020-10-19Calculate visibilities once in resolveVadim Petrochenkov-2/+2
Then use them through a query based on resolver outputs
2020-09-02pretty: trim paths of unique symbolsDan Aloni-8/+8
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-2/+2
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-03-22Use more targetted span for error labelEsteban Küber-2/+2
2020-03-22Normalize wording of privacy access labelsEsteban Küber-7/+7
2020-03-22Add span label to primary error spanEsteban Küber-6/+6
2020-03-12update testsMark Mansi-4/+4
2020-01-16resolve: Point at the private item definitions in privacy errorsVadim Petrochenkov-2/+14
2019-10-29Change E0741 into E0742Guillaume Gomez-4/+4
2019-10-29Update ui testsGuillaume Gomez-3/+4
2019-08-05Don't recommend `extern crate` syntaxKornel-3/+3
2019-07-03Migrate compile-pass annotations to build-passYuki Okushi-1/+1
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-1/+1
2019-03-11Update testsVadim Petrochenkov-16/+16
2018-12-25Remove licensesMark Rousskov-66/+16
2018-11-25resolve: Prohibit relative paths in visibilities on 2018 editionVadim Petrochenkov-0/+29
2018-11-18resolve: Avoid sentence breaks in diagnosticsVadim Petrochenkov-4/+4
2018-11-07Removed `#[rustc_error]` from tests that are all `// compile-pass`.Felix S. Klock II-15/+3
I also added `// skip-codegen` to each one, to address potential concerns that this change would otherwise slow down our test suite spending time generating code for files that are really just meant to be checks of compiler diagnostics. (However, I will say: My preference is to not use `// skip-codegen` if one can avoid it. We can use all the testing of how we drive LLVM that we can get...) (Updated post rebase.)
2018-10-28resolve: More precise spans for privacy errorsVadim Petrochenkov-4/+4
2018-08-14Merged migrated compile-fail tests and ui tests. Fixes #46841.David Wood-0/+308