0c0dfb88ee
as request T-lang is requesting some major changes in the lint inner workings in #126768#issuecomment-2192634762
56 lines
849 B
Rust
56 lines
849 B
Rust
//@ check-pass
|
|
//@ edition:2021
|
|
|
|
#![warn(non_local_definitions)]
|
|
|
|
use std::fmt::Debug;
|
|
|
|
trait GlobalTrait {}
|
|
|
|
fn main() {
|
|
struct InsideMain;
|
|
|
|
impl InsideMain {
|
|
fn foo() {}
|
|
}
|
|
|
|
impl GlobalTrait for InsideMain {}
|
|
|
|
impl Debug for InsideMain {
|
|
fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
todo!()
|
|
}
|
|
}
|
|
|
|
impl PartialEq<()> for InsideMain {
|
|
fn eq(&self, _: &()) -> bool {
|
|
todo!()
|
|
}
|
|
}
|
|
}
|
|
|
|
fn dyn_weirdness() {
|
|
trait LocalTrait {}
|
|
impl dyn LocalTrait {}
|
|
impl GlobalTrait for dyn LocalTrait {}
|
|
}
|
|
|
|
struct Test;
|
|
mod do_not_lint_mod {
|
|
pub trait Tait {}
|
|
|
|
impl super::Test {
|
|
fn hugo() {}
|
|
}
|
|
|
|
impl Tait for super::Test {}
|
|
}
|
|
|
|
fn bitflags() {
|
|
struct Flags;
|
|
|
|
const _: () = {
|
|
impl Flags {}
|
|
};
|
|
}
|