Skip to content

Commit 5c71e4e

Browse files
committed
Auto merge of #43551 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 8 pull requests - Successful merges: #43409, #43501, #43509, #43512, #43513, #43536, #43544, #43549 - Failed merges:
2 parents 53bf790 + 16c3fd9 commit 5c71e4e

File tree

22 files changed

+160
-58
lines changed

22 files changed

+160
-58
lines changed

src/bootstrap/builder.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ use check;
2828
use flags::Subcommand;
2929
use doc;
3030
use tool;
31+
use native;
3132

3233
pub use Compiler;
3334

@@ -256,7 +257,8 @@ impl<'a> Builder<'a> {
256257
compile::StartupObjects, tool::BuildManifest, tool::Rustbook, tool::ErrorIndex,
257258
tool::UnstableBookGen, tool::Tidy, tool::Linkchecker, tool::CargoTest,
258259
tool::Compiletest, tool::RemoteTestServer, tool::RemoteTestClient,
259-
tool::RustInstaller, tool::Cargo, tool::Rls, tool::Rustdoc),
260+
tool::RustInstaller, tool::Cargo, tool::Rls, tool::Rustdoc,
261+
native::Llvm),
260262
Kind::Test => describe!(check::Tidy, check::Bootstrap, check::DefaultCompiletest,
261263
check::HostCompiletest, check::Crate, check::CrateLibrustc, check::Linkcheck,
262264
check::Cargotest, check::Cargo, check::Rls, check::Docs, check::ErrorIndex,

src/bootstrap/native.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ impl Step for Llvm {
4848
run.path("src/llvm")
4949
}
5050

51+
fn make_run(run: RunConfig) {
52+
run.builder.ensure(Llvm { target: run.target })
53+
}
54+
5155
/// Compile LLVM for `target`.
5256
fn run(self, builder: &Builder) {
5357
let build = builder.build;

src/ci/docker/run.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ else
6767
args="$args --env SCCACHE_DIR=/sccache --volume $HOME/.cache/sccache:/sccache"
6868
fi
6969

70+
# Run containers as privileged as it should give them access to some more
71+
# syscalls such as ptrace and whatnot. In the upgrade to LLVM 5.0 it was
72+
# discovered that the leak sanitizer apparently needs these syscalls nowadays so
73+
# we'll need `--privileged` for at least the `x86_64-gnu` builder, so this just
74+
# goes ahead and sets it for all builders.
75+
args="$args --privileged"
76+
7077
exec docker \
7178
run \
7279
--volume "$root_dir:/checkout:ro" \

src/liballoc/allocator.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ impl Layout {
215215
/// of each element in the array.
216216
///
217217
/// On arithmetic overflow, returns `None`.
218+
#[inline]
218219
pub fn repeat(&self, n: usize) -> Option<(Self, usize)> {
219220
let padded_size = match self.size.checked_add(self.padding_needed_for(self.align)) {
220221
None => return None,

src/libcore/iter/traits.rs

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -147,22 +147,13 @@ pub trait FromIterator<A>: Sized {
147147
///
148148
/// ```
149149
/// let v = vec![1, 2, 3];
150-
///
151150
/// let mut iter = v.into_iter();
152151
///
153-
/// let n = iter.next();
154-
/// assert_eq!(Some(1), n);
155-
///
156-
/// let n = iter.next();
157-
/// assert_eq!(Some(2), n);
158-
///
159-
/// let n = iter.next();
160-
/// assert_eq!(Some(3), n);
161-
///
162-
/// let n = iter.next();
163-
/// assert_eq!(None, n);
152+
/// assert_eq!(Some(1), iter.next());
153+
/// assert_eq!(Some(2), iter.next());
154+
/// assert_eq!(Some(3), iter.next());
155+
/// assert_eq!(None, iter.next());
164156
/// ```
165-
///
166157
/// Implementing `IntoIterator` for your type:
167158
///
168159
/// ```
@@ -227,20 +218,12 @@ pub trait IntoIterator {
227218
///
228219
/// ```
229220
/// let v = vec![1, 2, 3];
230-
///
231221
/// let mut iter = v.into_iter();
232222
///
233-
/// let n = iter.next();
234-
/// assert_eq!(Some(1), n);
235-
///
236-
/// let n = iter.next();
237-
/// assert_eq!(Some(2), n);
238-
///
239-
/// let n = iter.next();
240-
/// assert_eq!(Some(3), n);
241-
///
242-
/// let n = iter.next();
243-
/// assert_eq!(None, n);
223+
/// assert_eq!(Some(1), iter.next());
224+
/// assert_eq!(Some(2), iter.next());
225+
/// assert_eq!(Some(3), iter.next());
226+
/// assert_eq!(None, iter.next());
244227
/// ```
245228
#[stable(feature = "rust1", since = "1.0.0")]
246229
fn into_iter(self) -> Self::IntoIter;

src/librustc/ich/impls_mir.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,11 @@ impl<'a, 'gcx, 'tcx> HashStable<StableHashingContext<'a, 'gcx, 'tcx>> for mir::L
258258
}
259259
}
260260

261-
impl<'a, 'gcx, 'tcx, B, V> HashStable<StableHashingContext<'a, 'gcx, 'tcx>>
262-
for mir::Projection<'tcx, B, V>
261+
impl<'a, 'gcx, 'tcx, B, V, T> HashStable<StableHashingContext<'a, 'gcx, 'tcx>>
262+
for mir::Projection<'tcx, B, V, T>
263263
where B: HashStable<StableHashingContext<'a, 'gcx, 'tcx>>,
264-
V: HashStable<StableHashingContext<'a, 'gcx, 'tcx>>
264+
V: HashStable<StableHashingContext<'a, 'gcx, 'tcx>>,
265+
T: HashStable<StableHashingContext<'a, 'gcx, 'tcx>>
265266
{
266267
fn hash_stable<W: StableHasherResult>(&self,
267268
hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>,
@@ -276,17 +277,18 @@ for mir::Projection<'tcx, B, V>
276277
}
277278
}
278279

279-
impl<'a, 'gcx, 'tcx, V> HashStable<StableHashingContext<'a, 'gcx, 'tcx>>
280-
for mir::ProjectionElem<'tcx, V>
281-
where V: HashStable<StableHashingContext<'a, 'gcx, 'tcx>>
280+
impl<'a, 'gcx, 'tcx, V, T> HashStable<StableHashingContext<'a, 'gcx, 'tcx>>
281+
for mir::ProjectionElem<'tcx, V, T>
282+
where V: HashStable<StableHashingContext<'a, 'gcx, 'tcx>>,
283+
T: HashStable<StableHashingContext<'a, 'gcx, 'tcx>>
282284
{
283285
fn hash_stable<W: StableHasherResult>(&self,
284286
hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>,
285287
hasher: &mut StableHasher<W>) {
286288
mem::discriminant(self).hash_stable(hcx, hasher);
287289
match *self {
288290
mir::ProjectionElem::Deref => {}
289-
mir::ProjectionElem::Field(field, ty) => {
291+
mir::ProjectionElem::Field(field, ref ty) => {
290292
field.hash_stable(hcx, hasher);
291293
ty.hash_stable(hcx, hasher);
292294
}

src/librustc/mir/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -887,15 +887,15 @@ impl_stable_hash_for!(struct Static<'tcx> {
887887
/// shared between `Constant` and `Lvalue`. See the aliases
888888
/// `LvalueProjection` etc below.
889889
#[derive(Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
890-
pub struct Projection<'tcx, B, V> {
890+
pub struct Projection<'tcx, B, V, T> {
891891
pub base: B,
892-
pub elem: ProjectionElem<'tcx, V>,
892+
pub elem: ProjectionElem<'tcx, V, T>,
893893
}
894894

895895
#[derive(Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
896-
pub enum ProjectionElem<'tcx, V> {
896+
pub enum ProjectionElem<'tcx, V, T> {
897897
Deref,
898-
Field(Field, Ty<'tcx>),
898+
Field(Field, T),
899899
Index(V),
900900

901901
/// These indices are generated by slice patterns. Easiest to explain
@@ -932,11 +932,11 @@ pub enum ProjectionElem<'tcx, V> {
932932

933933
/// Alias for projections as they appear in lvalues, where the base is an lvalue
934934
/// and the index is an operand.
935-
pub type LvalueProjection<'tcx> = Projection<'tcx, Lvalue<'tcx>, Operand<'tcx>>;
935+
pub type LvalueProjection<'tcx> = Projection<'tcx, Lvalue<'tcx>, Operand<'tcx>, Ty<'tcx>>;
936936

937937
/// Alias for projections as they appear in lvalues, where the base is an lvalue
938938
/// and the index is an operand.
939-
pub type LvalueElem<'tcx> = ProjectionElem<'tcx, Operand<'tcx>>;
939+
pub type LvalueElem<'tcx> = ProjectionElem<'tcx, Operand<'tcx>, Ty<'tcx>>;
940940

941941
newtype_index!(Field, "field");
942942

@@ -1720,16 +1720,16 @@ impl<'tcx> TypeFoldable<'tcx> for Operand<'tcx> {
17201720
}
17211721
}
17221722

1723-
impl<'tcx, B, V> TypeFoldable<'tcx> for Projection<'tcx, B, V>
1724-
where B: TypeFoldable<'tcx>, V: TypeFoldable<'tcx>
1723+
impl<'tcx, B, V, T> TypeFoldable<'tcx> for Projection<'tcx, B, V, T>
1724+
where B: TypeFoldable<'tcx>, V: TypeFoldable<'tcx>, T: TypeFoldable<'tcx>
17251725
{
17261726
fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self {
17271727
use mir::ProjectionElem::*;
17281728

17291729
let base = self.base.fold_with(folder);
17301730
let elem = match self.elem {
17311731
Deref => Deref,
1732-
Field(f, ty) => Field(f, ty.fold_with(folder)),
1732+
Field(f, ref ty) => Field(f, ty.fold_with(folder)),
17331733
Index(ref v) => Index(v.fold_with(folder)),
17341734
ref elem => elem.clone()
17351735
};
@@ -1745,7 +1745,7 @@ impl<'tcx, B, V> TypeFoldable<'tcx> for Projection<'tcx, B, V>
17451745

17461746
self.base.visit_with(visitor) ||
17471747
match self.elem {
1748-
Field(_, ty) => ty.visit_with(visitor),
1748+
Field(_, ref ty) => ty.visit_with(visitor),
17491749
Index(ref v) => v.visit_with(visitor),
17501750
_ => false
17511751
}

src/librustc_mir/dataflow/move_paths/abs_domain.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@
2323
2424
use rustc::mir::LvalueElem;
2525
use rustc::mir::{Operand, ProjectionElem};
26+
use rustc::ty::Ty;
2627

2728
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
2829
pub struct AbstractOperand;
30+
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
31+
pub struct AbstractType;
2932
pub type AbstractElem<'tcx> =
30-
ProjectionElem<'tcx, AbstractOperand>;
33+
ProjectionElem<'tcx, AbstractOperand, AbstractType>;
3134

3235
pub trait Lift {
3336
type Abstract;
@@ -37,14 +40,18 @@ impl<'tcx> Lift for Operand<'tcx> {
3740
type Abstract = AbstractOperand;
3841
fn lift(&self) -> Self::Abstract { AbstractOperand }
3942
}
43+
impl<'tcx> Lift for Ty<'tcx> {
44+
type Abstract = AbstractType;
45+
fn lift(&self) -> Self::Abstract { AbstractType }
46+
}
4047
impl<'tcx> Lift for LvalueElem<'tcx> {
4148
type Abstract = AbstractElem<'tcx>;
4249
fn lift(&self) -> Self::Abstract {
4350
match *self {
4451
ProjectionElem::Deref =>
4552
ProjectionElem::Deref,
4653
ProjectionElem::Field(ref f, ty) =>
47-
ProjectionElem::Field(f.clone(), ty.clone()),
54+
ProjectionElem::Field(f.clone(), ty.lift()),
4855
ProjectionElem::Index(ref i) =>
4956
ProjectionElem::Index(i.lift()),
5057
ProjectionElem::Subslice {from, to} =>

src/librustdoc/html/render.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2962,7 +2962,15 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
29622962
write!(w, "<code>")?;
29632963
render_assoc_item(w, item, link.anchor(&id), ItemType::Impl)?;
29642964
write!(w, "</code>")?;
2965-
render_stability_since_raw(w, item.stable_since(), outer_version)?;
2965+
if let Some(l) = (Item { cx, item }).src_href() {
2966+
write!(w, "</span><span class='out-of-band'>")?;
2967+
write!(w, "<div class='ghost'></div>")?;
2968+
render_stability_since_raw(w, item.stable_since(), outer_version)?;
2969+
write!(w, "<a class='srclink' href='{}' title='{}'>[src]</a>",
2970+
l, "goto source code")?;
2971+
} else {
2972+
render_stability_since_raw(w, item.stable_since(), outer_version)?;
2973+
}
29662974
write!(w, "</span></h4>\n")?;
29672975
}
29682976
}

src/librustdoc/html/static/rustdoc.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,10 @@ h3.impl > .out-of-band {
297297
font-size: 21px;
298298
}
299299

300+
h4.method > .out-of-band {
301+
font-size: 19px;
302+
}
303+
300304
h4 > code, h3 > code, .invisible > code {
301305
position: inherit;
302306
}

0 commit comments

Comments
 (0)