-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #53588 - tristanburgess:52985_diagnostics_no_concrete_t…
…ype_behind_existential_type, r=oli-obk 52985 diagnostics no concrete type behind existential type @oli-obk FYI. See below for new cycle error generated. ```rust error[E0391]: cycle detected when processing `Foo` --> /dev/staging/existential_type_no_concrete_type_nouse_potential.rs:3:1 | 3 | existential type Foo: Copy; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: ...which requires processing `bar`... --> /dev/staging/existential_type_no_concrete_type_nouse_potential.rs:6:23 | 6 | fn bar(x: Foo) -> Foo { | _______________________^ 7 | | x 8 | | } | |_^ = note: ...which again requires processing `Foo`, completing the cycle error: aborting due to previous error For more information about this error, try `rustc --explain E0391`. ```
- Loading branch information
Showing
4 changed files
with
95 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// 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. | ||
|
||
#![feature(existential_type)] | ||
// compile-pass | ||
mod my_mod { | ||
use std::fmt::Debug; | ||
|
||
pub existential type Foo: Debug; | ||
pub existential type Foot: Debug; | ||
|
||
pub fn get_foo() -> Foo { | ||
5i32 | ||
} | ||
|
||
pub fn get_foot() -> Foot { | ||
get_foo() | ||
} | ||
} | ||
|
||
fn main() { | ||
let _: my_mod::Foot = my_mod::get_foot(); | ||
} | ||
|
9 changes: 7 additions & 2 deletions
9
src/test/ui/existential_types/no_inferrable_concrete_type.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters