]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/auto-trait-leakage2.rs
Rollup merge of #105795 - nicholasbishop:bishop-stabilize-efiapi, r=joshtriplett
[rust.git] / tests / ui / type-alias-impl-trait / auto-trait-leakage2.rs
1 #![feature(type_alias_impl_trait)]
2 #![allow(dead_code)]
3
4 mod m {
5     use std::rc::Rc;
6
7     type Foo = impl std::fmt::Debug; //~ NOTE appears within the type
8     //~^ within this `Foo`
9     //~| expansion of desugaring
10
11     pub fn foo() -> Foo {
12         Rc::new(22_u32)
13     }
14 }
15
16 fn is_send<T: Send>(_: T) {}
17 //~^ required by this bound
18 //~| required by a bound
19
20 fn main() {
21     is_send(m::foo());
22     //~^ ERROR: `Rc<u32>` cannot be sent between threads safely [E0277]
23     //~| NOTE cannot be sent
24     //~| NOTE required by a bound
25 }