Skip to content

tests/ui: A New Order [6/N] #142132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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 @@
//! Checks proper validation of the `#![crate_name]` attribute.
//@ run-pass
//@ compile-flags:--crate-name crate_name_attr_used -F unused-attributes

Expand Down
38 changes: 0 additions & 38 deletions tests/ui/complex.rs

This file was deleted.

26 changes: 0 additions & 26 deletions tests/ui/constructor-lifetime-args.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#![crate_name="crate_method_reexport_grrrrrrr2"]
//! Used by `tests/ui/cross-crate/cross-crate-method-reexport.rs`
#![crate_name="method_reexport_aux"]

pub use name_pool::add;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
// name_pool::methods impl in the other crate is reachable from this
// crate.

//@ aux-build:crate-method-reexport-grrrrrrr2.rs
//@ aux-build:method_reexport_aux.rs

extern crate crate_method_reexport_grrrrrrr2;
extern crate method_reexport_aux;

pub fn main() {
use crate_method_reexport_grrrrrrr2::rust::add;
use crate_method_reexport_grrrrrrr2::rust::cx;
use method_reexport_aux::rust::add;
use method_reexport_aux::rust::cx;
let x: Box<_> = Box::new(());
x.cx();
let y = ();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// #39872, #39553
//! Test for #39872 and #39553
fn will_ice(something: &u32) -> impl Iterator<Item = &u32> {
//~^ ERROR `()` is not an iterator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0277]: `()` is not an iterator
--> $DIR/conservative_impl_trait.rs:3:33
--> $DIR/impl-trait-invalid-iterator-error.rs:3:33
|
LL | fn will_ice(something: &u32) -> impl Iterator<Item = &u32> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ `()` is not an iterator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Checks global path resolution of `mem::drop` using a leading `::`.
//@ run-pass

#![allow(dropping_copy_types)]
Expand Down
22 changes: 22 additions & 0 deletions tests/ui/lifetimes/constructor-lifetime-early-binding-error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//! Tests that all lifetime parameters in struct (`S`) and enum (`E`) constructors are
//! treated as early bound, similar to associated items, rather than late bound as in manual
//! constructors.
struct S<'a, 'b>(&'a u8, &'b u8);
enum E<'a, 'b> {
V(&'a u8),
U(&'b u8),
}

fn main() {
S(&0, &0); // OK
S::<'static>(&0, &0);
//~^ ERROR struct takes 2 lifetime arguments
S::<'static, 'static, 'static>(&0, &0);
//~^ ERROR struct takes 2 lifetime arguments
E::V(&0); // OK
E::V::<'static>(&0);
//~^ ERROR enum takes 2 lifetime arguments
E::V::<'static, 'static, 'static>(&0);
//~^ ERROR enum takes 2 lifetime arguments
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error[E0107]: struct takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/constructor-lifetime-args.rs:17:5
--> $DIR/constructor-lifetime-early-binding-error.rs:13:5
|
LL | S::<'static>(&0, &0);
| ^ ------- supplied 1 lifetime argument
| |
| expected 2 lifetime arguments
|
note: struct defined here, with 2 lifetime parameters: `'a`, `'b`
--> $DIR/constructor-lifetime-args.rs:9:8
--> $DIR/constructor-lifetime-early-binding-error.rs:5:8
|
LL | struct S<'a, 'b>(&'a u8, &'b u8);
| ^ -- --
Expand All @@ -17,29 +17,29 @@ LL | S::<'static, 'static>(&0, &0);
| +++++++++

error[E0107]: struct takes 2 lifetime arguments but 3 lifetime arguments were supplied
--> $DIR/constructor-lifetime-args.rs:19:5
--> $DIR/constructor-lifetime-early-binding-error.rs:15:5
|
LL | S::<'static, 'static, 'static>(&0, &0);
| ^ --------- help: remove the lifetime argument
| |
| expected 2 lifetime arguments
|
note: struct defined here, with 2 lifetime parameters: `'a`, `'b`
--> $DIR/constructor-lifetime-args.rs:9:8
--> $DIR/constructor-lifetime-early-binding-error.rs:5:8
|
LL | struct S<'a, 'b>(&'a u8, &'b u8);
| ^ -- --

error[E0107]: enum takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/constructor-lifetime-args.rs:22:8
--> $DIR/constructor-lifetime-early-binding-error.rs:18:8
|
LL | E::V::<'static>(&0);
| ^ ------- supplied 1 lifetime argument
| |
| expected 2 lifetime arguments
|
note: enum defined here, with 2 lifetime parameters: `'a`, `'b`
--> $DIR/constructor-lifetime-args.rs:10:6
--> $DIR/constructor-lifetime-early-binding-error.rs:6:6
|
LL | enum E<'a, 'b> {
| ^ -- --
Expand All @@ -49,15 +49,15 @@ LL | E::V::<'static, 'static>(&0);
| +++++++++

error[E0107]: enum takes 2 lifetime arguments but 3 lifetime arguments were supplied
--> $DIR/constructor-lifetime-args.rs:24:8
--> $DIR/constructor-lifetime-early-binding-error.rs:20:8
|
LL | E::V::<'static, 'static, 'static>(&0);
| ^ --------- help: remove the lifetime argument
| |
| expected 2 lifetime arguments
|
note: enum defined here, with 2 lifetime parameters: `'a`, `'b`
--> $DIR/constructor-lifetime-args.rs:10:6
--> $DIR/constructor-lifetime-early-binding-error.rs:6:6
|
LL | enum E<'a, 'b> {
| ^ -- --
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Test for #70183 that --crate-type flag display valid value.

//@ compile-flags: --crate-type dynlib

fn main() {}
Expand Down
Loading