cleaned up some tests
cleaned up cast-enum-const.rs cleaned up ufcs-trait-object-format.rs add comment to cast-to-box-arr.rs add comment to shadow-primitives.rs add comment to associated-type-const-nomalization.rs add comment to fn-trait-explicit-call.rs add comment to call-unit-struct-impl-fn-once.rs add comment to cast-to-char-compare.rs add comment to self-in-method-body-resolves.rs add comment to derive-debug-newtype-unsized-slice.rs add comment to tuple-ref-order-distinct-impls.rs add comment to derive-debug-generic-with-lifetime.rs add comment to recursive-trait-bound-on-type-param.rs cleaned up const-static-ref-to-closure.rs add comment to const-iter-no-conflict-for-loop.rs
This commit is contained in:
parent
5c5c1ff6db
commit
93f8ad9950
15 changed files with 59 additions and 33 deletions
|
|
@ -1,3 +1,4 @@
|
|||
//! regression test for <https://github.com/rust-lang/rust/issues/26614>
|
||||
//@ check-pass
|
||||
|
||||
trait Mirror {
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
//! regression test for <https://github.com/rust-lang/rust/issues/2428>
|
||||
//@ run-pass
|
||||
#![allow(non_upper_case_globals)]
|
||||
|
||||
|
||||
pub fn main() {
|
||||
let _foo = 100;
|
||||
const quux: isize = 5;
|
||||
fn main() {
|
||||
const QUUX: isize = 5;
|
||||
|
||||
enum Stuff {
|
||||
Bar = quux
|
||||
Bar = QUUX,
|
||||
}
|
||||
|
||||
assert_eq!(Stuff::Bar as isize, quux);
|
||||
assert_eq!(Stuff::Bar as isize, QUUX);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//! regression test for <https://github.com/rust-lang/rust/issues/22403>
|
||||
//@ run-pass
|
||||
fn main() {
|
||||
let x = Box::new([1, 2, 3]);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
//! regression test for <https://github.com/rust-lang/rust/issues/41998>
|
||||
//@ check-pass
|
||||
|
||||
|
||||
fn main() {
|
||||
if ('x' as char) < ('y' as char) {
|
||||
print!("x");
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
//! regression test for <https://github.com/rust-lang/rust/issues/25180>
|
||||
//@ check-pass
|
||||
#![allow(dead_code)]
|
||||
#![allow(non_upper_case_globals)]
|
||||
|
||||
const x: &'static dyn Fn() = &|| println!("ICE here");
|
||||
const X: &'static dyn Fn() = &|| println!("ICE here");
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//! regression test for <https://github.com/rust-lang/rust/issues/29030>
|
||||
//@ check-pass
|
||||
#![allow(dead_code)]
|
||||
#[derive(Debug)]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//! regression test for <https://github.com/rust-lang/rust/issues/25394>
|
||||
//@ check-pass
|
||||
#![allow(dead_code)]
|
||||
#[derive(Debug)]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//! regression test for <https://github.com/rust-lang/rust/issues/33687>
|
||||
//@ run-pass
|
||||
#![feature(unboxed_closures)]
|
||||
#![feature(fn_traits)]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//! regression test for <https://github.com/rust-lang/rust/issues/20847>
|
||||
//@ run-pass
|
||||
#![feature(fn_traits)]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
//! regression test for <https://github.com/rust-lang/rust/issues/27639>
|
||||
//! Ensure that a constant named `iter` does not
|
||||
//! interfere with the name resolution of the `iter` methods used internally
|
||||
//! by `for` loops
|
||||
//@ run-pass
|
||||
#![allow(dead_code)]
|
||||
#![allow(non_upper_case_globals)]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//! regression test for <https://github.com/rust-lang/rust/issues/20427>
|
||||
//@ run-pass
|
||||
#![allow(dead_code)]
|
||||
#![allow(unused_variables)]
|
||||
|
|
@ -31,17 +32,10 @@ mod char {
|
|||
mod char_ {}
|
||||
|
||||
mod str {
|
||||
use super::i8 as i8;
|
||||
use super::i32_ as i32;
|
||||
use super::i64_ as i64;
|
||||
use super::u8_ as u8;
|
||||
use super::f_ as f64;
|
||||
use super::u16_ as u16;
|
||||
use super::u32_ as u32;
|
||||
use super::u64_ as u64;
|
||||
use super::bool_ as bool;
|
||||
use super::{bool_ as str};
|
||||
use super::char_ as char;
|
||||
use super::{
|
||||
bool_ as bool, bool_ as str, char_ as char, f_ as f64, i8, i32_ as i32, i64_ as i64,
|
||||
u8_ as u8, u16_ as u16, u32_ as u32, u64_ as u64,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -49,7 +43,9 @@ trait isize_ {
|
|||
type isize;
|
||||
}
|
||||
|
||||
fn usize<'usize>(usize: &'usize usize) -> &'usize usize { usize }
|
||||
fn usize<'usize>(usize: &'usize usize) -> &'usize usize {
|
||||
usize
|
||||
}
|
||||
|
||||
mod reuse {
|
||||
use std::mem::size_of;
|
||||
|
|
@ -68,9 +64,10 @@ mod reuse {
|
|||
mod guard {
|
||||
pub fn check() {
|
||||
use std::u8; // bring module u8 in scope
|
||||
fn f() -> u8 { // OK, resolves to primitive u8, not to std::u8
|
||||
fn f() -> u8 {
|
||||
// OK, resolves to primitive u8, not to std::u8
|
||||
u8::max_value() // OK, resolves to associated function <u8>::max_value,
|
||||
// not to non-existent std::u8::max_value
|
||||
// not to non-existent std::u8::max_value
|
||||
}
|
||||
assert_eq!(f(), u8::MAX); // OK, resolves to std::u8::MAX
|
||||
}
|
||||
|
|
@ -79,7 +76,13 @@ mod guard {
|
|||
fn main() {
|
||||
let bool = true;
|
||||
let _ = match bool {
|
||||
str @ true => if str { i32 as i64 } else { i64 },
|
||||
str @ true => {
|
||||
if str {
|
||||
i32 as i64
|
||||
} else {
|
||||
i64
|
||||
}
|
||||
}
|
||||
false => i64,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,16 @@
|
|||
//! regression test for <https://github.com/rust-lang/rust/issues/24389>
|
||||
//@ check-pass
|
||||
#![allow(dead_code)]
|
||||
|
||||
struct Foo;
|
||||
|
||||
impl Foo {
|
||||
fn new() -> Self { Foo }
|
||||
fn bar() { Self::new(); }
|
||||
fn new() -> Self {
|
||||
Foo
|
||||
}
|
||||
fn bar() {
|
||||
Self::new();
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
//! regression test for <https://github.com/rust-lang/rust/issues/19601>
|
||||
//@ check-pass
|
||||
|
||||
trait A<T> {}
|
||||
struct B<T> where B<T>: A<B<T>> { t: T }
|
||||
struct B<T>
|
||||
where
|
||||
B<T>: A<B<T>>,
|
||||
{
|
||||
t: T,
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
//! regression test for <https://github.com/rust-lang/rust/issues/11384>
|
||||
//@ check-pass
|
||||
|
||||
trait Common { fn dummy(&self) { } }
|
||||
trait Common {
|
||||
fn dummy(&self) {}
|
||||
}
|
||||
|
||||
impl<'t, T> Common for (T, &'t T) {}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
//@ run-pass
|
||||
// Regression test for #20676. Error was that we didn't support
|
||||
// UFCS-style calls to a method in `Trait` where `Self` was bound to a
|
||||
// trait object of type `Trait`. See also `ufcs-trait-object.rs`.
|
||||
|
||||
//! Regression test for <https://github.com/rust-lang/rust/issues/20676>.
|
||||
//! Error was that we didn't support
|
||||
//! UFCS-style calls to a method in `Trait` where `Self` was bound to a
|
||||
//! trait object of type `Trait`.
|
||||
//! See also <https://github.com/rust-lang/rust/blob/ec2cc76/tests/ui/traits/ufcs-object.rs>.
|
||||
|
||||
use std::fmt;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue