Add more missing 2015 edition directives

This commit is contained in:
Lukas Wirth 2025-06-05 08:42:30 +02:00
parent 46326e159f
commit 1d7c1b1b4f
43 changed files with 90 additions and 63 deletions

View File

@ -1,3 +1,4 @@
//@ edition: 2015
//@ compile-flags:--extern extern_prelude
//@ aux-build:extern-prelude.rs

View File

@ -1,5 +1,5 @@
error[E0432]: unresolved import `extern_prelude`
--> $DIR/extern-prelude-fail.rs:7:9
--> $DIR/extern-prelude-fail.rs:8:9
|
LL | use extern_prelude::S;
| ^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `extern_prelude`
@ -10,7 +10,7 @@ LL + extern crate extern_prelude;
|
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `extern_prelude`
--> $DIR/extern-prelude-fail.rs:8:15
--> $DIR/extern-prelude-fail.rs:9:15
|
LL | let s = ::extern_prelude::S;
| ^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `extern_prelude`

View File

@ -1,3 +1,4 @@
//@ edition: 2015
enum E {}
trait Tr {}

View File

@ -1,23 +1,23 @@
error[E0577]: expected module, found enum `E`
--> $DIR/resolve-bad-visibility.rs:4:8
--> $DIR/resolve-bad-visibility.rs:5:8
|
LL | pub(in E) struct S;
| ^ not a module
error[E0577]: expected module, found trait `Tr`
--> $DIR/resolve-bad-visibility.rs:5:8
--> $DIR/resolve-bad-visibility.rs:6:8
|
LL | pub(in Tr) struct Z;
| ^^ not a module
error[E0742]: visibilities can only be restricted to ancestor modules
--> $DIR/resolve-bad-visibility.rs:6:8
--> $DIR/resolve-bad-visibility.rs:7:8
|
LL | pub(in std::vec) struct F;
| ^^^^^^^^
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistent`
--> $DIR/resolve-bad-visibility.rs:7:8
--> $DIR/resolve-bad-visibility.rs:8:8
|
LL | pub(in nonexistent) struct G;
| ^^^^^^^^^^^ use of unresolved module or unlinked crate `nonexistent`
@ -28,7 +28,7 @@ LL + extern crate nonexistent;
|
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `too_soon`
--> $DIR/resolve-bad-visibility.rs:8:8
--> $DIR/resolve-bad-visibility.rs:9:8
|
LL | pub(in too_soon) struct H;
| ^^^^^^^^ use of unresolved module or unlinked crate `too_soon`

View File

@ -32,7 +32,7 @@ impl Bar {
}
mod SomeMod {
use Bar;
use crate::Bar;
impl Bar {
// Public method. Should be suggested

View File

@ -5,7 +5,7 @@ extern crate alloc as b;
mod foo {
mod bar {
pub(in b::string::String::newy) extern crate alloc as e;
pub(in crate::b::string::String::newy) extern crate alloc as e;
//~^ ERROR failed to resolve: `String` is a struct, not a module [E0433]
}
}

View File

@ -1,8 +1,8 @@
error[E0433]: failed to resolve: `String` is a struct, not a module
--> $DIR/unresolved-segments-visibility.rs:8:27
--> $DIR/unresolved-segments-visibility.rs:8:34
|
LL | pub(in b::string::String::newy) extern crate alloc as e;
| ^^^^^^ `String` is a struct, not a module
LL | pub(in crate::b::string::String::newy) extern crate alloc as e;
| ^^^^^^ `String` is a struct, not a module
error: aborting due to 1 previous error

View File

@ -1,3 +1,4 @@
//@ edition: 2015
//@ run-rustfix
#![deny(absolute_paths_not_starting_with_crate)]

View File

@ -1,3 +1,4 @@
//@ edition: 2015
//@ run-rustfix
#![deny(absolute_paths_not_starting_with_crate)]

View File

@ -1,5 +1,5 @@
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> $DIR/edition-lint-fully-qualified-paths.rs:18:25
--> $DIR/edition-lint-fully-qualified-paths.rs:19:25
|
LL | let _: <foo::Baz as ::foo::Foo>::Bar = ();
| ^^^^^^^^^^ help: use `crate`: `crate::foo::Foo`
@ -7,13 +7,13 @@ LL | let _: <foo::Baz as ::foo::Foo>::Bar = ();
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
= note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
note: the lint level is defined here
--> $DIR/edition-lint-fully-qualified-paths.rs:3:9
--> $DIR/edition-lint-fully-qualified-paths.rs:4:9
|
LL | #![deny(absolute_paths_not_starting_with_crate)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> $DIR/edition-lint-fully-qualified-paths.rs:18:25
--> $DIR/edition-lint-fully-qualified-paths.rs:19:25
|
LL | let _: <foo::Baz as ::foo::Foo>::Bar = ();
| ^^^^^^^^^^ help: use `crate`: `crate::foo::Foo`
@ -23,7 +23,7 @@ LL | let _: <foo::Baz as ::foo::Foo>::Bar = ();
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> $DIR/edition-lint-fully-qualified-paths.rs:24:13
--> $DIR/edition-lint-fully-qualified-paths.rs:25:13
|
LL | let _: <::foo::Baz as foo::Foo>::Bar = ();
| ^^^^^^^^^^ help: use `crate`: `crate::foo::Baz`

View File

@ -1,3 +1,4 @@
//@ edition: 2015
//@ run-rustfix
#![deny(absolute_paths_not_starting_with_crate)]

View File

@ -1,3 +1,4 @@
//@ edition: 2015
//@ run-rustfix
#![deny(absolute_paths_not_starting_with_crate)]

View File

@ -1,5 +1,5 @@
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> $DIR/edition-lint-nested-empty-paths.rs:16:5
--> $DIR/edition-lint-nested-empty-paths.rs:17:5
|
LL | use foo::{bar::{baz::{}}};
| ^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{bar::{baz::{}}}`
@ -7,13 +7,13 @@ LL | use foo::{bar::{baz::{}}};
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
= note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
note: the lint level is defined here
--> $DIR/edition-lint-nested-empty-paths.rs:3:9
--> $DIR/edition-lint-nested-empty-paths.rs:4:9
|
LL | #![deny(absolute_paths_not_starting_with_crate)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> $DIR/edition-lint-nested-empty-paths.rs:20:5
--> $DIR/edition-lint-nested-empty-paths.rs:21:5
|
LL | use foo::{bar::{XX, baz::{}}};
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{bar::{XX, baz::{}}}`
@ -22,7 +22,7 @@ LL | use foo::{bar::{XX, baz::{}}};
= note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> $DIR/edition-lint-nested-empty-paths.rs:20:5
--> $DIR/edition-lint-nested-empty-paths.rs:21:5
|
LL | use foo::{bar::{XX, baz::{}}};
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{bar::{XX, baz::{}}}`
@ -32,7 +32,7 @@ LL | use foo::{bar::{XX, baz::{}}};
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> $DIR/edition-lint-nested-empty-paths.rs:26:5
--> $DIR/edition-lint-nested-empty-paths.rs:27:5
|
LL | use foo::{bar::{baz::{}, baz1::{}}};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{bar::{baz::{}, baz1::{}}}`
@ -41,7 +41,7 @@ LL | use foo::{bar::{baz::{}, baz1::{}}};
= note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> $DIR/edition-lint-nested-empty-paths.rs:26:5
--> $DIR/edition-lint-nested-empty-paths.rs:27:5
|
LL | use foo::{bar::{baz::{}, baz1::{}}};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{bar::{baz::{}, baz1::{}}}`

