about summary refs log tree commit diff
path: root/src/test/ui/pub
AgeCommit message (Collapse)AuthorLines
2021-08-11Modify structured suggestion outputEsteban Küber-6/+6
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2021-02-11resolve: Reduce scope of `pub_use_of_private_extern_crate` deprecation lintVadim Petrochenkov-22/+25
2020-10-19Calculate visibilities once in resolveVadim Petrochenkov-14/+14
Then use them through a query based on resolver outputs
2020-09-02pretty: trim paths of unique symbolsDan Aloni-4/+4
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-07-02Audit uses of `span_suggestion_short`Yuki Okushi-7/+39
2020-02-24parse: tweak diagnostic wordingsMazdak Farrokhzad-2/+2
2020-02-24parser: tweak unmatched wordingMazdak Farrokhzad-3/+3
2020-02-13parser: misc small item related improvements & cleanups.Mazdak Farrokhzad-2/+2
2020-02-13parser: introduce `parse_item_kind` as central `ItemInfo` logic.Mazdak Farrokhzad-5/+12
this also extracts macro item parsers.
2019-10-29Change E0741 into E0742Guillaume Gomez-2/+2
2019-10-29Update ui testsGuillaume Gomez-2/+3
2019-10-24Increase spacing for suggestions in diagnosticsEsteban Küber-0/+6
Make the spacing between the code snippet and verbose structured suggestions consistent with note and help messages.
2019-07-17normalize use of backticks in compiler messages for librustc/lintSamy Kacimi-1/+1
https://github.com/rust-lang/rust/issues/60532
2019-05-04Rollup merge of #60429 - estebank:pub-path, r=michaelwoeristerMazdak Farrokhzad-4/+17
Account for paths in incorrect pub qualifier help Handle case where incorrect pub qualifier with a mod path is used and provide the same help given for all other incorrect qualifiers by making the `pub(crate)` parse check more specific.
2019-05-02Rollup merge of #59634 - DevQps:explain-E0704, r=estebankMazdak Farrokhzad-0/+1
Added an explanation for the E0704 error. # Description Adds an explanation on the E0704 error. I tried to stick as closely to the message that the compiler generates. It's the first time I am fixing error messages here, so if there is something I did wrong or should improve, please let me know. closes #55398
2019-05-01Added the E0704 error with a link to the Rust reference.Christian-0/+1
2019-04-30Account for paths in incorrect pub qualifier helpEsteban Küber-4/+17
2019-04-19Remove assumption from recovery codeEsteban Küber-0/+16
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-1/+0
2019-03-11Update testsVadim Petrochenkov-11/+11
2018-12-25Remove licensesMark Rousskov-139/+19
2018-11-30Use appropriate terminology based on heuristicEsteban Küber-16/+34
2018-11-30Suggest an appropriate token when encountering `pub Ident<'a>`Esteban Küber-0/+47
2018-08-14Merged migrated compile-fail tests and ui tests. Fixes #46841.David Wood-0/+210
2018-06-30in which the private/restricted-in-public error messaging gets specificZack M. Davis-0/+68
April 2016's Issue #33174 called out the E0446 diagnostics as confusing. While adding the name of the restricted type to the message (548e681f) clarified matters somewhat, Esteban Küber pointed out that we could stand to place a secondary span on the restricted type. Here, we differentiate between crate-visible, truly private, and otherwise restricted types, and place a secondary span specifically on the visibility modifier of the restricted type's declaration (which we can do now that HIR visibilities have spans!). At long last, this resolves #33174.
2018-06-19Update error code numbersEsteban Küber-5/+5
2018-06-19Add code to incorrect `pub` restriction errorEsteban Küber-4/+5
2018-02-26Update UI testsVadim Petrochenkov-8/+8
2018-01-07`struct` pattern parsing and diagnostic tweaksEsteban Küber-2/+2
- Recover from struct parse error on match and point out missing match body. - Point at struct when finding non-identifier while parsing its fields. - Add label to "expected identifier, found {}" error.
2017-12-01Auto merge of #45997 - estebank:pub-ident, r=nikomatsakisbors-1/+1
Account for missing keyword in fn/struct definition Fix #38911.
2017-11-24Do not attemt to continue parsing after `pub ident`Esteban Küber-1/+1
Try to identify the following code in order to provide better diagnostics, but return the error to bail out early during the parse.
2017-11-24Merge cfail and ui tests into ui testsOliver Schneider-16/+16
2017-07-02Revert "Change error count messages"Ariel Ben-Yehuda-4/+4
This reverts commit 5558c64f33446225739c1153b43d2e309bb4f50e.
2017-05-24Change error count messagesMichael Kohl-4/+4
See #33525 for details.
2017-04-25Rebase and address commentsOliver Schneider-4/+4
2017-04-25Address PR commentsOliver Schneider-4/+4
2017-04-25Update affected testsOliver Schneider-14/+23
2017-03-22Add diagnostic for incorrect `pub (restriction)`Esteban Küber-0/+155
Given the following statement ```rust pub (a) fn afn() {} ``` Provide the following diagnostic: ```rust error: incorrect restriction in `pub` --> file.rs:15:1 | 15 | pub (a) fn afn() {} | ^^^^^^^ | = help: some valid visibility restrictions are: `pub(crate)`: visible only on the current crate `pub(super)`: visible only in the current module's parent `pub(in path::to::module)`: visible only on the specified path help: to make this visible only to module `a`, add `in` before the path: | pub (in a) fn afn() {} ``` Remove cruft from old `pub(path)` syntax.