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,4 +1,7 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/28344>.
//! Test we don't ICE on item resolution when associated type is omitted.
//@ edition:2015

use std::ops::BitXor;

fn main() {
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-28344.rs:5:17
--> $DIR/resolve-method-with-missing-assoc-type.rs:8:17
|
LL | let x: u8 = BitXor::bitor(0 as u8, 0 as u8);
| ^^^^^^
Expand All @@ -13,7 +13,7 @@ LL | let x: u8 = <dyn BitXor>::bitor(0 as u8, 0 as u8);
| ++++ +

error[E0191]: the value of the associated type `Output` in `BitXor<_>` must be specified
--> $DIR/issue-28344.rs:5:17
--> $DIR/resolve-method-with-missing-assoc-type.rs:8:17
|
LL | let x: u8 = BitXor::bitor(0 as u8, 0 as u8);
| ^^^^^^
Expand All @@ -24,7 +24,7 @@ LL | let x: u8 = BitXor::<Output = /* Type */>::bitor(0 as u8, 0 as u8);
| +++++++++++++++++++++++

warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/issue-28344.rs:10:13
--> $DIR/resolve-method-with-missing-assoc-type.rs:13:13
|
LL | let g = BitXor::bitor;
| ^^^^^^
Expand All @@ -37,7 +37,7 @@ LL | let g = <dyn BitXor>::bitor;
| ++++ +

error[E0191]: the value of the associated type `Output` in `BitXor<_>` must be specified
--> $DIR/issue-28344.rs:10:13
--> $DIR/resolve-method-with-missing-assoc-type.rs:13:13
|
LL | let g = BitXor::bitor;
| ^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/27949>.
//!
//! At one time, the `==` operator (and other binary operators) did not
//! support subtyping during type checking, and would therefore require
//! LHS and RHS to be exactly identical--i.e. to have the same lifetimes.
//!
//! This was fixed in 1a7fb7dc78439a704f024609ce3dc0beb1386552.
//@ run-pass
//
// At one time, the `==` operator (and other binary operators) did not
// support subtyping during type checking, and would therefore require
// LHS and RHS to be exactly identical--i.e. to have the same lifetimes.
//
// This was fixed in 1a7fb7dc78439a704f024609ce3dc0beb1386552.

#[derive(Copy, Clone)]
struct Input<'a> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/27889>.
//! Test that a field can have the same name in different variants
//! of an enum, and borrowck won't treat them as the same value.
//@ check-pass
#![allow(unused_assignments)]
#![allow(unused_variables)]
// Test that a field can have the same name in different variants
// of an enum

pub enum Foo {
X { foo: u32 },
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/27340>.
//! Test anon fields in tuple-syntax structs which don't implement trait
//! get nice error message mentioning the type of field and its span.

struct Foo;
#[derive(Copy, Clone)]
struct Bar(Foo);
//~^ ERROR: the trait `Copy` cannot be implemented for this type
//~| ERROR: `Foo: Clone` is not satisfied

fn main() {}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error[E0204]: the trait `Copy` cannot be implemented for this type
--> $DIR/issue-27340.rs:3:8
--> $DIR/derive-copy-clone-non-copy-field-diagnostic.rs:7:8
|
LL | #[derive(Copy, Clone)]
| ---- in this derive macro expansion
LL | struct Bar(Foo);
| ^^^ --- this field does not implement `Copy`

error[E0277]: the trait bound `Foo: Clone` is not satisfied
--> $DIR/issue-27340.rs:3:12
--> $DIR/derive-copy-clone-non-copy-field-diagnostic.rs:7:12
|
LL | #[derive(Copy, Clone)]
| ----- in this derive macro expansion
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/27401>.
//! Check that when a `let`-binding occurs in a loop, its associated
//! drop-flag is reinitialized (to indicate "needs-drop" at the end of
//! the owning variable's scope).
//@ run-pass

// Check that when a `let`-binding occurs in a loop, its associated
// drop-flag is reinitialized (to indicate "needs-drop" at the end of
// the owning variable's scope).

struct A<'a>(&'a mut i32);

impl<'a> Drop for A<'a> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/28279>.
//! Region variables escaped comparison for common supertype, which led
//! `Rc<Fn(&T)>` and `*mut Fn(&T)` to break.
//@ check-pass

#![allow(dead_code)]
use std::rc::Rc;

Expand Down
7 changes: 0 additions & 7 deletions tests/ui/issues/issue-27340.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/27942>.
//! Test internal compiler structs do not leak into error message.
//@ dont-require-annotations: NOTE

pub trait Resources<'a> {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
error[E0308]: mismatched types
--> $DIR/issue-27942.rs:7:25
--> $DIR/trait-method-return-lifetime-mismatch.rs:9:25
|
LL | fn select(&self) -> BufferViewHandle<R>;
| ^^^^^^^^^^^^^^^^^^^ lifetime mismatch
|
= note: expected trait `Resources<'_>`
found trait `Resources<'a>`
note: the lifetime `'a` as defined here...
--> $DIR/issue-27942.rs:5:18
--> $DIR/trait-method-return-lifetime-mismatch.rs:7:18
|
LL | pub trait Buffer<'a, R: Resources<'a>> {
| ^^
note: ...does not necessarily outlive the anonymous lifetime defined here
--> $DIR/issue-27942.rs:7:15
--> $DIR/trait-method-return-lifetime-mismatch.rs:9:15
|
LL | fn select(&self) -> BufferViewHandle<R>;
| ^^^^^

error[E0308]: mismatched types
--> $DIR/issue-27942.rs:7:25
--> $DIR/trait-method-return-lifetime-mismatch.rs:9:25
|
LL | fn select(&self) -> BufferViewHandle<R>;
| ^^^^^^^^^^^^^^^^^^^ lifetime mismatch
|
= note: expected trait `Resources<'_>`
found trait `Resources<'a>`
note: the anonymous lifetime defined here...
--> $DIR/issue-27942.rs:7:15
--> $DIR/trait-method-return-lifetime-mismatch.rs:9:15
|
LL | fn select(&self) -> BufferViewHandle<R>;
| ^^^^^
note: ...does not necessarily outlive the lifetime `'a` as defined here
--> $DIR/issue-27942.rs:5:18
--> $DIR/trait-method-return-lifetime-mismatch.rs:7:18
|
LL | pub trait Buffer<'a, R: Resources<'a>> {
| ^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/2761>.
//@ run-fail
//@ error-pattern:custom message
//@ needs-subprocess
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/27815>.
//! Test usage of struct literal syntax with non-structs doesn't ICE.

mod A {}

fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
error[E0574]: expected struct, variant or union type, found module `A`
--> $DIR/issue-27815.rs:4:13
--> $DIR/non-struct-in-struct-position.rs:7:13
|
LL | let u = A { x: 1 };
| ^ not a struct, variant or union type

error[E0574]: expected struct, variant or union type, found builtin type `u32`
--> $DIR/issue-27815.rs:5:13
--> $DIR/non-struct-in-struct-position.rs:8:13
|
LL | let v = u32 { x: 1 };
| ^^^ not a struct, variant or union type

error[E0574]: expected struct, variant or union type, found module `A`
--> $DIR/issue-27815.rs:7:9
--> $DIR/non-struct-in-struct-position.rs:10:9
|
LL | A { x: 1 } => {}
| ^ not a struct, variant or union type

error[E0574]: expected struct, variant or union type, found builtin type `u32`
--> $DIR/issue-27815.rs:9:9
--> $DIR/non-struct-in-struct-position.rs:12:9
|
LL | u32 { x: 1 } => {}
| ^^^ not a struct, variant or union type
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/27842>.
//! Test we suggest the use of dot syntax when user is trying to index
//! tuple via square brackets.

fn main() {
let tup = (0, 1, 2);
// the case where we show a suggestion
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
error[E0608]: cannot index into a value of type `({integer}, {integer}, {integer})`
--> $DIR/issue-27842.rs:4:16
--> $DIR/tuple-bracket-index-suggest-dot.rs:8:16
|
LL | let _ = tup[0];
| ^^^ help: to access tuple element `0`, use: `.0`
|
= help: tuples are indexed with a dot and a literal index: `tuple.0`, `tuple.1`, etc.

error[E0608]: cannot index into a value of type `({integer}, {integer}, {integer})`
--> $DIR/issue-27842.rs:9:16
--> $DIR/tuple-bracket-index-suggest-dot.rs:13:16
|
LL | let _ = tup[i];
| ^^^
|
= help: tuples are indexed with a dot and a literal index: `tuple.0`, `tuple.1`, etc.

error[E0608]: cannot index into a value of type `({integer},)`
--> $DIR/issue-27842.rs:14:16
--> $DIR/tuple-bracket-index-suggest-dot.rs:18:16
|
LL | let _ = tup[3];
| ^^^
Expand Down
Loading