Skip to content

Warning shown despite --cap-lints=allow: E0122 "trait bounds are not (yet) enforced in type definitions" #43134

Closed
@SimonSapin

Description

@SimonSapin

Test case:

type Foo<T: Clone> = Option<T>;

fn main() {}

With rustc 1.20.0-nightly (696412d 2017-07-06), output when compiling with --cap-lints=allow:

warning[E0122]: trait bounds are not (yet) enforced in type definitions
 --> a.rs:1:1
  |
1 | type Foo<T: Clone> = Option<T>;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--cap-lints=allow correctly stops the dead code / unused type alias warning from being shown, but the trait bounds not enforced warning is shown anyway.

Per #34596 and #40640 (comment), this might be on purpose. I think this is the wrong decision. The point of cap-lints is to allow Cargo to inhibit warnings in external dependencies. When building Servo it is not useful to spam the console with many warnings, future-proofing or not, about code that Servo has not direct control over.

CC @nikomatsakis @aturon

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language 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