Auto merge of #22909 - Manishearth:rollup, r=Manishearth
r? @Manishearth
This commit is contained in:
commit
0905c8a5ec
8 changed files with 38 additions and 7 deletions
2
configure
vendored
2
configure
vendored
|
@ -875,7 +875,7 @@ then
|
|||
| cut -d ' ' -f 2)
|
||||
|
||||
case $CFG_CLANG_VERSION in
|
||||
(3.0svn | 3.0 | 3.1* | 3.2* | 3.3* | 3.4* | 3.5* | 3.6*)
|
||||
(3.2* | 3.3* | 3.4* | 3.5* | 3.6*)
|
||||
step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
|
||||
if [ -z "$CC" ]
|
||||
then
|
||||
|
|
|
@ -1455,9 +1455,9 @@ pub trait StrExt: Index<RangeFull, Output = str> {
|
|||
///
|
||||
/// `is_cjk` determines behavior for characters in the Ambiguous category: if `is_cjk` is
|
||||
/// `true`, these are 2 columns wide; otherwise, they are 1. In CJK locales, `is_cjk` should be
|
||||
/// `true`, else it should be `false`. [Unicode Standard Annex
|
||||
/// #11](http://www.unicode.org/reports/tr11/) recommends that these characters be treated as 1
|
||||
/// column (i.e., `is_cjk` = `false`) if the locale is unknown.
|
||||
/// `true`, else it should be `false`.
|
||||
/// [Unicode Standard Annex #11](http://www.unicode.org/reports/tr11/) recommends that these
|
||||
/// characters be treated as 1 column (i.e., `is_cjk = false`) if the locale is unknown.
|
||||
#[unstable(feature = "collections",
|
||||
reason = "this functionality may only be provided by libunicode")]
|
||||
fn width(&self, is_cjk: bool) -> usize {
|
||||
|
|
|
@ -700,7 +700,7 @@ impl Display for char {
|
|||
impl<T> Pointer for *const T {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
f.flags |= 1 << (FlagV1::Alternate as u32);
|
||||
let ret = LowerHex::fmt(&(*self as u32), f);
|
||||
let ret = LowerHex::fmt(&(*self as usize), f);
|
||||
f.flags &= !(1 << (FlagV1::Alternate as u32));
|
||||
ret
|
||||
}
|
||||
|
|
|
@ -851,7 +851,9 @@ pub fn run_passes(sess: &Session,
|
|||
|
||||
// FIXME: time_llvm_passes support - does this use a global context or
|
||||
// something?
|
||||
//if sess.time_llvm_passes() { llvm::LLVMRustPrintPassTimings(); }
|
||||
if sess.opts.cg.codegen_units == 1 && sess.time_llvm_passes() {
|
||||
unsafe { llvm::LLVMRustPrintPassTimings(); }
|
||||
}
|
||||
}
|
||||
|
||||
struct WorkItem {
|
||||
|
|
|
@ -2332,6 +2332,11 @@ pub fn trans_item(ccx: &CrateContext, item: &ast::Item) {
|
|||
// Do static_assert checking. It can't really be done much earlier
|
||||
// because we need to get the value of the bool out of LLVM
|
||||
if attr::contains_name(&item.attrs, "static_assert") {
|
||||
if !ty::type_is_bool(ty::expr_ty(ccx.tcx(), expr)) {
|
||||
ccx.sess().span_fatal(expr.span,
|
||||
"can only have static_assert on a static \
|
||||
with type `bool`");
|
||||
}
|
||||
if m == ast::MutMutable {
|
||||
ccx.sess().span_fatal(expr.span,
|
||||
"cannot have static_assert on a mutable \
|
||||
|
|
|
@ -164,7 +164,7 @@ pub mod guard {
|
|||
|
||||
if pthread_main_np() == 1 {
|
||||
// main thread
|
||||
current_stack.ss_sp as uint - current_stack.ss_size as uint + 3 * PAGE_SIZE as uint
|
||||
current_stack.ss_sp as uint - current_stack.ss_size as uint + PAGE_SIZE as uint
|
||||
|
||||
} else {
|
||||
// new thread
|
||||
|
|
16
src/test/compile-fail/nonbool_static_assert.rs
Normal file
16
src/test/compile-fail/nonbool_static_assert.rs
Normal file
|
@ -0,0 +1,16 @@
|
|||
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![allow(dead_code)]
|
||||
|
||||
#[static_assert]
|
||||
static E: i32 = 1; //~ ERROR can only have static_assert on a static with type `bool`
|
||||
|
||||
fn main() {}
|
|
@ -17,6 +17,7 @@
|
|||
#![feature(box_syntax)]
|
||||
|
||||
use std::fmt;
|
||||
use std::usize;
|
||||
|
||||
struct A;
|
||||
struct B;
|
||||
|
@ -137,6 +138,13 @@ pub fn main() {
|
|||
t!(format!("{:+10.3e}", 1.2345e6f64), " +1.234e6");
|
||||
t!(format!("{:+10.3e}", -1.2345e6f64), " -1.234e6");
|
||||
|
||||
// Test that pointers don't get truncated.
|
||||
{
|
||||
let val = usize::MAX;
|
||||
let exp = format!("{:#x}", val);
|
||||
t!(format!("{:p}", val as *const isize), exp);
|
||||
}
|
||||
|
||||
// Escaping
|
||||
t!(format!("{{"), "{");
|
||||
t!(format!("}}"), "}");
|
||||
|
|
Loading…
Add table
Reference in a new issue