Skip to content

Commit 2c88f10

Browse files
committed
---
yaml --- r: 235714 b: refs/heads/stable c: 312f886 h: refs/heads/master v: v3
1 parent a96c681 commit 2c88f10

File tree

11 files changed

+41
-90
lines changed

11 files changed

+41
-90
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: 7911d9979f672982b45d288d3cd6e5f588a2b699
32+
refs/heads/stable: 312f886d03d748b1cf63a0e9ad68ce654e5d1cd0
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: 12 additions & 3 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-
/// Bytewise slice equality
874+
// share the implementation of the lang-item vs. non-lang-item
875+
// eq_slice.
875876
/// NOTE: This function is (ab)used in rustc::middle::trans::_match
876877
/// 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,6 +887,15 @@ 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+
890899
/*
891900
Section: Misc
892901
*/

branches/stable/src/librustc/middle/resolve_lifetime.rs

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ pub fn krate(sess: &Session, krate: &ast::Crate, def_map: &DefMap) -> NamedRegio
109109

110110
impl<'a, 'v> Visitor<'v> for LifetimeContext<'a> {
111111
fn visit_item(&mut self, item: &ast::Item) {
112-
// Items save/restore the set of labels. This way inner items
112+
// Items save/restore the set of labels. This way innner items
113113
// can freely reuse names, be they loop labels or lifetimes.
114114
let saved = replace(&mut self.labels_in_fn, vec![]);
115115

@@ -151,29 +151,6 @@ impl<'a, 'v> Visitor<'v> for LifetimeContext<'a> {
151151
replace(&mut self.labels_in_fn, saved);
152152
}
153153

154-
fn visit_foreign_item(&mut self, item: &ast::ForeignItem) {
155-
// Items save/restore the set of labels. This way inner items
156-
// can freely reuse names, be they loop labels or lifetimes.
157-
let saved = replace(&mut self.labels_in_fn, vec![]);
158-
159-
// Items always introduce a new root scope
160-
self.with(RootScope, |_, this| {
161-
match item.node {
162-
ast::ForeignItemFn(_, ref generics) => {
163-
this.visit_early_late(subst::FnSpace, generics, |this| {
164-
visit::walk_foreign_item(this, item);
165-
})
166-
}
167-
ast::ForeignItemStatic(..) => {
168-
visit::walk_foreign_item(this, item);
169-
}
170-
}
171-
});
172-
173-
// Done traversing the item; restore saved set of labels.
174-
replace(&mut self.labels_in_fn, saved);
175-
}
176-
177154
fn visit_fn(&mut self, fk: visit::FnKind<'v>, fd: &'v ast::FnDecl,
178155
b: &'v ast::Block, s: Span, _: ast::NodeId) {
179156
match fk {

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 => ast::DUMMY_NODE_ID,
481+
None => -1,
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 => ast::DUMMY_NODE_ID,
539+
None => -1,
540540
};
541541
self.fmt.struct_variant_str(variant.span,
542542
self.span.span_for_first_ident(variant.span),

branches/stable/src/librustc_trans/trans/cleanup.rs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -774,22 +774,20 @@ impl<'blk, 'tcx> CleanupHelperMethods<'blk, 'tcx> for FunctionContext<'blk, 'tcx
774774
// At this point, `popped_scopes` is empty, and so the final block
775775
// that we return to the user is `Cleanup(AST 24)`.
776776
while let Some(mut scope) = popped_scopes.pop() {
777-
if !scope.cleanups.is_empty() {
778-
let name = scope.block_name("clean");
779-
debug!("generating cleanups for {}", name);
780-
let bcx_in = self.new_block(label.is_unwind(),
781-
&name[..],
782-
None);
783-
let mut bcx_out = bcx_in;
784-
for cleanup in scope.cleanups.iter().rev() {
785-
bcx_out = cleanup.trans(bcx_out,
786-
scope.debug_loc);
787-
}
788-
build::Br(bcx_out, prev_llbb, DebugLoc::None);
789-
prev_llbb = bcx_in.llbb;
790-
791-
scope.add_cached_early_exit(label, prev_llbb);
777+
let name = scope.block_name("clean");
778+
debug!("generating cleanups for {}", name);
779+
let bcx_in = self.new_block(label.is_unwind(),
780+
&name[..],
781+
None);
782+
let mut bcx_out = bcx_in;
783+
for cleanup in scope.cleanups.iter().rev() {
784+
bcx_out = cleanup.trans(bcx_out,
785+
scope.debug_loc);
792786
}
787+
build::Br(bcx_out, prev_llbb, DebugLoc::None);
788+
prev_llbb = bcx_in.llbb;
789+
790+
scope.add_cached_early_exit(label, prev_llbb);
793791
self.push_scope(scope);
794792
}
795793

branches/stable/src/librustc_typeck/astconv.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ 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;
6362
use rscope::{self, UnelidableRscope, RegionScope, ElidableRscope, ExplicitRscope,
6463
ObjectLifetimeDefaultRscope, ShiftedRscope, BindingRscope,
6564
ElisionFailureInfo, ElidedLifetime};
@@ -1576,7 +1575,10 @@ pub fn ast_ty_to_ty<'tcx>(this: &AstConv<'tcx>,
15761575
}
15771576
ast::TyParen(ref typ) => ast_ty_to_ty(this, rscope, &**typ),
15781577
ast::TyBareFn(ref bf) => {
1579-
require_c_abi_if_variadic(tcx, &bf.decl, bf.abi, ast_ty.span);
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+
}
15801582
let bare_fn = ty_of_bare_fn(this, bf.unsafety, bf.abi, &*bf.decl);
15811583
tcx.mk_fn(None, tcx.mk_bare_fn(bare_fn))
15821584
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ 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;
101100
use rscope::{ElisionFailureInfo, RegionScope};
102101
use session::Session;
103102
use {CrateCtxt, lookup_full_def, require_same_types};
@@ -686,7 +685,10 @@ pub fn check_item_type<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>, it: &'tcx ast::Item) {
686685
}
687686

688687
if let ast::ForeignItemFn(ref fn_decl, _) = item.node {
689-
require_c_abi_if_variadic(ccx.tcx, fn_decl, m.abi, item.span);
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+
}
690692
}
691693
}
692694
}

branches/stable/src/librustc_typeck/lib.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -176,16 +176,6 @@ 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-
189179
fn require_same_types<'a, 'tcx, M>(tcx: &ty::ctxt<'tcx>,
190180
maybe_infcx: Option<&infer::InferCtxt<'a, 'tcx>>,
191181
t1_is_expected: bool,

branches/stable/src/libstd/num/f32.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
1515
#![stable(feature = "rust1", since = "1.0.0")]
1616
#![allow(missing_docs)]
17-
#![allow(unsigned_negation)]
1817

1918
use prelude::v1::*;
2019

branches/stable/src/libsyntax/parse/parser.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2738,15 +2738,14 @@ impl<'a> Parser<'a> {
27382738
// (much lower than other prefix expressions) to be consistent
27392739
// with the postfix-form 'expr..'
27402740
let lo = self.span.lo;
2741-
let mut hi = self.span.hi;
27422741
try!(self.bump());
27432742
let opt_end = if self.is_at_start_of_range_notation_rhs() {
27442743
let end = try!(self.parse_binops());
2745-
hi = end.span.hi;
27462744
Some(end)
27472745
} else {
27482746
None
27492747
};
2748+
let hi = self.span.hi;
27502749
let ex = self.mk_range(None, opt_end);
27512750
Ok(self.mk_expr(lo, hi, ex))
27522751
}
@@ -2788,17 +2787,17 @@ impl<'a> Parser<'a> {
27882787
}
27892788
// A range expression, either `expr..expr` or `expr..`.
27902789
token::DotDot => {
2791-
let lo = lhs.span.lo;
2792-
let mut hi = self.span.hi;
27932790
try!(self.bump());
27942791

27952792
let opt_end = if self.is_at_start_of_range_notation_rhs() {
27962793
let end = try!(self.parse_binops());
2797-
hi = end.span.hi;
27982794
Some(end)
27992795
} else {
28002796
None
28012797
};
2798+
2799+
let lo = lhs.span.lo;
2800+
let hi = self.span.hi;
28022801
let range = self.mk_range(Some(lhs), opt_end);
28032802
return Ok(self.mk_expr(lo, hi, range));
28042803
}

branches/stable/src/test/compile-fail/generic-extern-lifetime.rs

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)