Skip to content

Commit b9f76c6

Browse files
committed
---
yaml --- r: 138396 b: refs/heads/master c: 2130f22 h: refs/heads/master v: v3
1 parent 432239b commit b9f76c6

File tree

5 files changed

+30
-24
lines changed

5 files changed

+30
-24
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 4765bb9cb87bcac5fecc0f02cea5dc0eca1c347d
2+
refs/heads/master: 2130f2221600f03129df95f3611444468806b237
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5

trunk/mk/rt.mk

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -284,16 +284,15 @@ endif
284284
# ./configure script. This is done to force libbacktrace to *not* use the
285285
# atomic/sync functionality because it pulls in unnecessary dependencies and we
286286
# never use it anyway.
287-
$$(BACKTRACE_BUILD_DIR_$(1))/Makefile: \
288-
export CFLAGS:=$$(CFG_GCCISH_CFLAGS_$(1):-Werror=) \
289-
-fno-stack-protector
290-
$$(BACKTRACE_BUILD_DIR_$(1))/Makefile: export CC:=$$(CC_$(1))
291-
$$(BACKTRACE_BUILD_DIR_$(1))/Makefile: export AR:=$$(AR_$(1))
292-
$$(BACKTRACE_BUILD_DIR_$(1))/Makefile: export RANLIB:=$$(AR_$(1)) s
293287
$$(BACKTRACE_BUILD_DIR_$(1))/Makefile: $$(BACKTRACE_DEPS) $$(MKFILE_DEPS)
288+
@$$(call E, configure: libbacktrace for $(1))
294289
$$(Q)rm -rf $$(BACKTRACE_BUILD_DIR_$(1))
295290
$$(Q)mkdir -p $$(BACKTRACE_BUILD_DIR_$(1))
296291
$$(Q)(cd $$(BACKTRACE_BUILD_DIR_$(1)) && \
292+
CC="$$(CC_$(1))" \
293+
AR="$$(AR_$(1))" \
294+
RANLIB="$$(AR_$(1)) s" \
295+
CFLAGS="$$(CFG_GCCISH_CFLAGS_$(1):-Werror=) -fno-stack-protector" \
297296
$(S)src/libbacktrace/configure --target=$(1) --host=$(CFG_BUILD))
298297
$$(Q)echo '#undef HAVE_ATOMIC_FUNCTIONS' >> \
299298
$$(BACKTRACE_BUILD_DIR_$(1))/config.h

trunk/src/libcore/option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ impl<T> Option<T> {
245245
/// ```
246246
/// let mut x = Some(2u);
247247
/// match x.as_mut() {
248-
/// Some(&ref mut v) => *v = 42,
248+
/// Some(v) => *v = 42,
249249
/// None => {},
250250
/// }
251251
/// assert_eq!(x, Some(42u));

trunk/src/librustc/lint/builtin.rs

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use syntax::abi;
4343
use syntax::ast_map;
4444
use syntax::attr::AttrMetaMethods;
4545
use syntax::attr;
46-
use syntax::codemap::{Span, NO_EXPANSION};
46+
use syntax::codemap::Span;
4747
use syntax::parse::token;
4848
use syntax::{ast, ast_util, visit};
4949
use syntax::ptr::P;
@@ -1473,27 +1473,33 @@ impl LintPass for Stability {
14731473
}
14741474

14751475
fn check_expr(&mut self, cx: &Context, e: &ast::Expr) {
1476-
// skip if `e` is not from macro arguments
1477-
let skip = cx.tcx.sess.codemap().with_expn_info(e.span.expn_id, |expninfo| {
1476+
// first, check if the given expression was generated by a macro or not
1477+
// we need to go back the expn_info tree to check only the arguments
1478+
// of the initial macro call, not the nested ones.
1479+
let mut expnid = e.span.expn_id;
1480+
let mut is_internal = false;
1481+
while cx.tcx.sess.codemap().with_expn_info(expnid, |expninfo| {
14781482
match expninfo {
14791483
Some(ref info) => {
1480-
if info.call_site.expn_id != NO_EXPANSION ||
1481-
!( e.span.lo > info.call_site.lo && e.span.hi < info.call_site.hi ) {
1482-
// This code is not from the arguments,
1483-
// or this macro call was generated by an other macro
1484-
// We can't handle it.
1485-
true
1486-
} else if info.callee.span.is_none() {
1487-
// We don't want to mess with compiler builtins.
1488-
true
1484+
// save the parent expn_id for next loop iteration
1485+
expnid = info.call_site.expn_id;
1486+
if info.callee.span.is_none() {
1487+
// it's a compiler built-in, we *really* don't want to mess with it
1488+
// so we skip it, unless it was called by a regular macro, in which case
1489+
// we will handle the caller macro next turn
1490+
is_internal = true;
1491+
true // continue looping
14891492
} else {
1490-
false
1493+
// was this expression from the current macro arguments ?
1494+
is_internal = !( e.span.lo > info.call_site.lo &&
1495+
e.span.hi < info.call_site.hi );
1496+
true // continue looping
14911497
}
14921498
},
1493-
_ => { false }
1499+
_ => false // stop looping
14941500
}
1495-
});
1496-
if skip { return; }
1501+
}) { /* empty while loop body */ }
1502+
if is_internal { return; }
14971503

14981504
let mut span = e.span;
14991505

trunk/src/test/compile-fail/lint-stability.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ mod cross_crate {
116116
// on macros themselves are not yet linted.
117117
macro_test!();
118118
macro_test_arg!(deprecated_text()); //~ ERROR use of deprecated item: text
119+
macro_test_arg!(macro_test_arg!(deprecated_text())); //~ ERROR use of deprecated item: text
119120
macro_test_arg_nested!(deprecated_text);
120121
}
121122

0 commit comments

Comments
 (0)