Auto merge of #49460 - kennytm:rollup, r=kennytm
Rollup of 12 pull requests - Successful merges: #49243, #49329, #49364, #49400, #49405, #49427, #49428, #49429, #49439, #49442, #49444, #49452 - Failed merges:
This commit is contained in:
commit
d52c44ea8d
35 changed files with 472 additions and 158 deletions
|
|
@ -8,7 +8,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// no-system-llvm -- needs MCSubtargetInfo::getFeatureTable()
|
||||
// min-llvm-version 6.0
|
||||
// ^ needs MCSubtargetInfo::checkFeatures()
|
||||
// ignore-cloudabi no std::env
|
||||
|
||||
#![feature(cfg_target_feature)]
|
||||
|
|
@ -29,4 +30,7 @@ fn main() {
|
|||
assert!(cfg!(target_feature = "sse2"),
|
||||
"SSE2 was not detected as available on an x86 platform");
|
||||
}
|
||||
// check a negative case too -- whitelisted on x86, but not enabled by default
|
||||
assert!(cfg!(not(target_feature = "avx2")),
|
||||
"AVX2 shouldn't be detected as available by default on any platform");
|
||||
}
|
||||
|
|
|
|||
37
src/test/rustdoc/auxiliary/extern-impl-trait.rs
Normal file
37
src/test/rustdoc/auxiliary/extern-impl-trait.rs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
pub trait Foo {
|
||||
type Associated;
|
||||
}
|
||||
|
||||
pub struct X;
|
||||
pub struct Y;
|
||||
|
||||
|
||||
impl Foo for X {
|
||||
type Associated = ();
|
||||
}
|
||||
|
||||
impl Foo for Y {
|
||||
type Associated = ();
|
||||
}
|
||||
|
||||
impl X {
|
||||
pub fn returns_sized<'a>(&'a self) -> impl Foo<Associated=()> + 'a {
|
||||
X
|
||||
}
|
||||
}
|
||||
|
||||
impl Y {
|
||||
pub fn returns_unsized<'a>(&'a self) -> Box<impl ?Sized + Foo<Associated=()> + 'a> {
|
||||
Box::new(X)
|
||||
}
|
||||
}
|
||||
21
src/test/rustdoc/extern-impl-trait.rs
Normal file
21
src/test/rustdoc/extern-impl-trait.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// aux-build:extern-impl-trait.rs
|
||||
|
||||
#![crate_name = "foo"]
|
||||
|
||||
extern crate extern_impl_trait;
|
||||
|
||||
// @has 'foo/struct.X.html' '//code' "impl Foo<Associated = ()> + 'a"
|
||||
pub use extern_impl_trait::X;
|
||||
|
||||
// @has 'foo/struct.Y.html' '//code' "impl ?Sized + Foo<Associated = ()> + 'a"
|
||||
pub use extern_impl_trait::Y;
|
||||
|
|
@ -30,7 +30,7 @@ mod foo {
|
|||
}
|
||||
|
||||
// @has complex/struct.NotOuter.html
|
||||
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/*/code' "impl<'a, T, K: \
|
||||
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//*/code' "impl<'a, T, K: \
|
||||
// ?Sized> Send for NotOuter<'a, T, K> where K: for<'b> Fn((&'b bool, &'a u8)) \
|
||||
// -> &'b i8, T: MyTrait<'a>, <T as MyTrait<'a>>::MyItem: Copy, 'a: 'static"
|
||||
|
||||
|
|
|
|||
|
|
@ -18,10 +18,10 @@ where
|
|||
{}
|
||||
|
||||
// @has lifetimes/struct.Foo.html
|
||||
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/*/code' "impl<'c, K> Send \
|
||||
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//*/code' "impl<'c, K> Send \
|
||||
// for Foo<'c, K> where K: for<'b> Fn(&'b bool) -> &'c u8, 'c: 'static"
|
||||
//
|
||||
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/*/code' "impl<'c, K> Sync \
|
||||
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//*/code' "impl<'c, K> Sync \
|
||||
// for Foo<'c, K> where K: Sync"
|
||||
pub struct Foo<'c, K: 'c> {
|
||||
inner_field: Inner<'c, K>,
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@
|
|||
// except according to those terms.
|
||||
|
||||
// @has manual/struct.Foo.html
|
||||
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/*/code' 'impl<T> Sync for \
|
||||
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//*/code' 'impl<T> Sync for \
|
||||
// Foo<T> where T: Sync'
|
||||
//
|
||||
// @has - '//*[@id="implementations-list"]/*[@class="impl"]/*/code' \
|
||||
// @has - '//*[@id="implementations-list"]/*[@class="impl"]//*/code' \
|
||||
// 'impl<T> Send for Foo<T>'
|
||||
//
|
||||
// @count - '//*[@id="implementations-list"]/*[@class="impl"]' 1
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ pub struct Inner<T: Copy> {
|
|||
}
|
||||
|
||||
// @has negative/struct.Outer.html
|
||||
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/*/code' "impl<T> !Send for \
|
||||
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//*/code' "impl<T> !Send for \
|
||||
// Outer<T>"
|
||||
//
|
||||
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/*/code' "impl<T> \
|
||||
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//*/code' "impl<T> \
|
||||
// !Sync for Outer<T>"
|
||||
pub struct Outer<T: Copy> {
|
||||
inner_field: Inner<T>,
|
||||
|
|
|
|||
|
|
@ -18,10 +18,10 @@ where
|
|||
}
|
||||
|
||||
// @has nested/struct.Foo.html
|
||||
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/*/code' 'impl<T> Send for \
|
||||
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//*/code' 'impl<T> Send for \
|
||||
// Foo<T> where T: Copy'
|
||||
//
|
||||
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/*/code' \
|
||||
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//*/code' \
|
||||
// 'impl<T> Sync for Foo<T> where T: Sync'
|
||||
pub struct Foo<T> {
|
||||
inner_field: Inner<T>,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ where
|
|||
}
|
||||
|
||||
// @has no_redundancy/struct.Outer.html
|
||||
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/*/code' "impl<T> Send for \
|
||||
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//*/code' "impl<T> Send for \
|
||||
// Outer<T> where T: Copy + Send"
|
||||
pub struct Outer<T> {
|
||||
inner_field: Inner<T>,
|
||||
|
|
|
|||
|
|
@ -33,10 +33,10 @@ where
|
|||
}
|
||||
|
||||
// @has project/struct.Foo.html
|
||||
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/*/code' "impl<'c, K> Send \
|
||||
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//*/code' "impl<'c, K> Send \
|
||||
// for Foo<'c, K> where K: MyTrait<MyItem = bool>, 'c: 'static"
|
||||
//
|
||||
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]/*/code' "impl<'c, K> Sync \
|
||||
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//*/code' "impl<'c, K> Sync \
|
||||
// for Foo<'c, K> where K: MyTrait, <K as MyTrait>::MyItem: OtherTrait, 'c: 'static,"
|
||||
pub struct Foo<'c, K: 'c> {
|
||||
inner_field: Inner<'c, K>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue