1
Fork 0
rust/src/test/ui/error-codes/E0161.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
996 B
Rust
Raw Normal View History

// Check that E0161 is a hard error in all possible configurations that might
// affect it.
// revisions: migrate nll zflags edition migrateul nllul zflagsul editionul
//[zflags]compile-flags: -Z borrowck=migrate
//[edition]edition:2018
//[zflagsul]compile-flags: -Z borrowck=migrate
//[editionul]edition:2018
//[migrateul] check-pass
//[nllul] check-pass
//[zflagsul] check-pass
//[editionul] check-pass
2021-11-20 23:13:40 +11:00
// Since we are testing nll (and migration) explicitly as a separate
// revisions, don't worry about the --compare-mode=nll on this test.
// ignore-compare-mode-nll
#![allow(incomplete_features)]
#![cfg_attr(nll, feature(nll))]
#![cfg_attr(nllul, feature(nll))]
#![cfg_attr(migrateul, feature(unsized_locals))]
#![cfg_attr(zflagsul, feature(unsized_locals))]
#![cfg_attr(nllul, feature(unsized_locals))]
#![cfg_attr(editionul, feature(unsized_locals))]
2016-05-27 22:06:24 +02:00
trait Bar {
fn f(self);
}
fn foo(x: Box<dyn Bar>) {
x.f();
//[migrate,nll,zflags,edition]~^ ERROR E0161
2016-05-27 22:06:24 +02:00
}
fn main() {}