Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constants should not require 'static bound for their typeparams #33573

Closed
nagisa opened this issue May 11, 2016 · 0 comments
Closed

Constants should not require 'static bound for their typeparams #33573

nagisa opened this issue May 11, 2016 · 0 comments
Labels
A-associated-items Area: Associated items such as associated types and consts.

Comments

@nagisa
Copy link
Member

nagisa commented May 11, 2016

Code like

trait Lattice {
    const BOTTOM: Self;
}

impl<T> Lattice for Option<T> {
    const BOTTOM: Option<T> = None;
}

fails to compile (after #33572) despite being “just” all-right because compiler demands for a 'static lifetime on T, which is completely unnecessary (constants are instantiated inline).

Expected results: should compile.

@nagisa nagisa changed the title Constants should not require 'static bount for their typeparams Constants should not require 'static bound for their typeparams May 12, 2016
@nagisa nagisa added the A-associated-items Area: Associated items such as associated types and consts. label May 16, 2016
bors added a commit that referenced this issue May 22, 2017
…-const-ty-refs, r=eddyb

Remove 'static bound in assoc const test.

Types do not have to be `'static` to be referenced in
associated consts.

Fixes #33573.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-associated-items Area: Associated items such as associated types and consts.
Projects
None yet
Development

No branches or pull requests

1 participant