Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update toolchain 2020-09-11 #1588

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2020-08-14
nightly-2020-12-31
2 changes: 1 addition & 1 deletion rust_src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ fn env_var(name: &str) -> String {

// What to ignore when walking the list of files
fn ignore(path: &str, additional_ignored_paths: &[&str]) -> bool {
path == "" || path.starts_with('.') || additional_ignored_paths.contains(&path)
path.is_empty() || path.starts_with('.') || additional_ignored_paths.contains(&path)
}

// What files to ignore depending on chosen features
Expand Down
2 changes: 1 addition & 1 deletion rust_src/src/base64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ fn base64_decode_1(encoded: &[u8], multibyte: bool) -> Result<(Vec<u8>, usize),
Ok((decoded, len))
}
}
_ => Err(()),
Err(_) => Err(()),
}
}

Expand Down
8 changes: 4 additions & 4 deletions rust_src/src/casetab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ pub unsafe extern "C" fn init_casetab_once() {
for i in 0..128 {
// Set up a table for the lower 7 bits of ASCII.
// All upper case letters are mapped to lower case letters.
let c = if i >= 0x41 && i <= 0x5A {
let c = if (0x41..=0x5A).contains(&i) {
i + 32 // 'a' - 'A'
} else {
i
Expand All @@ -284,7 +284,7 @@ pub unsafe extern "C" fn init_casetab_once() {
for i in 0..128 {
// Set up a table for the lower 7 bits of ASCII.
// All lower case letters are mapped to upper case letters.
let c = if i >= 0x61 && i <= 0x7A {
let c = if (0x61..=0x7A).contains(&i) {
i - 32 // 'A' - 'a'
} else {
i
Expand All @@ -298,9 +298,9 @@ pub unsafe extern "C" fn init_casetab_once() {
// Set up a table for the lower 7 bits of ASCII.
// All upper case letters are mapped to lower case letters
// and vice versa.
let c = if i >= 0x41 && i <= 0x5A {
let c = if (0x41..=0x5A).contains(&i) {
i + 32 // 'a' - 'A'
} else if i >= 0x61 && i <= 0x7A {
} else if (0x61..=0x7A).contains(&i) {
i - 32 // 'A' - 'a'
} else {
i
Expand Down
4 changes: 2 additions & 2 deletions rust_src/src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ fn default_value(mut symbol: LispSymbolRef) -> LispObject {
// For other variables, get the current value.
do_symval_forwarding(valcontents)
},
_ => panic!("Symbol type has no default value"),
symbol_redirect::SYMBOL_VARALIAS => panic!("Symbol type has no default value"),
}
}

Expand Down Expand Up @@ -833,7 +833,7 @@ pub fn string_to_number_lisp(mut string: LispStringRef, base: Option<EmacsInt>)
let b = match base {
None => 10,
Some(n) => {
if n < 2 || n > 16 {
if !(2..=16).contains(&n) {
args_out_of_range!(base, 2, 16)
}
n
Expand Down
2 changes: 1 addition & 1 deletion rust_src/src/decompress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ pub fn zlib_decompress_region(start: LispObject, end: LispObject) -> bool {
}

// Decompress failed.
_ => {
Err(_) => {
// Delete any uncompressed data already inserted on error, but
// without calling the change hooks.

Expand Down
15 changes: 7 additions & 8 deletions rust_src/src/dired_unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -711,15 +711,14 @@ impl FileAttrs {
pub fn file_attributes_intro(filename: LispStringRef, id_format: LispObject) -> LispObject {
let fnexp = expand_file_name(filename, None);
let handler = find_file_name_handler(fnexp, Qfile_attributes);
if handler.is_not_nil() {
if id_format.is_not_nil() {
return call!(handler, Qfile_attributes, fnexp.into(), id_format);
} else {
return call!(handler, Qfile_attributes, fnexp.into());
}
}

file_attributes_core(fnexp.into(), id_format)
if handler.is_nil() {
file_attributes_core(fnexp.into(), id_format)
} else if id_format.is_nil() {
call!(handler, Qfile_attributes, fnexp.into())
} else {
call!(handler, Qfile_attributes, fnexp.into(), id_format)
}
}

// Used by directory-files-and-attributes
Expand Down
4 changes: 2 additions & 2 deletions rust_src/src/editfns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ pub fn char_to_string(character: Codepoint) -> LispObject {
/// Convert arg BYTE to a unibyte string containing that byte.
#[lisp_fn]
pub fn byte_to_string(byte: EmacsInt) -> LispObject {
if byte < 0 || byte > 255 {
if !(0..=255).contains(&byte) {
error!("Invalid byte");
}
let byte = byte as libc::c_char;
Expand Down Expand Up @@ -1578,7 +1578,7 @@ fn general_insert_function<IF, IFSF>(
for &val in args {
if val.is_character() {
let c = Codepoint::from(val);
let mut s = [0 as c_uchar; MAX_MULTIBYTE_LENGTH];
let mut s = [0_u8; MAX_MULTIBYTE_LENGTH];
let multibyte = ThreadState::current_buffer_unchecked().multibyte_characters_enabled();
let len = if multibyte {
c.write_to(&mut s)
Expand Down
4 changes: 2 additions & 2 deletions rust_src/src/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,9 +593,9 @@ pub fn macroexpand(mut form: LispObject, environment: LispObject) -> LispObject
let newform = apply1(expander, body);
if form.eq(newform) {
break;
} else {
form = newform;
}

form = newform;
}

form
Expand Down
2 changes: 1 addition & 1 deletion rust_src/src/fonts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ pub fn font_at_lisp(
pos
}

_ => {
None => {
if w.contents != cur_buf.into() {
error!("Specified window is not displaying the current buffer");
}
Expand Down
39 changes: 19 additions & 20 deletions rust_src/src/keymap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,8 @@ pub fn set_keymap_parent(keymap: LispObject, parent: LispObject) -> LispObject {
Some(cons) => {
if keymapp(list) {
break;
} else {
prev = cons;
}
prev = cons;
}
}
}
Expand Down Expand Up @@ -361,27 +360,27 @@ pub unsafe extern "C" fn map_keymap_internal(
let binding = tail_cons.car();
if binding.eq(Qkeymap) {
break;
} else {
// An embedded parent.
if keymapp(binding) {
break;
}
}

if let Some((car, cdr)) = binding.into() {
map_keymap_item(fun, args, car, cdr, data);
} else if binding.is_vector() {
if let Some(binding_vec) = binding.as_vectorlike() {
for c in 0..binding_vec.pseudovector_size() {
map_keymap_item(fun, args, c.into(), aref(binding, c), data);
}
// An embedded parent.
if keymapp(binding) {
break;
}

if let Some((car, cdr)) = binding.into() {
map_keymap_item(fun, args, car, cdr, data);
} else if binding.is_vector() {
if let Some(binding_vec) = binding.as_vectorlike() {
for c in 0..binding_vec.pseudovector_size() {
map_keymap_item(fun, args, c.into(), aref(binding, c), data);
}
} else if binding.is_char_table() {
let saved = match fun {
Some(f) => make_save_funcptr_ptr_obj(Some(std::mem::transmute(f)), data, args),
None => make_save_funcptr_ptr_obj(None, data, args),
};
map_char_table(Some(map_keymap_char_table_item), Qnil, binding, saved);
}
} else if binding.is_char_table() {
let saved = match fun {
Some(f) => make_save_funcptr_ptr_obj(Some(std::mem::transmute(f)), data, args),
None => make_save_funcptr_ptr_obj(None, data, args),
};
map_char_table(Some(map_keymap_char_table_item), Qnil, binding, saved);
}

parent = tail_cons.cdr();
Expand Down
1 change: 0 additions & 1 deletion rust_src/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#![feature(const_fn)]
#![feature(const_fn_union)]
#![feature(never_type)]
#![feature(ptr_offset_from)]
#![feature(specialization)]
#![feature(stmt_expr_attributes)]
#![feature(untagged_unions)]
Expand Down
2 changes: 1 addition & 1 deletion rust_src/src/libm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use libc::c_int;
mod sys {
use libc::{c_double, c_int};

#[link_name = "m"]
#[link(name = "m")]
extern "C" {
pub fn frexp(n: c_double, value: &mut c_int) -> c_double;
pub fn ldexp(x: c_double, n: c_int) -> c_double;
Expand Down
2 changes: 1 addition & 1 deletion rust_src/src/lists.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ impl TailsIter {
) -> Self {
let errsym = match end_checks {
LispConsEndChecks::on => Some(ty),
_ => None,
LispConsEndChecks::off => None,
};

Self {
Expand Down
6 changes: 3 additions & 3 deletions rust_src/src/multibyte.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ impl Codepoint {
let unshifted = cp & !char_bits::CHAR_SHIFT;
// Shift modifier is valid only with [A-Za-z].
// Shift modifier for control characters and SPC is ignored.
if (ascii >= b'A' && ascii <= b'Z') || ascii <= b' ' {
if (b'A'..=b'Z').contains(&ascii) || ascii <= b' ' {
cp = unshifted;
} else if ascii >= b'a' && ascii <= b'z' {
} else if (b'a'..=b'z').contains(&ascii) {
cp = unshifted & !0x20;
}
}
Expand All @@ -253,7 +253,7 @@ impl Codepoint {
cp &= !0x7F & !char_bits::CHAR_CTL;
} else if ascii == b'?' {
cp = 0x7F | (cp & !0x7F & !char_bits::CHAR_CTL);
} else if ascii >= b'@' && ascii <= b'_' {
} else if (b'@'..=b'_').contains(&ascii) {
// ASCII control chars are made from letters (both cases),
// as well as the non-letters within 0o100...0o137.
cp &= 0x1F | (!0x7F & !char_bits::CHAR_CTL);
Expand Down
10 changes: 5 additions & 5 deletions rust_src/src/symbols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ impl LispSymbolRef {
}
}
symbol_redirect::SYMBOL_FORWARDED => do_symval_forwarding(symbol.get_fwd()),
_ => unreachable!(),
symbol_redirect::SYMBOL_VARALIAS => unreachable!(),
}
}

Expand Down Expand Up @@ -401,7 +401,7 @@ pub fn boundp(mut symbol: LispSymbolRef) -> bool {
// set to Qunbound.
return true;
}
_ => unreachable!(),
symbol_redirect::SYMBOL_VARALIAS => unreachable!(),
};

!valcontents.eq(Qunbound)
Expand Down Expand Up @@ -537,7 +537,7 @@ pub fn local_variable_p(mut symbol: LispSymbolRef, buffer: LispBufferOrCurrent)
None => false,
}
},
_ => unreachable!(),
symbol_redirect::SYMBOL_VARALIAS => unreachable!(),
}
}

Expand Down Expand Up @@ -579,7 +579,7 @@ pub fn variable_binding_locus(mut symbol: LispSymbolRef) -> LispObject {
}
},
symbol_redirect::SYMBOL_LOCALIZED => localized_handler(symbol),
_ => unreachable!(),
symbol_redirect::SYMBOL_VARALIAS => unreachable!(),
}
}

Expand All @@ -603,7 +603,7 @@ pub fn local_variable_if_set_p(mut symbol: LispSymbolRef, buffer: LispBufferOrCu
// All BUFFER_OBJFWD slots become local if they are set.
unsafe { is_buffer_objfwd(symbol.get_fwd()) }
}
_ => unreachable!(),
symbol_redirect::SYMBOL_VARALIAS => unreachable!(),
}
}

Expand Down
26 changes: 13 additions & 13 deletions rust_src/src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,21 +247,21 @@ pub unsafe extern "C" fn decode_time_components(
*dresult = t;
}
return 1;
} else if low.is_nil() {
let now = current_timespec();
if !result.is_null() {
(*result).hi = hi_time(now.tv_sec);
(*result).lo = lo_time(now.tv_sec);
(*result).us = (now.tv_nsec / 1000) as c_int;
(*result).ps = (now.tv_nsec % 1000 * 1000) as c_int;
}
if !dresult.is_null() {
*dresult = (now.tv_sec as f64) + (now.tv_nsec as f64) / 1e9;
}
return 1;
} else {
} else if low.is_not_nil() {
return 0;
}

let now = current_timespec();
if !result.is_null() {
(*result).hi = hi_time(now.tv_sec);
(*result).lo = lo_time(now.tv_sec);
(*result).us = (now.tv_nsec / 1000) as c_int;
(*result).ps = (now.tv_nsec % 1000 * 1000) as c_int;
}
if !dresult.is_null() {
*dresult = (now.tv_sec as f64) + (now.tv_nsec as f64) / 1e9;
}
return 1;
}

let mut hi = high.as_fixnum().unwrap();
Expand Down