Skip to content

Commit cb9c7b4

Browse files
committed
---
yaml --- r: 234808 b: refs/heads/tmp c: 920f32b h: refs/heads/master v: v3
1 parent 130a21f commit cb9c7b4

File tree

36 files changed

+79
-282
lines changed

36 files changed

+79
-282
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2626
refs/heads/beta: d2e13e822a73e0ea46ae9e21afdd3155fc997f6d
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28-
refs/heads/tmp: 0b089cd2d537e2fbf0ccbd7590af138086558eb5
28+
refs/heads/tmp: 920f32becd5d54864a966900963a376d74d09922
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: ab792abf1fcc28afbd315426213f6428da25c085
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828

branches/tmp/src/compiletest/runtest.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1669,7 +1669,8 @@ fn compile_test_and_save_ir(config: &Config, props: &TestProps,
16691669
// FIXME (#9639): This needs to handle non-utf8 paths
16701670
let mut link_args = vec!("-L".to_owned(),
16711671
aux_dir.to_str().unwrap().to_owned());
1672-
let llvm_args = vec!("--emit=llvm-ir".to_owned(),);
1672+
let llvm_args = vec!("--emit=llvm-ir".to_owned(),
1673+
"--crate-type=lib".to_owned());
16731674
link_args.extend(llvm_args);
16741675
let args = make_compile_args(config,
16751676
props,

branches/tmp/src/liballoc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
#![cfg_attr(stage0, feature(alloc_system))]
101101
#![cfg_attr(not(stage0), feature(needs_allocator))]
102102

103-
#![cfg_attr(test, feature(test, rustc_private, box_heap))]
103+
#![cfg_attr(test, feature(test, rustc_private))]
104104

105105
#[cfg(stage0)]
106106
extern crate alloc_system;

branches/tmp/src/libcollections/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
#![feature(core_intrinsics)]
3939
#![feature(core_slice_ext)]
4040
#![feature(core_str_ext)]
41-
#![feature(fmt_internals)]
42-
#![feature(fmt_radix)]
4341
#![feature(heap_api)]
4442
#![feature(iter_order)]
4543
#![feature(iter_arith)]
@@ -49,8 +47,6 @@
4947
#![feature(oom)]
5048
#![feature(pattern)]
5149
#![feature(ptr_as_ref)]
52-
#![feature(ref_slice)]
53-
#![feature(slice_bytes)]
5450
#![feature(slice_patterns)]
5551
#![feature(staged_api)]
5652
#![feature(step_by)]

branches/tmp/src/libcollections/str.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ use slice::SliceConcatExt;
3838
use boxed::Box;
3939

4040
pub use core::str::{FromStr, Utf8Error};
41-
#[allow(deprecated)]
4241
pub use core::str::{Lines, LinesAny, CharRange};
4342
pub use core::str::{Split, RSplit};
4443
pub use core::str::{SplitN, RSplitN};

branches/tmp/src/librustc/lint/context.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -767,11 +767,6 @@ impl<'a, 'tcx, 'v> hir_visit::Visitor<'v> for LateContext<'a, 'tcx> {
767767
hir_visit::walk_path(self, p);
768768
}
769769

770-
fn visit_path_list_item(&mut self, prefix: &hir::Path, item: &hir::PathListItem) {
771-
run_lints!(self, check_path_list_item, late_passes, item);
772-
hir_visit::walk_path_list_item(self, prefix, item);
773-
}
774-
775770
fn visit_attribute(&mut self, attr: &ast::Attribute) {
776771
run_lints!(self, check_attribute, late_passes, attr);
777772
}
@@ -920,11 +915,6 @@ impl<'a, 'v> ast_visit::Visitor<'v> for EarlyContext<'a> {
920915
ast_visit::walk_path(self, p);
921916
}
922917

923-
fn visit_path_list_item(&mut self, prefix: &ast::Path, item: &ast::PathListItem) {
924-
run_lints!(self, check_path_list_item, early_passes, item);
925-
ast_visit::walk_path_list_item(self, prefix, item);
926-
}
927-
928918
fn visit_attribute(&mut self, attr: &ast::Attribute) {
929919
run_lints!(self, check_attribute, early_passes, attr);
930920
}

branches/tmp/src/librustc/lint/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ pub trait LateLintPass: LintPass {
161161
fn check_lifetime_def(&mut self, _: &LateContext, _: &hir::LifetimeDef) { }
162162
fn check_explicit_self(&mut self, _: &LateContext, _: &hir::ExplicitSelf) { }
163163
fn check_path(&mut self, _: &LateContext, _: &hir::Path, _: ast::NodeId) { }
164-
fn check_path_list_item(&mut self, _: &LateContext, _: &hir::PathListItem) { }
165164
fn check_attribute(&mut self, _: &LateContext, _: &ast::Attribute) { }
166165

167166
/// Called when entering a syntax node that can have lint attributes such
@@ -207,7 +206,6 @@ pub trait EarlyLintPass: LintPass {
207206
fn check_lifetime_def(&mut self, _: &EarlyContext, _: &ast::LifetimeDef) { }
208207
fn check_explicit_self(&mut self, _: &EarlyContext, _: &ast::ExplicitSelf) { }
209208
fn check_path(&mut self, _: &EarlyContext, _: &ast::Path, _: ast::NodeId) { }
210-
fn check_path_list_item(&mut self, _: &EarlyContext, _: &ast::PathListItem) { }
211209
fn check_attribute(&mut self, _: &EarlyContext, _: &ast::Attribute) { }
212210

213211
/// Called when entering a syntax node that can have lint attributes such

branches/tmp/src/librustc/middle/dead.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,6 @@ impl<'a, 'tcx, 'v> Visitor<'v> for MarkSymbolVisitor<'a, 'tcx> {
279279
visit::walk_path(self, path);
280280
}
281281

282-
fn visit_path_list_item(&mut self, path: &hir::Path, item: &hir::PathListItem) {
283-
self.lookup_and_handle_definition(&item.node.id());
284-
visit::walk_path_list_item(self, path, item);
285-
}
286-
287282
fn visit_item(&mut self, _: &hir::Item) {
288283
// Do not recurse into items. These items will be added to the
289284
// worklist and recursed into manually if necessary.

branches/tmp/src/librustc/middle/stability.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -355,12 +355,6 @@ impl<'a, 'v, 'tcx> Visitor<'v> for Checker<'a, 'tcx> {
355355
visit::walk_path(self, path)
356356
}
357357

358-
fn visit_path_list_item(&mut self, prefix: &hir::Path, item: &hir::PathListItem) {
359-
check_path_list_item(self.tcx, item,
360-
&mut |id, sp, stab| self.check(id, sp, stab));
361-
visit::walk_path_list_item(self, prefix, item)
362-
}
363-
364358
fn visit_pat(&mut self, pat: &hir::Pat) {
365359
check_pat(self.tcx, pat,
366360
&mut |id, sp, stab| self.check(id, sp, stab));
@@ -476,17 +470,7 @@ pub fn check_path(tcx: &ty::ctxt, path: &hir::Path, id: ast::NodeId,
476470
}
477471
None => {}
478472
}
479-
}
480473

481-
pub fn check_path_list_item(tcx: &ty::ctxt, item: &hir::PathListItem,
482-
cb: &mut FnMut(DefId, Span, &Option<&Stability>)) {
483-
match tcx.def_map.borrow().get(&item.node.id()).map(|d| d.full_def()) {
484-
Some(def::DefPrimTy(..)) => {}
485-
Some(def) => {
486-
maybe_do_stability_check(tcx, def.def_id(), item.span, cb);
487-
}
488-
None => {}
489-
}
490474
}
491475

492476
pub fn check_pat(tcx: &ty::ctxt, pat: &hir::Pat,

branches/tmp/src/librustc_back/svh.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,6 @@ mod svh_visitor {
423423
SawPath.hash(self.st); visit::walk_path(self, path)
424424
}
425425

426-
fn visit_path_list_item(&mut self, prefix: &Path, item: &'v PathListItem) {
427-
SawPath.hash(self.st); visit::walk_path_list_item(self, prefix, item)
428-
}
429-
430426
fn visit_block(&mut self, b: &Block) {
431427
SawBlock.hash(self.st); visit::walk_block(self, b)
432428
}

branches/tmp/src/librustc_back/target/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ pub struct TargetOptions {
157157
/// Whether to disable linking to compiler-rt. Defaults to false, as LLVM
158158
/// will emit references to the functions that compiler-rt provides.
159159
pub no_compiler_rt: bool,
160+
/// Whether to disable linking to the default libraries, typically corresponds
161+
/// to `-nodefaultlibs`. Defaults to true.
162+
pub no_default_libraries: bool,
160163
/// Dynamically linked executables can be compiled as position independent
161164
/// if the default relocation model of position independent code is not
162165
/// changed. This is a requirement to take advantage of ASLR, as otherwise
@@ -212,6 +215,7 @@ impl Default for TargetOptions {
212215
linker_is_gnu: false,
213216
has_rpath: false,
214217
no_compiler_rt: false,
218+
no_default_libraries: true,
215219
position_independent_executables: false,
216220
pre_link_objects: Vec::new(),
217221
post_link_objects: Vec::new(),
@@ -319,6 +323,7 @@ impl Target {
319323
key!(linker_is_gnu, bool);
320324
key!(has_rpath, bool);
321325
key!(no_compiler_rt, bool);
326+
key!(no_default_libraries, bool);
322327
key!(pre_link_args, list);
323328
key!(post_link_args, list);
324329
key!(allow_asm, bool);

branches/tmp/src/librustc_back/target/windows_base.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ pub fn opts() -> TargetOptions {
2323
exe_suffix: ".exe".to_string(),
2424
staticlib_prefix: "".to_string(),
2525
staticlib_suffix: ".lib".to_string(),
26+
// Unfortunately right now passing -nodefaultlibs to gcc on windows
27+
// doesn't work so hot (in terms of native dependencies). This flag
28+
// should hopefully be removed one day though!
29+
no_default_libraries: false,
2630
is_like_windows: true,
2731
archive_format: "gnu".to_string(),
2832
pre_link_args: vec!(

branches/tmp/src/librustc_front/visit.rs

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,6 @@ pub trait Visitor<'v> : Sized {
121121
fn visit_path(&mut self, path: &'v Path, _id: NodeId) {
122122
walk_path(self, path)
123123
}
124-
fn visit_path_list_item(&mut self, prefix: &'v Path, item: &'v PathListItem) {
125-
walk_path_list_item(self, prefix, item)
126-
}
127124
fn visit_path_segment(&mut self, path_span: Span, path_segment: &'v PathSegment) {
128125
walk_path_segment(self, path_span, path_segment)
129126
}
@@ -206,20 +203,26 @@ pub fn walk_item<'v, V: Visitor<'v>>(visitor: &mut V, item: &'v Item) {
206203
ItemExternCrate(..) => {}
207204
ItemUse(ref vp) => {
208205
match vp.node {
209-
ViewPathSimple(_ident, ref path) => {
206+
ViewPathSimple(ident, ref path) => {
207+
visitor.visit_ident(vp.span, ident);
210208
visitor.visit_path(path, item.id);
211209
}
212210
ViewPathGlob(ref path) => {
213211
visitor.visit_path(path, item.id);
214212
}
215213
ViewPathList(ref prefix, ref list) => {
216-
if !list.is_empty() {
217-
for item in list {
218-
visitor.visit_path_list_item(prefix, item)
214+
for id in list {
215+
match id.node {
216+
PathListIdent { name, .. } => {
217+
visitor.visit_ident(id.span, name);
218+
}
219+
PathListMod { .. } => ()
219220
}
220-
} else {
221-
visitor.visit_path(prefix, item.id);
222221
}
222+
223+
// Note that the `prefix` here is not a complete
224+
// path, so we don't use `visit_path`.
225+
walk_path(visitor, prefix);
223226
}
224227
}
225228
}
@@ -397,17 +400,6 @@ pub fn walk_path<'v, V: Visitor<'v>>(visitor: &mut V, path: &'v Path) {
397400
}
398401
}
399402

400-
pub fn walk_path_list_item<'v, V: Visitor<'v>>(visitor: &mut V, prefix: &'v Path,
401-
item: &'v PathListItem) {
402-
for segment in &prefix.segments {
403-
visitor.visit_path_segment(prefix.span, segment);
404-
}
405-
406-
if let PathListIdent { name, .. } = item.node {
407-
visitor.visit_ident(item.span, name);
408-
}
409-
}
410-
411403
pub fn walk_path_segment<'v, V: Visitor<'v>>(visitor: &mut V,
412404
path_span: Span,
413405
segment: &'v PathSegment) {

branches/tmp/src/librustc_lint/builtin.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,13 +1386,6 @@ impl LateLintPass for Stability {
13861386
&stab.map(|s| hir_to_ast_stability(s)).as_ref()));
13871387
}
13881388

1389-
fn check_path_list_item(&mut self, cx: &LateContext, item: &hir::PathListItem) {
1390-
stability::check_path_list_item(cx.tcx, item,
1391-
&mut |id, sp, stab|
1392-
self.lint(cx, id, sp,
1393-
&stab.map(|s| hir_to_ast_stability(s)).as_ref()));
1394-
}
1395-
13961389
fn check_pat(&mut self, cx: &LateContext, pat: &hir::Pat) {
13971390
stability::check_pat(cx.tcx, pat,
13981391
&mut |id, sp, stab|

branches/tmp/src/librustc_privacy/lib.rs

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,23 @@ impl<'a, 'tcx> PrivacyVisitor<'a, 'tcx> {
859859

860860
impl<'a, 'tcx, 'v> Visitor<'v> for PrivacyVisitor<'a, 'tcx> {
861861
fn visit_item(&mut self, item: &hir::Item) {
862+
if let hir::ItemUse(ref vpath) = item.node {
863+
if let hir::ViewPathList(ref prefix, ref list) = vpath.node {
864+
for pid in list {
865+
match pid.node {
866+
hir::PathListIdent { id, name, .. } => {
867+
debug!("privacy - ident item {}", id);
868+
self.check_path(pid.span, id, name.name);
869+
}
870+
hir::PathListMod { id, .. } => {
871+
debug!("privacy - mod item {}", id);
872+
let name = prefix.segments.last().unwrap().identifier.name;
873+
self.check_path(pid.span, id, name);
874+
}
875+
}
876+
}
877+
}
878+
}
862879
let orig_curitem = replace(&mut self.curitem, item.id);
863880
visit::walk_item(self, item);
864881
self.curitem = orig_curitem;
@@ -980,22 +997,8 @@ impl<'a, 'tcx, 'v> Visitor<'v> for PrivacyVisitor<'a, 'tcx> {
980997
}
981998

982999
fn visit_path(&mut self, path: &hir::Path, id: ast::NodeId) {
983-
if !path.segments.is_empty() {
984-
self.check_path(path.span, id, path.segments.last().unwrap().identifier.name);
985-
visit::walk_path(self, path);
986-
}
987-
}
988-
989-
fn visit_path_list_item(&mut self, prefix: &hir::Path, item: &hir::PathListItem) {
990-
let name = if let hir::PathListIdent { name, .. } = item.node {
991-
name.name
992-
} else if !prefix.segments.is_empty() {
993-
prefix.segments.last().unwrap().identifier.name
994-
} else {
995-
self.tcx.sess.bug("`self` import in an import list with empty prefix");
996-
};
997-
self.check_path(item.span, item.node.id(), name);
998-
visit::walk_path_list_item(self, prefix, item);
1000+
self.check_path(path.span, id, path.segments.last().unwrap().identifier.name);
1001+
visit::walk_path(self, path);
9991002
}
10001003
}
10011004

branches/tmp/src/librustc_resolve/lib.rs

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2210,39 +2210,23 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
22102210

22112211
ItemUse(ref view_path) => {
22122212
// check for imports shadowing primitive types
2213-
let check_rename = |this: &Self, id, ident: Ident| {
2214-
match this.def_map.borrow().get(&id).map(|d| d.full_def()) {
2213+
let check_rename = |id, ident: Ident| {
2214+
match self.def_map.borrow().get(&id).map(|d| d.full_def()) {
22152215
Some(DefTy(..)) | Some(DefStruct(..)) | Some(DefTrait(..)) | None => {
2216-
this.check_if_primitive_type_name(ident.name, item.span);
2216+
self.check_if_primitive_type_name(ident.name, item.span);
22172217
}
22182218
_ => {}
22192219
}
22202220
};
22212221

22222222
match view_path.node {
22232223
hir::ViewPathSimple(ident, _) => {
2224-
check_rename(self, item.id, ident);
2224+
check_rename(item.id, ident);
22252225
}
2226-
hir::ViewPathList(ref prefix, ref items) => {
2226+
hir::ViewPathList(_, ref items) => {
22272227
for item in items {
22282228
if let Some(ident) = item.node.rename() {
2229-
check_rename(self, item.node.id(), ident);
2230-
}
2231-
}
2232-
2233-
// Resolve prefix of an import with empty braces (issue #28388)
2234-
if items.is_empty() && !prefix.segments.is_empty() {
2235-
match self.resolve_crate_relative_path(prefix.span,
2236-
&prefix.segments,
2237-
TypeNS) {
2238-
Some((def, lp)) => self.record_def(item.id,
2239-
PathResolution::new(def, lp, 0)),
2240-
None => {
2241-
resolve_error(self,
2242-
prefix.span,
2243-
ResolutionError::FailedToResolve(
2244-
&path_names_to_string(prefix, 0)));
2245-
}
2229+
check_rename(item.node.id(), ident);
22462230
}
22472231
}
22482232
}

branches/tmp/src/librustc_trans/back/link.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,9 @@ fn link_args(cmd: &mut Linker,
970970
// default. Note that this does not happen for windows because windows pulls
971971
// in some large number of libraries and I couldn't quite figure out which
972972
// subset we wanted.
973-
cmd.no_default_libraries();
973+
if t.options.no_default_libraries {
974+
cmd.no_default_libraries();
975+
}
974976

975977
// Take careful note of the ordering of the arguments we pass to the linker
976978
// here. Linkers will assume that things on the left depend on things to the

branches/tmp/src/librustc_trans/back/linker.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,7 @@ impl<'a> Linker for GnuLinker<'a> {
159159
}
160160

161161
fn no_default_libraries(&mut self) {
162-
// Unfortunately right now passing -nodefaultlibs to gcc on windows
163-
// doesn't work so hot (in terms of native dependencies). This if
164-
// statement should hopefully be removed one day though!
165-
if !self.sess.target.target.options.is_like_windows {
166-
self.cmd.arg("-nodefaultlibs");
167-
}
162+
self.cmd.arg("-nodefaultlibs");
168163
}
169164

170165
fn build_dylib(&mut self, out_filename: &Path) {

0 commit comments

Comments
 (0)