Skip to content

Commit

Permalink
clippy: update no_core tests w/ new traits
Browse files Browse the repository at this point in the history
One clippy test is `no_core` and needs to have `MetaSized` and
`PointeeSized` added to it.
  • Loading branch information
davidtwco committed Mar 3, 2025
1 parent 90f7918 commit 3e5a550
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/tools/clippy/tests/ui/def_id_nocore.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
//@ignore-target: apple

#![feature(no_core, lang_items)]
#![feature(const_trait_impl)]
#![no_core]
#![allow(clippy::missing_safety_doc)]

#[link(name = "c")]
extern "C" {}

#[lang = "pointeesized"]
pub trait PointeeSized {}

#[lang = "metasized"]
#[const_trait]
pub trait MetaSized: PointeeSized {}

#[lang = "sized"]
pub trait Sized {}
#[const_trait]
pub trait Sized: MetaSized {}
#[lang = "copy"]
pub trait Copy {}
#[lang = "freeze"]
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/tests/ui/def_id_nocore.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: methods called `as_*` usually take `self` by reference or `self` by mutable reference
--> tests/ui/def_id_nocore.rs:27:19
--> tests/ui/def_id_nocore.rs:36:19
|
LL | pub fn as_ref(self) -> &'static str {
| ^^^^
Expand Down

0 comments on commit 3e5a550

Please sign in to comment.