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
I was trying to take a look at constexpr folding, and came across this bug. This seems to be due to a lack of ref mut support, i.e. #2082 's TODO list.
Rustc compiles this code happily
Reproducer
I tried this code:
extern"C"{fnprintf(s:*consti8, ...);}enumOption{Some(i32),None}implOption{fnadd(&mutself){match*self{Option::Some(refmut a) => {*a += 1},Option::None => {},}}}fnmain(){unsafe{letmut a = Option::None;
a.add();let _s = "%d\n\0";let _s = _s as*conststr;let s = _s as*consti8;printf(s,a);}}
Does the code make use of any (1.49) nightly feature ?
Nightly
Godbolt link
No response
Actual behavior
The current behavior is...
main.rs:12:41: error: expected reference type got i32
12 | Option::Some(ref mut a) => {*a += 1},
| ^
main.rs:12:41: error: cannot apply operator ‘+=’ to types <tyty::error> and <integer>
Summary
I was trying to take a look at constexpr folding, and came across this bug. This seems to be due to a lack of ref mut support, i.e. #2082 's TODO list.
Rustc compiles this code happily
Reproducer
I tried this code:
Does the code make use of any (1.49) nightly feature ?
Godbolt link
No response
Actual behavior
The current behavior is...
Expected behavior
Rustc compiles the code
GCC Version
483ee3a
The text was updated successfully, but these errors were encountered: