Skip to content

Commit 80be96b

Browse files
committed
---
yaml --- r: 235709 b: refs/heads/stable c: d6a6178 h: refs/heads/master i: 235707: d3af90d v: v3
1 parent 4517a8f commit 80be96b

File tree

6 files changed

+20
-23
lines changed

6 files changed

+20
-23
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: b2213498c4654d60af7e40ff8f59b14a9a3a18a9
32+
refs/heads/stable: d6a617863761a4023b437bd70288abc77ac20554
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/src/libcore/str/mod.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -871,12 +871,12 @@ impl<'a> DoubleEndedIterator for LinesAny<'a> {
871871
Section: Comparing strings
872872
*/
873873

874-
// share the implementation of the lang-item vs. non-lang-item
875-
// eq_slice.
874+
/// Bytewise slice equality
876875
/// NOTE: This function is (ab)used in rustc::middle::trans::_match
877876
/// to compare &[u8] byte slices that are not necessarily valid UTF-8.
877+
#[lang = "str_eq"]
878878
#[inline]
879-
fn eq_slice_(a: &str, b: &str) -> bool {
879+
fn eq_slice(a: &str, b: &str) -> bool {
880880
// NOTE: In theory n should be libc::size_t and not usize, but libc is not available here
881881
#[allow(improper_ctypes)]
882882
extern { fn memcmp(s1: *const i8, s2: *const i8, n: usize) -> i32; }
@@ -887,15 +887,6 @@ fn eq_slice_(a: &str, b: &str) -> bool {
887887
}
888888
}
889889

890-
/// Bytewise slice equality
891-
/// NOTE: This function is (ab)used in rustc::middle::trans::_match
892-
/// to compare &[u8] byte slices that are not necessarily valid UTF-8.
893-
#[lang = "str_eq"]
894-
#[inline]
895-
fn eq_slice(a: &str, b: &str) -> bool {
896-
eq_slice_(a, b)
897-
}
898-
899890
/*
900891
Section: Misc
901892
*/

branches/stable/src/librustc_trans/save/dump_csv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
478478

479479
let ctor_id = match def.ctor_id {
480480
Some(node_id) => node_id,
481-
None => -1,
481+
None => ast::DUMMY_NODE_ID,
482482
};
483483
let val = self.span.snippet(item.span);
484484
let sub_span = self.span.sub_span_after_keyword(item.span, keywords::Struct);
@@ -536,7 +536,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
536536
ast::StructVariantKind(ref struct_def) => {
537537
let ctor_id = match struct_def.ctor_id {
538538
Some(node_id) => node_id,
539-
None => -1,
539+
None => ast::DUMMY_NODE_ID,
540540
};
541541
self.fmt.struct_variant_str(variant.span,
542542
self.span.span_for_first_ident(variant.span),

branches/stable/src/librustc_typeck/astconv.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ use middle::subst::{FnSpace, TypeSpace, SelfSpace, Subst, Substs};
5959
use middle::traits;
6060
use middle::ty::{self, RegionEscape, Ty, ToPredicate, HasTypeFlags};
6161
use middle::ty_fold;
62+
use require_c_abi_if_variadic;
6263
use rscope::{self, UnelidableRscope, RegionScope, ElidableRscope, ExplicitRscope,
6364
ObjectLifetimeDefaultRscope, ShiftedRscope, BindingRscope,
6465
ElisionFailureInfo, ElidedLifetime};
@@ -1575,10 +1576,7 @@ pub fn ast_ty_to_ty<'tcx>(this: &AstConv<'tcx>,
15751576
}
15761577
ast::TyParen(ref typ) => ast_ty_to_ty(this, rscope, &**typ),
15771578
ast::TyBareFn(ref bf) => {
1578-
if bf.decl.variadic && bf.abi != abi::C {
1579-
span_err!(tcx.sess, ast_ty.span, E0045,
1580-
"variadic function must have C calling convention");
1581-
}
1579+
require_c_abi_if_variadic(tcx, &bf.decl, bf.abi, ast_ty.span);
15821580
let bare_fn = ty_of_bare_fn(this, bf.unsafety, bf.abi, &*bf.decl);
15831581
tcx.mk_fn(None, tcx.mk_bare_fn(bare_fn))
15841582
}

branches/stable/src/librustc_typeck/check/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ use middle::ty::{Disr, ParamTy, ParameterEnvironment};
9797
use middle::ty::{self, HasTypeFlags, RegionEscape, ToPolyTraitRef, Ty};
9898
use middle::ty::{MethodCall, MethodCallee};
9999
use middle::ty_fold::{TypeFolder, TypeFoldable};
100+
use require_c_abi_if_variadic;
100101
use rscope::{ElisionFailureInfo, RegionScope};
101102
use session::Session;
102103
use {CrateCtxt, lookup_full_def, require_same_types};
@@ -685,10 +686,7 @@ pub fn check_item_type<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>, it: &'tcx ast::Item) {
685686
}
686687

687688
if let ast::ForeignItemFn(ref fn_decl, _) = item.node {
688-
if fn_decl.variadic && m.abi != abi::C {
689-
span_err!(ccx.tcx.sess, item.span, E0045,
690-
"variadic function must have C calling convention");
691-
}
689+
require_c_abi_if_variadic(ccx.tcx, fn_decl, m.abi, item.span);
692690
}
693691
}
694692
}

branches/stable/src/librustc_typeck/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,16 @@ fn lookup_full_def(tcx: &ty::ctxt, sp: Span, id: ast::NodeId) -> def::Def {
176176
}
177177
}
178178

179+
fn require_c_abi_if_variadic(tcx: &ty::ctxt,
180+
decl: &ast::FnDecl,
181+
abi: abi::Abi,
182+
span: Span) {
183+
if decl.variadic && abi != abi::C {
184+
span_err!(tcx.sess, span, E0045,
185+
"variadic function must have C calling convention");
186+
}
187+
}
188+
179189
fn require_same_types<'a, 'tcx, M>(tcx: &ty::ctxt<'tcx>,
180190
maybe_infcx: Option<&infer::InferCtxt<'a, 'tcx>>,
181191
t1_is_expected: bool,

0 commit comments

Comments
 (0)