Hi,

sn0int fails to build with rustc 1.36.

The following patch backport a fix on rustyline (the failing crate). The
build still build with current rustc 1.35.

Comments or OK ?
-- 
Sebastien Marie

Index: Makefile
===================================================================
RCS file: /cvs/ports/security/sn0int/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- Makefile    25 Jun 2019 10:50:02 -0000      1.1.1.1
+++ Makefile    1 Jul 2019 12:07:24 -0000
@@ -407,6 +407,7 @@ MODCARGO_CRATES +=  yansi   0.5.0   # MIT/Apa
 
 CONFIGURE_STYLE =      cargo
 SEPARATE_BUILD =       Yes
+PATCHORIG =            .openbsd.orig
 
 MODCARGO_RUSTFLAGS =   -C debuginfo=0
 
Index: patches/patch-modcargo-crates_rustyline-4_0_0_src_history_rs
===================================================================
RCS file: patches/patch-modcargo-crates_rustyline-4_0_0_src_history_rs
diff -N patches/patch-modcargo-crates_rustyline-4_0_0_src_history_rs
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-modcargo-crates_rustyline-4_0_0_src_history_rs        1 Jul 
2019 12:07:24 -0000
@@ -0,0 +1,15 @@
+$OpenBSD$
+backport https://github.com/kkawakam/rustyline/pull/218 to fix build with 
rustc-1.36.
+
+Index: modcargo-crates/rustyline-4.0.0/src/history.rs
+--- modcargo-crates/rustyline-4.0.0/src/history.rs.orig
++++ modcargo-crates/rustyline-4.0.0/src/history.rs
+@@ -148,7 +148,7 @@ impl History {
+         let file = File::open(&path)?;
+         let rdr = BufReader::new(file);
+         for line in rdr.lines() {
+-            self.add(line?.as_ref()); // TODO truncate to MAX_LINE
++            self.add(line?); // TODO truncate to MAX_LINE
+         }
+         Ok(())
+     }
Index: patches/patch-modcargo-crates_rustyline-4_0_0_src_lib_rs
===================================================================
RCS file: patches/patch-modcargo-crates_rustyline-4_0_0_src_lib_rs
diff -N patches/patch-modcargo-crates_rustyline-4_0_0_src_lib_rs
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-modcargo-crates_rustyline-4_0_0_src_lib_rs    1 Jul 2019 
12:07:24 -0000
@@ -0,0 +1,15 @@
+$OpenBSD$
+backport https://github.com/kkawakam/rustyline/pull/218 to fix build with 
rustc-1.36.
+
+Index: modcargo-crates/rustyline-4.0.0/src/lib.rs
+--- modcargo-crates/rustyline-4.0.0/src/lib.rs.orig
++++ modcargo-crates/rustyline-4.0.0/src/lib.rs
+@@ -624,7 +624,7 @@ fn readline_raw<H: Helper>(
+     let user_input = readline_edit(prompt, initial, editor, &original_mode);
+     if editor.config.auto_add_history() {
+         if let Ok(ref line) = user_input {
+-            editor.add_history_entry(line.as_ref());
++            editor.add_history_entry(line.as_str());
+         }
+     }
+     drop(guard); // disable_raw_mode(original_mode)?;

Reply via email to