View File

@ -1,3 +1,4 @@
//@ edition: 2015
//@ run-rustfix
#![deny(absolute_paths_not_starting_with_crate)]

View File

@ -1,3 +1,4 @@
//@ edition: 2015
//@ run-rustfix
#![deny(absolute_paths_not_starting_with_crate)]

View File

@ -1,5 +1,5 @@
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> $DIR/edition-lint-nested-paths.rs:5:5
--> $DIR/edition-lint-nested-paths.rs:6:5
|
LL | use foo::{a, b};
| ^^^^^^^^^^^ help: use `crate`: `crate::foo::{a, b}`
@ -7,13 +7,13 @@ LL | use foo::{a, b};
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
= note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
note: the lint level is defined here
--> $DIR/edition-lint-nested-paths.rs:3:9
--> $DIR/edition-lint-nested-paths.rs:4:9
|
LL | #![deny(absolute_paths_not_starting_with_crate)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> $DIR/edition-lint-nested-paths.rs:5:5
--> $DIR/edition-lint-nested-paths.rs:6:5
|
LL | use foo::{a, b};
| ^^^^^^^^^^^ help: use `crate`: `crate::foo::{a, b}`
@ -23,7 +23,7 @@ LL | use foo::{a, b};
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> $DIR/edition-lint-nested-paths.rs:22:13
--> $DIR/edition-lint-nested-paths.rs:23:13
|
LL | use foo::{self as x, c};
| ^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{self as x, c}`
@ -32,7 +32,7 @@ LL | use foo::{self as x, c};
= note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> $DIR/edition-lint-nested-paths.rs:22:13
--> $DIR/edition-lint-nested-paths.rs:23:13
|
LL | use foo::{self as x, c};
| ^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{self as x, c}`

View File

@ -1,3 +1,4 @@
//@ edition: 2015
//@ aux-build:edition-lint-paths.rs
//@ run-rustfix

View File

@ -1,3 +1,4 @@
//@ edition: 2015
//@ aux-build:edition-lint-paths.rs
//@ run-rustfix

View File

@ -1,5 +1,5 @@
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> $DIR/edition-lint-paths.rs:11:9
--> $DIR/edition-lint-paths.rs:12:9
|
LL | use bar::Bar;
| ^^^^^^^^ help: use `crate`: `crate::bar::Bar`
@ -7,13 +7,13 @@ LL | use bar::Bar;
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
= note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
note: the lint level is defined here
--> $DIR/edition-lint-paths.rs:4:9
--> $DIR/edition-lint-paths.rs:5:9
|
LL | #![deny(absolute_paths_not_starting_with_crate)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> $DIR/edition-lint-paths.rs:18:9
--> $DIR/edition-lint-paths.rs:19:9
|
LL | use bar;
| ^^^ help: use `crate`: `crate::bar`
@ -22,7 +22,7 @@ LL | use bar;
= note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> $DIR/edition-lint-paths.rs:24:9
--> $DIR/edition-lint-paths.rs:25:9
|
LL | use {main, Bar as SomethingElse};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::{main, Bar as SomethingElse}`
@ -31,7 +31,7 @@ LL | use {main, Bar as SomethingElse};
= note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> $DIR/edition-lint-paths.rs:24:9
--> $DIR/edition-lint-paths.rs:25:9
|
LL | use {main, Bar as SomethingElse};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::{main, Bar as SomethingElse}`
@ -41,7 +41,7 @@ LL | use {main, Bar as SomethingElse};
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> $DIR/edition-lint-paths.rs:24:9
--> $DIR/edition-lint-paths.rs:25:9
|
LL | use {main, Bar as SomethingElse};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::{main, Bar as SomethingElse}`
@ -51,7 +51,7 @@ LL | use {main, Bar as SomethingElse};
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> $DIR/edition-lint-paths.rs:39:5
--> $DIR/edition-lint-paths.rs:40:5
|
LL | use bar::Bar;
| ^^^^^^^^ help: use `crate`: `crate::bar::Bar`
@ -60,7 +60,7 @@ LL | use bar::Bar;
= note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> $DIR/edition-lint-paths.rs:51:9
--> $DIR/edition-lint-paths.rs:52:9
|
LL | use *;
| ^ help: use `crate`: `crate::*`
@ -69,7 +69,7 @@ LL | use *;
= note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> $DIR/edition-lint-paths.rs:56:6
--> $DIR/edition-lint-paths.rs:57:6
|
LL | impl ::foo::SomeTrait for u32 {}
| ^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::SomeTrait`
@ -78,7 +78,7 @@ LL | impl ::foo::SomeTrait for u32 {}
= note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> $DIR/edition-lint-paths.rs:61:13
--> $DIR/edition-lint-paths.rs:62:13
|
LL | let x = ::bar::Bar;
| ^^^^^^^^^^ help: use `crate`: `crate::bar::Bar`

View File

@ -1,3 +1,4 @@
//@ edition: 2015
//@ aux-build:edition-lint-paths.rs
//@ run-rustfix

View File

@ -1,3 +1,4 @@
//@ edition: 2015
//@ aux-build:edition-lint-paths.rs
//@ run-rustfix

View File

@ -1,5 +1,5 @@
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> $DIR/extern-crate-rename.rs:11:5
--> $DIR/extern-crate-rename.rs:12:5
|
LL | use my_crate::foo;
| ^^^^^^^^^^^^^ help: use `crate`: `crate::my_crate::foo`
@ -7,7 +7,7 @@ LL | use my_crate::foo;
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
= note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
note: the lint level is defined here
--> $DIR/extern-crate-rename.rs:7:9
--> $DIR/extern-crate-rename.rs:8:9
|
LL | #![deny(absolute_paths_not_starting_with_crate)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,3 +1,4 @@
//@ edition: 2015
//@ aux-build:edition-lint-paths.rs
//@ run-rustfix

View File

@ -1,3 +1,4 @@
//@ edition: 2015
//@ aux-build:edition-lint-paths.rs
//@ run-rustfix

View File

@ -1,5 +1,5 @@
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
--> $DIR/extern-crate-submod.rs:18:5
--> $DIR/extern-crate-submod.rs:19:5
|
LL | use m::edition_lint_paths::foo;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::m::edition_lint_paths::foo`
@ -7,7 +7,7 @@ LL | use m::edition_lint_paths::foo;
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
= note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
note: the lint level is defined here
--> $DIR/extern-crate-submod.rs:8:9
--> $DIR/extern-crate-submod.rs:9:9
|
LL | #![deny(absolute_paths_not_starting_with_crate)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,3 +1,4 @@
//@ edition: 2015
//@ run-rustfix
//@ check-pass

View File

@ -1,3 +1,4 @@
//@ edition: 2015
//@ run-rustfix
//@ check-pass

View File

@ -1,5 +1,5 @@
warning: `try` is a keyword in the 2018 edition
--> $DIR/try-ident.rs:7:5
--> $DIR/try-ident.rs:8:5
|
LL | try();
| ^^^ help: you can use a raw identifier to stay compatible: `r#try`
@ -7,14 +7,14 @@ LL | try();
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
note: the lint level is defined here
--> $DIR/try-ident.rs:4:9
--> $DIR/try-ident.rs:5:9
|
LL | #![warn(rust_2018_compatibility)]
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: `#[warn(keyword_idents_2018)]` implied by `#[warn(rust_2018_compatibility)]`
warning: `try` is a keyword in the 2018 edition
--> $DIR/try-ident.rs:12:4
--> $DIR/try-ident.rs:13:4
|
LL | fn try() {
| ^^^ help: you can use a raw identifier to stay compatible: `r#try`

View File

@ -1,5 +1,6 @@
// Test that `try!` macros are rewritten.
//@ edition: 2015
//@ run-rustfix
//@ check-pass

View File

@ -1,5 +1,6 @@
// Test that `try!` macros are rewritten.
//@ edition: 2015
//@ run-rustfix
//@ check-pass

View File

@ -1,5 +1,5 @@
warning: `try` is a keyword in the 2018 edition
--> $DIR/try-macro.rs:12:5
--> $DIR/try-macro.rs:13:5
|
LL | try!(x);
| ^^^ help: you can use a raw identifier to stay compatible: `r#try`
@ -7,7 +7,7 @@ LL | try!(x);
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
note: the lint level is defined here
--> $DIR/try-macro.rs:6:9
--> $DIR/try-macro.rs:7:9
|
LL | #![warn(rust_2018_compatibility)]
| ^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,3 +1,5 @@
//@ edition: 2015
#![warn(rust_2021_incompatible_closure_captures)]
fn main() {}

View File

@ -1,5 +1,5 @@
error[E0670]: `async fn` is not permitted in Rust 2015
--> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs:8:16
--> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs:10:16
|
LL | pub(crate) async fn new(
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
@ -8,7 +8,7 @@ LL | pub(crate) async fn new(
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0412]: cannot find type `Duration` in this scope
--> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs:10:19
--> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs:12:19
|
LL | interval: Duration,
| ^^^^^^^^ not found in this scope

View File

@ -1,4 +1,5 @@
// Regression test for ICE #125876
//@ edition: 2015
fn main() {
std::ptr::from_ref(num).cast_mut().as_deref();

View File

@ -1,11 +1,11 @@
error[E0425]: cannot find value `num` in this scope
--> $DIR/ice-unwrap-probe-many-result-125876.rs:4:24
--> $DIR/ice-unwrap-probe-many-result-125876.rs:5:24
|
LL | std::ptr::from_ref(num).cast_mut().as_deref();
| ^^^ not found in this scope
warning: type annotations needed
--> $DIR/ice-unwrap-probe-many-result-125876.rs:4:29
--> $DIR/ice-unwrap-probe-many-result-125876.rs:5:29
|
LL | std::ptr::from_ref(num).cast_mut().as_deref();
| ^^^^^^^^
@ -15,7 +15,7 @@ LL | std::ptr::from_ref(num).cast_mut().as_deref();
= note: `#[warn(tyvar_behind_raw_pointer)]` on by default
warning: type annotations needed
--> $DIR/ice-unwrap-probe-many-result-125876.rs:4:40
--> $DIR/ice-unwrap-probe-many-result-125876.rs:5:40
|
LL | std::ptr::from_ref(num).cast_mut().as_deref();
| ^^^^^^^^
@ -24,7 +24,7 @@ LL | std::ptr::from_ref(num).cast_mut().as_deref();
= note: for more information, see issue #46906 <https://github.com/rust-lang/rust/issues/46906>
error[E0599]: no method named `as_deref` found for raw pointer `*mut _` in the current scope
--> $DIR/ice-unwrap-probe-many-result-125876.rs:4:40
--> $DIR/ice-unwrap-probe-many-result-125876.rs:5:40
|
LL | std::ptr::from_ref(num).cast_mut().as_deref();
| ^^^^^^^^

View File

@ -1,3 +1,5 @@
//@ edition: 2015
trait Foo {
type Clone;
fn foo() -> Clone;

View File

@ -1,5 +1,5 @@
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/issue-116434-2015.rs:3:17
--> $DIR/issue-116434-2015.rs:5:17
|
LL | fn foo() -> Clone;
| ^^^^^
@ -13,7 +13,7 @@ LL | fn foo() -> dyn Clone;
| +++
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/issue-116434-2015.rs:3:17
--> $DIR/issue-116434-2015.rs:5:17
|
LL | fn foo() -> Clone;
| ^^^^^
@ -27,7 +27,7 @@ LL | fn foo() -> dyn Clone;
| +++
error[E0038]: the trait `Clone` is not dyn compatible
--> $DIR/issue-116434-2015.rs:3:17
--> $DIR/issue-116434-2015.rs:5:17
|
LL | fn foo() -> Clone;
| ^^^^^ `Clone` is not dyn compatible
@ -41,7 +41,7 @@ LL | fn foo() -> Self::Clone;
| ++++++
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/issue-116434-2015.rs:18:20
--> $DIR/issue-116434-2015.rs:20:20
|
LL | fn handle() -> DbHandle;
| ^^^^^^^^
@ -54,7 +54,7 @@ LL | fn handle() -> dyn DbHandle;
| +++
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/issue-116434-2015.rs:18:20
--> $DIR/issue-116434-2015.rs:20:20
|
LL | fn handle() -> DbHandle;
| ^^^^^^^^
@ -68,14 +68,14 @@ LL | fn handle() -> dyn DbHandle;
| +++
error[E0038]: the trait `DbHandle` is not dyn compatible
--> $DIR/issue-116434-2015.rs:18:20
--> $DIR/issue-116434-2015.rs:20:20
|
LL | fn handle() -> DbHandle;
| ^^^^^^^^ `DbHandle` is not dyn compatible
|
note: for a trait to be dyn compatible it needs to allow building a vtable
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
--> $DIR/issue-116434-2015.rs:14:17
--> $DIR/issue-116434-2015.rs:16:17
|
LL | trait DbHandle: Sized {}
| -------- ^^^^^ ...because it requires `Self: Sized`

View File

@ -1,3 +1,4 @@
//@ edition: 2015
//@ proc-macro: issue-61963.rs
//@ proc-macro: issue-61963-1.rs
#![deny(bare_trait_objects)]

View File

@ -1,5 +1,5 @@
error: trait objects without an explicit `dyn` are deprecated
--> $DIR/issue-61963.rs:22:14
--> $DIR/issue-61963.rs:23:14
|
LL | bar: Box<Bar>,
| ^^^
@ -7,7 +7,7 @@ LL | bar: Box<Bar>,
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
note: the lint level is defined here
--> $DIR/issue-61963.rs:3:9
--> $DIR/issue-61963.rs:4:9
|
LL | #![deny(bare_trait_objects)]
| ^^^^^^^^^^^^^^^^^^
@ -17,7 +17,7 @@ LL | bar: Box<dyn Bar>,
| +++
error: trait objects without an explicit `dyn` are deprecated
--> $DIR/issue-61963.rs:18:1
--> $DIR/issue-61963.rs:19:1
|
LL | pub struct Foo {
| ^^^

View File

@ -1,3 +1,4 @@
//@ edition: 2015
//@ run-rustfix
#![allow(non_snake_case)]
mod A {

View File

@ -1,3 +1,4 @@
//@ edition: 2015
//@ run-rustfix
#![allow(non_snake_case)]
mod A {

View File

@ -1,5 +1,5 @@
error[E0405]: cannot find trait `Trait` in `A`
--> $DIR/shadowed-path-in-trait-bound-suggestion.rs:9:24
--> $DIR/shadowed-path-in-trait-bound-suggestion.rs:10:24
|
LL | pub struct A<H: A::Trait>(pub H);
| ^^^^^ not found in `A`

View File

@ -1,6 +1,7 @@
// Ensure that the introduction of const trait bound didn't regress this code in Rust 2015.
// See also `mbe-const-trait-bound-theoretical-regression.rs`.
//@ edition: 2015
//@ check-pass
macro_rules! check {