Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fdfbcf8

Browse files
committedDec 3, 2017
Auto merge of #46482 - frewsxcv:rollup, r=frewsxcv
Rollup of 8 pull requests - Successful merges: #45957, #46260, #46432, #46442, #46454, #46462, #46465, #46473 - Failed merges:
2 parents 1956d55 + 48d3855 commit fdfbcf8

File tree

12 files changed

+160
-120
lines changed

12 files changed

+160
-120
lines changed
 

‎src/doc/unstable-book/src/language-features/plugin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ quasiquote as an ordinary plugin library.
177177
Plugins can extend [Rust's lint
178178
infrastructure](../reference/attributes.html#lint-check-attributes) with
179179
additional checks for code style, safety, etc. Now let's write a plugin
180-
[`lint_plugin_test.rs`](https://github.com/rust-lang/rust/blob/master/src/test/run-pass-fulldeps/auxiliary/lint_plugin_test.rs)
180+
[`lint_plugin_test.rs`](https://github.com/rust-lang/rust/blob/master/src/test/ui-fulldeps/auxiliary/lint_plugin_test.rs)
181181
that warns about any item named `lintme`.
182182

183183
```rust,ignore

‎src/etc/test-float-parse/runtests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python2.7
1+
#!/usr/bin/env python2.7
22
#
33
# Copyright 2015 The Rust Project Developers. See the COPYRIGHT
44
# file at the top-level directory of this distribution and at

‎src/libcore/macros.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -612,9 +612,10 @@ mod builtin {
612612
#[stable(feature = "rust1", since = "1.0.0")]
613613
#[macro_export]
614614
#[cfg(dox)]
615-
macro_rules! format_args { ($fmt:expr, $($args:tt)*) => ({
616-
/* compiler built-in */
617-
}) }
615+
macro_rules! format_args {
616+
($fmt:expr) => ({ /* compiler built-in */ });
617+
($fmt:expr, $($args:tt)*) => ({ /* compiler built-in */ });
618+
}
618619

619620
/// Inspect an environment variable at compile time.
620621
///
@@ -624,7 +625,10 @@ mod builtin {
624625
#[stable(feature = "rust1", since = "1.0.0")]
625626
#[macro_export]
626627
#[cfg(dox)]
627-
macro_rules! env { ($name:expr) => ({ /* compiler built-in */ }) }
628+
macro_rules! env {
629+
($name:expr) => ({ /* compiler built-in */ });
630+
($name:expr,) => ({ /* compiler built-in */ });
631+
}
628632

629633
/// Optionally inspect an environment variable at compile time.
630634
///
@@ -645,7 +649,8 @@ mod builtin {
645649
#[macro_export]
646650
#[cfg(dox)]
647651
macro_rules! concat_idents {
648-
($($e:ident),*) => ({ /* compiler built-in */ })
652+
($($e:ident),*) => ({ /* compiler built-in */ });
653+
($($e:ident,)*) => ({ /* compiler built-in */ });
649654
}
650655

651656
/// Concatenates literals into a static string slice.
@@ -656,7 +661,10 @@ mod builtin {
656661
#[stable(feature = "rust1", since = "1.0.0")]
657662
#[macro_export]
658663
#[cfg(dox)]
659-
macro_rules! concat { ($($e:expr),*) => ({ /* compiler built-in */ }) }
664+
macro_rules! concat {
665+
($($e:expr),*) => ({ /* compiler built-in */ });
666+
($($e:expr,)*) => ({ /* compiler built-in */ });
667+
}
660668

661669
/// A macro which expands to the line number on which it was invoked.
662670
///

‎src/libcore/num/mod.rs

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

‎src/librustc/session/config.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,8 +1053,6 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
10531053
save_analysis: bool = (false, parse_bool, [UNTRACKED],
10541054
"write syntax and type analysis (in JSON format) information, in \
10551055
addition to normal output"),
1056-
print_move_fragments: bool = (false, parse_bool, [UNTRACKED],
1057-
"print out move-fragment data for every fn"),
10581056
flowgraph_print_loans: bool = (false, parse_bool, [UNTRACKED],
10591057
"include loan analysis data in --unpretty flowgraph output"),
10601058
flowgraph_print_moves: bool = (false, parse_bool, [UNTRACKED],
@@ -2684,8 +2682,6 @@ mod tests {
26842682
assert_eq!(reference.dep_tracking_hash(), opts.dep_tracking_hash());
26852683
opts.debugging_opts.save_analysis = true;
26862684
assert_eq!(reference.dep_tracking_hash(), opts.dep_tracking_hash());
2687-
opts.debugging_opts.print_move_fragments = true;
2688-
assert_eq!(reference.dep_tracking_hash(), opts.dep_tracking_hash());
26892685
opts.debugging_opts.flowgraph_print_loans = true;
26902686
assert_eq!(reference.dep_tracking_hash(), opts.dep_tracking_hash());
26912687
opts.debugging_opts.flowgraph_print_moves = true;

‎src/librustc_mir/transform/copy_prop.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,13 @@ impl<'tcx> Action<'tcx> {
239239
// USE(SRC);
240240
let src_def_count = src_use_info.def_count_not_including_drop();
241241
// allow function arguments to be propagated
242-
if src_def_count > 1 ||
243-
(src_def_count == 0 && mir.local_kind(src_local) != LocalKind::Arg) {
244-
debug!(" Can't copy-propagate local: {} defs of src",
245-
src_use_info.def_count_not_including_drop());
242+
let is_arg = mir.local_kind(src_local) == LocalKind::Arg;
243+
if (is_arg && src_def_count != 0) || (!is_arg && src_def_count != 1) {
244+
debug!(
245+
" Can't copy-propagate local: {} defs of src{}",
246+
src_def_count,
247+
if is_arg { " (argument)" } else { "" },
248+
);
246249
return None
247250
}
248251

‎src/librustdoc/html/static/rustdoc.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ nav.sub {
179179
top: 0;
180180
height: 100vh;
181181
overflow: auto;
182+
z-index: 1;
182183
}
183184

184185
.sidebar .current {

‎src/libstd/macros.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,10 @@ pub mod builtin {
325325
/// ```
326326
#[stable(feature = "rust1", since = "1.0.0")]
327327
#[macro_export]
328-
macro_rules! format_args { ($fmt:expr, $($args:tt)*) => ({
329-
/* compiler built-in */
330-
}) }
328+
macro_rules! format_args {
329+
($fmt:expr) => ({ /* compiler built-in */ });
330+
($fmt:expr, $($args:tt)*) => ({ /* compiler built-in */ });
331+
}
331332

332333
/// Inspect an environment variable at compile time.
333334
///
@@ -348,7 +349,10 @@ pub mod builtin {
348349
/// ```
349350
#[stable(feature = "rust1", since = "1.0.0")]
350351
#[macro_export]
351-
macro_rules! env { ($name:expr) => ({ /* compiler built-in */ }) }
352+
macro_rules! env {
353+
($name:expr) => ({ /* compiler built-in */ });
354+
($name:expr,) => ({ /* compiler built-in */ });
355+
}
352356

353357
/// Optionally inspect an environment variable at compile time.
354358
///
@@ -400,7 +404,8 @@ pub mod builtin {
400404
#[unstable(feature = "concat_idents_macro", issue = "29599")]
401405
#[macro_export]
402406
macro_rules! concat_idents {
403-
($($e:ident),*) => ({ /* compiler built-in */ })
407+
($($e:ident),*) => ({ /* compiler built-in */ });
408+
($($e:ident,)*) => ({ /* compiler built-in */ });
404409
}
405410

406411
/// Concatenates literals into a static string slice.
@@ -420,7 +425,10 @@ pub mod builtin {
420425
/// ```
421426
#[stable(feature = "rust1", since = "1.0.0")]
422427
#[macro_export]
423-
macro_rules! concat { ($($e:expr),*) => ({ /* compiler built-in */ }) }
428+
macro_rules! concat {
429+
($($e:expr),*) => ({ /* compiler built-in */ });
430+
($($e:expr,)*) => ({ /* compiler built-in */ });
431+
}
424432

425433
/// A macro which expands to the line number on which it was invoked.
426434
///

‎src/libstd_unicode/char.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,7 @@ pub struct DecodeUtf16<I>
14611461
buf: Option<u16>,
14621462
}
14631463

1464-
/// An iterator that decodes UTF-16 encoded code points from an iterator of `u16`s.
1464+
/// An error that can be returned when decoding UTF-16 code points.
14651465
#[stable(feature = "decode_utf16", since = "1.9.0")]
14661466
#[derive(Debug, Clone, Eq, PartialEq)]
14671467
pub struct DecodeUtf16Error {

‎src/test/mir-opt/copy_propagation_arg.rs

Lines changed: 50 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -30,42 +30,43 @@ fn baz(mut x: i32) {
3030
x = x;
3131
}
3232

33+
fn arg_src(mut x: i32) -> i32 {
34+
let y = x;
35+
x = 123; // Don't propagate this assignment to `y`
36+
y
37+
}
38+
3339
fn main() {
3440
// Make sure the function actually gets instantiated.
3541
foo(0);
3642
bar(0);
3743
baz(0);
44+
arg_src(0);
3845
}
3946

4047
// END RUST SOURCE
4148
// START rustc.foo.CopyPropagation.before.mir
4249
// bb0: {
43-
// StorageLive(_2);
44-
// StorageLive(_3);
50+
// ...
4551
// _3 = _1;
4652
// _2 = const dummy(move _3) -> bb1;
4753
// }
4854
// bb1: {
49-
// StorageDead(_3);
55+
// ...
5056
// _1 = move _2;
51-
// StorageDead(_2);
52-
// _0 = ();
53-
// return;
57+
// ...
5458
// }
5559
// END rustc.foo.CopyPropagation.before.mir
5660
// START rustc.foo.CopyPropagation.after.mir
5761
// bb0: {
58-
// StorageLive(_2);
59-
// nop;
60-
// nop;
61-
// _2 = const dummy(move _1) -> bb1;
62+
// ...
63+
// _3 = _1;
64+
// _2 = const dummy(move _3) -> bb1;
6265
// }
6366
// bb1: {
64-
// nop;
67+
// ...
6568
// _1 = move _2;
66-
// StorageDead(_2);
67-
// _0 = ();
68-
// return;
69+
// ...
6970
// }
7071
// END rustc.foo.CopyPropagation.after.mir
7172
// START rustc.bar.CopyPropagation.before.mir
@@ -83,15 +84,14 @@ fn main() {
8384
// END rustc.bar.CopyPropagation.before.mir
8485
// START rustc.bar.CopyPropagation.after.mir
8586
// bb0: {
86-
// nop;
87-
// nop;
88-
// _2 = const dummy(move _1) -> bb1;
87+
// ...
88+
// _3 = _1;
89+
// _2 = const dummy(move _3) -> bb1;
8990
// }
9091
// bb1: {
91-
// nop;
92+
// ...
9293
// _1 = const 5u8;
93-
// _0 = ();
94-
// return;
94+
// ...
9595
// }
9696
// END rustc.bar.CopyPropagation.after.mir
9797
// START rustc.baz.CopyPropagation.before.mir
@@ -106,11 +106,35 @@ fn main() {
106106
// END rustc.baz.CopyPropagation.before.mir
107107
// START rustc.baz.CopyPropagation.after.mir
108108
// bb0: {
109-
// nop;
110-
// nop;
111-
// nop;
112-
// nop;
113-
// _0 = ();
114-
// return;
109+
// ...
110+
// _2 = _1;
111+
// _1 = move _2;
112+
// ...
115113
// }
116114
// END rustc.baz.CopyPropagation.after.mir
115+
// START rustc.arg_src.CopyPropagation.before.mir
116+
// bb0: {
117+
// ...
118+
// _3 = _1;
119+
// _2 = move _3;
120+
// ...
121+
// _1 = const 123i32;
122+
// ...
123+
// _4 = _2;
124+
// _0 = move _4;
125+
// ...
126+
// return;
127+
// }
128+
// END rustc.arg_src.CopyPropagation.before.mir
129+
// START rustc.arg_src.CopyPropagation.after.mir
130+
// bb0: {
131+
// ...
132+
// _3 = _1;
133+
// ...
134+
// _1 = const 123i32;
135+
// ...
136+
// _0 = move _3;
137+
// ...
138+
// return;
139+
// }
140+
// END rustc.arg_src.CopyPropagation.after.mir

‎src/test/ui/update-all-references.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Copyright 2015 The Rust Project Developers. See the COPYRIGHT
44
# file at the top-level directory of this distribution and at

‎src/test/ui/update-references.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Copyright 2015 The Rust Project Developers. See the COPYRIGHT
44
# file at the top-level directory of this distribution and at

0 commit comments

Comments
 (0)
Please sign in to comment.