You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the below program we have a trait Foo which is private to the module private_mod, however we can call the foo() method on Bar in main despite the root module not being supposed to know about Foo at all.
This means that a trait used for internal implementation details (such as in #6845) leaks into user code. The way that Rust addresses this issue is by requiring the trait definition to be in scope in order to call trait methods.
The text was updated successfully, but these errors were encountered:
In the below program we have a trait
Foo
which is private to the moduleprivate_mod
, however we can call thefoo()
method onBar
inmain
despite the root module not being supposed to know aboutFoo
at all.This means that a trait used for internal implementation details (such as in #6845) leaks into user code. The way that Rust addresses this issue is by requiring the trait definition to be in scope in order to call trait methods.
The text was updated successfully, but these errors were encountered: