Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bb8c991
commit 93ac5bc
Showing
18 changed files
with
291 additions
and
157 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,9 @@ | ||
struct AlanTuring<T>(T); | ||
const fn no_rpit2() -> AlanTuring<impl std::fmt::Debug> { | ||
//~^ ERROR `impl Trait` in const fn is unstable | ||
AlanTuring(0) | ||
} | ||
|
||
const fn no_rpit() -> impl std::fmt::Debug {} //~ ERROR `impl Trait` in const fn is unstable | ||
|
||
fn main() {} |
21 changes: 21 additions & 0 deletions
21
src/test/ui/consts/min_const_fn/min_const_fn_impl_trait.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
error[E0723]: `impl Trait` in const fn is unstable | ||
--> $DIR/min_const_fn_impl_trait.rs:2:24 | ||
| | ||
LL | const fn no_rpit2() -> AlanTuring<impl std::fmt::Debug> { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information | ||
= help: add `#![feature(const_fn)]` to the crate attributes to enable | ||
|
||
error[E0723]: `impl Trait` in const fn is unstable | ||
--> $DIR/min_const_fn_impl_trait.rs:7:23 | ||
| | ||
LL | const fn no_rpit() -> impl std::fmt::Debug {} | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information | ||
= help: add `#![feature(const_fn)]` to the crate attributes to enable | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0723`. |
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 |
---|---|---|
@@ -1,9 +1,10 @@ | ||
trait Trait<'a, 'b> { } | ||
trait Trait<'a, 'b> {} | ||
impl<T> Trait<'_, '_> for T {} | ||
|
||
fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Trait<'a, 'b> { | ||
//~^ ERROR ambiguous lifetime bound | ||
//~| ERROR ambiguous lifetime bound | ||
(x, y) | ||
} | ||
|
||
fn main() { } | ||
fn main() {} |
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
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
Oops, something went wrong.