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,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/mismatched-types-in-trait-implementation-87490.rs:10:5
--> $DIR/mismatched-types-in-associated-type-87490.rs:10:5
|
LL | fn follow(_: &str) -> <&str as StreamOnce>::Position {
| ------------------------------ expected `usize` because of return type
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/72076
trait X {
type S;
fn f() -> Self::S {} //~ ERROR mismatched types
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-72076.rs:3:23
--> $DIR/missing-default-associated-type-72076.rs:4:23
|
LL | fn f() -> Self::S {}
| ^^ expected associated type, found `()`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0070]: invalid left-hand side of assignment
--> $DIR/invalid-assignment-in-while-loop-77218.rs:5:19
--> $DIR/invalid-assignment-in-while-77218.rs:5:19
|
LL | while Some(0) = value.get(0) {}
| - ^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/70724
fn a() -> i32 {
3
}
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 {a}`
--> $DIR/issue-70724-add_type_neq_err_label-unwrap.rs:6:5
--> $DIR/binary-operation-error-on-function-70724.rs:7:5
|
LL | assert_eq!(a, 0);
| ^^^^^^^^^^^^^^^^
Expand All @@ -10,7 +10,7 @@ LL | assert_eq!(a, 0);
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
--> $DIR/issue-70724-add_type_neq_err_label-unwrap.rs:6:5
--> $DIR/binary-operation-error-on-function-70724.rs:7:5
|
LL | assert_eq!(a, 0);
| ^^^^^^^^^^^^^^^^ expected fn item, found integer
Expand All @@ -20,7 +20,7 @@ LL | assert_eq!(a, 0);
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `fn() -> i32 {a}` doesn't implement `Debug`
--> $DIR/issue-70724-add_type_neq_err_label-unwrap.rs:6:5
--> $DIR/binary-operation-error-on-function-70724.rs:7:5
|
LL | fn a() -> i32 {
| - consider calling this function
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/72002
//@ check-pass
struct Indexable;

Expand Down
9 changes: 9 additions & 0 deletions tests/ui/ffi/extern-static-mut-slice-54410.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// https://github.com/rust-lang/rust/issues/54410
extern "C" {
pub static mut symbol: [i8];
//~^ ERROR the size for values of type `[i8]` cannot be known at compilation time
}

fn main() {
println!("{:p}", unsafe { &symbol });
}
12 changes: 12 additions & 0 deletions tests/ui/ffi/extern-static-mut-slice-54410.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
error[E0277]: the size for values of type `[i8]` cannot be known at compilation time
--> $DIR/extern-static-mut-slice-54410.rs:3:5
|
LL | pub static mut symbol: [i8];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[i8]`
= note: statics and constants must have a statically known size

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0277`.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/70381
// Test that multi-byte unicode characters with missing parameters do not ICE.

fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: 1 positional argument in format string, but no arguments were given
--> $DIR/issue-70381.rs:4:16
--> $DIR/unicode-format-string-missing-parameter-70381.rs:5:16
|
LL | println!("\r¡{}")
| ^^
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// https://github.com/rust-lang/rust/issues/60218
// Regression test for #60218
//
// This was reported to cause ICEs.

use std::iter::Map;

pub trait Foo {}

pub fn trigger_error<I, F>(iterable: I, functor: F)
where
for<'t> &'t I: IntoIterator,
for<'t> Map<<&'t I as IntoIterator>::IntoIter, F>: Iterator,
for<'t> <Map<<&'t I as IntoIterator>::IntoIter, F> as Iterator>::Item: Foo,
{
}

fn main() {
trigger_error(vec![], |x: &u32| x) //~ ERROR E0277
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
error[E0277]: the trait bound `&u32: Foo` is not satisfied
--> $DIR/higher-trait-bounds-ice-60218.rs:19:19
|
LL | trigger_error(vec![], |x: &u32| x)
| ------------- ^^^^^^ the trait `Foo` is not implemented for `&u32`
| |
| required by a bound introduced by this call
|
help: this trait has no implementations, consider adding one
--> $DIR/higher-trait-bounds-ice-60218.rs:8:1
|
LL | pub trait Foo {}
| ^^^^^^^^^^^^^
note: required by a bound in `trigger_error`
--> $DIR/higher-trait-bounds-ice-60218.rs:14:72
|
LL | pub fn trigger_error<I, F>(iterable: I, functor: F)
| ------------- required by a bound in this function
...
LL | for<'t> <Map<<&'t I as IntoIterator>::IntoIter, F> as Iterator>::Item: Foo,
| ^^^ required by this bound in `trigger_error`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0277`.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// https://github.com/rust-lang/rust/issues/72278
// and https://github.com/rust-lang/rust/issues/42868
//@ run-pass

#![allow(unused)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/issue-72278.rs:14:14
--> $DIR/late-bound-lifetime-arguments-warning-72278.rs:16:14
|
LL | fn func<'a, U>(&'a self) -> U {
| -- the late bound lifetime parameter is introduced here
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/mismatched_types/auxiliary/aux-56943.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub struct S;
mod m { pub struct S; }
pub use crate::m::S as S2;
28 changes: 28 additions & 0 deletions tests/ui/pin/pin-deref-target-partial-eq-67039.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// https://github.com/rust-lang/rust/issues/67039
// Pin's PartialEq implementation allowed to access the pointer allowing for
// unsoundness by using Rc::get_mut to move value within Rc.
// See https://internals.rust-lang.org/t/unsoundness-in-pin/11311/73 for more details.

use std::ops::Deref;
use std::pin::Pin;
use std::rc::Rc;

struct Apple;

impl Deref for Apple {
type Target = Apple;
fn deref(&self) -> &Apple {
&Apple
}
}

impl PartialEq<Rc<Apple>> for Apple {
fn eq(&self, _rc: &Rc<Apple>) -> bool {
unreachable!()
}
}

fn main() {
let _ = Pin::new(Apple) == Rc::pin(Apple);
//~^ ERROR type mismatch resolving
}
13 changes: 13 additions & 0 deletions tests/ui/pin/pin-deref-target-partial-eq-67039.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
error[E0271]: type mismatch resolving `<Rc<Apple> as Deref>::Target == Rc<Apple>`
--> $DIR/pin-deref-target-partial-eq-67039.rs:26:29
|
LL | let _ = Pin::new(Apple) == Rc::pin(Apple);
| ^^ expected `Rc<Apple>`, found `Apple`
|
= note: expected struct `Rc<Apple>`
found struct `Apple`
= note: required for `Pin<Apple>` to implement `PartialEq<Pin<Rc<Apple>>>`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0271`.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: pattern requires `..` due to inaccessible fields
--> $DIR/inaccessible-fields-pattern-matching-76077.rs:14:9
--> $DIR/inaccessible-private-fields-76077.rs:14:9
|
LL | let foo::Foo {} = foo::Foo::default();
| ^^^^^^^^^^^
Expand All @@ -10,7 +10,7 @@ LL | let foo::Foo { .. } = foo::Foo::default();
| ++

error: pattern requires `..` due to inaccessible fields
--> $DIR/inaccessible-fields-pattern-matching-76077.rs:17:9
--> $DIR/inaccessible-private-fields-76077.rs:17:9
|
LL | let foo::Bar { visible } = foo::Bar::default();
| ^^^^^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/74082
#![allow(dead_code)]

#[repr(i128)] //~ ERROR: attribute should be applied to an enum
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error[E0517]: attribute should be applied to an enum
--> $DIR/issue-74082.rs:3:8
--> $DIR/invalid-repr-on-structs-74082.rs:4:8
|
LL | #[repr(i128)]
| ^^^^
LL | struct Foo;
| ----------- not an enum

error[E0517]: attribute should be applied to an enum
--> $DIR/issue-74082.rs:6:8
--> $DIR/invalid-repr-on-structs-74082.rs:7:8
|
LL | #[repr(u128)]
| ^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
//@ aux-build:issue-73112.rs
// https://github.com/rust-lang/rust/issues/73112
//@ aux-build:aux-73112.rs

extern crate issue_73112;
extern crate aux_73112;

fn main() {
use issue_73112::PageTable;
use aux_73112::PageTable;

#[repr(C, packed)]
struct SomeStruct {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type
--> $DIR/issue-73112.rs:9:5
--> $DIR/packed-struct-contains-aligned-type-73112.rs:10:5
|
LL | struct SomeStruct {
| ^^^^^^^^^^^^^^^^^
|
note: `PageTable` has a `#[repr(align)]` attribute
--> $DIR/auxiliary/issue-73112.rs:8:1
--> $DIR/auxiliary/aux-73112.rs:8:1
|
LL | pub struct PageTable {
| ^^^^^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/71406
use std::sync::mpsc;

fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0433]: failed to resolve: expected type, found function `channel` in `mpsc`
--> $DIR/issue-71406.rs:4:26
--> $DIR/function-module-ambiguity-error-71406.rs:5:26
|
LL | let (tx, rx) = mpsc::channel::new(1);
| ^^^^^^^ expected type, found function `channel` in `mpsc`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
error: bound modifier `?` can only be applied to `Sized`
--> $DIR/relaxed-bounds-assumed-unsized-87199.rs:9:11
--> $DIR/invalid-bound-modifier-87199.rs:9:11
|
LL | fn arg<T: ?Send>(_: T) {}
| ^^^^^

error: bound modifier `?` can only be applied to `Sized`
--> $DIR/relaxed-bounds-assumed-unsized-87199.rs:11:15
--> $DIR/invalid-bound-modifier-87199.rs:11:15
|
LL | fn ref_arg<T: ?Send>(_: &T) {}
| ^^^^^

error: bound modifier `?` can only be applied to `Sized`
--> $DIR/relaxed-bounds-assumed-unsized-87199.rs:13:40
--> $DIR/invalid-bound-modifier-87199.rs:13:40
|
LL | fn ret() -> impl Iterator<Item = ()> + ?Send { std::iter::empty() }
| ^^^^^

error: bound modifier `?` can only be applied to `Sized`
--> $DIR/relaxed-bounds-assumed-unsized-87199.rs:13:40
--> $DIR/invalid-bound-modifier-87199.rs:13:40
|
LL | fn ret() -> impl Iterator<Item = ()> + ?Send { std::iter::empty() }
| ^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0277]: the size for values of type `[i32]` cannot be known at compilation time
--> $DIR/relaxed-bounds-assumed-unsized-87199.rs:20:15
--> $DIR/invalid-bound-modifier-87199.rs:20:15
|
LL | ref_arg::<[i32]>(&[5]);
| ^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[i32]`
note: required by an implicit `Sized` bound in `ref_arg`
--> $DIR/relaxed-bounds-assumed-unsized-87199.rs:11:12
--> $DIR/invalid-bound-modifier-87199.rs:11:12
|
LL | fn ref_arg<T: ?Send>(_: &T) {}
| ^ required by the implicit `Sized` requirement on this type parameter in `ref_arg`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0284]: type annotations needed
--> $DIR/issue-69455.rs:29:41
--> $DIR/projection-predicate-not-satisfied-69455.rs:29:41
|
LL | println!("{}", 23u64.test(xs.iter().sum()));
| ---- ^^^ cannot infer type of the type parameter `S` declared on the method `sum`
Expand All @@ -13,15 +13,15 @@ LL | println!("{}", 23u64.test(xs.iter().sum::<S>()));
| +++++

error[E0283]: type annotations needed
--> $DIR/issue-69455.rs:29:41
--> $DIR/projection-predicate-not-satisfied-69455.rs:29:41
|
LL | println!("{}", 23u64.test(xs.iter().sum()));
| ---- ^^^ cannot infer type of the type parameter `S` declared on the method `sum`
| |
| required by a bound introduced by this call
|
note: multiple `impl`s satisfying `u64: Test<_>` found
--> $DIR/issue-69455.rs:11:1
--> $DIR/projection-predicate-not-satisfied-69455.rs:11:1
|
LL | impl Test<u32> for u64 {
| ^^^^^^^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/73229
//@ check-pass

fn any<T>() -> T {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/69602
trait TraitA {
const VALUE: usize;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error[E0437]: type `M` is not a member of trait `TraitB`
--> $DIR/issue-69602-type-err-during-codegen-ice.rs:17:5
--> $DIR/trait-implementation-ambiguity-69602.rs:18:5
|
LL | type M = A;
| ^^^^^^^^^^^^^ not a member of trait `TraitB`

error[E0046]: not all trait items implemented, missing: `MyA`
--> $DIR/issue-69602-type-err-during-codegen-ice.rs:16:1
--> $DIR/trait-implementation-ambiguity-69602.rs:17:1
|
LL | type MyA: TraitA;
| ---------------- `MyA` from trait
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/69683
pub trait Element<S> {
type Array;
}
Expand Down
Loading
Loading