restructure unary_op to also dispatch on type first; fix promotion with unary '-' overflowing
This commit is contained in:
parent
066d2eea25
commit
e6a5a9418a
2 changed files with 62 additions and 42 deletions
|
|
@ -8,10 +8,18 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: -O
|
||||
|
||||
fn foo(_: &'static [&'static str]) {}
|
||||
fn bar(_: &'static [&'static str; 3]) {}
|
||||
fn baz_i32(_: &'static i32) {}
|
||||
fn baz_u32(_: &'static u32) {}
|
||||
|
||||
fn main() {
|
||||
foo(&["a", "b", "c"]);
|
||||
bar(&["d", "e", "f"]);
|
||||
|
||||
// make sure that these do not cause trouble despite overflowing
|
||||
baz_u32(&(0-1));
|
||||
baz_i32(&-std::i32::MIN);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue