2018-08-21 20:47:39 +01:00
|
|
|
// ignore-compare-mode-nll
|
|
|
|
|
|
|
|
// Check that E0161 is a hard error in all possible configurations that might
|
|
|
|
// affect it.
|
|
|
|
|
2019-04-22 08:40:08 +01:00
|
|
|
// revisions: migrate nll zflags edition migrateul nllul zflagsul editionul
|
|
|
|
//[zflags]compile-flags: -Z borrowck=migrate
|
2018-08-21 20:47:39 +01:00
|
|
|
//[edition]edition:2018
|
2019-04-22 08:40:08 +01:00
|
|
|
//[zflagsul]compile-flags: -Z borrowck=migrate
|
2018-08-21 20:47:39 +01:00
|
|
|
//[editionul]edition:2018
|
2021-08-20 15:59:42 +02:00
|
|
|
//[migrateul] check-pass
|
|
|
|
//[nllul] check-pass
|
|
|
|
//[zflagsul] check-pass
|
|
|
|
//[editionul] check-pass
|
2018-08-21 20:47:39 +01:00
|
|
|
|
2020-10-16 19:37:54 -03:00
|
|
|
#![allow(incomplete_features)]
|
2018-08-21 20:47:39 +01:00
|
|
|
#![cfg_attr(nll, feature(nll))]
|
|
|
|
#![cfg_attr(nllul, feature(nll))]
|
2019-04-22 08:40:08 +01:00
|
|
|
#![cfg_attr(migrateul, feature(unsized_locals))]
|
2018-08-21 20:47:39 +01:00
|
|
|
#![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
|
|
|
|
2021-08-20 15:59:42 +02:00
|
|
|
trait Bar {
|
|
|
|
fn f(self);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn foo(x: Box<dyn Bar>) {
|
|
|
|
x.f();
|
2019-11-18 10:43:11 -08:00
|
|
|
//[migrate,nll,zflags,edition]~^ ERROR E0161
|
2016-05-27 22:06:24 +02:00
|
|
|
}
|
2018-08-21 20:47:39 +01:00
|
|
|
|
|
|
|
fn main() {}
|