Skip to content

Commit 59fe0ff

Browse files
committed
---
yaml --- r: 275066 b: refs/heads/stable c: 575c85a h: refs/heads/master
1 parent 0bb6a94 commit 59fe0ff

File tree

49 files changed

+1955
-1676
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1955
-1676
lines changed

[refs]

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

branches/stable/src/liballoc_jemalloc/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,19 @@ extern {}
4545
// explicitly request it), and on Android we explicitly request it as
4646
// unprefixing cause segfaults (mismatches in allocators).
4747
extern {
48-
#[cfg_attr(any(target_os = "macos", target_os = "android"),
48+
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
4949
link_name = "je_mallocx")]
5050
fn mallocx(size: size_t, flags: c_int) -> *mut c_void;
51-
#[cfg_attr(any(target_os = "macos", target_os = "android"),
51+
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
5252
link_name = "je_rallocx")]
5353
fn rallocx(ptr: *mut c_void, size: size_t, flags: c_int) -> *mut c_void;
54-
#[cfg_attr(any(target_os = "macos", target_os = "android"),
54+
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
5555
link_name = "je_xallocx")]
5656
fn xallocx(ptr: *mut c_void, size: size_t, extra: size_t, flags: c_int) -> size_t;
57-
#[cfg_attr(any(target_os = "macos", target_os = "android"),
57+
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
5858
link_name = "je_sdallocx")]
5959
fn sdallocx(ptr: *mut c_void, size: size_t, flags: c_int);
60-
#[cfg_attr(any(target_os = "macos", target_os = "android"),
60+
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
6161
link_name = "je_nallocx")]
6262
fn nallocx(size: size_t, flags: c_int) -> size_t;
6363
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ pub trait Write {
121121
self.0.write_str(s)
122122
}
123123

124+
fn write_char(&mut self, c: char) -> Result {
125+
self.0.write_char(c)
126+
}
127+
124128
fn write_fmt(&mut self, args: Arguments) -> Result {
125129
self.0.write_fmt(args)
126130
}

branches/stable/src/liblibc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit a64ee24718c0289b82a77d692cf56f8a1226de51
1+
Subproject commit 403bdc88394919f297bdb365032044cc0481c319

branches/stable/src/librustc/front/map/mod.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,17 @@ impl<'ast> Map<'ast> {
325325
return DepNode::Krate,
326326

327327
NotPresent =>
328-
panic!("Walking parents from `{}` led to `NotPresent` at `{}`", id0, id),
328+
// Some nodes, notably struct fields, are not
329+
// present in the map for whatever reason, but
330+
// they *do* have def-ids. So if we encounter an
331+
// empty hole, check for that case.
332+
return self.opt_local_def_id(id)
333+
.map(|def_id| DepNode::Hir(def_id))
334+
.unwrap_or_else(|| {
335+
panic!("Walking parents from `{}` \
336+
led to `NotPresent` at `{}`",
337+
id0, id)
338+
}),
329339
}
330340
}
331341
}

branches/stable/src/librustc_back/target/freebsd_base.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,20 @@ pub fn opts() -> TargetOptions {
1616
linker: "cc".to_string(),
1717
dynamic_linking: true,
1818
executables: true,
19+
linker_is_gnu: true,
1920
has_rpath: true,
20-
pre_link_args: vec![
21+
pre_link_args: vec!(
22+
// GNU-style linkers will use this to omit linking to libraries
23+
// which don't actually fulfill any relocations, but only for
24+
// libraries which follow this flag. Thus, use it before
25+
// specifying libraries to link to.
26+
"-Wl,--as-needed".to_string(),
27+
2128
// Always enable NX protection when it is available
2229
"-Wl,-z,noexecstack".to_string(),
23-
],
30+
),
31+
position_independent_executables: true,
2432
exe_allocation_crate: super::maybe_jemalloc(),
25-
2633
.. Default::default()
2734
}
2835
}

branches/stable/src/librustc_data_structures/graph/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ impl<N:Debug,E:Debug> Graph<N,E> {
115115
// Simple accessors
116116

117117
#[inline]
118-
pub fn all_nodes<'a>(&'a self) -> &'a [Node<N>] {
118+
pub fn all_nodes(&self) -> &[Node<N>] {
119119
&self.nodes
120120
}
121121

@@ -125,7 +125,7 @@ impl<N:Debug,E:Debug> Graph<N,E> {
125125
}
126126

127127
#[inline]
128-
pub fn all_edges<'a>(&'a self) -> &'a [Edge<E>] {
128+
pub fn all_edges(&self) -> &[Edge<E>] {
129129
&self.edges
130130
}
131131

@@ -150,15 +150,15 @@ impl<N:Debug,E:Debug> Graph<N,E> {
150150
idx
151151
}
152152

153-
pub fn mut_node_data<'a>(&'a mut self, idx: NodeIndex) -> &'a mut N {
153+
pub fn mut_node_data(&mut self, idx: NodeIndex) -> &mut N {
154154
&mut self.nodes[idx.0].data
155155
}
156156

157-
pub fn node_data<'a>(&'a self, idx: NodeIndex) -> &'a N {
157+
pub fn node_data(&self, idx: NodeIndex) -> &N {
158158
&self.nodes[idx.0].data
159159
}
160160

161-
pub fn node<'a>(&'a self, idx: NodeIndex) -> &'a Node<N> {
161+
pub fn node(&self, idx: NodeIndex) -> &Node<N> {
162162
&self.nodes[idx.0]
163163
}
164164

@@ -199,15 +199,15 @@ impl<N:Debug,E:Debug> Graph<N,E> {
199199
return idx;
200200
}
201201

202-
pub fn mut_edge_data<'a>(&'a mut self, idx: EdgeIndex) -> &'a mut E {
202+
pub fn mut_edge_data(&mut self, idx: EdgeIndex) -> &mut E {
203203
&mut self.edges[idx.0].data
204204
}
205205

206-
pub fn edge_data<'a>(&'a self, idx: EdgeIndex) -> &'a E {
206+
pub fn edge_data(&self, idx: EdgeIndex) -> &E {
207207
&self.edges[idx.0].data
208208
}
209209

210-
pub fn edge<'a>(&'a self, idx: EdgeIndex) -> &'a Edge<E> {
210+
pub fn edge(&self, idx: EdgeIndex) -> &Edge<E> {
211211
&self.edges[idx.0]
212212
}
213213

@@ -257,11 +257,11 @@ impl<N:Debug,E:Debug> Graph<N,E> {
257257
AdjacentEdges { graph: self, direction: direction, next: first_edge }
258258
}
259259

260-
pub fn successor_nodes<'a>(&'a self, source: NodeIndex) -> AdjacentTargets<N,E> {
260+
pub fn successor_nodes(&self, source: NodeIndex) -> AdjacentTargets<N,E> {
261261
self.outgoing_edges(source).targets()
262262
}
263263

264-
pub fn predecessor_nodes<'a>(&'a self, target: NodeIndex) -> AdjacentSources<N,E> {
264+
pub fn predecessor_nodes(&self, target: NodeIndex) -> AdjacentSources<N,E> {
265265
self.incoming_edges(target).sources()
266266
}
267267

branches/stable/src/librustc_data_structures/snapshot_vec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,14 @@ impl<D:SnapshotVecDelegate> SnapshotVec<D> {
9191
len
9292
}
9393

94-
pub fn get<'a>(&'a self, index: usize) -> &'a D::Value {
94+
pub fn get(&self, index: usize) -> &D::Value {
9595
&self.values[index]
9696
}
9797

9898
/// Returns a mutable pointer into the vec; whatever changes you make here cannot be undone
9999
/// automatically, so you should be sure call `record()` with some sort of suitable undo
100100
/// action.
101-
pub fn get_mut<'a>(&'a mut self, index: usize) -> &'a mut D::Value {
101+
pub fn get_mut(&mut self, index: usize) -> &mut D::Value {
102102
&mut self.values[index]
103103
}
104104

branches/stable/src/librustc_llvm/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,12 @@ impl AttrBuilder {
261261
}
262262
}
263263

264-
pub fn arg<'a, T: AttrHelper + 'static>(&'a mut self, idx: usize, a: T) -> &'a mut AttrBuilder {
264+
pub fn arg<T: AttrHelper + 'static>(&mut self, idx: usize, a: T) -> &mut AttrBuilder {
265265
self.attrs.push((idx, box a as Box<AttrHelper+'static>));
266266
self
267267
}
268268

269-
pub fn ret<'a, T: AttrHelper + 'static>(&'a mut self, a: T) -> &'a mut AttrBuilder {
269+
pub fn ret<T: AttrHelper + 'static>(&mut self, a: T) -> &mut AttrBuilder {
270270
self.attrs.push((ReturnIndex as usize, box a as Box<AttrHelper+'static>));
271271
self
272272
}

branches/stable/src/librustc_mir/mir_map.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extern crate rustc_front;
2222
use build;
2323
use graphviz;
2424
use pretty;
25-
use transform::simplify_cfg;
25+
use transform::{simplify_cfg, no_landing_pads};
2626
use rustc::dep_graph::DepNode;
2727
use rustc::mir::repr::Mir;
2828
use hair::cx::Cx;
@@ -148,6 +148,7 @@ impl<'a, 'm, 'tcx> Visitor<'tcx> for InnerDump<'a,'m,'tcx> {
148148

149149
match build_mir(Cx::new(&infcx), implicit_arg_tys, id, span, decl, body) {
150150
Ok(mut mir) => {
151+
no_landing_pads::NoLandingPads.run_on_mir(&mut mir, self.tcx);
151152
simplify_cfg::SimplifyCfg::new().run_on_mir(&mut mir, self.tcx);
152153

153154
let meta_item_list = self.attr

branches/stable/src/librustc_mir/transform/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010

1111
pub mod simplify_cfg;
1212
pub mod erase_regions;
13+
pub mod no_landing_pads;
1314
mod util;
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
//! This pass removes the unwind branch of all the terminators when the no-landing-pads option is
12+
//! specified.
13+
14+
use rustc::middle::ty;
15+
use rustc::mir::repr::*;
16+
use rustc::mir::visit::MutVisitor;
17+
use rustc::mir::transform::MirPass;
18+
19+
pub struct NoLandingPads;
20+
21+
impl<'tcx> MutVisitor<'tcx> for NoLandingPads {
22+
fn visit_terminator(&mut self, bb: BasicBlock, terminator: &mut Terminator<'tcx>) {
23+
match *terminator {
24+
Terminator::Goto { .. } |
25+
Terminator::Resume |
26+
Terminator::Return |
27+
Terminator::If { .. } |
28+
Terminator::Switch { .. } |
29+
Terminator::SwitchInt { .. } => {
30+
/* nothing to do */
31+
},
32+
Terminator::Drop { ref mut unwind, .. } => {
33+
unwind.take();
34+
},
35+
Terminator::Call { ref mut cleanup, .. } => {
36+
cleanup.take();
37+
},
38+
}
39+
self.super_terminator(bb, terminator);
40+
}
41+
}
42+
43+
impl MirPass for NoLandingPads {
44+
fn run_on_mir<'tcx>(&mut self, mir: &mut Mir<'tcx>, tcx: &ty::ctxt<'tcx>) {
45+
if tcx.sess.no_landing_pads() {
46+
self.visit_mir(mir);
47+
}
48+
}
49+
}

branches/stable/src/librustc_privacy/diagnostics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ let f = Bar::Foo{ a: 0, b: 0 }; // error: field `b` of struct `Bar::Foo`
205205
// is private
206206
```
207207
208-
To fix this error, please ensure that all the fields of the struct, or
209-
implement a function for easy instantiation. Examples:
208+
To fix this error, please ensure that all the fields of the struct are public,
209+
or implement a function for easy instantiation. Examples:
210210
211211
```
212212
mod Bar {

branches/stable/src/librustc_privacy/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ impl<'a, 'tcx> PrivacyVisitor<'a, 'tcx> {
833833
NamedField(name) => format!("field `{}` of {} is private",
834834
name, struct_desc),
835835
UnnamedField(idx) => format!("field #{} of {} is private",
836-
idx + 1, struct_desc),
836+
idx, struct_desc),
837837
};
838838
span_err!(self.tcx.sess, span, E0451,
839839
"{}", &msg[..]);

branches/stable/src/librustc_resolve/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,7 @@ impl<'a> NameBinding<'a> {
10381038

10391039
fn def_and_lp(&self) -> (Def, LastPrivate) {
10401040
let def = self.def().unwrap();
1041+
if let Def::Err = def { return (def, LastMod(AllPublic)) }
10411042
(def, LastMod(if self.is_public() { AllPublic } else { DependsOn(def.def_id()) }))
10421043
}
10431044

@@ -1289,7 +1290,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
12891290
span: Span,
12901291
lp: LastPrivate)
12911292
-> ResolveResult<(Module<'a>, LastPrivate)> {
1292-
fn search_parent_externals<'a>(needle: Name, module: Module<'a>) -> Option<Module<'a>> {
1293+
fn search_parent_externals(needle: Name, module: Module) -> Option<Module> {
12931294
match module.resolve_name(needle, TypeNS, false) {
12941295
Success(binding) if binding.is_extern_crate() => Some(module),
12951296
_ => match module.parent_link {
@@ -3513,10 +3514,10 @@ fn path_names_to_string(path: &Path, depth: usize) -> String {
35133514
}
35143515

35153516
/// A somewhat inefficient routine to obtain the name of a module.
3516-
fn module_to_string<'a>(module: Module<'a>) -> String {
3517+
fn module_to_string(module: Module) -> String {
35173518
let mut names = Vec::new();
35183519

3519-
fn collect_mod<'a>(names: &mut Vec<ast::Name>, module: Module<'a>) {
3520+
fn collect_mod(names: &mut Vec<ast::Name>, module: Module) {
35203521
match module.parent_link {
35213522
NoParentLink => {}
35223523
ModuleParentLink(ref module, name) => {

branches/stable/src/librustc_resolve/resolve_imports.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
218218
kind: NameBindingKind::Def(Def::Err),
219219
span: None,
220220
});
221+
let dummy_binding =
222+
self.resolver.new_name_binding(e.import_directive.import(dummy_binding));
221223

222224
let _ = e.source_module.try_define_child(target, ValueNS, dummy_binding);
223225
let _ = e.source_module.try_define_child(target, TypeNS, dummy_binding);

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,10 @@ impl<'blk, 'tcx> BlockAndBuilder<'blk, 'tcx> {
767767
{
768768
self.bcx.monomorphize(value)
769769
}
770+
771+
pub fn set_lpad(&self, lpad: Option<LandingPad>) {
772+
self.bcx.lpad.set(lpad.map(|p| &*self.fcx().lpad_arena.alloc(p)))
773+
}
770774
}
771775

772776
impl<'blk, 'tcx> Deref for BlockAndBuilder<'blk, 'tcx> {

0 commit comments

Comments
 (0)