remove unknown nightly feature 'const_ptr_offset'#22
remove unknown nightly feature 'const_ptr_offset'#22phil-opp merged 1 commit intorust-osdev:masterfrom
Conversation
josephlr
left a comment
There was a problem hiding this comment.
@phil-opp this also fixes some build failures for the x86_64 crate. See https://github.com/rust-osdev/x86_64/runs/5715700359
|
Thanks a lot! |
|
Published as v0.2.17 |
Problem statement: An error will be reported after the uart version is updated: error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:28:36 | 28 | int_en: AtomicPtr::new(base_pointer.add(1)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:29:39 | 29 | fifo_ctrl: AtomicPtr::new(base_pointer.add(2)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:30:39 | 30 | line_ctrl: AtomicPtr::new(base_pointer.add(3)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:31:40 | 31 | modem_ctrl: AtomicPtr::new(base_pointer.add(4)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:32:38 | 32 | line_sts: AtomicPtr::new(base_pointer.add(5)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: could not compile `uart_16550` due to 5 previous errors Investigation: uart_16550 update - Remove stabilized nightly feature 'const_ptr_offset' ([confidential-containers#22](rust-osdev/uart_16550#22)) Solution: fixed uart_16550 version to 0.2.14 Signed-off-by: haowei <WeiX.Hao@intel.com>
Problem statement: An error will be reported after the uart version is updated: error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:28:36 | 28 | int_en: AtomicPtr::new(base_pointer.add(1)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:29:39 | 29 | fifo_ctrl: AtomicPtr::new(base_pointer.add(2)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:30:39 | 30 | line_ctrl: AtomicPtr::new(base_pointer.add(3)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:31:40 | 31 | modem_ctrl: AtomicPtr::new(base_pointer.add(4)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:32:38 | 32 | line_sts: AtomicPtr::new(base_pointer.add(5)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: could not compile `uart_16550` due to 5 previous errors Investigation + root cause: View recent updates to uart_16550 uart_16550 updated. - Remove stabilized nightly feature 'const_ptr_offset' ([confidential-containers#22](rust-osdev/uart_16550#22)) Solution: fixed uart_16550 version to 0.2.14 Signed-off-by: haowei <WeiX.Hao@intel.com>
Problem statement: An error will be reported after the uart version is updated: error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:28:36 | 28 | int_en: AtomicPtr::new(base_pointer.add(1)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:29:39 | 29 | fifo_ctrl: AtomicPtr::new(base_pointer.add(2)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:30:39 | 30 | line_ctrl: AtomicPtr::new(base_pointer.add(3)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:31:40 | 31 | modem_ctrl: AtomicPtr::new(base_pointer.add(4)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:32:38 | 32 | line_sts: AtomicPtr::new(base_pointer.add(5)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: could not compile `uart_16550` due to 5 previous errors Investigation + root cause: View recent updates to uart_16550 uart_16550 updated. - Remove stabilized nightly feature 'const_ptr_offset' ([#22](rust-osdev/uart_16550#22)) Solution: fixed uart_16550 version to 0.2.14 Signed-off-by: haowei <WeiX.Hao@intel.com>
Problem statement: An error will be reported after the uart version is updated: error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:28:36 | 28 | int_en: AtomicPtr::new(base_pointer.add(1)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:29:39 | 29 | fifo_ctrl: AtomicPtr::new(base_pointer.add(2)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:30:39 | 30 | line_ctrl: AtomicPtr::new(base_pointer.add(3)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:31:40 | 31 | modem_ctrl: AtomicPtr::new(base_pointer.add(4)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:32:38 | 32 | line_sts: AtomicPtr::new(base_pointer.add(5)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: could not compile `uart_16550` due to 5 previous errors Investigation + root cause: View recent updates to uart_16550 uart_16550 updated. - Remove stabilized nightly feature 'const_ptr_offset' ([confidential-containers#22](rust-osdev/uart_16550#22)) Solution: fixed uart_16550 version to 0.2.14 Signed-off-by: haowei <WeiX.Hao@intel.com>
Problem statement: An error will be reported after the uart version is updated: error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:28:36 | 28 | int_en: AtomicPtr::new(base_pointer.add(1)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:29:39 | 29 | fifo_ctrl: AtomicPtr::new(base_pointer.add(2)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:30:39 | 30 | line_ctrl: AtomicPtr::new(base_pointer.add(3)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:31:40 | 31 | modem_ctrl: AtomicPtr::new(base_pointer.add(4)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: `ptr::mut_ptr::<impl *mut T>::add` is not yet stable as a const fn --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/uart_16550-0.2.17/src/mmio.rs:32:38 | 32 | line_sts: AtomicPtr::new(base_pointer.add(5)), | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(const_ptr_offset)]` to the crate attributes to enable error: could not compile `uart_16550` due to 5 previous errors Investigation + root cause: View recent updates to uart_16550 uart_16550 updated. - Remove stabilized nightly feature 'const_ptr_offset' ([#22](rust-osdev/uart_16550#22)) Solution: fixed uart_16550 version to 0.2.14 Signed-off-by: haowei <WeiX.Hao@intel.com>
|
I am aware of that people break builds with feature updates ( |
|
This change was a necessary bugfix to allow this crate to continue building on the latest nightly. Without this change, the crate would no longer compile. Im confused how this actually broke you though. This change should be fine on older rustc versions. What specific compiler error are you getting? What version of rustc are you using? Are you using version 0.2.18 of this crate? |
Ah okay, I see. Well, this is my project respectively the fix: phip1611/diplomarbeit-impl@7296fbc It's on 1.61 nightly. I could fix this by pinning version 0.2.16. |
|
Changed feature gates are the main difficulty of maintaining crates that target nightly Rust. Often, there is no way to keep supporting older nightly versions in such cases. In this case, the older nightlies expect the feature gate, but the newer ones throw an error because the feature gate no longer exists (since the feature was stabilized). We had a lot of similar cases for the The main reason for doing only patch releases as opposed to changing the minor version are transitive dependencies. For example, if we did a minor version bump for each feature gate update in That being said, it might be possible to continue supporting older nightlies through |
|
Yeah, I agree. The longer I think about it, the more your approach makes sense. That's what people have to expect when working on nightly Rust.
Probably overkill, as long as the lib doesn't have 100k active users :D |
This seems to let it build again.
Seems related to rust-lang/rust#71499 and rust-lang/rust#93957