Auto merge of #155149 - danieljofficial:move-tests-deref, r=Kivooeo

Move deref tests from issues into deref folder

Hi, Some deref tests, please look at them when you can
 r? @Kivooeo
This commit is contained in:
bors
2026-04-11 13:43:17 +00:00
9 changed files with 17 additions and 1 deletions
@@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/4972
#![feature(box_patterns)]
trait MyTrait {
@@ -1,5 +1,5 @@
error[E0033]: type `Box<(dyn MyTrait + 'static)>` cannot be dereferenced
--> $DIR/issue-4972.rs:13:25
--> $DIR/box-pattern-trait-object-cannot-deref.rs:15:25
|
LL | TraitWrapper::A(box ref map) => map,
| ^^^^^^^^^^^ type `Box<(dyn MyTrait + 'static)>` cannot be dereferenced
@@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/27697
//@ check-pass
use std::ops::Deref;
@@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/16774
//@ run-pass
#![feature(box_patterns)]
@@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/26205
//@ check-pass
#![allow(dead_code)]
use std::ops::{Deref, DerefMut};
@@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/22992
//@ run-pass
struct A(B);
struct B;
@@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/24589
//@ run-pass
pub struct _X([u8]);
@@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/38381
//@ check-pass
use std::ops::Deref;
@@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/26186
//@ check-pass
use std::sync::Mutex;
use std::cell::RefCell;