Skip to content

"exceeding_bitshifts" lint does not work in associated consts #69021

@RalfJung

Description

@RalfJung

The exceeding_bitshifts lint should fire on the following code, but it does not:

pub trait Foo {
    const N: i32;
}

impl<T: Foo> Foo for Vec<T> {
    const N: i32 = T::N << 42; // no warning here
}

Playground
(This testcase now exists in-tree as a FIXME in ui/lint/lint-exceeding-bitshifts.rs.)

Cc @oli-obk @wesleywiser

This issue has been assigned to @jumbatm via this comment.

Metadata

Metadata

Assignees

Labels

A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions