Skip to content

Commit a139f84

Browse files
committed
---
yaml --- r: 277898 b: refs/heads/auto c: 60c8f7d h: refs/heads/master
1 parent 231c9fb commit a139f84

File tree

25 files changed

+653
-555
lines changed

25 files changed

+653
-555
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: 855fb6192263a5c059325bb4b4e10b55e4e8ddbb
11+
refs/heads/auto: 60c8f7dbf5788f1c9f3a27be2e7be28ecf7817ff
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Read ["Installing Rust"] from [The Book].
1616

1717
1. Make sure you have installed the dependencies:
1818

19-
* `g++` 4.7 or later or `clang++` 3.x
19+
* `g++` 4.7 or `clang++` 3.x
2020
* `python` 2.7 (but not 3.x)
2121
* GNU `make` 3.81 or later
2222
* `curl`

branches/auto/configure

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,19 +1453,6 @@ then
14531453
cd ${CFG_BUILD_DIR}
14541454
fi
14551455

1456-
# Do a sanity check that the submodule source exists. Because GitHub
1457-
# automatically publishes broken tarballs that can't be disabled, and
1458-
# people download them and try to use them.
1459-
if [ ! -e "${CFG_SRC_DIR}/src/liblibc" ]; then
1460-
err "some submodules are missing. Is this a broken tarball?
1461-
1462-
If you downloaded this tarball from the GitHub release pages at
1463-
https://github.com/rust-lang/rust/releases,
1464-
then please delete it and instead download the source from
1465-
https://www.rust-lang.org/downloads.html"
1466-
1467-
fi
1468-
14691456
# Configure llvm, only if necessary
14701457
step_msg "looking at LLVM"
14711458
CFG_LLVM_SRC_DIR=${CFG_SRC_DIR}src/llvm/

branches/auto/src/libcollections/btree/map.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,15 +1654,6 @@ impl<'a, K: Ord, V> Entry<'a, K, V> {
16541654
Vacant(entry) => entry.insert(default()),
16551655
}
16561656
}
1657-
1658-
/// Returns a reference to this entry's key.
1659-
#[unstable(feature = "map_entry_keys", issue = "32281")]
1660-
pub fn key(&self) -> &K {
1661-
match *self {
1662-
Occupied(ref entry) => entry.key(),
1663-
Vacant(ref entry) => entry.key(),
1664-
}
1665-
}
16661657
}
16671658

16681659
impl<'a, K: Ord, V> VacantEntry<'a, K, V> {

branches/auto/src/libcollections/btree/set.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,9 +477,9 @@ impl<T: Ord> BTreeSet<T> {
477477

478478
/// Adds a value to the set.
479479
///
480-
/// If the set did not have this value present, `true` is returned.
480+
/// If the set did not have a value present, `true` is returned.
481481
///
482-
/// If the set did have this value present, `false` is returned, and the
482+
/// If the set did have this key present, `false` is returned, and the
483483
/// entry is not updated. See the [module-level documentation] for more.
484484
///
485485
/// [module-level documentation]: index.html#insert-and-complex-keys

branches/auto/src/librustc/hir/lowering.rs

Lines changed: 569 additions & 336 deletions
Large diffs are not rendered by default.

branches/auto/src/librustc_driver/driver.rs

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ pub fn compile_input(sess: &Session,
165165
&hir_map,
166166
&expanded_crate,
167167
&hir_map.krate(),
168-
&id[..]),
168+
&id[..],
169+
&lcx),
169170
Ok(()));
170171
}
171172

@@ -202,6 +203,7 @@ pub fn compile_input(sess: &Session,
202203
&analysis,
203204
mir_map.as_ref(),
204205
tcx,
206+
&lcx,
205207
&id);
206208
(control.after_analysis.callback)(state);
207209

@@ -246,7 +248,9 @@ pub fn compile_input(sess: &Session,
246248
}
247249

248250
fn keep_mtwt_tables(sess: &Session) -> bool {
249-
sess.opts.debugging_opts.keep_mtwt_tables
251+
sess.opts.debugging_opts.keep_mtwt_tables ||
252+
sess.opts.debugging_opts.save_analysis ||
253+
sess.opts.debugging_opts.save_analysis_csv
250254
}
251255

252256
fn keep_ast(sess: &Session) -> bool {
@@ -341,6 +345,7 @@ pub struct CompileState<'a, 'ast: 'a, 'tcx: 'a> {
341345
pub mir_map: Option<&'a MirMap<'tcx>>,
342346
pub analysis: Option<&'a ty::CrateAnalysis<'a>>,
343347
pub tcx: Option<&'a TyCtxt<'tcx>>,
348+
pub lcx: Option<&'a LoweringContext<'a>>,
344349
pub trans: Option<&'a trans::CrateTranslation>,
345350
}
346351

@@ -363,6 +368,7 @@ impl<'a, 'ast, 'tcx> CompileState<'a, 'ast, 'tcx> {
363368
analysis: None,
364369
mir_map: None,
365370
tcx: None,
371+
lcx: None,
366372
trans: None,
367373
}
368374
}
@@ -394,13 +400,15 @@ impl<'a, 'ast, 'tcx> CompileState<'a, 'ast, 'tcx> {
394400
hir_map: &'a hir_map::Map<'ast>,
395401
krate: &'a ast::Crate,
396402
hir_crate: &'a hir::Crate,
397-
crate_name: &'a str)
403+
crate_name: &'a str,
404+
lcx: &'a LoweringContext<'a>)
398405
-> CompileState<'a, 'ast, 'tcx> {
399406
CompileState {
400407
crate_name: Some(crate_name),
401408
ast_map: Some(hir_map),
402409
krate: Some(krate),
403410
hir_crate: Some(hir_crate),
411+
lcx: Some(lcx),
404412
..CompileState::empty(input, session, out_dir)
405413
}
406414
}
@@ -413,6 +421,7 @@ impl<'a, 'ast, 'tcx> CompileState<'a, 'ast, 'tcx> {
413421
analysis: &'a ty::CrateAnalysis,
414422
mir_map: Option<&'a MirMap<'tcx>>,
415423
tcx: &'a TyCtxt<'tcx>,
424+
lcx: &'a LoweringContext<'a>,
416425
crate_name: &'a str)
417426
-> CompileState<'a, 'ast, 'tcx> {
418427
CompileState {
@@ -421,6 +430,7 @@ impl<'a, 'ast, 'tcx> CompileState<'a, 'ast, 'tcx> {
421430
tcx: Some(tcx),
422431
krate: krate,
423432
hir_crate: Some(hir_crate),
433+
lcx: Some(lcx),
424434
crate_name: Some(crate_name),
425435
..CompileState::empty(input, session, out_dir)
426436
}
@@ -635,6 +645,21 @@ pub fn phase_2_configure_and_expand(sess: &Session,
635645
ret
636646
});
637647

648+
// Needs to go *after* expansion to be able to check the results
649+
// of macro expansion. This runs before #[cfg] to try to catch as
650+
// much as possible (e.g. help the programmer avoid platform
651+
// specific differences)
652+
time(time_passes, "complete gated feature checking 1", || {
653+
sess.track_errors(|| {
654+
let features = syntax::feature_gate::check_crate(sess.codemap(),
655+
&sess.parse_sess.span_diagnostic,
656+
&krate,
657+
&attributes,
658+
sess.opts.unstable_features);
659+
*sess.features.borrow_mut() = features;
660+
})
661+
})?;
662+
638663
// JBC: make CFG processing part of expansion to avoid this problem:
639664

640665
// strip again, in case expansion added anything with a #[cfg].
@@ -673,8 +698,10 @@ pub fn phase_2_configure_and_expand(sess: &Session,
673698
"checking for inline asm in case the target doesn't support it",
674699
|| no_asm::check_crate(sess, &krate));
675700

676-
// Needs to go *after* expansion to be able to check the results of macro expansion.
677-
time(time_passes, "complete gated feature checking", || {
701+
// One final feature gating of the true AST that gets compiled
702+
// later, to make sure we've got everything (e.g. configuration
703+
// can insert new attributes via `cfg_attr`)
704+
time(time_passes, "complete gated feature checking 2", || {
678705
sess.track_errors(|| {
679706
let features = syntax::feature_gate::check_crate(sess.codemap(),
680707
&sess.parse_sess.span_diagnostic,

branches/auto/src/librustc_driver/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@ impl<'a> CompilerCalls<'a> for RustcDefaultCalls {
499499
control.after_analysis.callback = box |state| {
500500
time(state.session.time_passes(), "save analysis", || {
501501
save::process_crate(state.tcx.unwrap(),
502+
state.lcx.unwrap(),
502503
state.krate.unwrap(),
503504
state.analysis.unwrap(),
504505
state.crate_name.unwrap(),

branches/auto/src/librustc_resolve/diagnostics.rs

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -948,51 +948,6 @@ use something_which_doesnt_exist;
948948
Please verify you didn't misspell the import's name.
949949
"##,
950950

951-
E0434: r##"
952-
This error indicates that a variable usage inside an inner function is invalid
953-
because the variable comes from a dynamic environment. Inner functions do not
954-
have access to their containing environment.
955-
956-
Example of erroneous code:
957-
958-
```compile_fail
959-
fn foo() {
960-
let y = 5;
961-
fn bar() -> u32 {
962-
y // error: can't capture dynamic environment in a fn item; use the
963-
// || { ... } closure form instead.
964-
}
965-
}
966-
```
967-
968-
Functions do not capture local variables. To fix this error, you can replace the
969-
function with a closure:
970-
971-
```
972-
fn foo() {
973-
let y = 5;
974-
let bar = || {
975-
y
976-
};
977-
}
978-
```
979-
980-
or replace the captured variable with a constant or a static item:
981-
982-
```
983-
fn foo() {
984-
static mut X: u32 = 4;
985-
const Y: u32 = 5;
986-
fn bar() -> u32 {
987-
unsafe {
988-
X = 3;
989-
}
990-
Y
991-
}
992-
}
993-
```
994-
"##,
995-
996951
E0435: r##"
997952
A non-constant value was used to initialise a constant. Example of erroneous
998953
code:
@@ -1089,4 +1044,5 @@ register_diagnostics! {
10891044
E0421, // unresolved associated const
10901045
E0427, // cannot use `ref` binding mode with ...
10911046
E0429, // `self` imports are only allowed within a { } list
1047+
E0434, // can't capture dynamic environment in a fn item
10921048
}

0 commit comments

Comments
 (0)