Skip to content

Commit f12d3d7

Browse files
committed
---
yaml --- r: 234701 b: refs/heads/tmp c: 913fe6d h: refs/heads/master i: 234699: f14ac6d v: v3
1 parent a3556ad commit f12d3d7

Some content is hidden

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

45 files changed

+239
-327
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: b3afb16d246c6aa080cf52a85003e19da79b828e
28+
refs/heads/tmp: 913fe6dbe9425330027b7d75ba16be47d7280d66
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/RELEASES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Version 1.3.0 (2015-09-17)
1+
Version 1.3.0 (September 2015)
22
==============================
33

44
* ~900 changes, numerous bugfixes

branches/tmp/configure

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,6 +1095,12 @@ envopt CPP
10951095
envopt CFLAGS
10961096
envopt CXXFLAGS
10971097

1098+
# stdc++ name in use
1099+
# used to manage non-standard name (on OpenBSD for example)
1100+
program_transform_name=$($CFG_CC -v 2>&1 | sed -n "s/.*--program-transform-name='\([^']*\)'.*/\1/p")
1101+
CFG_STDCPP_NAME=$(echo "stdc++" | sed "${program_transform_name}")
1102+
putvar CFG_STDCPP_NAME
1103+
10981104
# a little post-processing of various config values
10991105
CFG_PREFIX=${CFG_PREFIX%/}
11001106
CFG_MANDIR=${CFG_MANDIR%/}

branches/tmp/mk/llvm.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ $$(LLVM_STAMP_$(1)): $(S)src/rustllvm/llvm-auto-clean-trigger
7373

7474
ifeq ($$(CFG_ENABLE_LLVM_STATIC_STDCPP),1)
7575
LLVM_STDCPP_RUSTFLAGS_$(1) = -L "$$(dir $$(shell $$(CC_$(1)) $$(CFG_GCCISH_CFLAGS_$(1)) \
76-
-print-file-name=libstdc++.a))"
76+
-print-file-name=lib$(CFG_STDCPP_NAME).a))"
7777
else
7878
LLVM_STDCPP_RUSTFLAGS_$(1) =
7979
endif
@@ -83,7 +83,7 @@ endif
8383
LLVM_LINKAGE_PATH_$(1):=$$(abspath $$(RT_OUTPUT_DIR_$(1))/llvmdeps.rs)
8484
$$(LLVM_LINKAGE_PATH_$(1)): $(S)src/etc/mklldeps.py $$(LLVM_CONFIG_$(1))
8585
$(Q)$(CFG_PYTHON) "$$<" "$$@" "$$(LLVM_COMPONENTS)" "$$(CFG_ENABLE_LLVM_STATIC_STDCPP)" \
86-
$$(LLVM_CONFIG_$(1))
86+
$$(LLVM_CONFIG_$(1)) "$(CFG_STDCPP_NAME)"
8787
endef
8888

8989
$(foreach host,$(CFG_HOST), \

branches/tmp/src/doc/reference.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,22 +1178,11 @@ let px: i32 = match p { Point(x, _) => x };
11781178
```
11791179

11801180
A _unit-like struct_ is a structure without any fields, defined by leaving off
1181-
the list of fields entirely. Such a structure implicitly defines a constant of
1182-
its type with the same name. For example:
1181+
the list of fields entirely. Such types will have a single value. For example:
11831182

11841183
```
1185-
# #![feature(braced_empty_structs)]
11861184
struct Cookie;
1187-
let c = [Cookie, Cookie {}, Cookie, Cookie {}];
1188-
```
1189-
1190-
is equivalent to
1191-
1192-
```
1193-
# #![feature(braced_empty_structs)]
1194-
struct Cookie {}
1195-
const Cookie: Cookie = Cookie {};
1196-
let c = [Cookie, Cookie {}, Cookie, Cookie {}];
1185+
let c = [Cookie, Cookie, Cookie, Cookie];
11971186
```
11981187

11991188
The precise memory layout of a structure is not specified. One can specify a
@@ -2422,7 +2411,6 @@ The currently implemented features of the reference compiler are:
24222411
terms of encapsulation).
24232412
* - `default_type_parameter_fallback` - Allows type parameter defaults to
24242413
influence type inference.
2425-
* - `braced_empty_structs` - Allows use of empty structs with braces.
24262414

24272415
If a feature is promoted to a language feature, then all existing programs will
24282416
start to receive compilation warnings about `#![feature]` directives which enabled

branches/tmp/src/doc/trpl/error-handling.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ thread '<main>' panicked at 'Invalid number: 11', src/bin/panic-simple.rs:5
8787
Here's another example that is slightly less contrived. A program that accepts
8888
an integer as an argument, doubles it and prints it.
8989

90-
<div id="code-unwrap-double">
90+
<a name="code-unwrap-double"/>
9191
```rust,should_panic
9292
9393
use std::env;
@@ -99,7 +99,6 @@ fn main() {
9999
println!("{}", 2 * n);
100100
}
101101
```
102-
</div>
103102

104103
If you give this program zero arguments (error 1) or if the first argument
105104
isn't an integer (error 2), the program will panic just like in the first
@@ -140,7 +139,7 @@ system is an important concept because it will cause the compiler to force the
140139
programmer to handle that absence. Let's take a look at an example that tries
141140
to find a character in a string:
142141

143-
<div id="code-option-ex-string-find">
142+
<a name="code-option-ex-string-find"/>
144143
```rust
145144
// Searches `haystack` for the Unicode character `needle`. If one is found, the
146145
// byte offset of the character is returned. Otherwise, `None` is returned.
@@ -153,7 +152,6 @@ fn find(haystack: &str, needle: char) -> Option<usize> {
153152
None
154153
}
155154
```
156-
</div>
157155

158156
Notice that when this function finds a matching character, it doen't just
159157
return the `offset`. Instead, it returns `Some(offset)`. `Some` is a variant or

branches/tmp/src/etc/mklldeps.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
components = sys.argv[2].split() # splits on whitespace
1818
enable_static = sys.argv[3]
1919
llvm_config = sys.argv[4]
20+
stdcpp_name = sys.argv[5]
2021

2122
f.write("""// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2223
// file at the top-level directory of this distribution and at
@@ -77,15 +78,15 @@ def run(args):
7778
out = run([llvm_config, '--cxxflags'])
7879
if enable_static == '1':
7980
assert('stdlib=libc++' not in out)
80-
f.write("#[link(name = \"stdc++\", kind = \"static\")]\n")
81+
f.write("#[link(name = \"" + stdcpp_name + "\", kind = \"static\")]\n")
8182
else:
8283
# Note that we use `cfg_attr` here because on MSVC the C++ standard library
8384
# is not c++ or stdc++, but rather the linker takes care of linking the
8485
# right standard library.
8586
if 'stdlib=libc++' in out:
8687
f.write("#[cfg_attr(not(target_env = \"msvc\"), link(name = \"c++\"))]\n")
8788
else:
88-
f.write("#[cfg_attr(not(target_env = \"msvc\"), link(name = \"stdc++\"))]\n")
89+
f.write("#[cfg_attr(not(target_env = \"msvc\"), link(name = \"" + stdcpp_name + "\"))]\n")
8990

9091
# Attach everything to an extern block
9192
f.write("extern {}\n")

branches/tmp/src/librustc_front/fold.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ pub fn noop_fold_foreign_mod<T: Folder>(ForeignMod {abi, items}: ForeignMod,
415415
}
416416

417417
pub fn noop_fold_variant<T: Folder>(v: P<Variant>, fld: &mut T) -> P<Variant> {
418-
v.map(|Spanned {node: Variant_ {id, name, attrs, kind, disr_expr}, span}| Spanned {
418+
v.map(|Spanned {node: Variant_ {id, name, attrs, kind, disr_expr, vis}, span}| Spanned {
419419
node: Variant_ {
420420
id: fld.new_id(id),
421421
name: name,
@@ -430,6 +430,7 @@ pub fn noop_fold_variant<T: Folder>(v: P<Variant>, fld: &mut T) -> P<Variant> {
430430
}
431431
},
432432
disr_expr: disr_expr.map(|e| fld.fold_expr(e)),
433+
vis: vis,
433434
},
434435
span: fld.new_span(span),
435436
})

branches/tmp/src/librustc_front/hir.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,7 @@ pub struct Variant_ {
10521052
pub id: NodeId,
10531053
/// Explicit discriminant, eg `Foo = 1`
10541054
pub disr_expr: Option<P<Expr>>,
1055+
pub vis: Visibility,
10551056
}
10561057

10571058
pub type Variant = Spanned<Variant_>;

branches/tmp/src/librustc_front/lowering.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ pub fn lower_variant(v: &Variant) -> P<hir::Variant> {
147147
}
148148
},
149149
disr_expr: v.node.disr_expr.as_ref().map(|e| lower_expr(e)),
150+
vis: lower_visibility(v.node.vis),
150151
},
151152
span: v.span,
152153
})

branches/tmp/src/librustc_front/print/pprust.rs

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,7 @@ impl<'a> State<'a> {
944944
}
945945

946946
pub fn print_variant(&mut self, v: &hir::Variant) -> io::Result<()> {
947+
try!(self.print_visibility(v.node.vis));
947948
match v.node.kind {
948949
hir::TupleVariantKind(ref args) => {
949950
try!(self.print_ident(v.node.name));
@@ -1217,34 +1218,34 @@ impl<'a> State<'a> {
12171218
fields: &[hir::Field],
12181219
wth: &Option<P<hir::Expr>>) -> io::Result<()> {
12191220
try!(self.print_path(path, true, 0));
1220-
try!(word(&mut self.s, "{"));
1221-
try!(self.commasep_cmnt(
1222-
Consistent,
1223-
&fields[..],
1224-
|s, field| {
1225-
try!(s.ibox(indent_unit));
1226-
try!(s.print_ident(field.ident.node));
1227-
try!(s.word_space(":"));
1228-
try!(s.print_expr(&*field.expr));
1229-
s.end()
1230-
},
1231-
|f| f.span));
1232-
match *wth {
1233-
Some(ref expr) => {
1234-
try!(self.ibox(indent_unit));
1235-
if !fields.is_empty() {
1236-
try!(word(&mut self.s, ","));
1237-
try!(space(&mut self.s));
1221+
if !(fields.is_empty() && wth.is_none()) {
1222+
try!(word(&mut self.s, "{"));
1223+
try!(self.commasep_cmnt(
1224+
Consistent,
1225+
&fields[..],
1226+
|s, field| {
1227+
try!(s.ibox(indent_unit));
1228+
try!(s.print_ident(field.ident.node));
1229+
try!(s.word_space(":"));
1230+
try!(s.print_expr(&*field.expr));
1231+
s.end()
1232+
},
1233+
|f| f.span));
1234+
match *wth {
1235+
Some(ref expr) => {
1236+
try!(self.ibox(indent_unit));
1237+
if !fields.is_empty() {
1238+
try!(word(&mut self.s, ","));
1239+
try!(space(&mut self.s));
1240+
}
1241+
try!(word(&mut self.s, ".."));
1242+
try!(self.print_expr(&**expr));
1243+
try!(self.end());
12381244
}
1239-
try!(word(&mut self.s, ".."));
1240-
try!(self.print_expr(&**expr));
1241-
try!(self.end());
1242-
}
1243-
_ => if !fields.is_empty() {
1244-
try!(word(&mut self.s, ","))
1245+
_ => try!(word(&mut self.s, ",")),
12451246
}
1247+
try!(word(&mut self.s, "}"));
12461248
}
1247-
try!(word(&mut self.s, "}"));
12481249
Ok(())
12491250
}
12501251

branches/tmp/src/librustc_lint/builtin.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ use std::{i8, i16, i32, i64, u8, u16, u32, u64, f32, f64};
4949
use syntax::{abi, ast};
5050
use syntax::attr::{self, AttrMetaMethods};
5151
use syntax::codemap::{self, Span};
52-
use syntax::feature_gate::{KNOWN_ATTRIBUTES, AttributeType, emit_feature_err, GateIssue};
52+
use syntax::feature_gate::{KNOWN_ATTRIBUTES, AttributeType};
5353
use syntax::ast::{TyIs, TyUs, TyI8, TyU8, TyI16, TyU16, TyI32, TyU32, TyI64, TyU64};
5454
use syntax::ptr::P;
5555

@@ -381,12 +381,13 @@ impl LateLintPass for TypeLimits {
381381

382382
fn check_unsigned_negation_feature(cx: &LateContext, span: Span) {
383383
if !cx.sess().features.borrow().negate_unsigned {
384-
emit_feature_err(
385-
&cx.sess().parse_sess.span_diagnostic,
386-
"negate_unsigned",
387-
span,
388-
GateIssue::Language,
389-
"unary negation of unsigned integers may be removed in the future");
384+
// FIXME(#27141): change this to syntax::feature_gate::emit_feature_err…
385+
cx.sess().span_warn(span,
386+
"unary negation of unsigned integers will be feature gated in the future");
387+
// …and remove following two expressions.
388+
if option_env!("CFG_DISABLE_UNSTABLE_FEATURES").is_some() { return; }
389+
cx.sess().fileline_help(span, "add #![feature(negate_unsigned)] to the \
390+
crate attributes to enable the gate in advance");
390391
}
391392
}
392393
}

branches/tmp/src/librustc_privacy/lib.rs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,20 @@ impl<'a, 'tcx> SanePrivacyVisitor<'a, 'tcx> {
10751075
instead");
10761076
}
10771077

1078-
hir::ItemEnum(..) |
1078+
hir::ItemEnum(ref def, _) => {
1079+
for v in &def.variants {
1080+
match v.node.vis {
1081+
hir::Public => {
1082+
if item.vis == hir::Public {
1083+
span_err!(tcx.sess, v.span, E0448,
1084+
"unnecessary `pub` visibility");
1085+
}
1086+
}
1087+
hir::Inherited => {}
1088+
}
1089+
}
1090+
}
1091+
10791092
hir::ItemTrait(..) | hir::ItemDefaultImpl(..) |
10801093
hir::ItemConst(..) | hir::ItemStatic(..) | hir::ItemStruct(..) |
10811094
hir::ItemFn(..) | hir::ItemMod(..) | hir::ItemTy(..) |
@@ -1118,10 +1131,14 @@ impl<'a, 'tcx> SanePrivacyVisitor<'a, 'tcx> {
11181131
check_inherited(tcx, i.span, i.vis);
11191132
}
11201133
}
1134+
hir::ItemEnum(ref def, _) => {
1135+
for v in &def.variants {
1136+
check_inherited(tcx, v.span, v.node.vis);
1137+
}
1138+
}
11211139

11221140
hir::ItemStruct(ref def, _) => check_struct(&**def),
11231141

1124-
hir::ItemEnum(..) |
11251142
hir::ItemExternCrate(_) | hir::ItemUse(_) |
11261143
hir::ItemTrait(..) | hir::ItemDefaultImpl(..) |
11271144
hir::ItemStatic(..) | hir::ItemConst(..) |

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ impl<'l, 'tcx, 'v> Visitor<'v> for DumpCsvVisitor<'l, 'tcx> {
10971097

10981098
self.visit_expr(&**sub_ex);
10991099

1100-
let hir_node = lower_expr(sub_ex);
1100+
let hir_node = self.tcx.map.expect_expr(sub_ex.id);
11011101
let ty = &self.tcx.expr_ty_adjusted(&hir_node).sty;
11021102
match *ty {
11031103
ty::TyStruct(def, _) => {

branches/tmp/src/librustc_trans/save/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use std::path::{Path, PathBuf};
1818

1919
use rustc_front;
2020
use rustc::front::map::NodeItem;
21-
use rustc_front::{hir, lowering};
21+
use rustc_front::hir;
2222

2323
use syntax::attr;
2424
use syntax::ast::{self, NodeId};
@@ -442,7 +442,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
442442
pub fn get_expr_data(&self, expr: &ast::Expr) -> Option<Data> {
443443
match expr.node {
444444
ast::ExprField(ref sub_ex, ident) => {
445-
let hir_node = lowering::lower_expr(sub_ex);
445+
let hir_node = self.tcx.map.expect_expr(sub_ex.id);
446446
let ty = &self.tcx.expr_ty_adjusted(&hir_node).sty;
447447
match *ty {
448448
ty::TyStruct(def, _) => {
@@ -462,8 +462,8 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
462462
}
463463
}
464464
ast::ExprStruct(ref path, _, _) => {
465-
let hir_node = lowering::lower_expr(expr);
466-
let ty = &self.tcx.expr_ty_adjusted(&hir_node).sty;
465+
let hir_node = self.tcx.map.expect_expr(expr.id);
466+
let ty = &self.tcx.expr_ty_adjusted(hir_node).sty;
467467
match *ty {
468468
ty::TyStruct(def, _) => {
469469
let sub_span = self.span_utils.span_for_last_ident(path.span);

branches/tmp/src/librustc_trans/trans/expr.rs

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ pub fn trans_into<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
119119

120120
debuginfo::set_source_location(bcx.fcx, expr.id, expr.span);
121121

122-
if adjustment_required(bcx, expr) {
122+
if bcx.tcx().tables.borrow().adjustments.contains_key(&expr.id) {
123123
// use trans, which may be less efficient but
124124
// which will perform the adjustments:
125125
let datum = unpack_datum!(bcx, trans(bcx, expr));
@@ -334,37 +334,6 @@ pub fn unsized_info<'ccx, 'tcx>(ccx: &CrateContext<'ccx, 'tcx>,
334334
}
335335
}
336336

337-
fn adjustment_required<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
338-
expr: &hir::Expr) -> bool {
339-
let adjustment = match bcx.tcx().tables.borrow().adjustments.get(&expr.id).cloned() {
340-
None => { return false; }
341-
Some(adj) => adj
342-
};
343-
344-
// Don't skip a conversion from Box<T> to &T, etc.
345-
if bcx.tcx().is_overloaded_autoderef(expr.id, 0) {
346-
return true;
347-
}
348-
349-
match adjustment {
350-
AdjustReifyFnPointer => {
351-
// FIXME(#19925) once fn item types are
352-
// zero-sized, we'll need to return true here
353-
false
354-
}
355-
AdjustUnsafeFnPointer => {
356-
// purely a type-level thing
357-
false
358-
}
359-
AdjustDerefRef(ref adj) => {
360-
// We are a bit paranoid about adjustments and thus might have a re-
361-
// borrow here which merely derefs and then refs again (it might have
362-
// a different region or mutability, but we don't care here).
363-
!(adj.autoderefs == 1 && adj.autoref.is_some() && adj.unsize.is_none())
364-
}
365-
}
366-
}
367-
368337
/// Helper for trans that apply adjustments from `expr` to `datum`, which should be the unadjusted
369338
/// translation of `expr`.
370339
fn apply_adjustments<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,

0 commit comments

Comments
 (0)