This website requires JavaScript.
Explore
Help
Sign In
nordic-dev.net
/
rust
Watch
2
Star
0
Fork
0
You've already forked rust
mirror of
https://github.com/rust-lang/rust.git
synced
2025-04-29 11:37:39 +00:00
Code
Issues
Packages
Projects
Releases
Wiki
Activity
14e59bb317
rust
/
tests
/
ui
/
pub
/
pub-restricted-non-path.rs
6 lines
93 B
Rust
Raw
Normal View
History
Unescape
Escape
Add diagnostic for incorrect `pub (restriction)` 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.
2017-03-18 04:13:00 +00:00
#![
feature(pub_restricted)
]
Merge cfail and ui tests into ui tests
2017-11-20 12:13:27 +00:00
pub
(
.
)
fn
afn
(
)
{
}
//~ ERROR expected identifier
Add diagnostic for incorrect `pub (restriction)` 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.
2017-03-18 04:13:00 +00:00
fn
main
(
)
{
}
Reference in New Issue
Copy Permalink