mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Fix fallout in tests
This commit is contained in:
parent
20ee53c2f1
commit
35f5e18f75
@ -16,5 +16,4 @@ extern crate macro_crate_test;
|
|||||||
fn main() {
|
fn main() {
|
||||||
macro_crate_test::foo();
|
macro_crate_test::foo();
|
||||||
//~^ ERROR failed to resolve. Use of undeclared type or module `macro_crate_test`
|
//~^ ERROR failed to resolve. Use of undeclared type or module `macro_crate_test`
|
||||||
//~^^ ERROR unresolved name `macro_crate_test::foo`
|
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,6 @@
|
|||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// error-pattern: unresolved name
|
// error-pattern: failed to resolve. Use of undeclared type or module `thing`
|
||||||
|
|
||||||
fn main() { let foo = thing::len(Vec::new()); }
|
fn main() { let foo = thing::len(Vec::new()); }
|
||||||
|
@ -10,6 +10,5 @@
|
|||||||
|
|
||||||
fn foo<T>() {
|
fn foo<T>() {
|
||||||
fn bar(b: T) { } //~ ERROR can't use type parameters from outer
|
fn bar(b: T) { } //~ ERROR can't use type parameters from outer
|
||||||
//~^ ERROR type name `T` is undefined or not in scope
|
|
||||||
}
|
}
|
||||||
fn main() { }
|
fn main() { }
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// error-pattern: unresolved name
|
// error-pattern: failed to resolve. Use of undeclared type or module `foo`
|
||||||
|
|
||||||
// In this test baz isn't resolved when called as foo.baz even though
|
// In this test baz isn't resolved when called as foo.baz even though
|
||||||
// it's called from inside foo. This is somewhat surprising and may
|
// it's called from inside foo. This is somewhat surprising and may
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// error-pattern: unresolved name
|
// error-pattern: failed to resolve. Use of undeclared type or module `bar`
|
||||||
|
|
||||||
mod foo {
|
mod foo {
|
||||||
pub fn x() { bar::x(); }
|
pub fn x() { bar::x(); }
|
||||||
|
@ -15,7 +15,6 @@ enum Bar<T> { What } //~ ERROR parameter `T` is never used
|
|||||||
fn foo<T>() {
|
fn foo<T>() {
|
||||||
static a: Bar<T> = Bar::What;
|
static a: Bar<T> = Bar::What;
|
||||||
//~^ ERROR cannot use an outer type parameter in this context
|
//~^ ERROR cannot use an outer type parameter in this context
|
||||||
//~| ERROR type name `T` is undefined or not in scope
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -12,7 +12,6 @@ trait Trait {
|
|||||||
fn outer(&self) {
|
fn outer(&self) {
|
||||||
fn inner(_: &Self) {
|
fn inner(_: &Self) {
|
||||||
//~^ ERROR can't use type parameters from outer function
|
//~^ ERROR can't use type parameters from outer function
|
||||||
//~^^ ERROR use of `Self` outside of an impl or trait
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,6 @@ fn siphash(k0 : u64) {
|
|||||||
impl siphash {
|
impl siphash {
|
||||||
pub fn reset(&mut self) {
|
pub fn reset(&mut self) {
|
||||||
self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment
|
self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment
|
||||||
//~^ ERROR unresolved name `k0`
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,6 @@ fn siphash<T>() {
|
|||||||
trait t {
|
trait t {
|
||||||
fn g(&self, x: T) -> T; //~ ERROR can't use type parameters from outer function; try using
|
fn g(&self, x: T) -> T; //~ ERROR can't use type parameters from outer function; try using
|
||||||
//~^ ERROR can't use type parameters from outer function; try using
|
//~^ ERROR can't use type parameters from outer function; try using
|
||||||
//~^^ ERROR type name `T` is undefined or not in scope
|
|
||||||
//~^^^ ERROR type name `T` is undefined or not in scope
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,9 +29,7 @@ fn siphash(k0 : u64, k1 : u64) {
|
|||||||
impl siphash for SipState {
|
impl siphash for SipState {
|
||||||
fn reset(&self) {
|
fn reset(&self) {
|
||||||
self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment
|
self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment
|
||||||
//~^ ERROR unresolved name `k0`
|
|
||||||
self.v1 = k1 ^ 0x646f72616e646f6d; //~ ERROR can't capture dynamic environment
|
self.v1 = k1 ^ 0x646f72616e646f6d; //~ ERROR can't capture dynamic environment
|
||||||
//~^ ERROR unresolved name `k1`
|
|
||||||
}
|
}
|
||||||
fn result(&self) -> u64 { return mk_result(self); }
|
fn result(&self) -> u64 { return mk_result(self); }
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,6 @@ fn siphash(k0 : u64) {
|
|||||||
impl SipHash for SipState {
|
impl SipHash for SipState {
|
||||||
fn reset(&self) {
|
fn reset(&self) {
|
||||||
self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment
|
self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment
|
||||||
//~^ ERROR unresolved name `k0`
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
panic!();
|
panic!();
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
fn foo<T>() {
|
fn foo<T>() {
|
||||||
struct foo {
|
struct foo {
|
||||||
x: T, //~ ERROR can't use type parameters from outer function;
|
x: T, //~ ERROR can't use type parameters from outer function;
|
||||||
//~^ ERROR type name `T` is undefined or not in scope
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> Drop for foo<T> {
|
impl<T> Drop for foo<T> {
|
||||||
|
@ -13,7 +13,6 @@ fn main() {
|
|||||||
|
|
||||||
static y: isize = foo + 1;
|
static y: isize = foo + 1;
|
||||||
//~^ ERROR attempt to use a non-constant value in a constant
|
//~^ ERROR attempt to use a non-constant value in a constant
|
||||||
//~| ERROR unresolved name `foo`
|
|
||||||
|
|
||||||
println!("{}", y);
|
println!("{}", y);
|
||||||
}
|
}
|
||||||
|
@ -15,8 +15,7 @@ fn main() {
|
|||||||
enum Stuff {
|
enum Stuff {
|
||||||
Bar = foo
|
Bar = foo
|
||||||
//~^ ERROR attempt to use a non-constant value in a constant
|
//~^ ERROR attempt to use a non-constant value in a constant
|
||||||
//~| ERROR unresolved name `foo`
|
//~^^ ERROR constant evaluation error: non-constant path in constant expression
|
||||||
//~^^^ ERROR constant evaluation error: non-constant path in constant expression
|
|
||||||
}
|
}
|
||||||
|
|
||||||
println!("{}", Stuff::Bar);
|
println!("{}", Stuff::Bar);
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
fn f(x:isize) {
|
fn f(x:isize) {
|
||||||
static child: isize = x + 1;
|
static child: isize = x + 1;
|
||||||
//~^ ERROR attempt to use a non-constant value in a constant
|
//~^ ERROR attempt to use a non-constant value in a constant
|
||||||
//~| ERROR unresolved name `x`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
@ -17,7 +17,6 @@ impl PTrait for P {
|
|||||||
fn getChildOption(&self) -> Option<Box<P>> {
|
fn getChildOption(&self) -> Option<Box<P>> {
|
||||||
static childVal: Box<P> = self.child.get();
|
static childVal: Box<P> = self.child.get();
|
||||||
//~^ ERROR attempt to use a non-constant value in a constant
|
//~^ ERROR attempt to use a non-constant value in a constant
|
||||||
//~| ERROR unresolved name `self`
|
|
||||||
panic!();
|
panic!();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
fn f<Z>() -> bool {
|
fn f<Z>() -> bool {
|
||||||
enum E { V(Z) }
|
enum E { V(Z) }
|
||||||
//~^ ERROR can't use type parameters from outer function
|
//~^ ERROR can't use type parameters from outer function
|
||||||
//~^^ ERROR type name `Z` is undefined or not in scope
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,8 +9,7 @@
|
|||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
fn f<T>() -> bool {
|
fn f<T>() -> bool {
|
||||||
struct S(T); //~ ERROR type name `T` is undefined or not in scope
|
struct S(T); //~ ERROR can't use type parameters from outer function; try using
|
||||||
//~^ ERROR can't use type parameters from outer function; try using
|
|
||||||
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,6 @@ impl A {
|
|||||||
fn m(&self) {
|
fn m(&self) {
|
||||||
fn x() {
|
fn x() {
|
||||||
self.m() //~ ERROR can't capture dynamic environment in a fn item
|
self.m() //~ ERROR can't capture dynamic environment in a fn item
|
||||||
//~^ ERROR unresolved name `self`
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,5 @@ test!(b,
|
|||||||
fn main() {
|
fn main() {
|
||||||
a::bar();
|
a::bar();
|
||||||
//~^ ERROR failed to resolve. Use of undeclared type or module `a`
|
//~^ ERROR failed to resolve. Use of undeclared type or module `a`
|
||||||
//~^^ ERROR unresolved name `a::bar`
|
|
||||||
b::bar();
|
b::bar();
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,5 @@ extern crate libc;
|
|||||||
fn main() {
|
fn main() {
|
||||||
unsafe {
|
unsafe {
|
||||||
libc::abs(0); //~ ERROR Use of undeclared type or module `libc`
|
libc::abs(0); //~ ERROR Use of undeclared type or module `libc`
|
||||||
//~^ ERROR unresolved name `libc::abs`
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,6 @@ trait TraitA<A> {
|
|||||||
//~^ ERROR parameter `B` is never used
|
//~^ ERROR parameter `B` is never used
|
||||||
Variance(A)
|
Variance(A)
|
||||||
//~^ ERROR can't use type parameters from outer function
|
//~^ ERROR can't use type parameters from outer function
|
||||||
//~^^ ERROR type name `A` is undefined or not in scope
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -27,8 +26,7 @@ trait TraitB<A> {
|
|||||||
fn outer(self) {
|
fn outer(self) {
|
||||||
struct Foo<B>(A);
|
struct Foo<B>(A);
|
||||||
//~^ ERROR can't use type parameters from outer function
|
//~^ ERROR can't use type parameters from outer function
|
||||||
//~^^ ERROR type name `A` is undefined or not in scope
|
//~^^ ERROR parameter `B` is never used
|
||||||
//~^^^ ERROR parameter `B` is never used
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,8 +34,7 @@ trait TraitC<A> {
|
|||||||
fn outer(self) {
|
fn outer(self) {
|
||||||
struct Foo<B> { a: A }
|
struct Foo<B> { a: A }
|
||||||
//~^ ERROR can't use type parameters from outer function
|
//~^ ERROR can't use type parameters from outer function
|
||||||
//~^^ ERROR type name `A` is undefined or not in scope
|
//~^^ ERROR parameter `B` is never used
|
||||||
//~^^^ ERROR parameter `B` is never used
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,7 +42,6 @@ trait TraitD<A> {
|
|||||||
fn outer(self) {
|
fn outer(self) {
|
||||||
fn foo<B>(a: A) { }
|
fn foo<B>(a: A) { }
|
||||||
//~^ ERROR can't use type parameters from outer function
|
//~^ ERROR can't use type parameters from outer function
|
||||||
//~^^ ERROR type name `A` is undefined or not in scope
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user