Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
mu001999 committed Dec 22, 2023
1 parent 4830325 commit d3f466a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
4 changes: 1 addition & 3 deletions tests/ui/entry-point/return-ty-has-bound-vars.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// issue-119209

type Foo<'a> = impl PartialEq; //~ERROR `impl Trait` in type aliases is unstable

fn main<'a>(_: &'a i32) -> Foo<'a> {} //~ERROR `main` function return type is not allowed to have generic parameters
fn main<'a>(_: &'a i32) -> &'a () { &() } //~ERROR `main` function return type is not allowed to have generic parameters
20 changes: 5 additions & 15 deletions tests/ui/entry-point/return-ty-has-bound-vars.stderr
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/return-ty-has-bound-vars.rs:3:16
|
LL | type Foo<'a> = impl PartialEq;
| ^^^^^^^^^^^^^^
|
= note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable

error[E0131]: `main` function return type is not allowed to have generic parameters
--> $DIR/return-ty-has-bound-vars.rs:5:28
--> $DIR/return-ty-has-bound-vars.rs:3:28
|
LL | fn main<'a>(_: &'a i32) -> Foo<'a> {}
| ^^^^^^^
LL | fn main<'a>(_: &'a i32) -> &'a () { &() }
| ^^^^^^

error: aborting due to 2 previous errors
error: aborting due to 1 previous error

Some errors have detailed explanations: E0131, E0658.
For more information about an error, try `rustc --explain E0131`.
For more information about this error, try `rustc --explain E0131`.

0 comments on commit d3f466a

Please sign in to comment.