Auto merge of #22851 - FlaPer87:oibit-send-and-friends, r=nikomatsakis
Fixes #22828 Fixes #22629 r? @nikomatsakis
This commit is contained in:
commit
6f8d831406
4 changed files with 114 additions and 63 deletions
20
src/test/run-pass/issue-22629.rs
Normal file
20
src/test/run-pass/issue-22629.rs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright 2015 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.
|
||||
|
||||
// Test transitive analysis for associated types. Collected types
|
||||
// should be normalized and new obligations generated.
|
||||
|
||||
use std::borrow::{ToOwned, Cow};
|
||||
|
||||
fn assert_send<T: Send>(_: T) {}
|
||||
|
||||
fn main() {
|
||||
assert_send(Cow::Borrowed("foo"));
|
||||
}
|
||||
29
src/test/run-pass/issue-22828.rs
Normal file
29
src/test/run-pass/issue-22828.rs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright 2015 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.
|
||||
|
||||
// Test transitive analysis for associated types. Collected types
|
||||
// should be normalized and new obligations generated.
|
||||
|
||||
trait Foo {
|
||||
type A;
|
||||
fn foo(&self) {}
|
||||
}
|
||||
|
||||
impl Foo for usize {
|
||||
type A = usize;
|
||||
}
|
||||
|
||||
struct Bar<T: Foo> { inner: T::A }
|
||||
|
||||
fn is_send<T: Send>() {}
|
||||
|
||||
fn main() {
|
||||
is_send::<Bar<usize>>();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue