From 0209b28ad54a2fc90ee50360a7392e0ca61d4cf0 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sat, 8 Jul 2017 00:51:24 +0300 Subject: [PATCH] Fix build on nightly --- src/encoding.rs | 2 +- src/syntax.rs | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/encoding.rs b/src/encoding.rs index d5ec728..363e2b8 100644 --- a/src/encoding.rs +++ b/src/encoding.rs @@ -6,4 +6,4 @@ extern { } pub type Encoding = c_void; -pub static ENCODING_UTF8: &'static Encoding = &OnigEncodingUTF8; +pub static ENCODING_UTF8: &'static Encoding = unsafe { &OnigEncodingUTF8 }; diff --git a/src/syntax.rs b/src/syntax.rs index d91333d..1446e55 100644 --- a/src/syntax.rs +++ b/src/syntax.rs @@ -28,25 +28,25 @@ extern { } /// Plain text syntax -pub static SYNTAX_ASIS: &'static Syntax = &OnigSyntaxASIS; +pub static SYNTAX_ASIS: &'static Syntax = unsafe { &OnigSyntaxASIS }; /// POSIX Basic RE syntax -pub static SYNTAX_POSIX_BASIC: &'static Syntax = &OnigSyntaxPosixBasic; +pub static SYNTAX_POSIX_BASIC: &'static Syntax = unsafe { &OnigSyntaxPosixBasic }; /// POSIX Extended RE syntax -pub static SYNTAX_POSIX_EXTENDED: &'static Syntax = &OnigSyntaxPosixExtended; +pub static SYNTAX_POSIX_EXTENDED: &'static Syntax = unsafe { &OnigSyntaxPosixExtended }; /// Emacs syntax -pub static SYNTAX_EMACS: &'static Syntax = &OnigSyntaxEmacs; +pub static SYNTAX_EMACS: &'static Syntax = unsafe { &OnigSyntaxEmacs }; /// Grep syntax -pub static SYNTAX_GREP: &'static Syntax = &OnigSyntaxGrep; +pub static SYNTAX_GREP: &'static Syntax = unsafe { &OnigSyntaxGrep }; /// GNU regex syntax -pub static SYNTAX_GNU_REGEX: &'static Syntax = &OnigSyntaxGnuRegex; +pub static SYNTAX_GNU_REGEX: &'static Syntax = unsafe { &OnigSyntaxGnuRegex }; /// Java (Sun java.util.regex) syntax -pub static SYNTAX_JAVA: &'static Syntax = &OnigSyntaxJava; +pub static SYNTAX_JAVA: &'static Syntax = unsafe { &OnigSyntaxJava }; /// Perl syntax -pub static SYNTAX_PERL: &'static Syntax = &OnigSyntaxPerl; +pub static SYNTAX_PERL: &'static Syntax = unsafe { &OnigSyntaxPerl }; /// Perl + named group syntax -pub static SYNTAX_PERL_NG: &'static Syntax = &OnigSyntaxPerl_NG; +pub static SYNTAX_PERL_NG: &'static Syntax = unsafe { &OnigSyntaxPerl_NG }; /// Ruby syntax (default) -pub static SYNTAX_RUBY: &'static Syntax = &OnigSyntaxRuby; +pub static SYNTAX_RUBY: &'static Syntax = unsafe { &OnigSyntaxRuby }; type OnigCodePoint = c_ulong;