DragonOS-Community / DragonOS

使用Rust从0自研内核,具有Linux兼容性的操作系统,面向云计算轻量化场景而设计。DragonOS is an operating system developed from scratch using Rust, with Linux compatibility. It is designed for lightweight cloud computing scenarios.
https://dragonos.org
GNU General Public License v2.0
860 stars 138 forks source link

[BUG REPORT] error: casting `&T` to `&mut T` is undefined behavior #832

Closed FlyingOnion closed 4 months ago

FlyingOnion commented 4 months ago

描述错误 make kernel 出现该错误

error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`

请填写您的电脑的信息:

其他上下文 共 4 处 src/sched/mod.rs:366:26 src/sched/mod.rs:373:26 src/sched/fair.rs:147:18 src/sched/fair.rs:419:18

fslongjin commented 4 months ago

你是不是修改了什么代码?因为默认情况下,他一定会使用20230815的工具链的

FlyingOnion commented 4 months ago

你是不是修改了什么代码?因为默认情况下,他一定会使用20230815的工具链的

是,我修改了 nightly 日期

fslongjin commented 4 months ago

这个内核就是固定工具链的,所以不能修改. 改了的话,可能会导致跑不了,这个不属于bug。 目前有一个PR是正在更新工具链的, https://github.com/DragonOS-Community/DragonOS/pull/786