Skip to content

Commit 5891a64

Browse files
Merge pull request #4 from rust-lang/master
sync with upstream
2 parents fa76d42 + 42f401d commit 5891a64

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+767
-504
lines changed

src/Cargo.lock

+11-10
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ dependencies = [
204204
"env_logger 0.5.12 (registry+https://github.com/rust-lang/crates.io-index)",
205205
"failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
206206
"filetime 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
207-
"flate2 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
207+
"flate2 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
208208
"fs2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
209209
"fwdansi 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
210210
"git2 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -737,7 +737,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
737737

738738
[[package]]
739739
name = "flate2"
740-
version = "1.0.2"
740+
version = "1.0.3"
741741
source = "registry+https://github.com/rust-lang/crates.io-index"
742742
dependencies = [
743743
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -959,7 +959,7 @@ version = "0.0.0"
959959
dependencies = [
960960
"clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
961961
"error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
962-
"flate2 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
962+
"flate2 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
963963
"lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
964964
"rayon 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
965965
"tar 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1649,7 +1649,7 @@ dependencies = [
16491649

16501650
[[package]]
16511651
name = "racer"
1652-
version = "2.1.6"
1652+
version = "2.1.7"
16531653
source = "registry+https://github.com/rust-lang/crates.io-index"
16541654
dependencies = [
16551655
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1797,7 +1797,7 @@ dependencies = [
17971797
"log 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
17981798
"num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
17991799
"ordslice 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
1800-
"racer 2.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
1800+
"racer 2.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
18011801
"rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
18021802
"rayon 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
18031803
"regex 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1814,6 +1814,7 @@ dependencies = [
18141814
"serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)",
18151815
"serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)",
18161816
"serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)",
1817+
"toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
18171818
"url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
18181819
"walkdir 2.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
18191820
]
@@ -1889,7 +1890,7 @@ dependencies = [
18891890
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
18901891
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
18911892
"chalk-engine 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
1892-
"flate2 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
1893+
"flate2 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
18931894
"fmt_macros 0.0.0",
18941895
"graphviz 0.0.0",
18951896
"jobserver 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2133,7 +2134,7 @@ dependencies = [
21332134
name = "rustc_codegen_utils"
21342135
version = "0.0.0"
21352136
dependencies = [
2136-
"flate2 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
2137+
"flate2 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
21372138
"log 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
21382139
"rustc 0.0.0",
21392140
"rustc_data_structures 0.0.0",
@@ -2276,7 +2277,7 @@ dependencies = [
22762277
name = "rustc_metadata"
22772278
version = "0.0.0"
22782279
dependencies = [
2279-
"flate2 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
2280+
"flate2 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
22802281
"log 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
22812282
"proc_macro 0.0.0",
22822283
"rustc 0.0.0",
@@ -3222,7 +3223,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
32223223
"checksum failure_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "946d0e98a50d9831f5d589038d2ca7f8f455b1c21028c0db0e84116a12696426"
32233224
"checksum filetime 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "da4b9849e77b13195302c174324b5ba73eec9b236b24c221a61000daefb95c5f"
32243225
"checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33"
3225-
"checksum flate2 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "37847f133aae7acf82bb9577ccd8bda241df836787642654286e79679826a54b"
3226+
"checksum flate2 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4af030962d89d62aa52cd9492083b1cd9b2d1a77764878102a6c0f86b4d5444d"
32263227
"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3"
32273228
"checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
32283229
"checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
@@ -3319,7 +3320,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
33193320
"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
33203321
"checksum quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8"
33213322
"checksum quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dd636425967c33af890042c483632d33fa7a18f19ad1d7ea72e8998c6ef8dea5"
3322-
"checksum racer 2.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "99e820b7f7701c834c3f6f8226f388c19c0ea948a3ef79ddc96aa7398b5ba87a"
3323+
"checksum racer 2.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0beefbfaed799c3554021a48856113ad53862311395f6d75376192884ba5fbe6"
33233324
"checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd"
33243325
"checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c"
33253326
"checksum rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "edecf0f94da5551fc9b492093e30b041a891657db7940ee221f9d2f66e82eef2"

src/bootstrap/dist.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1263,14 +1263,16 @@ impl Step for Clippy {
12631263
builder.install(&cargoclippy, &image.join("bin"), 0o755);
12641264
let doc = image.join("share/doc/clippy");
12651265
builder.install(&src.join("README.md"), &doc, 0o644);
1266-
builder.install(&src.join("LICENSE"), &doc, 0o644);
1266+
builder.install(&src.join("LICENSE-APACHE"), &doc, 0o644);
1267+
builder.install(&src.join("LICENSE-MIT"), &doc, 0o644);
12671268

12681269
// Prepare the overlay
12691270
let overlay = tmp.join("clippy-overlay");
12701271
drop(fs::remove_dir_all(&overlay));
12711272
t!(fs::create_dir_all(&overlay));
12721273
builder.install(&src.join("README.md"), &overlay, 0o644);
1273-
builder.install(&src.join("LICENSE"), &doc, 0o644);
1274+
builder.install(&src.join("LICENSE-APACHE"), &doc, 0o644);
1275+
builder.install(&src.join("LICENSE-MIT"), &doc, 0o644);
12741276
builder.create(&overlay.join("version"), &version);
12751277

12761278
// Generate the installer tarball

src/bootstrap/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1288,6 +1288,9 @@ impl Build {
12881288
t!(fs::create_dir_all(dstdir));
12891289
drop(fs::remove_file(&dst));
12901290
{
1291+
if !src.exists() {
1292+
panic!("Error: File \"{}\" not found!", src.display());
1293+
}
12911294
let mut s = t!(fs::File::open(&src));
12921295
let mut d = t!(fs::File::create(&dst));
12931296
io::copy(&mut s, &mut d).expect("failed to copy");

src/liballoc/fmt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
//! Additionally, the return value of this function is [`fmt::Result`] which is a
153153
//! type alias of [`Result`]`<(), `[`std::fmt::Error`]`>`. Formatting implementations
154154
//! should ensure that they propagate errors from the [`Formatter`][`Formatter`] (e.g., when
155-
//! calling [`write!`]) however, they should never return errors spuriously. That
155+
//! calling [`write!`]). However, they should never return errors spuriously. That
156156
//! is, a formatting implementation must and may only return an error if the
157157
//! passed-in [`Formatter`] returns an error. This is because, contrary to what
158158
//! the function signature might suggest, string formatting is an infallible

src/liballoc/rc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ impl<T: ?Sized> Clone for Rc<T> {
867867
///
868868
/// let five = Rc::new(5);
869869
///
870-
/// Rc::clone(&five);
870+
/// let _ = Rc::clone(&five);
871871
/// ```
872872
#[inline]
873873
fn clone(&self) -> Rc<T> {
@@ -1304,7 +1304,7 @@ impl<T: ?Sized> Clone for Weak<T> {
13041304
///
13051305
/// let weak_five = Rc::downgrade(&Rc::new(5));
13061306
///
1307-
/// Weak::clone(&weak_five);
1307+
/// let _ = Weak::clone(&weak_five);
13081308
/// ```
13091309
#[inline]
13101310
fn clone(&self) -> Weak<T> {

src/liballoc/sync.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ impl<T: ?Sized> Clone for Arc<T> {
713713
///
714714
/// let five = Arc::new(5);
715715
///
716-
/// Arc::clone(&five);
716+
/// let _ = Arc::clone(&five);
717717
/// ```
718718
#[inline]
719719
fn clone(&self) -> Arc<T> {
@@ -1135,7 +1135,7 @@ impl<T: ?Sized> Clone for Weak<T> {
11351135
///
11361136
/// let weak_five = Arc::downgrade(&Arc::new(5));
11371137
///
1138-
/// Weak::clone(&weak_five);
1138+
/// let _ = Weak::clone(&weak_five);
11391139
/// ```
11401140
#[inline]
11411141
fn clone(&self) -> Weak<T> {

src/librustc/traits/coherence.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,7 @@ fn fundamental_ty(tcx: TyCtxt<'_, '_, '_>, ty: Ty<'_>) -> bool {
418418
match ty.sty {
419419
ty::Ref(..) => true,
420420
ty::Adt(def, _) => def.is_fundamental(),
421-
ty::Dynamic(ref data, ..) => {
422-
data.principal().map_or(false, |p| tcx.has_attr(p.def_id(), "fundamental"))
423-
}
421+
ty::Dynamic(ref data, ..) => tcx.has_attr(data.principal().def_id(), "fundamental"),
424422
_ => false
425423
}
426424
}
@@ -467,11 +465,7 @@ fn ty_is_local_constructor(ty: Ty<'_>, in_crate: InCrate) -> bool {
467465
ty::Adt(def, _) => def_id_is_local(def.did, in_crate),
468466
ty::Foreign(did) => def_id_is_local(did, in_crate),
469467

470-
ty::Dynamic(ref tt, ..) => {
471-
tt.principal().map_or(false, |p|
472-
def_id_is_local(p.def_id(), in_crate)
473-
)
474-
}
468+
ty::Dynamic(ref tt, ..) => def_id_is_local(tt.principal().def_id(), in_crate),
475469

476470
ty::Error => true,
477471

src/librustc/traits/select.rs

+8-19
Original file line numberDiff line numberDiff line change
@@ -2088,10 +2088,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
20882088
return;
20892089
}
20902090

2091-
match data.principal() {
2092-
Some(p) => p.with_self_ty(this.tcx(), self_ty),
2093-
None => return,
2094-
}
2091+
data.principal().with_self_ty(this.tcx(), self_ty)
20952092
}
20962093
ty::Infer(ty::TyVar(_)) => {
20972094
debug!("assemble_candidates_from_object_ty: ambiguous");
@@ -2183,15 +2180,10 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
21832180
//
21842181
// We always upcast when we can because of reason
21852182
// #2 (region bounds).
2186-
match (data_a.principal(), data_b.principal()) {
2187-
(Some(a), Some(b)) => {
2188-
a.def_id() == b.def_id()
2189-
&& data_b.auto_traits()
2190-
// All of a's auto traits need to be in b's auto traits.
2191-
.all(|b| data_a.auto_traits().any(|a| a == b))
2192-
}
2193-
_ => false,
2194-
}
2183+
data_a.principal().def_id() == data_b.principal().def_id()
2184+
&& data_b.auto_traits()
2185+
// All of a's auto traits need to be in b's auto traits.
2186+
.all(|b| data_a.auto_traits().any(|a| a == b))
21952187
}
21962188

21972189
// T -> Trait.
@@ -2981,7 +2973,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
29812973
.shallow_resolve(*obligation.self_ty().skip_binder());
29822974
let poly_trait_ref = match self_ty.sty {
29832975
ty::Dynamic(ref data, ..) => {
2984-
data.principal().unwrap().with_self_ty(self.tcx(), self_ty)
2976+
data.principal().with_self_ty(self.tcx(), self_ty)
29852977
}
29862978
_ => span_bug!(obligation.cause.span, "object candidate with non-object"),
29872979
};
@@ -3244,10 +3236,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
32443236
(&ty::Dynamic(ref data_a, r_a), &ty::Dynamic(ref data_b, r_b)) => {
32453237
// See assemble_candidates_for_unsizing for more info.
32463238
let existential_predicates = data_a.map_bound(|data_a| {
3247-
let principal = data_a.principal();
3248-
let iter = principal
3249-
.into_iter()
3250-
.map(ty::ExistentialPredicate::Trait)
3239+
let iter = iter::once(ty::ExistentialPredicate::Trait(data_a.principal()))
32513240
.chain(
32523241
data_a
32533242
.projection_bounds()
@@ -3285,7 +3274,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
32853274
// T -> Trait.
32863275
(_, &ty::Dynamic(ref data, r)) => {
32873276
let mut object_dids = data.auto_traits()
3288-
.chain(data.principal().map(|p| p.def_id()));
3277+
.chain(iter::once(data.principal().def_id()));
32893278
if let Some(did) = object_dids.find(|did| !tcx.is_object_safe(*did)) {
32903279
return Err(TraitNotObjectSafe(did));
32913280
}

src/librustc/ty/error.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,7 @@ impl<'a, 'gcx, 'lcx, 'tcx> ty::TyS<'tcx> {
208208
ty::FnDef(..) => "fn item".into(),
209209
ty::FnPtr(_) => "fn pointer".into(),
210210
ty::Dynamic(ref inner, ..) => {
211-
inner.principal().map_or_else(|| "trait".into(),
212-
|p| format!("trait {}", tcx.item_path_str(p.def_id())).into())
211+
format!("trait {}", tcx.item_path_str(inner.principal().def_id())).into()
213212
}
214213
ty::Closure(..) => "closure".into(),
215214
ty::Generator(..) => "generator".into(),

src/librustc/ty/fast_reject.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pub fn simplify_type<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
7878
ty::Array(..) | ty::Slice(_) => Some(ArraySimplifiedType),
7979
ty::RawPtr(_) => Some(PtrSimplifiedType),
8080
ty::Dynamic(ref trait_info, ..) => {
81-
trait_info.principal().map(|p| TraitSimplifiedType(p.def_id()))
81+
Some(TraitSimplifiedType(trait_info.principal().def_id()))
8282
}
8383
ty::Ref(_, ty, _) => {
8484
// since we introduce auto-refs during method lookup, we

src/librustc/ty/item_path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ pub fn characteristic_def_id_of_type(ty: Ty<'_>) -> Option<DefId> {
436436
match ty.sty {
437437
ty::Adt(adt_def, _) => Some(adt_def.did),
438438

439-
ty::Dynamic(data, ..) => data.principal().map(|p| p.def_id()),
439+
ty::Dynamic(data, ..) => Some(data.principal().def_id()),
440440

441441
ty::Array(subty, _) |
442442
ty::Slice(subty) => characteristic_def_id_of_type(subty),

src/librustc/ty/sty.rs

+7-9
Original file line numberDiff line numberDiff line change
@@ -559,10 +559,10 @@ impl<'a, 'gcx, 'tcx> Binder<ExistentialPredicate<'tcx>> {
559559
impl<'tcx> serialize::UseSpecializedDecodable for &'tcx List<ExistentialPredicate<'tcx>> {}
560560

561561
impl<'tcx> List<ExistentialPredicate<'tcx>> {
562-
pub fn principal(&self) -> Option<ExistentialTraitRef<'tcx>> {
563-
match self.get(0) {
564-
Some(&ExistentialPredicate::Trait(tr)) => Some(tr),
565-
_ => None,
562+
pub fn principal(&self) -> ExistentialTraitRef<'tcx> {
563+
match self[0] {
564+
ExistentialPredicate::Trait(tr) => tr,
565+
other => bug!("first predicate is {:?}", other),
566566
}
567567
}
568568

@@ -589,8 +589,8 @@ impl<'tcx> List<ExistentialPredicate<'tcx>> {
589589
}
590590

591591
impl<'tcx> Binder<&'tcx List<ExistentialPredicate<'tcx>>> {
592-
pub fn principal(&self) -> Option<PolyExistentialTraitRef<'tcx>> {
593-
self.skip_binder().principal().map(Binder::bind)
592+
pub fn principal(&self) -> PolyExistentialTraitRef<'tcx> {
593+
Binder::bind(self.skip_binder().principal())
594594
}
595595

596596
#[inline]
@@ -1825,9 +1825,7 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
18251825
}
18261826
Dynamic(ref obj, region) => {
18271827
let mut v = vec![region];
1828-
if let Some(p) = obj.principal() {
1829-
v.extend(p.skip_binder().substs.regions());
1830-
}
1828+
v.extend(obj.principal().skip_binder().substs.regions());
18311829
v
18321830
}
18331831
Adt(_, substs) | Opaque(_, substs) => {

src/librustc/ty/wf.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ impl<'a, 'gcx, 'tcx> WfPredicates<'a, 'gcx, 'tcx> {
387387

388388
let cause = self.cause(traits::MiscObligation);
389389
let component_traits =
390-
data.auto_traits().chain(data.principal().map(|p| p.def_id()));
390+
data.auto_traits().chain(once(data.principal().def_id()));
391391
self.out.extend(
392392
component_traits.map(|did| traits::Obligation::new(
393393
cause.clone(),

src/librustc/util/ppaux.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -621,16 +621,16 @@ define_print! {
621621
// Use a type that can't appear in defaults of type parameters.
622622
let dummy_self = tcx.mk_infer(ty::FreshTy(0));
623623

624-
if let Some(p) = self.principal() {
625-
let principal = tcx.lift(&p).expect("could not lift TraitRef for printing")
626-
.with_self_ty(tcx, dummy_self);
627-
let projections = self.projection_bounds().map(|p| {
628-
tcx.lift(&p)
629-
.expect("could not lift projection for printing")
630-
.with_self_ty(tcx, dummy_self)
631-
}).collect::<Vec<_>>();
632-
cx.parameterized(f, principal.substs, principal.def_id, &projections)?;
633-
}
624+
let principal = tcx
625+
.lift(&self.principal())
626+
.expect("could not lift TraitRef for printing")
627+
.with_self_ty(tcx, dummy_self);
628+
let projections = self.projection_bounds().map(|p| {
629+
tcx.lift(&p)
630+
.expect("could not lift projection for printing")
631+
.with_self_ty(tcx, dummy_self)
632+
}).collect::<Vec<_>>();
633+
cx.parameterized(f, principal.substs, principal.def_id, &projections)?;
634634

635635
// Builtin bounds.
636636
for did in self.auto_traits() {

src/librustc_codegen_llvm/abi.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,10 @@ impl<'tcx> FnTypeExt<'tcx> for FnType<'tcx, Ty<'tcx>> {
536536
// Note that the platform intrinsic ABI is exempt here as
537537
// that's how we connect up to LLVM and it's unstable
538538
// anyway, we control all calls to it in libstd.
539-
layout::Abi::Vector { .. } if abi != Abi::PlatformIntrinsic => {
539+
layout::Abi::Vector { .. }
540+
if abi != Abi::PlatformIntrinsic &&
541+
cx.sess().target.target.options.simd_types_indirect =>
542+
{
540543
arg.make_indirect();
541544
return
542545
}

src/librustc_codegen_llvm/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub struct CodegenCx<'a, 'tcx: 'a> {
5959
/// Cache instances of monomorphic and polymorphic items
6060
pub instances: RefCell<FxHashMap<Instance<'tcx>, &'a Value>>,
6161
/// Cache generated vtables
62-
pub vtables: RefCell<FxHashMap<(Ty<'tcx>, Option<ty::PolyExistentialTraitRef<'tcx>>),
62+
pub vtables: RefCell<FxHashMap<(Ty<'tcx>, ty::PolyExistentialTraitRef<'tcx>),
6363
&'a Value>>,
6464
/// Cache of constant strings,
6565
pub const_cstr_cache: RefCell<FxHashMap<LocalInternedString, &'a Value>>,

0 commit comments

Comments
 (0)