Skip to content

Commit ce70207

Browse files
Ariel Ben-Yehudaarielb1
Ariel Ben-Yehuda
authored andcommitted
fix fallout
looks like some mix of #18653 and `projection_must_outlive`, but that needs to be investigated further (crater run?)
1 parent 603a75c commit ce70207

File tree

5 files changed

+8
-2
lines changed

5 files changed

+8
-2
lines changed

src/librustc/middle/ty/structural_impls.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,9 @@ impl<'tcx, A: Lift<'tcx>, B: Lift<'tcx>> Lift<'tcx> for (A, B) {
417417
impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for [T] {
418418
type Lifted = Vec<T::Lifted>;
419419
fn lift_to_tcx(&self, tcx: &ty::ctxt<'tcx>) -> Option<Self::Lifted> {
420-
let mut result = Vec::with_capacity(self.len());
420+
// type annotation needed to inform `projection_must_outlive`
421+
let mut result : Vec<<T as Lift<'tcx>>::Lifted>
422+
= Vec::with_capacity(self.len());
421423
for x in self {
422424
if let Some(value) = tcx.lift(x) {
423425
result.push(value);

src/libstd/thread/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,8 @@ impl Builder {
266266
let my_thread = Thread::new(name);
267267
let their_thread = my_thread.clone();
268268

269-
let my_packet = Arc::new(UnsafeCell::new(None));
269+
let my_packet : Arc<UnsafeCell<Option<Result<T>>>>
270+
= Arc::new(UnsafeCell::new(None));
270271
let their_packet = my_packet.clone();
271272

272273
let main = move || {

src/test/compile-fail/issue-18959.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ fn foo(b: &Bar) {
2222
b.foo(&0)
2323
//~^ ERROR the trait `Foo` is not implemented for the type `Bar`
2424
//~| ERROR E0038
25+
//~| WARNING E0038
2526
}
2627

2728
fn main() {

src/test/compile-fail/object-safety-issue-22040.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ struct SExpr<'x> {
2626
impl<'x> PartialEq for SExpr<'x> {
2727
fn eq(&self, other:&SExpr<'x>) -> bool {
2828
println!("L1: {} L2: {}", self.elements.len(), other.elements.len());
29+
2930
let result = self.elements.len() == other.elements.len();
3031

3132
println!("Got compare {}", result);

src/test/compile-fail/trait-test-2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ fn main() {
2121
//~^ ERROR E0038
2222
//~| ERROR E0038
2323
//~| ERROR E0277
24+
//~| WARNING E0038
2425
}

0 commit comments

Comments
 (0)