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
structMyStruct{number:usize,}implMyStruct{fnnew(number:usize) -> Self{Self{ number }asSelf}}// example 1let s = MyStruct::new(123);// example 2let n = u64::from(123u32);
after (actual):
structMyStruct{number:usize,}implMyStruct{fnnew(number:usize) -> Self{Self{ number }asSelf}}// example 1let s = {let number = 123;MyStruct{ number }asSelf};// example 2let n = {let small = 123u32;
small asSelf};
after (expected):
structMyStruct{number:usize,}implMyStruct{fnnew(number:usize) -> Self{Self{ number }asSelf}}// example 1let s = {let number = 123;MyStruct{ number }asMyStruct};// example 2let n = {let small = 123u32;
small asu64};
Self should be changed to what the Self type was in the function (MyStruct or u64 here)
found after reporting #16090, might have the exact same fix but i have little experience here with the codebase
The text was updated successfully, but these errors were encountered:
rust-analyzer version: 0.4.1765-standalone
rustc version: rustc 1.74.0 (79e9716c9 2023-11-13)
relevant settings: None
before:
after (actual):
after (expected):
Self
should be changed to what theSelf
type was in the function (MyStruct
oru64
here)found after reporting #16090, might have the exact same fix but i have little experience here with the codebase
The text was updated successfully, but these errors were encountered: