Skip to content

Commit

Permalink
bless tests/ui/
Browse files Browse the repository at this point in the history
  • Loading branch information
mu001999 committed Nov 25, 2023
1 parent 0abfe64 commit 9fc34e3
Show file tree
Hide file tree
Showing 196 changed files with 251 additions and 67 deletions.
1 change: 1 addition & 0 deletions tests/ui/anon-params/anon-params-deprecated.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// check-pass
// edition:2015
// run-rustfix
#![allow(dead_code)]

trait T {
fn foo(_: i32); //~ WARNING anonymous parameters are deprecated
Expand Down
1 change: 1 addition & 0 deletions tests/ui/anon-params/anon-params-deprecated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// check-pass
// edition:2015
// run-rustfix
#![allow(dead_code)]

trait T {
fn foo(i32); //~ WARNING anonymous parameters are deprecated
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/anon-params/anon-params-deprecated.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: anonymous parameters are deprecated and will be removed in the next edition
--> $DIR/anon-params-deprecated.rs:9:12
--> $DIR/anon-params-deprecated.rs:10:12
|
LL | fn foo(i32);
| ^^^ help: try naming the parameter or explicitly ignoring it: `_: i32`
Expand All @@ -13,7 +13,7 @@ LL | #![warn(anonymous_parameters)]
| ^^^^^^^^^^^^^^^^^^^^

warning: anonymous parameters are deprecated and will be removed in the next edition
--> $DIR/anon-params-deprecated.rs:12:30
--> $DIR/anon-params-deprecated.rs:13:30
|
LL | fn bar_with_default_impl(String, String) {}
| ^^^^^^ help: try naming the parameter or explicitly ignoring it: `_: String`
Expand All @@ -22,7 +22,7 @@ LL | fn bar_with_default_impl(String, String) {}
= note: for more information, see issue #41686 <https://github.com/rust-lang/rust/issues/41686>

warning: anonymous parameters are deprecated and will be removed in the next edition
--> $DIR/anon-params-deprecated.rs:12:38
--> $DIR/anon-params-deprecated.rs:13:38
|
LL | fn bar_with_default_impl(String, String) {}
| ^^^^^^ help: try naming the parameter or explicitly ignoring it: `_: String`
Expand Down
2 changes: 2 additions & 0 deletions tests/ui/associated-consts/associated-const-outer-ty-refs.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// run-pass
#![allow(dead_code)]

trait Lattice {
const BOTTOM: Self;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// run-pass

#![allow(dead_code)]
trait Foo {
const X: i32;
fn get_x() -> i32 {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/associated-type-bounds/dyn-impl-trait-type.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// run-pass

#![allow(dead_code)]
#![feature(associated_type_bounds)]

use std::ops::Add;
Expand Down
1 change: 1 addition & 0 deletions tests/ui/associated-type-bounds/dyn-rpit-and-let.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

// FIXME: uncomment let binding types below when `impl_trait_in_bindings` feature is fixed.

#![allow(dead_code)]
#![feature(associated_type_bounds)]

use std::ops::Add;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/associated-type-bounds/rpit.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// run-pass

#![allow(dead_code)]
#![feature(associated_type_bounds)]

use std::ops::Add;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-rustfix
#![allow(dead_code)]
trait O {
type M;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-rustfix
#![allow(dead_code)]
trait O {
type M;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/suggest-contraining-assoc-type-because-of-assoc-const.rs:12:21
--> $DIR/suggest-contraining-assoc-type-because-of-assoc-const.rs:13:21
|
LL | const N: C::M = 4u8;
| ^^^ expected associated type, found `u8`
Expand Down
1 change: 1 addition & 0 deletions tests/ui/associated-type-bounds/trait-alias-impl-trait.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-pass

#![allow(dead_code)]
#![feature(associated_type_bounds)]
#![feature(type_alias_impl_trait)]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-rustfix
#![allow(dead_code)]
#![allow(unused_variables)]

trait Get {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-rustfix
#![allow(dead_code)]
#![allow(unused_variables)]

trait Get {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `Self: Get` is not satisfied
--> $DIR/associated-types-for-unimpl-trait.rs:10:40
--> $DIR/associated-types-for-unimpl-trait.rs:11:40
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
| ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// itself includes a `Self::Item` shorthand.
//
// Regression test for issue #33425.
#![allow(dead_code)]

trait ParallelIterator {
type Item;
Expand Down
1 change: 1 addition & 0 deletions tests/ui/associated-types/associated-types-issue-20220.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-pass
// Test references to `Self::Item` in the trait. Issue #20220.
#![allow(dead_code)]


use std::vec;
Expand Down
1 change: 1 addition & 0 deletions tests/ui/associated-types/associated-types-issue-20371.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// before the actual trait.

// pretty-expanded FIXME #23616
#![allow(dead_code)]

impl X for f64 { type Y = isize; }
trait X { type Y; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
#![allow(dead_code)]
#![allow(unused_variables)]
// Test that we can resolve nested projection types. Issue #20666.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
#![allow(dead_code)]
#![allow(unused_variables)]
// Test that we normalize associated types that appear in bounds; if
// we didn't, the call to `self.split2()` fails to type check.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
#![allow(dead_code)]
#![allow(unused_variables)]
// Test that we normalize associated types that appear in bounds; if
// we didn't, the call to `self.split2()` fails to type check.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
#![allow(dead_code)]
#![allow(unused_variables)]
// Test that we correctly handle projection bounds appearing in the
// supertrait list (and in conjunction with overloaded operators). In
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// run-pass
// Test where the impl self type uses a projection from a constant type.

#![allow(dead_code)]

trait Int
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Check that we get an error when you use `<Self as Get>::Value` in
// the trait definition even if there is no default method.

#![allow(dead_code)]
trait Get {
type Value;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Check that we get an error when you use `<Self as Get>::Value` in
// the trait definition even if there is no default method.

#![allow(dead_code)]
trait Get {
type Value;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `Self: Get` is not satisfied
--> $DIR/associated-types-projection-to-unrelated-trait-in-method-without-default.rs:10:40
--> $DIR/associated-types-projection-to-unrelated-trait-in-method-without-default.rs:11:40
|
LL | fn okay<U:Get>(&self, foo: U, bar: <Self as Get>::Value);
| ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// See also tests associated-types-no-suitable-supertrait
// and associated-types-no-suitable-supertrait-2, which show how small
// variants of the code below can fail.
#![allow(dead_code)]

trait Get {
type Value;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-pass
// pretty-expanded FIXME #23616
#![allow(dead_code)]

trait Foo<T> {
type Bar;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// run-pass
// pretty-expanded FIXME #23616

#![allow(dead_code)]
trait Get<T> {
fn get(&self) -> T;
}
Expand Down
1 change: 1 addition & 0 deletions tests/ui/auto-traits/auto-trait-validation.fixed
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![feature(auto_traits)]
#![allow(dead_code)]

// run-rustfix

Expand Down
1 change: 1 addition & 0 deletions tests/ui/auto-traits/auto-trait-validation.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![feature(auto_traits)]
#![allow(dead_code)]

// run-rustfix

Expand Down
8 changes: 4 additions & 4 deletions tests/ui/auto-traits/auto-trait-validation.stderr
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
error[E0567]: auto traits cannot have generic parameters
--> $DIR/auto-trait-validation.rs:5:19
--> $DIR/auto-trait-validation.rs:6:19
|
LL | auto trait Generic<T> {}
| -------^^^ help: remove the parameters
| |
| auto trait cannot have generic parameters

error[E0568]: auto traits cannot have super traits or lifetime bounds
--> $DIR/auto-trait-validation.rs:7:17
--> $DIR/auto-trait-validation.rs:8:17
|
LL | auto trait Bound : Copy {}
| -----^^^^^^^ help: remove the super traits or lifetime bounds
| |
| auto traits cannot have super traits or lifetime bounds

error[E0568]: auto traits cannot have super traits or lifetime bounds
--> $DIR/auto-trait-validation.rs:9:25
--> $DIR/auto-trait-validation.rs:10:25
|
LL | auto trait LifetimeBound : 'static {}
| -------------^^^^^^^^^^ help: remove the super traits or lifetime bounds
| |
| auto traits cannot have super traits or lifetime bounds

error[E0380]: auto traits cannot have associated items
--> $DIR/auto-trait-validation.rs:11:25
--> $DIR/auto-trait-validation.rs:12:25
|
LL | auto trait MyTrait { fn foo() {} }
| ------- ---^^^-----
Expand Down
1 change: 1 addition & 0 deletions tests/ui/auto-traits/auto-traits.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
#![allow(dead_code)]
#![allow(unused_doc_comments)]
#![feature(auto_traits)]
#![feature(negative_impls)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-pass

#![allow(dead_code)]
#![allow(unused_imports)]

// aux-build:trait_superkinds_in_metadata.rs
Expand Down
1 change: 1 addition & 0 deletions tests/ui/builtin-superkinds/builtin-superkinds-simple2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Simple test case of implementing a trait with super-builtin-kinds.

// pretty-expanded FIXME #23616
#![allow(dead_code)]

trait Foo : Send { }

Expand Down
1 change: 1 addition & 0 deletions tests/ui/builtin-superkinds/builtin-superkinds-typaram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// using a bounded type parameter.

// pretty-expanded FIXME #23616
#![allow(dead_code)]

trait Foo : Send { }

Expand Down
1 change: 1 addition & 0 deletions tests/ui/cast/cast-rfc0401-vtable-kinds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Check that you can cast between different pointers to trait objects
// whose vtable have the same kind (both lengths, or both trait pointers).

#![allow(dead_code)]
#![feature(unsized_tuple_coercion)]

trait Foo<T> {
Expand Down
1 change: 1 addition & 0 deletions tests/ui/cast/fat-ptr-cast-rpass.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-pass

#![allow(dead_code)]
#![feature(ptr_metadata)]

trait Foo {
Expand Down
1 change: 1 addition & 0 deletions tests/ui/coercion/issue-14589.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// coerced to a trait object

// pretty-expanded FIXME #23616
#![allow(dead_code)]

fn main() {
send::<Box<dyn Foo>>(Box::new(Output(0)));
Expand Down
1 change: 1 addition & 0 deletions tests/ui/coherence/coherence-multidispatch-tuple.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
#![allow(dead_code)]
#![allow(unused_imports)]
// pretty-expanded FIXME #23616

Expand Down
1 change: 1 addition & 0 deletions tests/ui/const-generics/associated-type-bound.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
#![allow(dead_code)]
trait Bar<const N: usize> {}

trait Foo<const N: usize> {
Expand Down
1 change: 1 addition & 0 deletions tests/ui/const-generics/condition-in-trait-const-arg.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Checks that `impl Trait<{anon_const}> for Type` evaluates successfully.
// run-pass
// revisions: full min
#![allow(dead_code)]

#![cfg_attr(full, feature(generic_const_exprs))]
#![cfg_attr(full, allow(incomplete_features))]
Expand Down
1 change: 1 addition & 0 deletions tests/ui/const-generics/dyn-supertraits.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
#![allow(dead_code)]

trait Foo<const N: usize> {
fn myfun(&self) -> usize;
Expand Down
1 change: 1 addition & 0 deletions tests/ui/const-generics/issues/issue-69654-run-pass.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
#![allow(dead_code)]
trait Bar<T> {}
impl<T> Bar<T> for [u8; 7] {}

Expand Down
1 change: 1 addition & 0 deletions tests/ui/consts/const-block-item.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
#![allow(dead_code)]
#![allow(unused_imports)]

mod foo {
Expand Down
1 change: 1 addition & 0 deletions tests/ui/consts/underscore_const_names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#![deny(unused)]

#[allow(dead_code)]
trait Trt {}
pub struct Str {}
impl Trt for Str {}
Expand Down
1 change: 1 addition & 0 deletions tests/ui/default-method-parsing.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-pass
// pretty-expanded FIXME #23616
#![allow(dead_code)]

trait Foo {
fn m(&self, _:isize) { }
Expand Down
1 change: 1 addition & 0 deletions tests/ui/deriving/deriving-bounds.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
#![allow(dead_code)]
#[derive(Copy, Clone)]
struct Test;

Expand Down
1 change: 1 addition & 0 deletions tests/ui/drop/drop-struct-as-object.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
#![allow(dead_code)]
#![allow(unused_variables)]
#![allow(non_upper_case_globals)]

Expand Down
1 change: 1 addition & 0 deletions tests/ui/dynamically-sized-types/dst-coercions.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
#![allow(dead_code)]
#![allow(unused_variables)]
// Test coercions involving DST and/or raw pointers

Expand Down
Loading

0 comments on commit 9fc34e3

Please sign in to comment.