Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public methods on private types are not exported symbols #11685

Closed
huonw opened this issue Jan 20, 2014 · 2 comments
Closed

Public methods on private types are not exported symbols #11685

huonw opened this issue Jan 20, 2014 · 2 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries

Comments

@huonw
Copy link
Member

huonw commented Jan 20, 2014

// foo.rs
struct Foo;

impl Foo {
    pub fn bar(&self) {}
}

pub fn foo() -> Foo { Foo }
extern mod foo;

fn main() {
    foo::foo().bar();
}
error: linking with `cc` failed: exit code: 1
note: cc arguments: '-m64' '-L/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-o' 'foo' 'foo.o' '-Wl,--as-needed' '-L.' '-L/home/huon/projects/test-rust/.rust' '-L/home/huon/projects/test-rust' '-L/home/huon/.rust' '-L/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-lstd-3e5aeb83-0.9' '-L/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-lgreen-83b1c0e5-0.9' '-L/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-lrustuv-2ba3695a-0.9' '-L.' '-lfoo-23ba3019-0.0' '-ldl' '-lm' '-lpthread' '-lpthread' '-lrt' '-lmorestack' '-Wl,-rpath,$ORIGIN/../../../../usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-Wl,-rpath,$ORIGIN/.' '-Wl,-rpath,/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-Wl,-rpath,/home/huon/projects/test-rust'
note: foo.o: In function `main::he2babae7630579acai::v0.0':
foo.rc:(.text+0x46): undefined reference to `Foo::bar::hc8b32dcced346a16vjaI::v0.0'
collect2: error: ld returned 1 exit status
@japaric
Copy link
Member

japaric commented Nov 2, 2014

This should be closed. This can't be reproduced since we now forbid exposing private types in public signatures.


@alexcrichton This is very similar to #18082, only that in that case, the compiler doesn't prevent exposing the private type in a public signature. Hence, I think that #18082 is actually a visibility bug not covered by rust-lang/rfcs#136.

@alexcrichton
Copy link
Member

Ah yes, thanks @japaric!

flip1995 pushed a commit to flip1995/rust that referenced this issue Nov 2, 2023
Create `clippy_config` crate, hide internal representation from docs

r? `@flip1995`

The first commit moves a decent chunk of code out of `clippy_lints`/`clippy_utils` into a new crate `clippy_config`

The second commit changes how `--explain`, the book and the site render configuration values. The internal type is now hidden and the displayed defaults are now valid TOML values instead of `Debug` output

changelog: none
flip1995 pushed a commit to flip1995/rust that referenced this issue Nov 16, 2023
update references of old `msrvs` and `conf` paths

In rust-lang#11685, `clippy_lints::utils::conf` and `clippy_utils::msrvs` were moved to a separate `clippy_config` crate.
I noticed that not all references to those paths were updated, so this small PR intends to fix those.

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries
Projects
None yet
Development

No branches or pull requests

3 participants