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
The following code was my incorrect attempt to explicitly specialize a static method:
trait Test {
fn hello();
}
fn main() {
struct T;
impl Test for T {
fn hello() {}
}
T::hello();
}
In fact, apparently the fn is not yet possible to call at all. However, the error output is needlessly confusing with an error!() message and three errors:
!!! (resolving module in lexical scope) module wasn't actually a module!
/tmp/r.rs:10:4: 10:12 error: unresolved name
/tmp/r.rs:10 T::hello();
^~~~~~~~
/tmp/r.rs:10:4: 10:12 error: use of undeclared module `T`
/tmp/r.rs:10 T::hello();
^~~~~~~~
!!! (resolving module in lexical scope) module wasn't actually a module!
/tmp/r.rs:10:4: 10:12 error: unresolved name `T::hello`.
/tmp/r.rs:10 T::hello();
The text was updated successfully, but these errors were encountered:
The "!!!" lines should be internal debugs, not user printouts. Adding a pull request to fix this, but not sure if any additional behavior here needs to be fixed. Are there existing instances where the Rust compiler warns you if you attempt to use a C++ OOP feature?
In uninit checking, add fallback for polymorphic types
After rust-lang#10520, we always assumed that polymorphic types do not allow to be left uninitialized. But we can do better, by peeking into polymorphic types and adding a few special cases for going through tuples, arrays (because the length may be polymorphic) and blanket allowing all unions (like MaybeUninit).
fixesrust-lang#10551
changelog: [uninit_vec]: fix false positive for polymorphic types
changelog: [uninit_assumed_init]: fix false positive for polymorphic types
The following code was my incorrect attempt to explicitly specialize a static method:
In fact, apparently the fn is not yet possible to call at all. However, the error output is needlessly confusing with an error!() message and three errors:
The text was updated successfully, but these errors were encountered: