Skip to content

Commit 266d540

Browse files
committed
---
yaml --- r: 214250 b: refs/heads/auto c: ffe0b66 h: refs/heads/master v: v3
1 parent 556acfc commit 266d540

Some content is hidden

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

60 files changed

+1195
-451
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: cb260e5e9b43922d74cef1ed784f24a5f38d8633
11+
refs/heads/auto: ffe0b6657f8d9c140d16a099930873bce8c3e21c
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# The Rust Programming Language
22

3-
Rust is a systems programming language that is fast, memory safe and
4-
multithreaded, but does not employ a garbage collector or otherwise
5-
impose significant runtime overhead.
3+
Rust is a fast systems programming language that guarantees
4+
memory safety and offers painless concurrency ([no data races]).
5+
It does not employ a garbage collector and has minimal runtime overhead.
66

77
This repo contains the code for `rustc`, the Rust compiler, as well
88
as standard libraries, tools and documentation for Rust.
99

10+
[no data races]: http://blog.rust-lang.org/2015/04/10/Fearless-Concurrency.html
11+
1012
## Quick Start
1113

1214
Read ["Installing Rust"] from [The Book].

branches/auto/mk/docs.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ ERR_IDX_GEN = $(RPATH_VAR2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $(ERR_IDX_GEN_EXE)
7777

7878
D := $(S)src/doc
7979

80-
# FIXME (#25705) eventually may want to put error-index target back here.
81-
DOC_TARGETS := trpl style
80+
DOC_TARGETS := trpl style error-index
8281
COMPILER_DOC_TARGETS :=
8382
DOC_L10N_TARGETS :=
8483

branches/auto/mk/reconfig.mk

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ endif
3232

3333
Makefile config.mk: config.stamp
3434

35+
ifeq ($(SREL),)
36+
SREL_ROOT := ./
37+
else
38+
SREL_ROOT := $(SREL)
39+
endif
40+
3541
config.stamp: $(S)configure $(S)Makefile.in $(S)src/snapshots.txt
3642
@$(call E, cfg: reconfiguring)
37-
$(SREL)configure $(CFG_CONFIGURE_ARGS)
43+
$(SREL_ROOT)configure $(CFG_CONFIGURE_ARGS)

branches/auto/src/error-index-generator/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ extern crate serialize as rustc_serialize;
1717
use std::collections::BTreeMap;
1818
use std::fs::{read_dir, File};
1919
use std::io::{Read, Write};
20+
use std::env;
2021
use std::path::Path;
2122
use std::error::Error;
2223

@@ -106,7 +107,8 @@ r##"<!DOCTYPE html>
106107
}
107108

108109
fn main_with_result() -> Result<(), Box<Error>> {
109-
let metadata_dir = get_metadata_dir();
110+
let build_arch = try!(env::var("CFG_BUILD"));
111+
let metadata_dir = get_metadata_dir(&build_arch);
110112
let err_map = try!(load_all_errors(&metadata_dir));
111113
try!(render_error_page(&err_map, Path::new("doc/error-index.html")));
112114
Ok(())

branches/auto/src/libcore/ptr.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,11 @@ impl<T: ?Sized> PartialOrd for *mut T {
512512
#[unstable(feature = "unique", reason = "needs an RFC to flesh out design")]
513513
pub struct Unique<T: ?Sized> {
514514
pointer: NonZero<*const T>,
515+
// NOTE: this marker has no consequences for variance, but is necessary
516+
// for dropck to understand that we logically own a `T`.
517+
//
518+
// For details, see:
519+
// https://github.com/rust-lang/rfcs/blob/master/text/0769-sound-generic-drop.md#phantom-data
515520
_marker: PhantomData<T>,
516521
}
517522

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

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ use self::TargetLint::*;
2828
use middle::privacy::ExportedItems;
2929
use middle::ty::{self, Ty};
3030
use session::{early_error, Session};
31-
use session::config::UnstableFeatures;
3231
use lint::{Level, LevelSource, Lint, LintId, LintArray, LintPass, LintPassObject};
33-
use lint::{Default, CommandLine, Node, Allow, Warn, Deny, Forbid, ReleaseChannel};
32+
use lint::{Default, CommandLine, Node, Allow, Warn, Deny, Forbid};
3433
use lint::builtin;
3534
use util::nodemap::FnvHashMap;
3635

@@ -208,23 +207,6 @@ impl LintStore {
208207
}
209208
}
210209
}
211-
212-
fn maybe_stage_features(&mut self, sess: &Session) {
213-
let lvl = match sess.opts.unstable_features {
214-
UnstableFeatures::Default => return,
215-
UnstableFeatures::Disallow => Forbid,
216-
UnstableFeatures::Cheat => Allow
217-
};
218-
match self.by_name.get("unstable_features") {
219-
Some(&Id(lint_id)) => if self.get_level_source(lint_id).0 != Forbid {
220-
self.set_level(lint_id, (lvl, ReleaseChannel))
221-
},
222-
Some(&Renamed(_, lint_id)) => if self.get_level_source(lint_id).0 != Forbid {
223-
self.set_level(lint_id, (lvl, ReleaseChannel))
224-
},
225-
None => unreachable!()
226-
}
227-
}
228210
}
229211

230212
/// Context for lint checking.
@@ -308,7 +290,6 @@ pub fn raw_emit_lint(sess: &Session, lint: &'static Lint,
308290

309291
let name = lint.name_lower();
310292
let mut def = None;
311-
let mut note = None;
312293
let msg = match source {
313294
Default => {
314295
format!("{}, #[{}({})] on by default", msg,
@@ -325,12 +306,6 @@ pub fn raw_emit_lint(sess: &Session, lint: &'static Lint,
325306
def = Some(src);
326307
msg.to_string()
327308
}
328-
ReleaseChannel => {
329-
let release_channel = option_env!("CFG_RELEASE_CHANNEL").unwrap_or("(unknown)");
330-
note = Some(format!("this feature may not be used in the {} release channel",
331-
release_channel));
332-
msg.to_string()
333-
}
334309
};
335310

336311
// For purposes of printing, we can treat forbid as deny.
@@ -344,10 +319,6 @@ pub fn raw_emit_lint(sess: &Session, lint: &'static Lint,
344319
_ => sess.bug("impossible level in raw_emit_lint"),
345320
}
346321

347-
if let Some(note) = note {
348-
sess.note(&note[..]);
349-
}
350-
351322
if let Some(span) = def {
352323
sess.span_note(span, "lint level defined here");
353324
}
@@ -689,9 +660,6 @@ impl LintPass for GatherNodeLevels {
689660
pub fn check_crate(tcx: &ty::ctxt,
690661
exported_items: &ExportedItems) {
691662

692-
// If this is a feature-staged build of rustc then flip several lints to 'forbid'
693-
tcx.sess.lint_store.borrow_mut().maybe_stage_features(&tcx.sess);
694-
695663
let krate = tcx.map.krate();
696664
let mut cx = Context::new(tcx, krate, exported_items);
697665

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,6 @@ pub enum LintSource {
247247

248248
/// Lint level was set by a command-line flag.
249249
CommandLine,
250-
251-
/// Lint level was set by the release channel.
252-
ReleaseChannel
253250
}
254251

255252
pub type LevelSource = (Level, LintSource);

branches/auto/src/librustc/session/config.rs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ use syntax::attr::AttrMetaMethods;
3232
use syntax::diagnostic::{ColorConfig, Auto, Always, Never, SpanHandler};
3333
use syntax::parse;
3434
use syntax::parse::token::InternedString;
35+
use syntax::feature_gate::UnstableFeatures;
3536

3637
use getopts;
3738
use std::collections::HashMap;
@@ -119,21 +120,6 @@ pub struct Options {
119120
pub unstable_features: UnstableFeatures
120121
}
121122

122-
#[derive(Clone, Copy)]
123-
pub enum UnstableFeatures {
124-
/// Hard errors for unstable features are active, as on
125-
/// beta/stable channels.
126-
Disallow,
127-
/// Use the default lint levels
128-
Default,
129-
/// Errors are bypassed for bootstrapping. This is required any time
130-
/// during the build that feature-related lints are set to warn or above
131-
/// because the build turns on warnings-as-errors and uses lots of unstable
132-
/// features. As a result, this this is always required for building Rust
133-
/// itself.
134-
Cheat
135-
}
136-
137123
#[derive(Clone, PartialEq, Eq)]
138124
pub enum PrintRequest {
139125
FileNames,
@@ -1074,7 +1060,7 @@ pub fn get_unstable_features_setting() -> UnstableFeatures {
10741060
match (disable_unstable_features, bootstrap_secret_key, bootstrap_provided_key) {
10751061
(_, Some(ref s), Some(ref p)) if s == p => UnstableFeatures::Cheat,
10761062
(true, _, _) => UnstableFeatures::Disallow,
1077-
(false, _, _) => UnstableFeatures::Default
1063+
(false, _, _) => UnstableFeatures::Allow
10781064
}
10791065
}
10801066

branches/auto/src/librustc_driver/driver.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,8 @@ pub fn phase_2_configure_and_expand(sess: &Session,
528528
let features =
529529
syntax::feature_gate::check_crate(sess.codemap(),
530530
&sess.parse_sess.span_diagnostic,
531-
&krate, &attributes);
531+
&krate, &attributes,
532+
sess.opts.unstable_features);
532533
*sess.features.borrow_mut() = features;
533534
sess.abort_if_errors();
534535
});
@@ -558,7 +559,8 @@ pub fn phase_2_configure_and_expand(sess: &Session,
558559
let features =
559560
syntax::feature_gate::check_crate(sess.codemap(),
560561
&sess.parse_sess.span_diagnostic,
561-
&krate, &attributes);
562+
&krate, &attributes,
563+
sess.opts.unstable_features);
562564
*sess.features.borrow_mut() = features;
563565
sess.abort_if_errors();
564566
});

branches/auto/src/librustc_driver/test.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ use syntax::codemap;
3535
use syntax::codemap::{Span, CodeMap, DUMMY_SP};
3636
use syntax::diagnostic::{Level, RenderSpan, Bug, Fatal, Error, Warning, Note, Help};
3737
use syntax::parse::token;
38+
use syntax::feature_gate::UnstableFeatures;
3839

3940
struct Env<'a, 'tcx: 'a> {
4041
infcx: &'a infer::InferCtxt<'a, 'tcx>,
@@ -102,6 +103,7 @@ fn test_env<F>(source_string: &str,
102103
let mut options =
103104
config::basic_options();
104105
options.debugging_opts.verbose = true;
106+
options.unstable_features = UnstableFeatures::Allow;
105107
let codemap =
106108
CodeMap::new();
107109
let diagnostic_handler =

branches/auto/src/librustc_lint/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2213,7 +2213,7 @@ pub struct UnstableFeatures;
22132213
declare_lint! {
22142214
UNSTABLE_FEATURES,
22152215
Allow,
2216-
"enabling unstable features"
2216+
"enabling unstable features (deprecated. do not use)"
22172217
}
22182218

22192219
impl LintPass for UnstableFeatures {

branches/auto/src/librustc_llvm/lib.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2252,6 +2252,18 @@ pub fn get_param(llfn: ValueRef, index: c_uint) -> ValueRef {
22522252
}
22532253
}
22542254

2255+
pub fn get_params(llfn: ValueRef) -> Vec<ValueRef> {
2256+
unsafe {
2257+
let num_params = LLVMCountParams(llfn);
2258+
let mut params = Vec::with_capacity(num_params as usize);
2259+
for idx in 0..num_params {
2260+
params.push(LLVMGetParam(llfn, idx));
2261+
}
2262+
2263+
params
2264+
}
2265+
}
2266+
22552267
#[allow(missing_copy_implementations)]
22562268
pub enum RustString_opaque {}
22572269
pub type RustStringRef = *mut RustString_opaque;

branches/auto/src/librustc_trans/trans/_match.rs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -828,19 +828,11 @@ fn compare_values<'blk, 'tcx>(cx: Block<'blk, 'tcx>,
828828
None,
829829
&format!("comparison of `{}`", rhs_t),
830830
StrEqFnLangItem);
831-
let t = ty::mk_str_slice(cx.tcx(), cx.tcx().mk_region(ty::ReStatic), ast::MutImmutable);
832-
// The comparison function gets the slices by value, so we have to make copies here. Even
833-
// if the function doesn't write through the pointer, things like lifetime intrinsics
834-
// require that we do this properly
835-
let lhs_arg = alloc_ty(cx, t, "lhs");
836-
let rhs_arg = alloc_ty(cx, t, "rhs");
837-
memcpy_ty(cx, lhs_arg, lhs, t);
838-
memcpy_ty(cx, rhs_arg, rhs, t);
839-
let res = callee::trans_lang_call(cx, did, &[lhs_arg, rhs_arg], None, debug_loc);
840-
call_lifetime_end(res.bcx, lhs_arg);
841-
call_lifetime_end(res.bcx, rhs_arg);
842-
843-
res
831+
let lhs_data = Load(cx, expr::get_dataptr(cx, lhs));
832+
let lhs_len = Load(cx, expr::get_len(cx, lhs));
833+
let rhs_data = Load(cx, expr::get_dataptr(cx, rhs));
834+
let rhs_len = Load(cx, expr::get_len(cx, rhs));
835+
callee::trans_lang_call(cx, did, &[lhs_data, lhs_len, rhs_data, rhs_len], None, debug_loc)
844836
}
845837

846838
let _icx = push_ctxt("compare_values");

branches/auto/src/librustc_trans/trans/asm.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,32 +45,31 @@ pub fn trans_inline_asm<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, ia: &ast::InlineAsm)
4545
output_types.push(type_of::type_of(bcx.ccx(), out_datum.ty));
4646
let val = out_datum.val;
4747
if is_rw {
48-
ext_inputs.push(unpack_result!(bcx, {
49-
callee::trans_arg_datum(bcx,
50-
expr_ty(bcx, &**out),
51-
out_datum,
52-
cleanup::CustomScope(temp_scope),
53-
callee::DontAutorefArg)
54-
}));
48+
bcx = callee::trans_arg_datum(bcx,
49+
expr_ty(bcx, &**out),
50+
out_datum,
51+
cleanup::CustomScope(temp_scope),
52+
callee::DontAutorefArg,
53+
&mut ext_inputs);
5554
ext_constraints.push(i.to_string());
5655
}
5756
val
5857

5958
}).collect::<Vec<_>>();
6059

6160
// Now the input operands
62-
let mut inputs = ia.inputs.iter().map(|&(ref c, ref input)| {
61+
let mut inputs = Vec::new();
62+
for &(ref c, ref input) in &ia.inputs {
6363
constraints.push((*c).clone());
6464

6565
let in_datum = unpack_datum!(bcx, expr::trans(bcx, &**input));
66-
unpack_result!(bcx, {
67-
callee::trans_arg_datum(bcx,
66+
bcx = callee::trans_arg_datum(bcx,
6867
expr_ty(bcx, &**input),
6968
in_datum,
7069
cleanup::CustomScope(temp_scope),
71-
callee::DontAutorefArg)
72-
})
73-
}).collect::<Vec<_>>();
70+
callee::DontAutorefArg,
71+
&mut inputs);
72+
}
7473
inputs.push_all(&ext_inputs[..]);
7574

7675
// no failure occurred preparing operands, no need to cleanup

0 commit comments

Comments
 (0)