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

ices/104779.rs: fixed with errors #1657

Merged
merged 1 commit into from
Oct 10, 2023
Merged

ices/104779.rs: fixed with errors #1657

merged 1 commit into from
Oct 10, 2023

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Sep 1, 2023

Issue: rust-lang/rust#104779

struct Inv<'a>(&'a mut &'a ());
enum Foo<T> {
    Bar,
    Var(T),
}
type Subtype = Foo<for<'a, 'b> fn(Inv<'a>, Inv<'b>)>;
type Supertype = Foo<for<'a> fn(Inv<'a>, Inv<'a>)>;

fn foo() -> impl Sized {
    loop {
        match foo() {
            Subtype::Bar => (),
            Supertype::Var(x) => {}
        }
    }
}

fn main() {}
=== stdout ===
=== stderr ===
warning: unused variable: `x`
  --> /home/runner/work/glacier/glacier/ices/104779.rs:13:28
   |
13 |             Supertype::Var(x) => {}
   |                            ^ help: if this is intentional, prefix it with an underscore: `_x`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: function cannot return without recursing
  --> /home/runner/work/glacier/glacier/ices/104779.rs:9:1
   |
9  | fn foo() -> impl Sized {
   | ^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
10 |     loop {
11 |         match foo() {
   |               ----- recursive call site
   |
   = help: a `loop` may express intention better if this is on purpose
   = note: `#[warn(unconditional_recursion)]` on by default

error: higher-ranked subtype error
  --> /home/runner/work/glacier/glacier/ices/104779.rs:11:15
   |
11 |         match foo() {
   |               ^^^^^

error: higher-ranked subtype error
  --> /home/runner/work/glacier/glacier/ices/104779.rs:12:13
   |
12 |             Subtype::Bar => (),
   |             ^^^^^^^^^^^^

error: aborting due to 2 previous errors; 2 warnings emitted

==============

=== stdout ===
=== stderr ===
warning: unused variable: `x`
  --> /home/runner/work/glacier/glacier/ices/104779.rs:13:28
   |
13 |             Supertype::Var(x) => {}
   |                            ^ help: if this is intentional, prefix it with an underscore: `_x`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: function cannot return without recursing
  --> /home/runner/work/glacier/glacier/ices/104779.rs:9:1
   |
9  | fn foo() -> impl Sized {
   | ^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
10 |     loop {
11 |         match foo() {
   |               ----- recursive call site
   |
   = help: a `loop` may express intention better if this is on purpose
   = note: `#[warn(unconditional_recursion)]` on by default

error: higher-ranked subtype error
  --> /home/runner/work/glacier/glacier/ices/104779.rs:11:15
   |
11 |         match foo() {
   |               ^^^^^

error: higher-ranked subtype error
  --> /home/runner/work/glacier/glacier/ices/104779.rs:12:13
   |
12 |             Subtype::Bar => (),
   |             ^^^^^^^^^^^^

error: aborting due to 2 previous errors; 2 warnings emitted

==============
@JohnTitor JohnTitor merged commit cdd8865 into master Oct 10, 2023
@JohnTitor JohnTitor deleted the autofix/ices/104779.rs branch October 10, 2023 14:52
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants