Skip to content
Open
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,5 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/18611>.
fn add_state(op: <isize as HasState>::State) {
//~^ ERROR `isize: HasState` is not satisfied
//~| ERROR `isize: HasState` is not satisfied
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
error[E0277]: the trait bound `isize: HasState` is not satisfied
--> $DIR/issue-18611.rs:1:18
--> $DIR/assoc-type-unsatisfied-bound.rs:3:18
|
LL | fn add_state(op: <isize as HasState>::State) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HasState` is not implemented for `isize`
|
help: this trait has no implementations, consider adding one
--> $DIR/issue-18611.rs:6:1
--> $DIR/assoc-type-unsatisfied-bound.rs:8:1
|
LL | trait HasState {
| ^^^^^^^^^^^^^^

error[E0277]: the trait bound `isize: HasState` is not satisfied
--> $DIR/issue-18611.rs:1:18
--> $DIR/assoc-type-unsatisfied-bound.rs:3:18
|
LL | fn add_state(op: <isize as HasState>::State) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HasState` is not implemented for `isize`
|
help: this trait has no implementations, consider adding one
--> $DIR/issue-18611.rs:6:1
--> $DIR/assoc-type-unsatisfied-bound.rs:8:1
|
LL | trait HasState {
| ^^^^^^^^^^^^^^
Expand Down
19 changes: 19 additions & 0 deletions tests/ui/box/box-deref-match-arm.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/18845>.
//!
//! This used to generate invalid IR in that even if we took the
//! `false` branch we'd still try to free the Box from the other
//! arm. This was due to treating `*Box::new(9)` as an rvalue datum
//! instead of as a place.

//@ run-pass

fn test(foo: bool) -> u8 {
match foo {
true => *Box::new(9),
false => 0
}
}

fn main() {
assert_eq!(9, test(true));
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Auxiliary crate for <https://github.com/rust-lang/rust/issues/18501>.
#![crate_type = "rlib"]
struct Foo;

Expand Down
15 changes: 15 additions & 0 deletions tests/ui/cross-crate/inline-fn-with-trait-method-as-value.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/18501>.
//!
//! Test that we don't ICE when inlining a function from another
//! crate that uses a trait method as a value due to incorrectly
//! translating the def ID of the trait during AST decoding.
//@ run-pass

//@ aux-build:inline-fn-with-trait-method-as-value.rs

extern crate inline_fn_with_trait_method_as_value as issue;

fn main() {
issue::pass_method();
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/18919>.
type FuncType<'f> = dyn Fn(&isize) -> isize + 'f;

fn ho_func(f: Option<FuncType>) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
error[E0277]: the size for values of type `dyn for<'a> Fn(&'a isize) -> isize` cannot be known at compilation time
--> $DIR/issue-18919.rs:3:15
--> $DIR/dyn-fn-type-in-generic-enum.rs:5:15
|
LL | fn ho_func(f: Option<FuncType>) {
| ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `dyn for<'a> Fn(&'a isize) -> isize`
note: required by an implicit `Sized` bound in `Option`
--> $DIR/issue-18919.rs:7:13
--> $DIR/dyn-fn-type-in-generic-enum.rs:9:13
|
LL | enum Option<T> {
| ^ required by the implicit `Sized` requirement on this type parameter in `Option`
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
--> $DIR/issue-18919.rs:7:13
--> $DIR/dyn-fn-type-in-generic-enum.rs:9:13
|
LL | enum Option<T> {
| ^ this could be changed to `T: ?Sized`...
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/18959>.

pub trait Foo { fn foo<T>(&self, ext_thing: &T); }
pub trait Bar: Foo { }
impl<T: Foo> Bar for T { }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
error[E0038]: the trait `Bar` is not dyn compatible
--> $DIR/issue-18959.rs:11:12
--> $DIR/dyn-incompatible-supertrait.rs:13:12
|
LL | fn foo(b: &dyn Bar) {
| ^^^^^^^ `Bar` 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-18959.rs:1:20
--> $DIR/dyn-incompatible-supertrait.rs:3:20
|
LL | pub trait Foo { fn foo<T>(&self, ext_thing: &T); }
| ^^^ ...because method `foo` has generic type parameters
Expand All @@ -15,14 +15,14 @@ LL | pub trait Bar: Foo { }
= help: consider moving `foo` to another trait

error[E0038]: the trait `Bar` is not dyn compatible
--> $DIR/issue-18959.rs:18:20
--> $DIR/dyn-incompatible-supertrait.rs:20:20
|
LL | let test: &dyn Bar = &mut thing;
| ^^^ `Bar` 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-18959.rs:1:20
--> $DIR/dyn-incompatible-supertrait.rs:3:20
|
LL | pub trait Foo { fn foo<T>(&self, ext_thing: &T); }
| ^^^ ...because method `foo` has generic type parameters
Expand All @@ -31,14 +31,14 @@ LL | pub trait Bar: Foo { }
= help: consider moving `foo` to another trait

error[E0038]: the trait `Bar` is not dyn compatible
--> $DIR/issue-18959.rs:20:9
--> $DIR/dyn-incompatible-supertrait.rs:22:9
|
LL | foo(test);
| ^^^^ `Bar` 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-18959.rs:1:20
--> $DIR/dyn-incompatible-supertrait.rs:3:20
|
LL | pub trait Foo { fn foo<T>(&self, ext_thing: &T); }
| ^^^ ...because method `foo` has generic type parameters
Expand Down
5 changes: 0 additions & 5 deletions tests/ui/issues/auxiliary/issue-18711.rs

This file was deleted.

12 changes: 0 additions & 12 deletions tests/ui/issues/issue-18501.rs

This file was deleted.

11 changes: 0 additions & 11 deletions tests/ui/issues/issue-18711.rs

This file was deleted.

16 changes: 0 additions & 16 deletions tests/ui/issues/issue-18845.rs

This file was deleted.

16 changes: 0 additions & 16 deletions tests/ui/issues/issue-18859.rs

This file was deleted.

9 changes: 0 additions & 9 deletions tests/ui/issues/issue-18913.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Auxiliary crate for <https://github.com/rust-lang/rust/issues/18913>.
//@ no-prefer-dynamic

#![crate_type = "rlib"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Auxiliary crate for <https://github.com/rust-lang/rust/issues/18913>.
//@ no-prefer-dynamic

#![crate_type = "rlib"]
Expand Down
11 changes: 11 additions & 0 deletions tests/ui/linking/duplicate-rlib-crate-name-precedence.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/18913>.
//@ run-pass
//@ aux-build:duplicate-rlib-crate-name-precedence-1.rs
//@ aux-build:duplicate-rlib-crate-name-precedence-2.rs

extern crate foo;

fn main() {
assert_eq!(foo::foo(), 1);
}
18 changes: 18 additions & 0 deletions tests/ui/macros/module-path-in-nested-modules.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/18859>.

//@ run-pass

mod foo {
pub mod bar {
pub mod baz {
pub fn name() -> &'static str {
module_path!()
}
}
}
}

fn main() {
assert_eq!(module_path!(), "module_path_in_nested_modules");
assert_eq!(foo::bar::baz::name(), "module_path_in_nested_modules::foo::bar::baz");
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/18988>.
//@ check-pass
#![allow(dead_code)]
pub trait Foo : Send { }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//! Auxiliary crate for <https://github.com/rust-lang/rust/issues/18711>.
#![crate_type = "rlib"]

pub fn inner<F>(f: F) -> F {
(move || f)()
}
12 changes: 12 additions & 0 deletions tests/ui/unboxed-closures/cross-crate-generic-fn-in-closure.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/18711>.
//! Test that we don't panic on a RefCell borrow conflict in certain
//! code paths involving unboxed closures.
//@ run-pass

//@ aux-build:cross-crate-generic-fn-in-closure.rs
extern crate cross_crate_generic_fn_in_closure as issue;

fn main() {
(|| issue::inner(()))();
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/18906>.
//@ check-pass
#![allow(dead_code)]

Expand Down
Loading