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

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#67739

#![allow(incomplete_features)]
#![feature(const_generics)]

use std::mem;

pub trait Trait {
    type Associated : Sized;

    fn associated_size(&self) -> usize {
        [0u8; mem::size_of::<Self::Associated>()];
        0   
    }   
}

fn main() {}
=== stdout ===
=== stderr ===
error: array lengths can't depend on generic parameters
  --> /home/runner/work/glacier/glacier/ices/67739.rs:10:15
   |
10 |         [0u8; mem::size_of::<Self::Associated>()];
   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

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

=== stdout ===
=== stderr ===
error: array lengths can't depend on generic parameters
  --> /home/runner/work/glacier/glacier/ices/67739.rs:10:15
   |
10 |         [0u8; mem::size_of::<Self::Associated>()];
   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

==============
Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a comment to the issue, marked as fixed.

@JohnTitor JohnTitor merged commit 34bcb28 into master Mar 12, 2020
@JohnTitor JohnTitor deleted the autofix/ices/67739.rs branch March 12, 2020 12:17
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