Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

ices/102114-1.rs: fixed with errors #1441

Merged
merged 1 commit into from
Oct 5, 2022
Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Oct 5, 2022

Issue: rust-lang/rust#102114

trait A{type B<'b>;}
struct C;
impl A for C {
    type B<b> =impl;
    fn a() -> Self::B<'a>;
}
=== stdout ===
=== stderr ===
error: at least one trait must be specified
 --> /home/runner/work/glacier/glacier/ices/102114-1.rs:4:16
  |
4 |     type B<b> =impl;
  |                ^^^^

error: associated function in `impl` without body
 --> /home/runner/work/glacier/glacier/ices/102114-1.rs:5:5
  |
5 |     fn a() -> Self::B<'a>;
  |     ^^^^^^^^^^^^^^^^^^^^^-
  |                          |
  |                          help: provide a definition for the function: `{ <body> }`

error[E0407]: method `a` is not a member of trait `A`
 --> /home/runner/work/glacier/glacier/ices/102114-1.rs:5:5
  |
5 |     fn a() -> Self::B<'a>;
  |     ^^^^^^^^^^^^^^^^^^^^^^ not a member of trait `A`

error[E0261]: use of undeclared lifetime name `'a`
 --> /home/runner/work/glacier/glacier/ices/102114-1.rs:5:23
  |
5 |     fn a() -> Self::B<'a>;
  |                       ^^ undeclared lifetime
  |
help: consider introducing lifetime `'a` here
  |
5 |     fn a<'a>() -> Self::B<'a>;
  |         ++++
help: consider introducing lifetime `'a` here
  |
3 | impl<'a> A for C {
  |     ++++

error[E0658]: `impl Trait` in type aliases is unstable
 --> /home/runner/work/glacier/glacier/ices/102114-1.rs:4:16
  |
4 |     type B<b> =impl;
  |                ^^^^
  |
  = 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

warning: type parameter `b` should have an upper camel case name
 --> /home/runner/work/glacier/glacier/ices/102114-1.rs:4:12
  |
4 |     type B<b> =impl;
  |            ^ help: convert the identifier to upper camel case: `B`
  |
  = note: `#[warn(non_camel_case_types)]` on by default

error[E0601]: `main` function not found in crate `102114_1`
 --> /home/runner/work/glacier/glacier/ices/102114-1.rs:6:2
  |
6 | }
  |  ^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/102114-1.rs`

error[E0049]: type `B` has 1 type parameter but its trait declaration has 0 type parameters
 --> /home/runner/work/glacier/glacier/ices/102114-1.rs:4:12
  |
1 | trait A{type B<'b>;}
  |                -- expected 0 type parameters
...
4 |     type B<b> =impl;
  |            ^ found 1 type parameter

error: aborting due to 7 previous errors; 1 warning emitted

Some errors have detailed explanations: E0049, E0261, E0407, E0601, E0658.
For more information about an error, try `rustc --explain E0049`.
==============

=== stdout ===
=== stderr ===
error: at least one trait must be specified
 --> /home/runner/work/glacier/glacier/ices/102114-1.rs:4:16
  |
4 |     type B<b> =impl;
  |                ^^^^

error: associated function in `impl` without body
 --> /home/runner/work/glacier/glacier/ices/102114-1.rs:5:5
  |
5 |     fn a() -> Self::B<'a>;
  |     ^^^^^^^^^^^^^^^^^^^^^-
  |                          |
  |                          help: provide a definition for the function: `{ <body> }`

error[E0407]: method `a` is not a member of trait `A`
 --> /home/runner/work/glacier/glacier/ices/102114-1.rs:5:5
  |
5 |     fn a() -> Self::B<'a>;
  |     ^^^^^^^^^^^^^^^^^^^^^^ not a member of trait `A`

error[E0261]: use of undeclared lifetime name `'a`
 --> /home/runner/work/glacier/glacier/ices/102114-1.rs:5:23
  |
5 |     fn a() -> Self::B<'a>;
  |                       ^^ undeclared lifetime
  |
help: consider introducing lifetime `'a` here
  |
5 |     fn a<'a>() -> Self::B<'a>;
  |         ++++
help: consider introducing lifetime `'a` here
  |
3 | impl<'a> A for C {
  |     ++++

error[E0658]: `impl Trait` in type aliases is unstable
 --> /home/runner/work/glacier/glacier/ices/102114-1.rs:4:16
  |
4 |     type B<b> =impl;
  |                ^^^^
  |
  = note: see issue #63063 <rust-lang/rust#63063> for more information
  = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable

warning: type parameter `b` should have an upper camel case name
 --> /home/runner/work/glacier/glacier/ices/102114-1.rs:4:12
  |
4 |     type B<b> =impl;
  |            ^ help: convert the identifier to upper camel case: `B`
  |
  = note: `#[warn(non_camel_case_types)]` on by default

error[E0601]: `main` function not found in crate `102114_1`
 --> /home/runner/work/glacier/glacier/ices/102114-1.rs:6:2
  |
6 | }
  |  ^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/102114-1.rs`

error[E0049]: type `B` has 1 type parameter but its trait declaration has 0 type parameters
 --> /home/runner/work/glacier/glacier/ices/102114-1.rs:4:12
  |
1 | trait A{type B<'b>;}
  |                -- expected 0 type parameters
...
4 |     type B<b> =impl;
  |            ^ found 1 type parameter

error: aborting due to 7 previous errors; 1 warning emitted

Some errors have detailed explanations: E0049, E0261, E0407, E0601, E0658.
For more information about an error, try `rustc --explain E0049`.
==============
@JohnTitor JohnTitor merged commit 7573116 into master Oct 5, 2022
@JohnTitor JohnTitor deleted the autofix/ices/102114-1.rs branch October 5, 2022 08:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants