Skip to content

Commit 3e5a550

Browse files
committed
clippy: update no_core tests w/ new traits
One clippy test is `no_core` and needs to have `MetaSized` and `PointeeSized` added to it.
1 parent 90f7918 commit 3e5a550

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/tools/clippy/tests/ui/def_id_nocore.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
//@ignore-target: apple
22

33
#![feature(no_core, lang_items)]
4+
#![feature(const_trait_impl)]
45
#![no_core]
56
#![allow(clippy::missing_safety_doc)]
67

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

11+
#[lang = "pointeesized"]
12+
pub trait PointeeSized {}
13+
14+
#[lang = "metasized"]
15+
#[const_trait]
16+
pub trait MetaSized: PointeeSized {}
17+
1018
#[lang = "sized"]
11-
pub trait Sized {}
19+
#[const_trait]
20+
pub trait Sized: MetaSized {}
1221
#[lang = "copy"]
1322
pub trait Copy {}
1423
#[lang = "freeze"]

src/tools/clippy/tests/ui/def_id_nocore.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: methods called `as_*` usually take `self` by reference or `self` by mutable reference
2-
--> tests/ui/def_id_nocore.rs:27:19
2+
--> tests/ui/def_id_nocore.rs:36:19
33
|
44
LL | pub fn as_ref(self) -> &'static str {
55
| ^^^^

0 commit comments

Comments
 (0)