Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/56806
pub trait Trait {
fn dyn_instead_of_self(self: Box<dyn Trait>);
//~^ ERROR invalid `self` parameter type
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0307]: invalid `self` parameter type: `Box<(dyn Trait + 'static)>`
--> $DIR/issue-56806.rs:2:34
--> $DIR/invalid-self-parameter-type-56806.rs:3:34
|
LL | fn dyn_instead_of_self(self: Box<dyn Trait>);
| ^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/56870
//@ build-pass
// Regression test for #56870: Internal compiler error (traits & associated consts)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/59326
//@ check-pass
trait Service {
type S;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/57399
//@ check-pass

trait T {
Expand All @@ -12,7 +13,6 @@ struct S<A> {
a: A,
}


impl From<u32> for S<<i32 as T>::T> {
fn from(a: u32) -> Self {
Self { a }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/59488
fn foo() -> i32 {
42
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0369]: binary operation `>` cannot be applied to type `fn() -> i32 {foo}`
--> $DIR/issue-59488.rs:14:9
--> $DIR/function-comparison-errors-59488.rs:15:9
|
LL | foo > 12;
| --- ^ -- {integer}
Expand All @@ -12,7 +12,7 @@ LL | foo() > 12;
| ++

error[E0308]: mismatched types
--> $DIR/issue-59488.rs:14:11
--> $DIR/function-comparison-errors-59488.rs:15:11
|
LL | foo > 12;
| ^^ expected fn item, found `i32`
Expand All @@ -21,7 +21,7 @@ LL | foo > 12;
found type `i32`

error[E0369]: binary operation `>` cannot be applied to type `fn(i64) -> i64 {bar}`
--> $DIR/issue-59488.rs:18:9
--> $DIR/function-comparison-errors-59488.rs:19:9
|
LL | bar > 13;
| --- ^ -- {integer}
Expand All @@ -34,7 +34,7 @@ LL | bar(/* i64 */) > 13;
| +++++++++++

error[E0308]: mismatched types
--> $DIR/issue-59488.rs:18:11
--> $DIR/function-comparison-errors-59488.rs:19:11
|
LL | bar > 13;
| ^^ expected fn item, found `i64`
Expand All @@ -43,7 +43,7 @@ LL | bar > 13;
found type `i64`

error[E0369]: binary operation `>` cannot be applied to type `fn() -> i32 {foo}`
--> $DIR/issue-59488.rs:22:9
--> $DIR/function-comparison-errors-59488.rs:23:9
|
LL | foo > foo;
| --- ^ --- fn() -> i32 {foo}
Expand All @@ -56,15 +56,15 @@ LL | foo() > foo();
| ++ ++

error[E0369]: binary operation `>` cannot be applied to type `fn() -> i32 {foo}`
--> $DIR/issue-59488.rs:25:9
--> $DIR/function-comparison-errors-59488.rs:26:9
|
LL | foo > bar;
| --- ^ --- fn(i64) -> i64 {bar}
| |
| fn() -> i32 {foo}

error[E0308]: mismatched types
--> $DIR/issue-59488.rs:25:11
--> $DIR/function-comparison-errors-59488.rs:26:11
|
LL | foo > bar;
| ^^^ expected fn item, found a different fn item
Expand All @@ -73,7 +73,7 @@ LL | foo > bar;
found fn item `fn(i64) -> i64 {bar}`

error[E0369]: binary operation `==` cannot be applied to type `fn(usize) -> Foo {Foo::Bar}`
--> $DIR/issue-59488.rs:30:5
--> $DIR/function-comparison-errors-59488.rs:31:5
|
LL | assert_eq!(Foo::Bar, i);
| ^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -84,15 +84,15 @@ LL | assert_eq!(Foo::Bar, i);
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `fn(usize) -> Foo {Foo::Bar}` doesn't implement `Debug`
--> $DIR/issue-59488.rs:30:5
--> $DIR/function-comparison-errors-59488.rs:31:5
|
LL | assert_eq!(Foo::Bar, i);
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Debug` is not implemented for fn item `fn(usize) -> Foo {Foo::Bar}`
|
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `fn(usize) -> Foo {Foo::Bar}` doesn't implement `Debug`
--> $DIR/issue-59488.rs:30:5
--> $DIR/function-comparison-errors-59488.rs:31:5
|
LL | assert_eq!(Foo::Bar, i);
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Debug` is not implemented for fn item `fn(usize) -> Foo {Foo::Bar}`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/57741
#![allow(warnings)]

// This tests that the `help: consider dereferencing the boxed value` suggestion isn't made
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-57741-1.rs:14:9
--> $DIR/boxed-value-matching-57741.rs:15:9
|
LL | let y = match x {
| - this expression has type `Box<u32>`
Expand All @@ -10,7 +10,7 @@ LL | S::A { a } | S::B { b: a } => a,
found enum `S`

error[E0308]: mismatched types
--> $DIR/issue-57741-1.rs:14:22
--> $DIR/boxed-value-matching-57741.rs:15:22
|
LL | let y = match x {
| - this expression has type `Box<u32>`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/57741
//@ run-rustfix

#![allow(warnings)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/57741
//@ run-rustfix

#![allow(warnings)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-57741.rs:20:9
--> $DIR/dereferencing-boxed-enum-in-match-57741.rs:21:9
|
LL | let y = match x {
| - this expression has type `Box<T>`
Expand All @@ -14,7 +14,7 @@ LL | let y = match *x {
| +

error[E0308]: mismatched types
--> $DIR/issue-57741.rs:20:19
--> $DIR/dereferencing-boxed-enum-in-match-57741.rs:21:19
|
LL | let y = match x {
| - this expression has type `Box<T>`
Expand All @@ -29,7 +29,7 @@ LL | let y = match *x {
| +

error[E0308]: mismatched types
--> $DIR/issue-57741.rs:27:9
--> $DIR/dereferencing-boxed-enum-in-match-57741.rs:28:9
|
LL | let y = match x {
| - this expression has type `Box<S>`
Expand All @@ -44,7 +44,7 @@ LL | let y = match *x {
| +

error[E0308]: mismatched types
--> $DIR/issue-57741.rs:27:22
--> $DIR/dereferencing-boxed-enum-in-match-57741.rs:28:22
|
LL | let y = match x {
| - this expression has type `Box<S>`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/59494
fn t7p<A, B, C>(f: impl Fn(B) -> C, g: impl Fn(A) -> B) -> impl Fn(A) -> C {
move |a: A| -> C { f(g(a)) }
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-59494.rs:20:40
--> $DIR/generic-typed-nested-closures-59494.rs:21:40
|
LL | let t7 = |env| |a| |b| t7p(f, g)(((env, a), b));
| ^^^ cyclic type of infinite size
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/58375
// Make sure that the mono-item collector does not crash when trying to
// instantiate a default impl for DecodeUtf16<<u8 as A>::Item>
// See https://github.com/rust-lang/rust/issues/58375
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/57162
//@ check-pass

trait Foo {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/57781
//@ run-pass

use std::cell::UnsafeCell;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/58463
//@ run-pass
//@ compile-flags:-C debuginfo=2

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/58734
trait Trait {
fn exists(self) -> ();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/issue-58734.rs:20:5
--> $DIR/spurious-dyn-compat-errors-58734.rs:21:5
|
LL | Trait::nonexistent(());
| ^^^^^
Expand All @@ -13,14 +13,14 @@ LL | <dyn Trait>::nonexistent(());
| ++++ +

error[E0038]: the trait `Trait` is not dyn compatible
--> $DIR/issue-58734.rs:20:5
--> $DIR/spurious-dyn-compat-errors-58734.rs:21:5
|
LL | Trait::nonexistent(());
| ^^^^^ `Trait` is not dyn compatible
|
note: for a trait to be dyn compatible it needs to allow building a vtable
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
--> $DIR/issue-58734.rs:4:8
--> $DIR/spurious-dyn-compat-errors-58734.rs:5:8
|
LL | trait Trait {
| ----- this trait is not dyn compatible...
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/56237
//@ run-pass

use std::ops::Deref;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/55731
use std::marker::PhantomData;

trait DistributedIterator {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: implementation of `DistributedIteratorMulti` is not general enough
--> $DIR/issue-55731.rs:48:5
--> $DIR/hrtb-associated-type-leak-check-55731.rs:49:5
|
LL | / multi(Map {
LL | | i: Cloned(PhantomData),
Expand Down
17 changes: 17 additions & 0 deletions tests/ui/imports/auxiliary/reexported-trait-56175.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
mod private {
pub trait Trait {
fn trait_method(&self) {
}
}
pub trait TraitB {
fn trait_method_b(&self) {
}
}
}

pub struct FooStruct;
pub use crate::private::Trait;
impl crate::private::Trait for FooStruct {}

pub use crate::private::TraitB as TraitBRename;
impl crate::private::TraitB for FooStruct {}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// https://github.com/rust-lang/rust/issues/56175
//@ edition:2018
//@ aux-crate:reexported_trait=reexported-trait.rs
//@ aux-crate:reexported_trait=reexported-trait-56175.rs

fn main() {
reexported_trait::FooStruct.trait_method();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
error[E0599]: no method named `trait_method` found for struct `FooStruct` in the current scope
--> $DIR/issue-56175.rs:5:33
--> $DIR/private-types-suggested-without-extern-crate-56175.rs:6:33
|
LL | reexported_trait::FooStruct.trait_method();
| ^^^^^^^^^^^^
|
::: $DIR/auxiliary/reexported-trait.rs:3:12
::: $DIR/auxiliary/reexported-trait-56175.rs:3:12
|
LL | fn trait_method(&self) {
| ------------ the method is available for `FooStruct` here
|
= help: items from traits can only be used if the trait is in scope
help: trait `Trait` which provides `trait_method` is implemented but not in scope; perhaps you want to import it
|
LL + use reexported_trait::Trait;
LL + use reexported_trait_56175::Trait;
|
help: there is a method `trait_method_b` with a similar name
|
LL | reexported_trait::FooStruct.trait_method_b();
| ++

error[E0599]: no method named `trait_method_b` found for struct `FooStruct` in the current scope
--> $DIR/issue-56175.rs:7:33
--> $DIR/private-types-suggested-without-extern-crate-56175.rs:8:33
|
LL | reexported_trait::FooStruct.trait_method_b();
| ^^^^^^^^^^^^^^
|
::: $DIR/auxiliary/reexported-trait.rs:7:12
::: $DIR/auxiliary/reexported-trait-56175.rs:7:12
|
LL | fn trait_method_b(&self) {
| -------------- the method is available for `FooStruct` here
|
= help: items from traits can only be used if the trait is in scope
help: trait `TraitB` which provides `trait_method_b` is implemented but not in scope; perhaps you want to import it
|
LL + use reexported_trait::TraitBRename;
LL + use reexported_trait_56175::TraitBRename;
|
help: there is a method `trait_method` with a similar name
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
//@ aux-build:issue-57271-lib.rs
// https://github.com/rust-lang/rust/issues/57271
//@ aux-build:aux-57271-lib.rs

extern crate issue_57271_lib;
extern crate aux_57271_lib;

use issue_57271_lib::BaseType;
use aux_57271_lib::BaseType;

pub enum ObjectType { //~ ERROR recursive types `ObjectType` and `TypeSignature` have infinite size
Class(ClassTypeSignature),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0072]: recursive types `ObjectType` and `TypeSignature` have infinite size
--> $DIR/issue-57271.rs:7:1
--> $DIR/mutually-recursive-infinite-types-57271.rs:8:1
|
LL | pub enum ObjectType {
| ^^^^^^^^^^^^^^^^^^^
Expand Down
8 changes: 0 additions & 8 deletions tests/ui/issues/issue-56943.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/57198
//@ run-pass

mod m {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// https://github.com/rust-lang/rust/issues/56943
//@ aux-build:aux-56943.rs

extern crate aux_56943;

fn main() {
let _: aux_56943::S = aux_56943::S2;
//~^ ERROR mismatched types [E0308]
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0308]: mismatched types
--> $DIR/issue-56943.rs:6:29
--> $DIR/type-mismatch-in-extern-crate-56943.rs:7:27
|
LL | let _: issue_56943::S = issue_56943::S2;
| -------------- ^^^^^^^^^^^^^^^ expected `S`, found `S2`
LL | let _: aux_56943::S = aux_56943::S2;
| ------------ ^^^^^^^^^^^^^ expected `S`, found `S2`
| |
| expected due to this

Expand Down
Loading
Loading