Skip to content

Commit

Permalink
update rust toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
declantsien committed Feb 10, 2024
1 parent eb01913 commit 4c2b63e
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 48 deletions.
163 changes: 127 additions & 36 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
self.overlays.default
emacs-overlay.overlay
(import rust-overlay)
devshell.overlay
devshell.overlays.default
];
config = {};
};
in rec {
devShells.default = with pkgs; let
devshell = with pkgs; let
custom-llvmPackages = llvmPackages_latest;
in
pkgs.devshell.mkShell {
Expand Down Expand Up @@ -121,7 +121,7 @@
withWebrender = true;
in
(
final.emacsGit.override
final.emacs-unstable.override
{
withImageMagick = true;
withNS = false;
Expand Down Expand Up @@ -217,6 +217,9 @@
++ lib.optionals (! withWebrender) [
"--with-harfbuzz"
]
# ++ lib.optionals stdenv.cc.isClang [
# "RUSTFLAGS='-l${stdenv.cc.libcxx.cxxabi.libName}'"
# ]
++ lib.optionals stdenv.isLinux [
"--with-dbus"
];
Expand Down Expand Up @@ -244,10 +247,9 @@
python3
]
++ rpathLibs)
++ [cargo rustc]
++ (with rustPlatform; [
cargoSetupHook
rust.cargo
rust.rustc
])
++ lib.optionals
stdenv.isDarwin
Expand Down Expand Up @@ -293,7 +295,7 @@
emacsng-noNativeComp = (
(
emacsng.override {
nativeComp = false;
withNativeCompilation = false;
}
)
.overrideAttrs (
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2023-02-20
nightly-2024-01-25
4 changes: 2 additions & 2 deletions rust_src/crates/emacs/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl LispSymbolRef {
}

pub fn set_next(mut self, next: Option<Self>) {
let mut s = unsafe { self.u.s.as_mut() };
let s = unsafe { self.u.s.as_mut() };
s.next = match next {
Some(sym) => sym.as_ptr() as *mut Lisp_Symbol,
None => ptr::null_mut(),
Expand Down Expand Up @@ -110,7 +110,7 @@ impl LispObject {
self.get_untaggedptr() as EmacsInt
};

let lispsym_offset = unsafe { &lispsym as *const _ as EmacsInt };
let lispsym_offset = unsafe { ptr::addr_of!(lispsym) as *const _ as EmacsInt };
ptr_value + lispsym_offset
}
}
Expand Down
4 changes: 2 additions & 2 deletions rust_src/crates/webrender/src/font_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl FontDB<'static> {
}

pub fn family_name(family_name: &str) -> Family {
match family_name.clone().to_lowercase().as_str() {
match family_name.to_lowercase().as_str() {
"default" => Family::Monospace, // emacs reports default
"serif" => Family::Serif,
"sans-serif" => Family::SansSerif,
Expand Down Expand Up @@ -155,7 +155,7 @@ impl FontDB<'static> {

#[cfg(free_unix)]
pub fn fc_family_name(name: &str) -> String {
match name.clone().to_lowercase().as_str() {
match name.to_lowercase().as_str() {
"default" => {
let mut property = system_fonts::FontPropertyBuilder::new().monospace().build();
let sysfonts = system_fonts::query_specific(&mut property);
Expand Down
1 change: 0 additions & 1 deletion rust_src/crates/webrender/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![allow(non_camel_case_types, non_snake_case, non_upper_case_globals)]
#![feature(concat_idents)]
#![allow(non_upper_case_globals)]
#![feature(once_cell)]

#[macro_use]
extern crate emacs;
Expand Down

0 comments on commit 4c2b63e

Please sign in to comment.