Don't emit refining_impl_trait for private items
This commit is contained in:
parent
4745d34bc3
commit
4d05da46e7
15 changed files with 98 additions and 47 deletions
|
@ -1,28 +1,28 @@
|
|||
// check-pass
|
||||
|
||||
#![feature(return_position_impl_trait_in_trait)]
|
||||
#![feature(return_position_impl_trait_in_trait, lint_reasons)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
use std::fmt::Display;
|
||||
use std::ops::Deref;
|
||||
|
||||
trait Foo {
|
||||
pub trait Foo {
|
||||
fn bar(self) -> impl Deref<Target = impl Display + ?Sized>;
|
||||
}
|
||||
|
||||
struct A;
|
||||
pub struct A;
|
||||
|
||||
impl Foo for A {
|
||||
#[allow(refining_impl_trait)]
|
||||
#[expect(refining_impl_trait)]
|
||||
fn bar(self) -> &'static str {
|
||||
"Hello, world"
|
||||
}
|
||||
}
|
||||
|
||||
struct B;
|
||||
pub struct B;
|
||||
|
||||
impl Foo for B {
|
||||
#[allow(refining_impl_trait)]
|
||||
#[expect(refining_impl_trait)]
|
||||
fn bar(self) -> Box<i32> {
|
||||
Box::new(42)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue