Auto merge of #31908 - jseyfried:disallow_shadowed_traits, r=nikomatsakis
Disallow methods from traits that are not in scope This PR only allows a trait method to be used if the trait is in scope (fixes #31379). This is a [breaking-change]. For example, the following would break: ```rust mod foo { pub trait T { fn f(&self) {} } impl T for () {} } mod bar { pub use foo::T; } fn main() { pub use bar::*; struct T; // This shadows the trait `T`, ().f() // making this an error. } ``` r? @nikomatsakis
Showing
想要评论请 注册 或 登录