}
/// Gets the span of the definition of the specified HIR node.
- /// This is used by `tcx.get_span`
+ /// This is used by `tcx.def_span`.
pub fn span(self, hir_id: HirId) -> Span {
self.opt_span(hir_id)
.unwrap_or_else(|| bug!("hir::map::Map::span: id not in map: {:?}", hir_id))
}
pub fn opt_span(self, hir_id: HirId) -> Option<Span> {
+ fn until_within(outer: Span, end: Span) -> Span {
+ if let Some(end) = end.find_ancestor_inside(outer) {
+ outer.with_hi(end.hi())
+ } else {
+ outer
+ }
+ }
+
+ fn named_span(item_span: Span, ident: Ident, generics: Option<&Generics<'_>>) -> Span {
+ if ident.name != kw::Empty {
+ let mut span = until_within(item_span, ident.span);
+ if let Some(g) = generics
+ && !g.span.is_dummy()
+ && let Some(g_span) = g.span.find_ancestor_inside(item_span)
+ {
+ span = span.to(g_span);
+ }
+ span
+ } else {
+ item_span
+ }
+ }
+
let span = match self.find(hir_id)? {
- Node::Param(param) => param.span,
+ // Function-like.
+ Node::Item(Item { kind: ItemKind::Fn(sig, ..), .. })
+ | Node::TraitItem(TraitItem { kind: TraitItemKind::Fn(sig, ..), .. })
+ | Node::ImplItem(ImplItem { kind: ImplItemKind::Fn(sig, ..), .. }) => sig.span,
+ // Constants and Statics.
+ Node::Item(Item {
+ kind:
+ ItemKind::Const(ty, ..)
+ | ItemKind::Static(ty, ..)
+ | ItemKind::Impl(Impl { self_ty: ty, .. }),
+ span: outer_span,
+ ..
+ })
+ | Node::TraitItem(TraitItem {
+ kind: TraitItemKind::Const(ty, ..),
+ span: outer_span,
+ ..
+ })
+ | Node::ImplItem(ImplItem {
+ kind: ImplItemKind::Const(ty, ..),
+ span: outer_span,
+ ..
+ })
+ | Node::ForeignItem(ForeignItem {
+ kind: ForeignItemKind::Static(ty, ..),
+ span: outer_span,
+ ..
+ }) => until_within(*outer_span, ty.span),
+ // With generics and bounds.
+ Node::Item(Item {
+ kind: ItemKind::Trait(_, _, generics, bounds, _),
+ span: outer_span,
+ ..
+ })
+ | Node::TraitItem(TraitItem {
+ kind: TraitItemKind::Type(bounds, _),
+ generics,
+ span: outer_span,
+ ..
+ }) => {
+ let end = if let Some(b) = bounds.last() { b.span() } else { generics.span };
+ until_within(*outer_span, end)
+ }
+ // Other cases.
Node::Item(item) => match &item.kind {
- ItemKind::Fn(sig, _, _) => sig.span,
- _ => item.span,
+ ItemKind::Use(path, _) => path.span,
+ _ => named_span(item.span, item.ident, item.kind.generics()),
},
- Node::ForeignItem(foreign_item) => foreign_item.span,
- Node::TraitItem(trait_item) => match &trait_item.kind {
- TraitItemKind::Fn(sig, _) => sig.span,
- _ => trait_item.span,
- },
- Node::ImplItem(impl_item) => match &impl_item.kind {
- ImplItemKind::Fn(sig, _) => sig.span,
- _ => impl_item.span,
+ Node::ImplItem(item) => named_span(item.span, item.ident, Some(item.generics)),
+ Node::ForeignItem(item) => match item.kind {
+ ForeignItemKind::Fn(decl, _, _) => until_within(item.span, decl.output.span()),
+ _ => named_span(item.span, item.ident, None),
},
+ Node::Ctor(..) => return self.opt_span(self.get_parent_node(hir_id)),
+ _ => self.span_with_body(hir_id),
+ };
+ Some(span)
+ }
+
+ /// Like `hir.span()`, but includes the body of items
+ /// (instead of just the item header)
+ pub fn span_with_body(self, hir_id: HirId) -> Span {
+ match self.get(hir_id) {
+ Node::Param(param) => param.span,
+ Node::Item(item) => item.span,
+ Node::ForeignItem(foreign_item) => foreign_item.span,
+ Node::TraitItem(trait_item) => trait_item.span,
+ Node::ImplItem(impl_item) => impl_item.span,
Node::Variant(variant) => variant.span,
Node::Field(field) => field.span,
Node::AnonConst(constant) => self.body(constant.body).value.span,
Node::Pat(pat) => pat.span,
Node::Arm(arm) => arm.span,
Node::Block(block) => block.span,
- Node::Ctor(..) => match self.find(self.get_parent_node(hir_id))? {
- Node::Item(item) => item.span,
- Node::Variant(variant) => variant.span,
- _ => unreachable!(),
- },
+ Node::Ctor(..) => self.span_with_body(self.get_parent_node(hir_id)),
Node::Lifetime(lifetime) => lifetime.span,
Node::GenericParam(param) => param.span,
Node::Infer(i) => i.span,
Node::Local(local) => local.span,
Node::Crate(item) => item.spans.inner_span,
- };
- Some(span)
- }
-
- /// Like `hir.span()`, but includes the body of function items
- /// (instead of just the function header)
- pub fn span_with_body(self, hir_id: HirId) -> Span {
- match self.find(hir_id) {
- Some(Node::TraitItem(item)) => item.span,
- Some(Node::ImplItem(impl_item)) => impl_item.span,
- Some(Node::Item(item)) => item.span,
- Some(_) => self.span(hir_id),
- _ => bug!("hir::map::Map::span_with_body: id not in map: {:?}", hir_id),
}
}
#[cfg(cfail)]
struct C(A);
-//[cfail]~^ ERROR 12:1: 12:13: recursive type `C` has infinite size [E0072]
+//[cfail]~^ ERROR 12:1: 12:9: recursive type `C` has infinite size [E0072]
fn main() {}
- StorageDead(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
- StorageDead(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
StorageDead(_1); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
- return; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
+ return; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:28
}
bb2 (cleanup): {
- resume; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
+ resume; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:28
}
- }
-
_1 = &_2; // scope 0 at $DIR/const-promotion-extern-static.rs:16:20: 16:23
_0 = &(*_1); // scope 0 at $DIR/const-promotion-extern-static.rs:16:20: 16:23
StorageDead(_1); // scope 0 at $DIR/const-promotion-extern-static.rs:16:22: 16:23
- return; // scope 0 at $DIR/const-promotion-extern-static.rs:16:1: 16:24
+ return; // scope 0 at $DIR/const-promotion-extern-static.rs:16:1: 16:17
}
}
- StorageDead(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
- StorageDead(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
StorageDead(_1); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
- return; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
+ return; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:28
}
bb2 (cleanup): {
- resume; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
+ resume; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:28
}
}
-
-// MIR for `<impl at $DIR/issue-41697.rs:18:1: 22:2>::{constant#0}` after SimplifyCfg-promote-consts
+// MIR for `<impl at $DIR/issue-41697.rs:18:1: 18:23>::{constant#0}` after SimplifyCfg-promote-consts
-<impl at $DIR/issue-41697.rs:18:1: 22:2>::{constant#0}: usize = {
+<impl at $DIR/issue-41697.rs:18:1: 18:23>::{constant#0}: usize = {
let mut _0: usize; // return place in scope 0 at $DIR/issue-41697.rs:18:19: 18:22
let mut _1: (usize, bool); // in scope 0 at $DIR/issue-41697.rs:18:19: 18:22
-// MIR for `<impl at $DIR/issue-41697.rs:18:1: 22:2>::{constant#0}` after SimplifyCfg-promote-consts
+// MIR for `<impl at $DIR/issue-41697.rs:18:1: 18:23>::{constant#0}` after SimplifyCfg-promote-consts
-<impl at $DIR/issue-41697.rs:18:1: 22:2>::{constant#0}: usize = {
+<impl at $DIR/issue-41697.rs:18:1: 18:23>::{constant#0}: usize = {
let mut _0: usize; // return place in scope 0 at $DIR/issue-41697.rs:18:19: 18:22
let mut _1: (usize, bool); // in scope 0 at $DIR/issue-41697.rs:18:19: 18:22
-// MIR for `<impl at $DIR/retag.rs:11:1: 19:2>::foo` after SimplifyCfg-elaborate-drops
+// MIR for `<impl at $DIR/retag.rs:11:1: 11:10>::foo` after SimplifyCfg-elaborate-drops
-fn <impl at $DIR/retag.rs:11:1: 19:2>::foo(_1: &Test, _2: &mut i32) -> &mut i32 {
+fn <impl at $DIR/retag.rs:11:1: 11:10>::foo(_1: &Test, _2: &mut i32) -> &mut i32 {
debug self => _1; // in scope 0 at $DIR/retag.rs:13:16: 13:21
debug x => _2; // in scope 0 at $DIR/retag.rs:13:23: 13:24
let mut _0: &mut i32; // return place in scope 0 at $DIR/retag.rs:13:42: 13:53
-// MIR for `<impl at $DIR/retag.rs:11:1: 19:2>::foo_shr` after SimplifyCfg-elaborate-drops
+// MIR for `<impl at $DIR/retag.rs:11:1: 11:10>::foo_shr` after SimplifyCfg-elaborate-drops
-fn <impl at $DIR/retag.rs:11:1: 19:2>::foo_shr(_1: &Test, _2: &i32) -> &i32 {
+fn <impl at $DIR/retag.rs:11:1: 11:10>::foo_shr(_1: &Test, _2: &i32) -> &i32 {
debug self => _1; // in scope 0 at $DIR/retag.rs:16:20: 16:25
debug x => _2; // in scope 0 at $DIR/retag.rs:16:27: 16:28
let mut _0: &i32; // return place in scope 0 at $DIR/retag.rs:16:42: 16:49
_0 = &(*_1); // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:28: 23:2
StorageDead(_5); // scope 0 at $DIR/storage_live_dead_in_statics.rs:23:1: 23:2
StorageDead(_1); // scope 0 at $DIR/storage_live_dead_in_statics.rs:23:1: 23:2
- return; // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:1: 23:3
+ return; // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:1: 5:25
}
}
-// MIR for `<impl at $DIR/unusual-item-types.rs:9:1: 11:2>::ASSOCIATED_CONSTANT` 0 mir_map
+// MIR for `<impl at $DIR/unusual-item-types.rs:9:1: 9:7>::ASSOCIATED_CONSTANT` 0 mir_map
-const <impl at $DIR/unusual-item-types.rs:9:1: 11:2>::ASSOCIATED_CONSTANT: i32 = {
+const <impl at $DIR/unusual-item-types.rs:9:1: 9:7>::ASSOCIATED_CONSTANT: i32 = {
let mut _0: i32; // return place in scope 0 at $DIR/unusual-item-types.rs:10:32: 10:35
bb0: {
_0 = const 2_i32; // scope 0 at $DIR/unusual-item-types.rs:10:38: 10:39
- return; // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40
+ return; // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:35
}
}
-// MIR for `<impl at $DIR/unusual-item-types.rs:9:1: 11:2>::ASSOCIATED_CONSTANT` 0 mir_map
+// MIR for `<impl at $DIR/unusual-item-types.rs:9:1: 9:7>::ASSOCIATED_CONSTANT` 0 mir_map
-const <impl at $DIR/unusual-item-types.rs:9:1: 11:2>::ASSOCIATED_CONSTANT: i32 = {
+const <impl at $DIR/unusual-item-types.rs:9:1: 9:7>::ASSOCIATED_CONSTANT: i32 = {
let mut _0: i32; // return place in scope 0 at $DIR/unusual-item-types.rs:10:32: 10:35
bb0: {
_0 = const 2_i32; // scope 0 at $DIR/unusual-item-types.rs:10:38: 10:39
- return; // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40
+ return; // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:35
}
}
error: missing code example in this documentation
--> $DIR/lint-missing-doc-code-example.rs:19:1
|
-LL | / pub mod module1 {
-LL | | }
- | |_^
+LL | pub mod module1 {
+ | ^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/lint-missing-doc-code-example.rs:2:9
#[path = "auxiliary/source-code-bar.rs"]
pub mod bar;
-// @count - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#5-7"]' 4
+// @count - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#5"]' 4
use bar::Bar;
-// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#13-17"]' 'self'
-// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14-16"]' 'Trait'
+// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#13"]' 'self'
+// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14"]' 'Trait'
use bar::sub::{self, Trait};
pub struct Foo;
y.hello();
}
-// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14-16"]' 'bar::sub::Trait'
-// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14-16"]' 'Trait'
+// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14"]' 'bar::sub::Trait'
+// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14"]' 'Trait'
pub fn foo2<T: bar::sub::Trait, V: Trait>(t: &T, v: &V, b: bool) {}
pub trait AnotherTrait {}
// @has - '//*[@class="docblock"]' 'docs for my_macro'
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.2.3: text'
// @has - '//*[@class="stab unstable"]' 'macro_test'
-// @has - '//a/@href' '../src/macros/macros.rs.html#8-10'
+// @has - '//a/@href' '../src/macros/macros.rs.html#8'
pub use macros::my_macro;
--> $DIR/array_const_index-0.rs:2:16
|
LL | const B: i32 = (&A)[1];
- | ---------------^^^^^^^-
- | |
- | index out of bounds: the length is 0 but the index is 1
+ | ------------ ^^^^^^^ index out of bounds: the length is 0 but the index is 1
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/array_const_index-0.rs:2:16
|
LL | const B: i32 = (&A)[1];
- | ---------------^^^^^^^-
- | |
- | index out of bounds: the length is 0 but the index is 1
+ | ------------ ^^^^^^^ index out of bounds: the length is 0 but the index is 1
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/array_const_index-1.rs:2:16
|
LL | const B: i32 = A[1];
- | ---------------^^^^-
- | |
- | index out of bounds: the length is 0 but the index is 1
+ | ------------ ^^^^ index out of bounds: the length is 0 but the index is 1
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/array_const_index-1.rs:2:16
|
LL | const B: i32 = A[1];
- | ---------------^^^^-
- | |
- | index out of bounds: the length is 0 but the index is 1
+ | ------------ ^^^^ index out of bounds: the length is 0 but the index is 1
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/assoc-const-ty-mismatch.rs:5:3
|
LL | const N: usize;
- | ^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^
error: mismatch in bind of associated type, got const
--> $DIR/assoc-const-ty-mismatch.rs:25:18
--> $DIR/assoc-const-ty-mismatch.rs:9:3
|
LL | type T;
- | ^^^^^^^
+ | ^^^^^^
error: aborting due to 2 previous errors
--> $DIR/associated-const-ambiguity-report.rs:10:5
|
LL | const ID: i32 = 1;
- | ^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^
note: candidate #2 is defined in an impl of the trait `Bar` for the type `i32`
--> $DIR/associated-const-ambiguity-report.rs:14:5
|
LL | const ID: i32 = 3;
- | ^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^
help: disambiguate the associated constant for candidate #1
|
LL | const X: i32 = <i32 as Foo>::ID;
--> $DIR/associated-const-private-impl.rs:13:30
|
LL | const ID: i32 = 1;
- | ------------------ private associated constant defined here
+ | ------------- private associated constant defined here
...
LL | assert_eq!(1, bar1::Foo::ID);
| ^^ private associated constant
--> $DIR/defaults-cyclic-fail.rs:5:5
|
LL | const A: u8 = Self::B;
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
|
note: ...which requires const-evaluating + checking `Tr::B`...
--> $DIR/defaults-cyclic-fail.rs:8:5
|
LL | const B: u8 = Self::A;
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
= note: ...which again requires const-evaluating + checking `Tr::A`, completing the cycle
note: cycle used when const-evaluating + checking `main::promoted[1]`
--> $DIR/defaults-cyclic-fail.rs:16:16
--> $DIR/defaults-not-assumed-fail.rs:8:19
|
LL | const B: u8 = Self::A + 1;
- | --------------^^^^^^^^^^^-
- | |
- | attempt to compute `u8::MAX + 1_u8`, which would overflow
+ | ----------- ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/defaults-not-assumed-fail.rs:8:19
|
LL | const B: u8 = Self::A + 1;
- | --------------^^^^^^^^^^^-
- | |
- | attempt to compute `u8::MAX + 1_u8`, which would overflow
+ | ----------- ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
-error[E0391]: cycle detected when elaborating drops for `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 13:2>::BAR`
+error[E0391]: cycle detected when elaborating drops for `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 11:19>::BAR`
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:22
|
LL | const BAR: u32 = IMPL_REF_BAR;
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1
|
LL | const IMPL_REF_BAR: u32 = GlobalImplRef::BAR;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires const-evaluating + checking `IMPL_REF_BAR`...
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1
|
LL | const IMPL_REF_BAR: u32 = GlobalImplRef::BAR;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 13:2>::BAR`...
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 11:19>::BAR`...
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:5
|
LL | const BAR: u32 = IMPL_REF_BAR;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires caching mir of `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 13:2>::BAR` for CTFE...
+ | ^^^^^^^^^^^^^^
+note: ...which requires caching mir of `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 11:19>::BAR` for CTFE...
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:5
|
LL | const BAR: u32 = IMPL_REF_BAR;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: ...which again requires elaborating drops for `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 13:2>::BAR`, completing the cycle
+ | ^^^^^^^^^^^^^^
+ = note: ...which again requires elaborating drops for `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 11:19>::BAR`, completing the cycle
= note: cycle used when running analysis passes on this crate
error: aborting due to previous error
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:1
|
LL | const DEFAULT_REF_BAR: u32 = <GlobalDefaultRef>::BAR;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires const-evaluating + checking `DEFAULT_REF_BAR`...
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:1
|
LL | const DEFAULT_REF_BAR: u32 = <GlobalDefaultRef>::BAR;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires const-evaluating + checking `FooDefault::BAR`...
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5
|
LL | const BAR: u32 = DEFAULT_REF_BAR;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^
note: ...which requires caching mir of `FooDefault::BAR` for CTFE...
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5
|
LL | const BAR: u32 = DEFAULT_REF_BAR;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^
= note: ...which again requires elaborating drops for `FooDefault::BAR`, completing the cycle
= note: cycle used when running analysis passes on this crate
-error[E0391]: cycle detected when elaborating drops for `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 13:2>::BAR`
+error[E0391]: cycle detected when elaborating drops for `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 11:28>::BAR`
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:22
|
LL | const BAR: u32 = TRAIT_REF_BAR;
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1
|
LL | const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires const-evaluating + checking `TRAIT_REF_BAR`...
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1
|
LL | const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 13:2>::BAR`...
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 11:28>::BAR`...
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:5
|
LL | const BAR: u32 = TRAIT_REF_BAR;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires caching mir of `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 13:2>::BAR` for CTFE...
+ | ^^^^^^^^^^^^^^
+note: ...which requires caching mir of `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 11:28>::BAR` for CTFE...
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:5
|
LL | const BAR: u32 = TRAIT_REF_BAR;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: ...which again requires elaborating drops for `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 13:2>::BAR`, completing the cycle
+ | ^^^^^^^^^^^^^^
+ = note: ...which again requires elaborating drops for `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 11:28>::BAR`, completing the cycle
= note: cycle used when running analysis passes on this crate
error: aborting due to previous error
--> $DIR/associated-item-duplicate-names-2.rs:5:5
|
LL | const bar: bool = true;
- | ----------------------- previous definition of `bar` here
+ | --------------- previous definition of `bar` here
LL | fn bar() {}
| ^^^^^^^^ duplicate definition
--> $DIR/associated-item-duplicate-names-3.rs:14:5
|
LL | type Bar = i16;
- | --------------- previous definition of `Bar` here
+ | -------- previous definition of `Bar` here
LL | type Bar = u16;
- | ^^^^^^^^^^^^^^^ duplicate definition
+ | ^^^^^^^^ duplicate definition
error: aborting due to previous error
--> $DIR/associated-item-duplicate-names.rs:11:5
|
LL | type Ty = ();
- | ------------- previous definition of `Ty` here
+ | ------- previous definition of `Ty` here
LL | type Ty = usize;
- | ^^^^^^^^^^^^^^^^ duplicate definition
+ | ^^^^^^^ duplicate definition
error[E0201]: duplicate definitions with name `BAR`:
--> $DIR/associated-item-duplicate-names.rs:13:5
|
LL | const BAR: u32 = 7;
- | ------------------- previous definition of `BAR` here
+ | -------------- previous definition of `BAR` here
LL | const BAR: u32 = 8;
- | ^^^^^^^^^^^^^^^^^^^ duplicate definition
+ | ^^^^^^^^^^^^^^ duplicate definition
error: aborting due to 2 previous errors
--> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:16:24
|
LL | type Color;
- | ----------- ambiguous `Color` from `Vehicle`
+ | ---------- ambiguous `Color` from `Vehicle`
...
LL | type Color;
- | ----------- ambiguous `Color` from `Box`
+ | ---------- ambiguous `Color` from `Box`
...
LL | fn a<C:Vehicle+Box>(_: C::Color) {
| ^^^^^^^^ ambiguous associated type `Color`
--> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:20:12
|
LL | type Color;
- | ----------- ambiguous `Color` from `Vehicle`
+ | ---------- ambiguous `Color` from `Vehicle`
...
LL | type Color;
- | ----------- ambiguous `Color` from `Box`
+ | ---------- ambiguous `Color` from `Box`
...
LL | fn b<C>(_: C::Color) where C : Vehicle+Box {
| ^^^^^^^^ ambiguous associated type `Color`
--> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:24:12
|
LL | type Color;
- | ----------- ambiguous `Color` from `Vehicle`
+ | ---------- ambiguous `Color` from `Vehicle`
...
LL | type Color;
- | ----------- ambiguous `Color` from `Box`
+ | ---------- ambiguous `Color` from `Box`
...
LL | fn c<C>(_: C::Color) where C : Vehicle, C : Box {
| ^^^^^^^^ ambiguous associated type `Color`
--> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:35:20
|
LL | type Color;
- | ----------- ambiguous `Color` from `Vehicle`
+ | ---------- ambiguous `Color` from `Vehicle`
...
LL | type Color;
- | ----------- ambiguous `Color` from `Box`
+ | ---------- ambiguous `Color` from `Box`
...
LL | fn e(&self, _: X::Color) where X : Box;
| ^^^^^^^^ ambiguous associated type `Color`
--> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:38:20
|
LL | type Color;
- | ----------- ambiguous `Color` from `Vehicle`
+ | ---------- ambiguous `Color` from `Vehicle`
...
LL | type Color;
- | ----------- ambiguous `Color` from `Box`
+ | ---------- ambiguous `Color` from `Box`
...
LL | fn f(&self, _: X::Color) where X : Box { }
| ^^^^^^^^ ambiguous associated type `Color`
--> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:30:20
|
LL | type Color;
- | ----------- ambiguous `Color` from `Vehicle`
+ | ---------- ambiguous `Color` from `Vehicle`
...
LL | type Color;
- | ----------- ambiguous `Color` from `Box`
+ | ---------- ambiguous `Color` from `Box`
...
LL | fn d(&self, _: X::Color) where X : Box { }
| ^^^^^^^^ ambiguous associated type `Color`
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:19:32
|
LL | type Color;
- | ----------- ambiguous `Color` from `Vehicle`
+ | ---------- ambiguous `Color` from `Vehicle`
...
LL | type Color;
- | ----------- ambiguous `Color` from `Box`
+ | ---------- ambiguous `Color` from `Box`
...
LL | fn dent<C:BoxCar>(c: C, color: C::Color) {
| ^^^^^^^^ ambiguous associated type `Color`
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:23:37
|
LL | type Color;
- | ----------- ambiguous `Color` from `Vehicle`
+ | ---------- ambiguous `Color` from `Vehicle`
...
LL | type Color;
- | ----------- ambiguous `Color` from `Box`
+ | ---------- ambiguous `Color` from `Box`
...
LL | fn dent_object<COLOR>(c: dyn BoxCar<Color=COLOR>) {
| ^^^^^^^^^^^ ambiguous associated type `Color`
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:23:30
|
LL | type Color;
- | ----------- `Vehicle::Color` defined here
+ | ---------- `Vehicle::Color` defined here
...
LL | type Color;
- | ----------- `Box::Color` defined here
+ | ---------- `Box::Color` defined here
...
LL | fn dent_object<COLOR>(c: dyn BoxCar<Color=COLOR>) {
| ^^^^^^^^^^^^^^^^^^^ associated types `Color` (from trait `Vehicle`), `Color` (from trait `Box`) must be specified
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:28:29
|
LL | type Color;
- | ----------- ambiguous `Color` from `Vehicle`
+ | ---------- ambiguous `Color` from `Vehicle`
...
LL | type Color;
- | ----------- ambiguous `Color` from `Box`
+ | ---------- ambiguous `Color` from `Box`
...
LL | fn paint<C:BoxCar>(c: C, d: C::Color) {
| ^^^^^^^^ ambiguous associated type `Color`
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:32:32
|
LL | type Color;
- | ----------- `Vehicle::Color` defined here
+ | ---------- `Vehicle::Color` defined here
...
LL | type Color;
- | ----------- `Box::Color` defined here
+ | ---------- `Box::Color` defined here
...
LL | fn dent_object_2<COLOR>(c: dyn BoxCar) where <dyn BoxCar as Vehicle>::Color = COLOR {
| ^^^^^^ associated types `Color` (from trait `Vehicle`), `Color` (from trait `Box`) must be specified
--> $DIR/associated-types-coherence-failure.rs:21:1
|
LL | impl<'a, B: ?Sized> IntoCow<'a, B> for <B as ToOwned>::Owned where B: ToOwned {
- | ----------------------------------------------------------------------------- first implementation here
+ | ------------------------------------------------------------ first implementation here
...
LL | impl<'a, B: ?Sized> IntoCow<'a, B> for Cow<'a, B> where B: ToOwned {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Cow<'_, _>`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Cow<'_, _>`
error[E0119]: conflicting implementations of trait `IntoCow<'_, _>` for type `&_`
--> $DIR/associated-types-coherence-failure.rs:28:1
|
LL | impl<'a, B: ?Sized> IntoCow<'a, B> for <B as ToOwned>::Owned where B: ToOwned {
- | ----------------------------------------------------------------------------- first implementation here
+ | ------------------------------------------------------------ first implementation here
...
LL | impl<'a, B: ?Sized> IntoCow<'a, B> for &'a B where B: ToOwned {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&_`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&_`
error: aborting due to 2 previous errors
--> $DIR/associated-types-incomplete-object.rs:23:30
|
LL | type B;
- | ------- `B` defined here
+ | ------ `B` defined here
...
LL | let b = &42isize as &dyn Foo<A=usize>;
| ^^^^^^^^^^^^ help: specify the associated type: `Foo<A=usize, B = Type>`
--> $DIR/associated-types-incomplete-object.rs:26:30
|
LL | type A;
- | ------- `A` defined here
+ | ------ `A` defined here
...
LL | let c = &42isize as &dyn Foo<B=char>;
| ^^^^^^^^^^^ help: specify the associated type: `Foo<B=char, A = Type>`
--> $DIR/associated-types-incomplete-object.rs:29:30
|
LL | type A;
- | ------- `A` defined here
+ | ------ `A` defined here
LL | type B;
- | ------- `B` defined here
+ | ------ `B` defined here
...
LL | let d = &42isize as &dyn Foo;
| ^^^ help: specify the associated types: `Foo<A = Type, B = Type>`
--> $DIR/associated-types-issue-17359.rs:8:1
|
LL | type Type;
- | ---------- `Type` from trait
+ | --------- `Type` from trait
...
LL | impl Trait for isize {}
| ^^^^^^^^^^^^^^^^^^^^ missing `Type` in implementation
--> $DIR/associated-types-path-1.rs:11:34
|
LL | type A;
- | ------- ambiguous `A` from `Foo`
+ | ------ ambiguous `A` from `Foo`
...
LL | type A;
- | ------- ambiguous `A` from `Bar`
+ | ------ ambiguous `A` from `Bar`
...
LL | pub fn f2<T: Foo + Bar>(a: T, x: T::A) {}
| ^^^^ ambiguous associated type `A`
--> $DIR/defaults-mixed.rs:11:1
|
LL | type Bar;
- | --------- `Bar` from trait
+ | -------- `Bar` from trait
...
LL | impl Trait for () {}
| ^^^^^^^^^^^^^^^^^ missing `Bar` in implementation
--> $DIR/defaults-mixed.rs:14:1
|
LL | type Bar;
- | --------- `Bar` from trait
+ | -------- `Bar` from trait
...
LL | impl Trait for bool {
| ^^^^^^^^^^^^^^^^^^^ missing `Bar` in implementation
error[E0275]: overflow evaluating the requirement `for<'b> u32: X<'b>`
--> $DIR/hr-associated-type-bound-2.rs:11:1
|
-LL | / impl X<'_> for u32
-LL | | where
-LL | | for<'b> <Self as X<'b>>::U: Clone,
-LL | | {
-LL | | type U = str;
-LL | | }
- | |_^
+LL | impl X<'_> for u32
+ | ^^^^^^^^^^^^^^^^^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`hr_associated_type_bound_2`)
note: required because of the requirements on the impl of `for<'b> X<'b>` for `u32`
error[E0275]: overflow evaluating the requirement `<(T,) as Grault>::A == _`
--> $DIR/impl-wf-cycle-1.rs:15:1
|
-LL | / impl<T: Grault> Grault for (T,)
-LL | |
-LL | | where
-LL | | Self::A: Baz,
-... |
-LL | | type B = bool;
-LL | | }
- | |_^
+LL | impl<T: Grault> Grault for (T,)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: required because of the requirements on the impl of `Grault` for `(T,)`
--> $DIR/impl-wf-cycle-1.rs:15:17
error[E0275]: overflow evaluating the requirement `<(T,) as Grault>::A == _`
--> $DIR/impl-wf-cycle-2.rs:7:1
|
-LL | / impl<T: Grault> Grault for (T,)
-LL | |
-LL | | where
-LL | | Self::A: Copy,
-LL | | {
-LL | | type A = ();
-LL | | }
- | |_^
+LL | impl<T: Grault> Grault for (T,)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: required because of the requirements on the impl of `Grault` for `(T,)`
--> $DIR/impl-wf-cycle-2.rs:7:17
error[E0393]: the type parameter `Rhs` must be explicitly specified
--> $DIR/issue-22560.rs:9:23
|
-LL | / trait Sub<Rhs=Self> {
-LL | | type Output;
-LL | | }
- | |_- type parameter `Rhs` must be specified for this
-LL |
-LL | type Test = dyn Add + Sub;
- | ^^^ help: set the type parameter to the desired type: `Sub<Rhs>`
+LL | trait Sub<Rhs=Self> {
+ | ------------------- type parameter `Rhs` must be specified for this
+...
+LL | type Test = dyn Add + Sub;
+ | ^^^ help: set the type parameter to the desired type: `Sub<Rhs>`
|
= note: because of the default `Self` reference, type parameters must be specified on object types
error[E0393]: the type parameter `Rhs` must be explicitly specified
--> $DIR/issue-22560.rs:9:17
|
-LL | / trait Add<Rhs=Self> {
-LL | | type Output;
-LL | | }
- | |_- type parameter `Rhs` must be specified for this
+LL | trait Add<Rhs=Self> {
+ | ------------------- type parameter `Rhs` must be specified for this
...
-LL | type Test = dyn Add + Sub;
- | ^^^ help: set the type parameter to the desired type: `Add<Rhs>`
+LL | type Test = dyn Add + Sub;
+ | ^^^ help: set the type parameter to the desired type: `Add<Rhs>`
|
= note: because of the default `Self` reference, type parameters must be specified on object types
--> $DIR/issue-22560.rs:9:17
|
LL | type Output;
- | ------------ `Output` defined here
+ | ----------- `Output` defined here
...
LL | type Output;
- | ------------ `Output` defined here
+ | ----------- `Output` defined here
...
LL | type Test = dyn Add + Sub;
| ^^^ ^^^ associated type `Output` must be specified
--> $DIR/issue-23595-1.rs:8:58
|
LL | type Value;
- | ----------- `Value` defined here
+ | ---------- `Value` defined here
LL | type ChildKey;
- | -------------- `ChildKey` defined here
+ | ------------- `ChildKey` defined here
LL | type Children = dyn Index<Self::ChildKey, Output=dyn Hierarchy>;
- | -----------------------------------------------------^^^^^^^^^--
- | | |
- | | help: specify the associated types: `Hierarchy<Value = Type, ChildKey = Type, Children = Type>`
- | `Children` defined here
+ | ------------- `Children` defined here ^^^^^^^^^ help: specify the associated types: `Hierarchy<Value = Type, ChildKey = Type, Children = Type>`
error: aborting due to previous error
LL | |
LL | |
LL | | Service<AssocType = <Bug as Foo>::OnlyFoo>
-... |
-LL | |
-LL | | }
- | |_^ the trait `Foo` is not implemented for `Bug`
+ | |______________________________________________^ the trait `Foo` is not implemented for `Bug`
|
help: consider further restricting this bound
|
--> $DIR/issue-85103.rs:6:1
|
LL | type Edges<'a, E> = Cow<'a, [E]>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/missing-associated-types.rs:12:21
|
LL | type A;
- | ------- `A` defined here
+ | ------ `A` defined here
...
LL | type Foo<Rhs> = dyn Add<Rhs> + Sub<Rhs> + X<Rhs> + Y<Rhs>;
| ^^^^^^^^ ^^^^^^^^ ^^^^^^ ^^^^^^ associated type `A` must be specified
--> $DIR/missing-associated-types.rs:15:21
|
LL | type A;
- | ------- `A` defined here
+ | ------ `A` defined here
LL | type B;
- | ------- `B` defined here
+ | ------ `B` defined here
...
LL | type Bar<Rhs> = dyn Add<Rhs> + Sub<Rhs> + X<Rhs> + Z<Rhs>;
| ^^^^^^^^ ^^^^^^^^ ^^^^^^ ^^^^^^ associated types `A`, `B`, `Output` must be specified
--> $DIR/missing-associated-types.rs:18:21
|
LL | type A;
- | ------- `A` defined here
+ | ------ `A` defined here
...
LL | type Baz<Rhs> = dyn Add<Rhs> + Sub<Rhs> + Y<Rhs>;
| ^^^^^^^^ ^^^^^^^^ ^^^^^^ associated type `A` must be specified
--> $DIR/suspicious-impls-lint.rs:9:1
|
LL | unsafe impl<T: Send> Send for MayImplementSendErr<&T> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/suspicious-impls-lint.rs:1:9
--> $DIR/suspicious-impls-lint.rs:8:1
|
LL | struct MayImplementSendErr<T>(T);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: cross-crate traits with a default impl, like `Send`, should not be specialized
--> $DIR/suspicious-impls-lint.rs:21:1
|
LL | unsafe impl Send for ContainsVec<i32> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this will change its meaning in a future release!
= note: for more information, see issue #93367 <https://github.com/rust-lang/rust/issues/93367>
--> $DIR/suspicious-impls-lint.rs:20:1
|
LL | struct ContainsVec<T>(Vec<T>);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^
error: cross-crate traits with a default impl, like `Send`, should not be specialized
--> $DIR/suspicious-impls-lint.rs:32:1
|
LL | unsafe impl<T: Send> Send for TwoParamsSame<T, T> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this will change its meaning in a future release!
= note: for more information, see issue #93367 <https://github.com/rust-lang/rust/issues/93367>
--> $DIR/suspicious-impls-lint.rs:31:1
|
LL | struct TwoParamsSame<T, U>(T, U);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: cross-crate traits with a default impl, like `Send`, should not be specialized
--> $DIR/suspicious-impls-lint.rs:40:1
|
LL | unsafe impl<T> Send for WithPhantomDataSend<*const T, i8> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this will change its meaning in a future release!
= note: for more information, see issue #93367 <https://github.com/rust-lang/rust/issues/93367>
--> $DIR/suspicious-impls-lint.rs:39:1
|
LL | pub struct WithPhantomDataSend<T, U>(PhantomData<T>, U);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: cross-crate traits with a default impl, like `Sync`, should not be specialized
--> $DIR/suspicious-impls-lint.rs:46:1
|
LL | unsafe impl<T> Sync for WithLifetime<'static, Vec<T>> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this will change its meaning in a future release!
= note: for more information, see issue #93367 <https://github.com/rust-lang/rust/issues/93367>
--> $DIR/suspicious-impls-lint.rs:44:1
|
LL | pub struct WithLifetime<'a, T>(&'a (), T);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 5 previous errors
--> $DIR/issue-28837.rs:1:1
|
LL | struct A;
- | ^^^^^^^^^ must implement `Add<_>`
+ | ^^^^^^^^ must implement `Add<_>`
note: the following trait must be implemented
--> $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
-LL | / pub trait Add<Rhs = Self> {
-LL | | /// The resulting type after applying the `+` operator.
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-LL | | type Output;
-... |
-LL | | fn add(self, rhs: Rhs) -> Self::Output;
-LL | | }
- | |_^
+LL | pub trait Add<Rhs = Self> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0369]: cannot subtract `A` from `A`
--> $DIR/issue-28837.rs:8:7
--> $DIR/issue-28837.rs:1:1
|
LL | struct A;
- | ^^^^^^^^^ must implement `Sub<_>`
+ | ^^^^^^^^ must implement `Sub<_>`
note: the following trait must be implemented
--> $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
-LL | / pub trait Sub<Rhs = Self> {
-LL | | /// The resulting type after applying the `-` operator.
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-LL | | type Output;
-... |
-LL | | fn sub(self, rhs: Rhs) -> Self::Output;
-LL | | }
- | |_^
+LL | pub trait Sub<Rhs = Self> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0369]: cannot multiply `A` by `A`
--> $DIR/issue-28837.rs:10:7
--> $DIR/issue-28837.rs:1:1
|
LL | struct A;
- | ^^^^^^^^^ must implement `Mul<_>`
+ | ^^^^^^^^ must implement `Mul<_>`
note: the following trait must be implemented
--> $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
-LL | / pub trait Mul<Rhs = Self> {
-LL | | /// The resulting type after applying the `*` operator.
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-LL | | type Output;
-... |
-LL | | fn mul(self, rhs: Rhs) -> Self::Output;
-LL | | }
- | |_^
+LL | pub trait Mul<Rhs = Self> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0369]: cannot divide `A` by `A`
--> $DIR/issue-28837.rs:12:7
--> $DIR/issue-28837.rs:1:1
|
LL | struct A;
- | ^^^^^^^^^ must implement `Div<_>`
+ | ^^^^^^^^ must implement `Div<_>`
note: the following trait must be implemented
--> $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
-LL | / pub trait Div<Rhs = Self> {
-LL | | /// The resulting type after applying the `/` operator.
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-LL | | type Output;
-... |
-LL | | fn div(self, rhs: Rhs) -> Self::Output;
-LL | | }
- | |_^
+LL | pub trait Div<Rhs = Self> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0369]: cannot mod `A` by `A`
--> $DIR/issue-28837.rs:14:7
--> $DIR/issue-28837.rs:1:1
|
LL | struct A;
- | ^^^^^^^^^ must implement `Rem<_>`
+ | ^^^^^^^^ must implement `Rem<_>`
note: the following trait must be implemented
--> $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
-LL | / pub trait Rem<Rhs = Self> {
-LL | | /// The resulting type after applying the `%` operator.
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-LL | | type Output;
-... |
-LL | | fn rem(self, rhs: Rhs) -> Self::Output;
-LL | | }
- | |_^
+LL | pub trait Rem<Rhs = Self> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0369]: no implementation for `A & A`
--> $DIR/issue-28837.rs:16:7
--> $DIR/issue-28837.rs:1:1
|
LL | struct A;
- | ^^^^^^^^^ must implement `BitAnd<_>`
+ | ^^^^^^^^ must implement `BitAnd<_>`
note: the following trait must be implemented
--> $SRC_DIR/core/src/ops/bit.rs:LL:COL
|
-LL | / pub trait BitAnd<Rhs = Self> {
-LL | | /// The resulting type after applying the `&` operator.
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-LL | | type Output;
-... |
-LL | | fn bitand(self, rhs: Rhs) -> Self::Output;
-LL | | }
- | |_^
+LL | pub trait BitAnd<Rhs = Self> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0369]: no implementation for `A | A`
--> $DIR/issue-28837.rs:18:7
--> $DIR/issue-28837.rs:1:1
|
LL | struct A;
- | ^^^^^^^^^ must implement `BitOr<_>`
+ | ^^^^^^^^ must implement `BitOr<_>`
note: the following trait must be implemented
--> $SRC_DIR/core/src/ops/bit.rs:LL:COL
|
-LL | / pub trait BitOr<Rhs = Self> {
-LL | | /// The resulting type after applying the `|` operator.
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-LL | | type Output;
-... |
-LL | | fn bitor(self, rhs: Rhs) -> Self::Output;
-LL | | }
- | |_^
+LL | pub trait BitOr<Rhs = Self> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0369]: no implementation for `A << A`
--> $DIR/issue-28837.rs:20:7
--> $DIR/issue-28837.rs:1:1
|
LL | struct A;
- | ^^^^^^^^^ must implement `Shl<_>`
+ | ^^^^^^^^ must implement `Shl<_>`
note: the following trait must be implemented
--> $SRC_DIR/core/src/ops/bit.rs:LL:COL
|
-LL | / pub trait Shl<Rhs = Self> {
-LL | | /// The resulting type after applying the `<<` operator.
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-LL | | type Output;
-... |
-LL | | fn shl(self, rhs: Rhs) -> Self::Output;
-LL | | }
- | |_^
+LL | pub trait Shl<Rhs = Self> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0369]: no implementation for `A >> A`
--> $DIR/issue-28837.rs:22:7
--> $DIR/issue-28837.rs:1:1
|
LL | struct A;
- | ^^^^^^^^^ must implement `Shr<_>`
+ | ^^^^^^^^ must implement `Shr<_>`
note: the following trait must be implemented
--> $SRC_DIR/core/src/ops/bit.rs:LL:COL
|
-LL | / pub trait Shr<Rhs = Self> {
-LL | | /// The resulting type after applying the `>>` operator.
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-LL | | type Output;
-... |
-LL | | fn shr(self, rhs: Rhs) -> Self::Output;
-LL | | }
- | |_^
+LL | pub trait Shr<Rhs = Self> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0369]: binary operation `==` cannot be applied to type `A`
--> $DIR/issue-28837.rs:24:7
--> $DIR/issue-28837.rs:1:1
|
LL | struct A;
- | ^^^^^^^^^ must implement `PartialEq<_>`
+ | ^^^^^^^^ must implement `PartialEq<_>`
help: consider annotating `A` with `#[derive(PartialEq)]`
|
LL | #[derive(PartialEq)]
--> $DIR/issue-28837.rs:1:1
|
LL | struct A;
- | ^^^^^^^^^ must implement `PartialEq<_>`
+ | ^^^^^^^^ must implement `PartialEq<_>`
help: consider annotating `A` with `#[derive(PartialEq)]`
|
LL | #[derive(PartialEq)]
--> $DIR/issue-28837.rs:1:1
|
LL | struct A;
- | ^^^^^^^^^ must implement `PartialOrd<_>`
+ | ^^^^^^^^ must implement `PartialOrd<_>`
help: consider annotating `A` with `#[derive(PartialEq, PartialOrd)]`
|
LL | #[derive(PartialEq, PartialOrd)]
--> $DIR/issue-28837.rs:1:1
|
LL | struct A;
- | ^^^^^^^^^ must implement `PartialOrd<_>`
+ | ^^^^^^^^ must implement `PartialOrd<_>`
help: consider annotating `A` with `#[derive(PartialEq, PartialOrd)]`
|
LL | #[derive(PartialEq, PartialOrd)]
--> $DIR/issue-28837.rs:1:1
|
LL | struct A;
- | ^^^^^^^^^ must implement `PartialOrd<_>`
+ | ^^^^^^^^ must implement `PartialOrd<_>`
help: consider annotating `A` with `#[derive(PartialEq, PartialOrd)]`
|
LL | #[derive(PartialEq, PartialOrd)]
--> $DIR/issue-28837.rs:1:1
|
LL | struct A;
- | ^^^^^^^^^ must implement `PartialOrd<_>`
+ | ^^^^^^^^ must implement `PartialOrd<_>`
help: consider annotating `A` with `#[derive(PartialEq, PartialOrd)]`
|
LL | #[derive(PartialEq, PartialOrd)]
note: the following trait must be implemented
--> $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
-LL | / pub trait Mul<Rhs = Self> {
-LL | | /// The resulting type after applying the `*` operator.
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-LL | | type Output;
-... |
-LL | | fn mul(self, rhs: Rhs) -> Self::Output;
-LL | | }
- | |_^
+LL | pub trait Mul<Rhs = Self> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/blind-item-block-middle.rs:6:9
|
LL | mod foo { pub struct bar; }
- | --------------- unit struct defined here
+ | -------------- unit struct defined here
...
LL | let bar = 5;
| ^^^ - this expression has type `{integer}`
--> $DIR/issue-81365-1.rs:12:5
|
LL | type Target = DerefTarget;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/issue-81365-2.rs:12:5
|
LL | type Target = DerefTarget;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/issue-81365-3.rs:23:5
|
LL | type Target = Container;
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/issue-81365-4.rs:24:5
|
LL | type Target = Container;
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/issue-81365-5.rs:19:5
|
LL | type Target = DerefTarget;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/issue-81365-6.rs:9:5
|
LL | type Target = [()];
- | ^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/issue-81365-7.rs:12:5
|
LL | type Target = DerefTarget;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/issue-81365-8.rs:12:5
|
LL | type Target = DerefTarget;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/issue-81899.rs:4:23
|
LL | const _CONST: &[u8] = &f(&[], |_| {});
- | ----------------------^^^^^^^^^^^^^^^-
- | |
- | referenced constant has errors
+ | ------------------- ^^^^^^^^^^^^^^^ referenced constant has errors
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/issue-81899.rs:4:23
|
LL | const _CONST: &[u8] = &f(&[], |_| {});
- | ----------------------^^^^^^^^^^^^^^^-
- | |
- | referenced constant has errors
+ | ------------------- ^^^^^^^^^^^^^^^ referenced constant has errors
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/issue-88434-minimal-example.rs:3:21
|
LL | const _CONST: &() = &f(&|_| {});
- | --------------------^^^^^^^^^^^-
- | |
- | referenced constant has errors
+ | ----------------- ^^^^^^^^^^^ referenced constant has errors
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/issue-88434-minimal-example.rs:3:21
|
LL | const _CONST: &() = &f(&|_| {});
- | --------------------^^^^^^^^^^^-
- | |
- | referenced constant has errors
+ | ----------------- ^^^^^^^^^^^ referenced constant has errors
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/issue-88434-removal-index-should-be-less.rs:3:23
|
LL | const _CONST: &[u8] = &f(&[], |_| {});
- | ----------------------^^^^^^^^^^^^^^^-
- | |
- | referenced constant has errors
+ | ------------------- ^^^^^^^^^^^^^^^ referenced constant has errors
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/issue-88434-removal-index-should-be-less.rs:3:23
|
LL | const _CONST: &[u8] = &f(&[], |_| {});
- | ----------------------^^^^^^^^^^^^^^^-
- | |
- | referenced constant has errors
+ | ------------------- ^^^^^^^^^^^^^^^ referenced constant has errors
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/auxiliary/match_non_exhaustive_lib.rs:2:1
|
LL | pub enum E1 {}
- | ^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
= note: the matched value is of type `E1`, which is marked as non-exhaustive
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
--> $DIR/auxiliary/match_non_exhaustive_lib.rs:5:1
|
LL | pub enum E2 { A, B }
- | ^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
= note: the matched value is of type `E2`, which is marked as non-exhaustive
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
--> $DIR/coherence-overlap-downstream.rs:14:1
|
LL | impl<X, T> Foo<X> for T where T: Bar<X> {}
- | --------------------------------------- first implementation here
+ | ----------------------- first implementation here
LL | impl<X> Foo<X> for i32 {}
| ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32`
|
--> $DIR/coherence-overlap-upstream.rs:13:1
|
LL | impl<T> Foo for T where T: Remote {}
- | --------------------------------- first implementation here
+ | ----------------- first implementation here
LL | impl Foo for i16 {}
| ^^^^^^^^^^^^^^^^ conflicting implementation for `i16`
|
error: conflicting implementations of trait `IntoWasmAbi` for type `&dyn std::ops::Fn(&_) -> _`
--> $DIR/coherence-wasm-bindgen.rs:28:1
|
-LL | / impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn Fn(A) -> R + 'b)
-LL | | where
-LL | | A: FromWasmAbi,
-LL | | R: ReturnWasmAbi,
-LL | | {
-LL | | }
- | |_- first implementation here
+LL | impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn Fn(A) -> R + 'b)
+ | ------------------------------------------------------------ first implementation here
...
-LL | / impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn for<'x> Fn(&'x A) -> R + 'b)
-LL | | where
-LL | | A: RefFromWasmAbi,
-LL | | R: ReturnWasmAbi,
-... |
-LL | |
-LL | | }
- | |_^ conflicting implementation for `&dyn std::ops::Fn(&_) -> _`
+LL | impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn for<'x> Fn(&'x A) -> R + 'b)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&dyn std::ops::Fn(&_) -> _`
|
note: the lint level is defined here
--> $DIR/coherence-wasm-bindgen.rs:10:9
--> $DIR/conflicting-repr-hints.rs:29:1
|
LL | struct F(i32);
- | ^^^^^^^^^^^^^^
+ | ^^^^^^^^
error[E0587]: type has conflicting packed and align representation hints
--> $DIR/conflicting-repr-hints.rs:33:1
|
LL | struct G(i32);
- | ^^^^^^^^^^^^^^
+ | ^^^^^^^^
error[E0587]: type has conflicting packed and align representation hints
--> $DIR/conflicting-repr-hints.rs:37:1
|
LL | struct H(i32);
- | ^^^^^^^^^^^^^^
+ | ^^^^^^^^
error[E0634]: type has conflicting packed representation hints
--> $DIR/conflicting-repr-hints.rs:40:1
|
LL | struct I(i32);
- | ^^^^^^^^^^^^^^
+ | ^^^^^^^^
error[E0634]: type has conflicting packed representation hints
--> $DIR/conflicting-repr-hints.rs:44:1
|
LL | struct J(i32);
- | ^^^^^^^^^^^^^^
+ | ^^^^^^^^
error[E0587]: type has conflicting packed and align representation hints
--> $DIR/conflicting-repr-hints.rs:50:1
|
-LL | / union X {
-LL | |
-LL | | i: i32,
-LL | | }
- | |_^
+LL | union X {
+ | ^^^^^^^
error[E0587]: type has conflicting packed and align representation hints
--> $DIR/conflicting-repr-hints.rs:57:1
|
-LL | / union Y {
-LL | |
-LL | | i: i32,
-LL | | }
- | |_^
+LL | union Y {
+ | ^^^^^^^
error[E0587]: type has conflicting packed and align representation hints
--> $DIR/conflicting-repr-hints.rs:64:1
|
-LL | / union Z {
-LL | |
-LL | | i: i32,
-LL | | }
- | |_^
+LL | union Z {
+ | ^^^^^^^
error[E0587]: type has conflicting packed and align representation hints
--> $DIR/conflicting-repr-hints.rs:70:1
|
LL | pub struct S(u16);
- | ^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0587]: type has conflicting packed and align representation hints
--> $DIR/conflicting-repr-hints.rs:73:1
|
-LL | / pub union U {
-LL | | u: u16
-LL | | }
- | |_^
+LL | pub union U {
+ | ^^^^^^^^^^^
error: aborting due to 12 previous errors
--> $DIR/eval-privacy.rs:16:5
|
LL | type AssocTy = Const<{ my_const_fn(U) }>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^^ can't leak private type
...
LL | const fn my_const_fn(val: u8) -> u8 {
| ----------------------------------- `fn(u8) -> u8 {my_const_fn}` declared as private
--> $DIR/issue-83765.rs:5:5
|
LL | const DIM: usize;
- | ^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^
|
note: ...which requires checking if `TensorDimension` fulfills its obligations...
--> $DIR/issue-83765.rs:4:1
--> $DIR/forbidden_slices.rs:26:1
|
LL | pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered uninitialized bytes
+ | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered uninitialized bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/forbidden_slices.rs:28:1
|
LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, size_of::<&u32>()) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered a pointer, but expected plain (non-pointer) bytes
+ | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered a pointer, but expected plain (non-pointer) bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/forbidden_slices.rs:30:1
|
LL | pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
+ | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/forbidden_slices.rs:33:1
|
-LL | / pub static S7: &[u16] = unsafe {
-LL | |
-LL | | let ptr = (&D2 as *const Struct as *const u16).byte_add(1);
-LL | |
-LL | | from_raw_parts(ptr, 4)
-LL | | };
- | |__^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
+LL | pub static S7: &[u16] = unsafe {
+ | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/forbidden_slices.rs:53:1
|
-LL | / pub static R4: &[u8] = unsafe {
-LL | |
-LL | | let ptr = (&D1) as *const MaybeUninit<&u32> as *const u8;
-LL | | from_ptr_range(ptr..ptr.add(1))
-LL | | };
- | |__^ constructing invalid value at .<deref>[0]: encountered uninitialized bytes
+LL | pub static R4: &[u8] = unsafe {
+ | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered uninitialized bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/forbidden_slices.rs:58:1
|
-LL | / pub static R5: &[u8] = unsafe {
-LL | |
-LL | | let ptr = &D3 as *const &u32;
-LL | | from_ptr_range(ptr.cast()..ptr.add(1).cast())
-LL | | };
- | |__^ constructing invalid value at .<deref>: encountered a pointer, but expected plain (non-pointer) bytes
+LL | pub static R5: &[u8] = unsafe {
+ | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered a pointer, but expected plain (non-pointer) bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/forbidden_slices.rs:63:1
|
-LL | / pub static R6: &[bool] = unsafe {
-LL | |
-LL | | let ptr = &D0 as *const u32 as *const bool;
-LL | | from_ptr_range(ptr..ptr.add(4))
-LL | | };
- | |__^ constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
+LL | pub static R6: &[bool] = unsafe {
+ | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/forbidden_slices.rs:68:1
|
-LL | / pub static R7: &[u16] = unsafe {
-LL | |
-LL | | let ptr = (&D2 as *const Struct as *const u16).byte_add(1);
-LL | | from_ptr_range(ptr..ptr.add(4))
-LL | | };
- | |__^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
+LL | pub static R7: &[u16] = unsafe {
+ | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/forbidden_slices.rs:26:1
|
LL | pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered uninitialized bytes
+ | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered uninitialized bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/forbidden_slices.rs:28:1
|
LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, size_of::<&u32>()) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered a pointer, but expected plain (non-pointer) bytes
+ | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered a pointer, but expected plain (non-pointer) bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/forbidden_slices.rs:30:1
|
LL | pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
+ | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/forbidden_slices.rs:33:1
|
-LL | / pub static S7: &[u16] = unsafe {
-LL | |
-LL | | let ptr = (&D2 as *const Struct as *const u16).byte_add(1);
-LL | |
-LL | | from_raw_parts(ptr, 4)
-LL | | };
- | |__^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
+LL | pub static S7: &[u16] = unsafe {
+ | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/forbidden_slices.rs:53:1
|
-LL | / pub static R4: &[u8] = unsafe {
-LL | |
-LL | | let ptr = (&D1) as *const MaybeUninit<&u32> as *const u8;
-LL | | from_ptr_range(ptr..ptr.add(1))
-LL | | };
- | |__^ constructing invalid value at .<deref>[0]: encountered uninitialized bytes
+LL | pub static R4: &[u8] = unsafe {
+ | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered uninitialized bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/forbidden_slices.rs:58:1
|
-LL | / pub static R5: &[u8] = unsafe {
-LL | |
-LL | | let ptr = &D3 as *const &u32;
-LL | | from_ptr_range(ptr.cast()..ptr.add(1).cast())
-LL | | };
- | |__^ constructing invalid value at .<deref>: encountered a pointer, but expected plain (non-pointer) bytes
+LL | pub static R5: &[u8] = unsafe {
+ | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered a pointer, but expected plain (non-pointer) bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/forbidden_slices.rs:63:1
|
-LL | / pub static R6: &[bool] = unsafe {
-LL | |
-LL | | let ptr = &D0 as *const u32 as *const bool;
-LL | | from_ptr_range(ptr..ptr.add(4))
-LL | | };
- | |__^ constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
+LL | pub static R6: &[bool] = unsafe {
+ | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/forbidden_slices.rs:68:1
|
-LL | / pub static R7: &[u16] = unsafe {
-LL | |
-LL | | let ptr = (&D2 as *const Struct as *const u16).byte_add(1);
-LL | | from_ptr_range(ptr..ptr.add(4))
-LL | | };
- | |__^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
+LL | pub static R7: &[u16] = unsafe {
+ | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
error: any use of this value will cause an error
--> $DIR/assert-type-intrinsics.rs:14:9
|
-LL | / const _BAD1: () = unsafe {
-LL | | MaybeUninit::<!>::uninit().assume_init();
- | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to instantiate uninhabited type `!`
-LL | | };
- | |______-
+LL | const _BAD1: () = unsafe {
+ | ---------------
+LL | MaybeUninit::<!>::uninit().assume_init();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to instantiate uninhabited type `!`
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
error: any use of this value will cause an error
--> $DIR/assert-type-intrinsics.rs:17:9
|
-LL | / const _BAD2: () = unsafe {
-LL | | intrinsics::assert_uninit_valid::<bool>();
- | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to leave type `bool` uninitialized, which is invalid
-LL | | };
- | |______-
+LL | const _BAD2: () = unsafe {
+ | ---------------
+LL | intrinsics::assert_uninit_valid::<bool>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to leave type `bool` uninitialized, which is invalid
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: any use of this value will cause an error
--> $DIR/assert-type-intrinsics.rs:20:9
|
-LL | / const _BAD3: () = unsafe {
-LL | | intrinsics::assert_zero_valid::<&'static i32>();
- | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to zero-initialize type `&i32`, which is invalid
-LL | | };
- | |______-
+LL | const _BAD3: () = unsafe {
+ | ---------------
+LL | intrinsics::assert_zero_valid::<&'static i32>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to zero-initialize type `&i32`, which is invalid
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: any use of this value will cause an error
--> $DIR/assert-type-intrinsics.rs:14:9
|
-LL | / const _BAD1: () = unsafe {
-LL | | MaybeUninit::<!>::uninit().assume_init();
- | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to instantiate uninhabited type `!`
-LL | | };
- | |______-
+LL | const _BAD1: () = unsafe {
+ | ---------------
+LL | MaybeUninit::<!>::uninit().assume_init();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to instantiate uninhabited type `!`
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
error: any use of this value will cause an error
--> $DIR/assert-type-intrinsics.rs:17:9
|
-LL | / const _BAD2: () = unsafe {
-LL | | intrinsics::assert_uninit_valid::<bool>();
- | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to leave type `bool` uninitialized, which is invalid
-LL | | };
- | |______-
+LL | const _BAD2: () = unsafe {
+ | ---------------
+LL | intrinsics::assert_uninit_valid::<bool>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to leave type `bool` uninitialized, which is invalid
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
error: any use of this value will cause an error
--> $DIR/assert-type-intrinsics.rs:20:9
|
-LL | / const _BAD3: () = unsafe {
-LL | | intrinsics::assert_zero_valid::<&'static i32>();
- | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to zero-initialize type `&i32`, which is invalid
-LL | | };
- | |______-
+LL | const _BAD3: () = unsafe {
+ | ---------------
+LL | intrinsics::assert_zero_valid::<&'static i32>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to zero-initialize type `&i32`, which is invalid
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/assoc_const_generic_impl.rs:11:34
|
LL | const I_AM_ZERO_SIZED: () = [()][std::mem::size_of::<Self>()];
- | -----------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
- | |
- | index out of bounds: the length is 1 but the index is 4
+ | ------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the length is 1 but the index is 4
|
note: the lint level is defined here
--> $DIR/assoc_const_generic_impl.rs:3:9
--> $DIR/assoc_const_generic_impl.rs:11:34
|
LL | const I_AM_ZERO_SIZED: () = [()][std::mem::size_of::<Self>()];
- | -----------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
- | |
- | index out of bounds: the length is 1 but the index is 4
+ | ------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the length is 1 but the index is 4
|
note: the lint level is defined here
--> $DIR/assoc_const_generic_impl.rs:3:9
--> $DIR/const-as-fn.rs:4:5
|
LL | const FOO: usize = 0;
- | --------------------- `FOO` defined here
+ | ---------------- `FOO` defined here
...
LL | FOO();
| ^^^--
--> $DIR/const-err-early.rs:3:19
|
LL | pub const A: i8 = -i8::MIN;
- | ------------------^^^^^^^^-
- | |
- | attempt to negate `i8::MIN`, which would overflow
+ | --------------- ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-err-early.rs:1:9
--> $DIR/const-err-early.rs:5:19
|
LL | pub const B: u8 = 200u8 + 200u8;
- | ------------------^^^^^^^^^^^^^-
- | |
- | attempt to compute `200_u8 + 200_u8`, which would overflow
+ | --------------- ^^^^^^^^^^^^^ attempt to compute `200_u8 + 200_u8`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-err-early.rs:7:19
|
LL | pub const C: u8 = 200u8 * 4;
- | ------------------^^^^^^^^^-
- | |
- | attempt to compute `200_u8 * 4_u8`, which would overflow
+ | --------------- ^^^^^^^^^ attempt to compute `200_u8 * 4_u8`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-err-early.rs:9:19
|
LL | pub const D: u8 = 42u8 - (42u8 + 1);
- | ------------------^^^^^^^^^^^^^^^^^-
- | |
- | attempt to compute `42_u8 - 43_u8`, which would overflow
+ | --------------- ^^^^^^^^^^^^^^^^^ attempt to compute `42_u8 - 43_u8`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-err-early.rs:11:19
|
LL | pub const E: u8 = [5u8][1];
- | ------------------^^^^^^^^-
- | |
- | index out of bounds: the length is 1 but the index is 1
+ | --------------- ^^^^^^^^ index out of bounds: the length is 1 but the index is 1
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-err-early.rs:3:19
|
LL | pub const A: i8 = -i8::MIN;
- | ------------------^^^^^^^^-
- | |
- | attempt to negate `i8::MIN`, which would overflow
+ | --------------- ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-err-early.rs:1:9
--> $DIR/const-err-early.rs:5:19
|
LL | pub const B: u8 = 200u8 + 200u8;
- | ------------------^^^^^^^^^^^^^-
- | |
- | attempt to compute `200_u8 + 200_u8`, which would overflow
+ | --------------- ^^^^^^^^^^^^^ attempt to compute `200_u8 + 200_u8`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-err-early.rs:1:9
--> $DIR/const-err-early.rs:7:19
|
LL | pub const C: u8 = 200u8 * 4;
- | ------------------^^^^^^^^^-
- | |
- | attempt to compute `200_u8 * 4_u8`, which would overflow
+ | --------------- ^^^^^^^^^ attempt to compute `200_u8 * 4_u8`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-err-early.rs:1:9
--> $DIR/const-err-early.rs:9:19
|
LL | pub const D: u8 = 42u8 - (42u8 + 1);
- | ------------------^^^^^^^^^^^^^^^^^-
- | |
- | attempt to compute `42_u8 - 43_u8`, which would overflow
+ | --------------- ^^^^^^^^^^^^^^^^^ attempt to compute `42_u8 - 43_u8`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-err-early.rs:1:9
--> $DIR/const-err-early.rs:11:19
|
LL | pub const E: u8 = [5u8][1];
- | ------------------^^^^^^^^-
- | |
- | index out of bounds: the length is 1 but the index is 1
+ | --------------- ^^^^^^^^ index out of bounds: the length is 1 but the index is 1
|
note: the lint level is defined here
--> $DIR/const-err-early.rs:1:9
--> $DIR/const-err-multi.rs:3:19
|
LL | pub const A: i8 = -i8::MIN;
- | ------------------^^^^^^^^-
- | |
- | attempt to negate `i8::MIN`, which would overflow
+ | --------------- ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-err-multi.rs:1:9
--> $DIR/const-err-multi.rs:6:19
|
LL | pub const B: i8 = A;
- | ------------------^-
- | |
- | referenced constant has errors
+ | --------------- ^ referenced constant has errors
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-err-multi.rs:9:19
|
LL | pub const C: u8 = A as u8;
- | ------------------^-------
- | |
- | referenced constant has errors
+ | --------------- ^ referenced constant has errors
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-err-multi.rs:12:24
|
LL | pub const D: i8 = 50 - A;
- | -----------------------^-
- | |
- | referenced constant has errors
+ | --------------- ^ referenced constant has errors
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-err-multi.rs:3:19
|
LL | pub const A: i8 = -i8::MIN;
- | ------------------^^^^^^^^-
- | |
- | attempt to negate `i8::MIN`, which would overflow
+ | --------------- ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-err-multi.rs:1:9
--> $DIR/const-err-multi.rs:6:19
|
LL | pub const B: i8 = A;
- | ------------------^-
- | |
- | referenced constant has errors
+ | --------------- ^ referenced constant has errors
|
note: the lint level is defined here
--> $DIR/const-err-multi.rs:1:9
--> $DIR/const-err-multi.rs:9:19
|
LL | pub const C: u8 = A as u8;
- | ------------------^-------
- | |
- | referenced constant has errors
+ | --------------- ^ referenced constant has errors
|
note: the lint level is defined here
--> $DIR/const-err-multi.rs:1:9
--> $DIR/const-err-multi.rs:12:24
|
LL | pub const D: i8 = 50 - A;
- | -----------------------^-
- | |
- | referenced constant has errors
+ | --------------- ^ referenced constant has errors
|
note: the lint level is defined here
--> $DIR/const-err-multi.rs:1:9
--> $DIR/const-err.rs:11:17
|
LL | const FOO: u8 = [5u8][1];
- | ----------------^^^^^^^^-
- | |
- | index out of bounds: the length is 1 but the index is 1
+ | ------------- ^^^^^^^^ index out of bounds: the length is 1 but the index is 1
|
note: the lint level is defined here
--> $DIR/const-err.rs:5:9
--> $DIR/const-err.rs:11:17
|
LL | const FOO: u8 = [5u8][1];
- | ----------------^^^^^^^^-
- | |
- | index out of bounds: the length is 1 but the index is 1
+ | ------------- ^^^^^^^^ index out of bounds: the length is 1 but the index is 1
|
note: the lint level is defined here
--> $DIR/const-err.rs:5:9
--> $DIR/conditional_array_execution.rs:7:19
|
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
- | ------------------^^^^^---------------------------
- | |
- | attempt to compute `5_u32 - 6_u32`, which would overflow
+ | -------------- ^^^^^ attempt to compute `5_u32 - 6_u32`, which would overflow
|
note: the lint level is defined here
--> $DIR/conditional_array_execution.rs:3:9
--> $DIR/conditional_array_execution.rs:7:19
|
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
- | ------------------^^^^^---------------------------
- | |
- | attempt to compute `5_u32 - 6_u32`, which would overflow
+ | -------------- ^^^^^ attempt to compute `5_u32 - 6_u32`, which would overflow
|
note: the lint level is defined here
--> $DIR/conditional_array_execution.rs:3:9
--> $DIR/const-eval-overflow-2.rs:11:25
|
LL | const NEG_NEG_128: i8 = -NEG_128;
- | ------------------------^^^^^^^^-
- | |
- | attempt to negate `i8::MIN`, which would overflow
+ | --------------------- ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow-2.rs:4:36
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2.rs:14:6
|
-LL | / const VALS_I8: (i8,) =
-LL | | (
-LL | | i8::MIN - 1,
- | | ^^^^^^^^^^^ attempt to compute `i8::MIN - 1_i8`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_I8: (i8,) =
+ | --------------------
+LL | (
+LL | i8::MIN - 1,
+ | ^^^^^^^^^^^ attempt to compute `i8::MIN - 1_i8`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2.rs:21:6
|
-LL | / const VALS_I16: (i16,) =
-LL | | (
-LL | | i16::MIN - 1,
- | | ^^^^^^^^^^^^ attempt to compute `i16::MIN - 1_i16`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_I16: (i16,) =
+ | ----------------------
+LL | (
+LL | i16::MIN - 1,
+ | ^^^^^^^^^^^^ attempt to compute `i16::MIN - 1_i16`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2.rs:28:6
|
-LL | / const VALS_I32: (i32,) =
-LL | | (
-LL | | i32::MIN - 1,
- | | ^^^^^^^^^^^^ attempt to compute `i32::MIN - 1_i32`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_I32: (i32,) =
+ | ----------------------
+LL | (
+LL | i32::MIN - 1,
+ | ^^^^^^^^^^^^ attempt to compute `i32::MIN - 1_i32`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2.rs:35:6
|
-LL | / const VALS_I64: (i64,) =
-LL | | (
-LL | | i64::MIN - 1,
- | | ^^^^^^^^^^^^ attempt to compute `i64::MIN - 1_i64`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_I64: (i64,) =
+ | ----------------------
+LL | (
+LL | i64::MIN - 1,
+ | ^^^^^^^^^^^^ attempt to compute `i64::MIN - 1_i64`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2.rs:42:6
|
-LL | / const VALS_U8: (u8,) =
-LL | | (
-LL | | u8::MIN - 1,
- | | ^^^^^^^^^^^ attempt to compute `0_u8 - 1_u8`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_U8: (u8,) =
+ | --------------------
+LL | (
+LL | u8::MIN - 1,
+ | ^^^^^^^^^^^ attempt to compute `0_u8 - 1_u8`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2.rs:48:6
|
-LL | / const VALS_U16: (u16,) = (
-LL | | u16::MIN - 1,
- | | ^^^^^^^^^^^^ attempt to compute `0_u16 - 1_u16`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_U16: (u16,) = (
+ | ----------------------
+LL | u16::MIN - 1,
+ | ^^^^^^^^^^^^ attempt to compute `0_u16 - 1_u16`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2.rs:54:6
|
-LL | / const VALS_U32: (u32,) = (
-LL | | u32::MIN - 1,
- | | ^^^^^^^^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_U32: (u32,) = (
+ | ----------------------
+LL | u32::MIN - 1,
+ | ^^^^^^^^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2.rs:61:6
|
-LL | / const VALS_U64: (u64,) =
-LL | | (
-LL | | u64::MIN - 1,
- | | ^^^^^^^^^^^^ attempt to compute `0_u64 - 1_u64`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_U64: (u64,) =
+ | ----------------------
+LL | (
+LL | u64::MIN - 1,
+ | ^^^^^^^^^^^^ attempt to compute `0_u64 - 1_u64`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2.rs:14:6
|
-LL | / const VALS_I8: (i8,) =
-LL | | (
-LL | | i8::MIN - 1,
- | | ^^^^^^^^^^^ attempt to compute `i8::MIN - 1_i8`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_I8: (i8,) =
+ | --------------------
+LL | (
+LL | i8::MIN - 1,
+ | ^^^^^^^^^^^ attempt to compute `i8::MIN - 1_i8`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2.rs:21:6
|
-LL | / const VALS_I16: (i16,) =
-LL | | (
-LL | | i16::MIN - 1,
- | | ^^^^^^^^^^^^ attempt to compute `i16::MIN - 1_i16`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_I16: (i16,) =
+ | ----------------------
+LL | (
+LL | i16::MIN - 1,
+ | ^^^^^^^^^^^^ attempt to compute `i16::MIN - 1_i16`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2.rs:28:6
|
-LL | / const VALS_I32: (i32,) =
-LL | | (
-LL | | i32::MIN - 1,
- | | ^^^^^^^^^^^^ attempt to compute `i32::MIN - 1_i32`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_I32: (i32,) =
+ | ----------------------
+LL | (
+LL | i32::MIN - 1,
+ | ^^^^^^^^^^^^ attempt to compute `i32::MIN - 1_i32`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2.rs:35:6
|
-LL | / const VALS_I64: (i64,) =
-LL | | (
-LL | | i64::MIN - 1,
- | | ^^^^^^^^^^^^ attempt to compute `i64::MIN - 1_i64`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_I64: (i64,) =
+ | ----------------------
+LL | (
+LL | i64::MIN - 1,
+ | ^^^^^^^^^^^^ attempt to compute `i64::MIN - 1_i64`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2.rs:42:6
|
-LL | / const VALS_U8: (u8,) =
-LL | | (
-LL | | u8::MIN - 1,
- | | ^^^^^^^^^^^ attempt to compute `0_u8 - 1_u8`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_U8: (u8,) =
+ | --------------------
+LL | (
+LL | u8::MIN - 1,
+ | ^^^^^^^^^^^ attempt to compute `0_u8 - 1_u8`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2.rs:48:6
|
-LL | / const VALS_U16: (u16,) = (
-LL | | u16::MIN - 1,
- | | ^^^^^^^^^^^^ attempt to compute `0_u16 - 1_u16`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_U16: (u16,) = (
+ | ----------------------
+LL | u16::MIN - 1,
+ | ^^^^^^^^^^^^ attempt to compute `0_u16 - 1_u16`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2.rs:54:6
|
-LL | / const VALS_U32: (u32,) = (
-LL | | u32::MIN - 1,
- | | ^^^^^^^^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_U32: (u32,) = (
+ | ----------------------
+LL | u32::MIN - 1,
+ | ^^^^^^^^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2.rs:61:6
|
-LL | / const VALS_U64: (u64,) =
-LL | | (
-LL | | u64::MIN - 1,
- | | ^^^^^^^^^^^^ attempt to compute `0_u64 - 1_u64`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_U64: (u64,) =
+ | ----------------------
+LL | (
+LL | u64::MIN - 1,
+ | ^^^^^^^^^^^^ attempt to compute `0_u64 - 1_u64`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2b.rs:14:6
|
-LL | / const VALS_I8: (i8,) =
-LL | | (
-LL | | i8::MAX + 1,
- | | ^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_I8: (i8,) =
+ | --------------------
+LL | (
+LL | i8::MAX + 1,
+ | ^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2b.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2b.rs:21:6
|
-LL | / const VALS_I16: (i16,) =
-LL | | (
-LL | | i16::MAX + 1,
- | | ^^^^^^^^^^^^ attempt to compute `i16::MAX + 1_i16`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_I16: (i16,) =
+ | ----------------------
+LL | (
+LL | i16::MAX + 1,
+ | ^^^^^^^^^^^^ attempt to compute `i16::MAX + 1_i16`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2b.rs:28:6
|
-LL | / const VALS_I32: (i32,) =
-LL | | (
-LL | | i32::MAX + 1,
- | | ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_I32: (i32,) =
+ | ----------------------
+LL | (
+LL | i32::MAX + 1,
+ | ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2b.rs:35:6
|
-LL | / const VALS_I64: (i64,) =
-LL | | (
-LL | | i64::MAX + 1,
- | | ^^^^^^^^^^^^ attempt to compute `i64::MAX + 1_i64`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_I64: (i64,) =
+ | ----------------------
+LL | (
+LL | i64::MAX + 1,
+ | ^^^^^^^^^^^^ attempt to compute `i64::MAX + 1_i64`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2b.rs:42:6
|
-LL | / const VALS_U8: (u8,) =
-LL | | (
-LL | | u8::MAX + 1,
- | | ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_U8: (u8,) =
+ | --------------------
+LL | (
+LL | u8::MAX + 1,
+ | ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2b.rs:48:6
|
-LL | / const VALS_U16: (u16,) = (
-LL | | u16::MAX + 1,
- | | ^^^^^^^^^^^^ attempt to compute `u16::MAX + 1_u16`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_U16: (u16,) = (
+ | ----------------------
+LL | u16::MAX + 1,
+ | ^^^^^^^^^^^^ attempt to compute `u16::MAX + 1_u16`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2b.rs:54:6
|
-LL | / const VALS_U32: (u32,) = (
-LL | | u32::MAX + 1,
- | | ^^^^^^^^^^^^ attempt to compute `u32::MAX + 1_u32`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_U32: (u32,) = (
+ | ----------------------
+LL | u32::MAX + 1,
+ | ^^^^^^^^^^^^ attempt to compute `u32::MAX + 1_u32`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2b.rs:61:6
|
-LL | / const VALS_U64: (u64,) =
-LL | | (
-LL | | u64::MAX + 1,
- | | ^^^^^^^^^^^^ attempt to compute `u64::MAX + 1_u64`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_U64: (u64,) =
+ | ----------------------
+LL | (
+LL | u64::MAX + 1,
+ | ^^^^^^^^^^^^ attempt to compute `u64::MAX + 1_u64`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2b.rs:14:6
|
-LL | / const VALS_I8: (i8,) =
-LL | | (
-LL | | i8::MAX + 1,
- | | ^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_I8: (i8,) =
+ | --------------------
+LL | (
+LL | i8::MAX + 1,
+ | ^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2b.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2b.rs:21:6
|
-LL | / const VALS_I16: (i16,) =
-LL | | (
-LL | | i16::MAX + 1,
- | | ^^^^^^^^^^^^ attempt to compute `i16::MAX + 1_i16`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_I16: (i16,) =
+ | ----------------------
+LL | (
+LL | i16::MAX + 1,
+ | ^^^^^^^^^^^^ attempt to compute `i16::MAX + 1_i16`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2b.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2b.rs:28:6
|
-LL | / const VALS_I32: (i32,) =
-LL | | (
-LL | | i32::MAX + 1,
- | | ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_I32: (i32,) =
+ | ----------------------
+LL | (
+LL | i32::MAX + 1,
+ | ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2b.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2b.rs:35:6
|
-LL | / const VALS_I64: (i64,) =
-LL | | (
-LL | | i64::MAX + 1,
- | | ^^^^^^^^^^^^ attempt to compute `i64::MAX + 1_i64`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_I64: (i64,) =
+ | ----------------------
+LL | (
+LL | i64::MAX + 1,
+ | ^^^^^^^^^^^^ attempt to compute `i64::MAX + 1_i64`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2b.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2b.rs:42:6
|
-LL | / const VALS_U8: (u8,) =
-LL | | (
-LL | | u8::MAX + 1,
- | | ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_U8: (u8,) =
+ | --------------------
+LL | (
+LL | u8::MAX + 1,
+ | ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2b.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2b.rs:48:6
|
-LL | / const VALS_U16: (u16,) = (
-LL | | u16::MAX + 1,
- | | ^^^^^^^^^^^^ attempt to compute `u16::MAX + 1_u16`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_U16: (u16,) = (
+ | ----------------------
+LL | u16::MAX + 1,
+ | ^^^^^^^^^^^^ attempt to compute `u16::MAX + 1_u16`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2b.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2b.rs:54:6
|
-LL | / const VALS_U32: (u32,) = (
-LL | | u32::MAX + 1,
- | | ^^^^^^^^^^^^ attempt to compute `u32::MAX + 1_u32`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_U32: (u32,) = (
+ | ----------------------
+LL | u32::MAX + 1,
+ | ^^^^^^^^^^^^ attempt to compute `u32::MAX + 1_u32`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2b.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2b.rs:61:6
|
-LL | / const VALS_U64: (u64,) =
-LL | | (
-LL | | u64::MAX + 1,
- | | ^^^^^^^^^^^^ attempt to compute `u64::MAX + 1_u64`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_U64: (u64,) =
+ | ----------------------
+LL | (
+LL | u64::MAX + 1,
+ | ^^^^^^^^^^^^ attempt to compute `u64::MAX + 1_u64`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2b.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2c.rs:14:6
|
-LL | / const VALS_I8: (i8,) =
-LL | | (
-LL | | i8::MIN * 2,
- | | ^^^^^^^^^^^ attempt to compute `i8::MIN * 2_i8`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_I8: (i8,) =
+ | --------------------
+LL | (
+LL | i8::MIN * 2,
+ | ^^^^^^^^^^^ attempt to compute `i8::MIN * 2_i8`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2c.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2c.rs:21:6
|
-LL | / const VALS_I16: (i16,) =
-LL | | (
-LL | | i16::MIN * 2,
- | | ^^^^^^^^^^^^ attempt to compute `i16::MIN * 2_i16`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_I16: (i16,) =
+ | ----------------------
+LL | (
+LL | i16::MIN * 2,
+ | ^^^^^^^^^^^^ attempt to compute `i16::MIN * 2_i16`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2c.rs:28:6
|
-LL | / const VALS_I32: (i32,) =
-LL | | (
-LL | | i32::MIN * 2,
- | | ^^^^^^^^^^^^ attempt to compute `i32::MIN * 2_i32`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_I32: (i32,) =
+ | ----------------------
+LL | (
+LL | i32::MIN * 2,
+ | ^^^^^^^^^^^^ attempt to compute `i32::MIN * 2_i32`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2c.rs:35:6
|
-LL | / const VALS_I64: (i64,) =
-LL | | (
-LL | | i64::MIN * 2,
- | | ^^^^^^^^^^^^ attempt to compute `i64::MIN * 2_i64`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_I64: (i64,) =
+ | ----------------------
+LL | (
+LL | i64::MIN * 2,
+ | ^^^^^^^^^^^^ attempt to compute `i64::MIN * 2_i64`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2c.rs:42:6
|
-LL | / const VALS_U8: (u8,) =
-LL | | (
-LL | | u8::MAX * 2,
- | | ^^^^^^^^^^^ attempt to compute `u8::MAX * 2_u8`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_U8: (u8,) =
+ | --------------------
+LL | (
+LL | u8::MAX * 2,
+ | ^^^^^^^^^^^ attempt to compute `u8::MAX * 2_u8`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2c.rs:48:6
|
-LL | / const VALS_U16: (u16,) = (
-LL | | u16::MAX * 2,
- | | ^^^^^^^^^^^^ attempt to compute `u16::MAX * 2_u16`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_U16: (u16,) = (
+ | ----------------------
+LL | u16::MAX * 2,
+ | ^^^^^^^^^^^^ attempt to compute `u16::MAX * 2_u16`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2c.rs:54:6
|
-LL | / const VALS_U32: (u32,) = (
-LL | | u32::MAX * 2,
- | | ^^^^^^^^^^^^ attempt to compute `u32::MAX * 2_u32`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_U32: (u32,) = (
+ | ----------------------
+LL | u32::MAX * 2,
+ | ^^^^^^^^^^^^ attempt to compute `u32::MAX * 2_u32`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2c.rs:61:6
|
-LL | / const VALS_U64: (u64,) =
-LL | | (
-LL | | u64::MAX * 2,
- | | ^^^^^^^^^^^^ attempt to compute `u64::MAX * 2_u64`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_U64: (u64,) =
+ | ----------------------
+LL | (
+LL | u64::MAX * 2,
+ | ^^^^^^^^^^^^ attempt to compute `u64::MAX * 2_u64`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2c.rs:14:6
|
-LL | / const VALS_I8: (i8,) =
-LL | | (
-LL | | i8::MIN * 2,
- | | ^^^^^^^^^^^ attempt to compute `i8::MIN * 2_i8`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_I8: (i8,) =
+ | --------------------
+LL | (
+LL | i8::MIN * 2,
+ | ^^^^^^^^^^^ attempt to compute `i8::MIN * 2_i8`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2c.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2c.rs:21:6
|
-LL | / const VALS_I16: (i16,) =
-LL | | (
-LL | | i16::MIN * 2,
- | | ^^^^^^^^^^^^ attempt to compute `i16::MIN * 2_i16`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_I16: (i16,) =
+ | ----------------------
+LL | (
+LL | i16::MIN * 2,
+ | ^^^^^^^^^^^^ attempt to compute `i16::MIN * 2_i16`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2c.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2c.rs:28:6
|
-LL | / const VALS_I32: (i32,) =
-LL | | (
-LL | | i32::MIN * 2,
- | | ^^^^^^^^^^^^ attempt to compute `i32::MIN * 2_i32`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_I32: (i32,) =
+ | ----------------------
+LL | (
+LL | i32::MIN * 2,
+ | ^^^^^^^^^^^^ attempt to compute `i32::MIN * 2_i32`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2c.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2c.rs:35:6
|
-LL | / const VALS_I64: (i64,) =
-LL | | (
-LL | | i64::MIN * 2,
- | | ^^^^^^^^^^^^ attempt to compute `i64::MIN * 2_i64`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_I64: (i64,) =
+ | ----------------------
+LL | (
+LL | i64::MIN * 2,
+ | ^^^^^^^^^^^^ attempt to compute `i64::MIN * 2_i64`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2c.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2c.rs:42:6
|
-LL | / const VALS_U8: (u8,) =
-LL | | (
-LL | | u8::MAX * 2,
- | | ^^^^^^^^^^^ attempt to compute `u8::MAX * 2_u8`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_U8: (u8,) =
+ | --------------------
+LL | (
+LL | u8::MAX * 2,
+ | ^^^^^^^^^^^ attempt to compute `u8::MAX * 2_u8`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2c.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2c.rs:48:6
|
-LL | / const VALS_U16: (u16,) = (
-LL | | u16::MAX * 2,
- | | ^^^^^^^^^^^^ attempt to compute `u16::MAX * 2_u16`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_U16: (u16,) = (
+ | ----------------------
+LL | u16::MAX * 2,
+ | ^^^^^^^^^^^^ attempt to compute `u16::MAX * 2_u16`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2c.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2c.rs:54:6
|
-LL | / const VALS_U32: (u32,) = (
-LL | | u32::MAX * 2,
- | | ^^^^^^^^^^^^ attempt to compute `u32::MAX * 2_u32`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_U32: (u32,) = (
+ | ----------------------
+LL | u32::MAX * 2,
+ | ^^^^^^^^^^^^ attempt to compute `u32::MAX * 2_u32`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2c.rs:8:9
error: any use of this value will cause an error
--> $DIR/const-eval-overflow2c.rs:61:6
|
-LL | / const VALS_U64: (u64,) =
-LL | | (
-LL | | u64::MAX * 2,
- | | ^^^^^^^^^^^^ attempt to compute `u64::MAX * 2_u64`, which would overflow
-LL | | );
- | |_______-
+LL | const VALS_U64: (u64,) =
+ | ----------------------
+LL | (
+LL | u64::MAX * 2,
+ | ^^^^^^^^^^^^ attempt to compute `u64::MAX * 2_u64`, which would overflow
|
note: the lint level is defined here
--> $DIR/const-eval-overflow2c.rs:8:9
--> $DIR/const-eval-query-stack.rs:19:16
|
LL | const X: i32 = 1 / 0;
- | ---------------^^^^^-
- | |
- | attempt to divide `1_i32` by zero
+ | ------------ ^^^^^ attempt to divide `1_i32` by zero
|
note: the lint level is defined here
--> $DIR/const-eval-query-stack.rs:18:8
--> $DIR/const-eval-query-stack.rs:19:16
|
LL | const X: i32 = 1 / 0;
- | ---------------^^^^^-
- | |
- | attempt to divide `1_i32` by zero
+ | ------------ ^^^^^ attempt to divide `1_i32` by zero
|
note: the lint level is defined here
--> $DIR/const-eval-query-stack.rs:18:8
--> $DIR/const-pointer-values-in-various-types.rs:26:49
|
LL | const I32_REF_USIZE_UNION: usize = unsafe { Nonsense { int_32_ref: &3 }.u };
- | --------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | -------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:30:43
|
LL | const I32_REF_U8_UNION: u8 = unsafe { Nonsense { int_32_ref: &3 }.uint_8 };
- | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:34:45
|
LL | const I32_REF_U16_UNION: u16 = unsafe { Nonsense { int_32_ref: &3 }.uint_16 };
- | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:38:45
|
LL | const I32_REF_U32_UNION: u32 = unsafe { Nonsense { int_32_ref: &3 }.uint_32 };
- | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:42:45
|
LL | const I32_REF_U64_UNION: u64 = unsafe { Nonsense { int_32_ref: &3 }.uint_64 };
- | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:46:5
|
LL | const I32_REF_U128_UNION: u128 = unsafe { Nonsense { int_32_ref: &3 }.uint_128 };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/const-pointer-values-in-various-types.rs:49:43
|
LL | const I32_REF_I8_UNION: i8 = unsafe { Nonsense { int_32_ref: &3 }.int_8 };
- | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:53:45
|
LL | const I32_REF_I16_UNION: i16 = unsafe { Nonsense { int_32_ref: &3 }.int_16 };
- | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:57:45
|
LL | const I32_REF_I32_UNION: i32 = unsafe { Nonsense { int_32_ref: &3 }.int_32 };
- | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:61:45
|
LL | const I32_REF_I64_UNION: i64 = unsafe { Nonsense { int_32_ref: &3 }.int_64 };
- | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:65:5
|
LL | const I32_REF_I128_UNION: i128 = unsafe { Nonsense { int_32_ref: &3 }.int_128 };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/const-pointer-values-in-various-types.rs:68:45
|
LL | const I32_REF_F32_UNION: f32 = unsafe { Nonsense { int_32_ref: &3 }.float_32 };
- | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:72:45
|
LL | const I32_REF_F64_UNION: f64 = unsafe { Nonsense { int_32_ref: &3 }.float_64 };
- | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:76:47
|
LL | const I32_REF_BOOL_UNION: bool = unsafe { Nonsense { int_32_ref: &3 }.truthy_falsey };
- | ------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:80:47
|
LL | const I32_REF_CHAR_UNION: char = unsafe { Nonsense { int_32_ref: &3 }.character };
- | ------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:84:39
|
LL | const STR_U8_UNION: u8 = unsafe { Nonsense { stringy: "3" }.uint_8 };
- | ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ---------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:88:41
|
LL | const STR_U16_UNION: u16 = unsafe { Nonsense { stringy: "3" }.uint_16 };
- | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:92:41
|
LL | const STR_U32_UNION: u32 = unsafe { Nonsense { stringy: "3" }.uint_32 };
- | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:96:41
|
LL | const STR_U64_UNION: u64 = unsafe { Nonsense { stringy: "3" }.uint_64 };
- | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:100:43
|
LL | const STR_U128_UNION: u128 = unsafe { Nonsense { stringy: "3" }.uint_128 };
- | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:104:39
|
LL | const STR_I8_UNION: i8 = unsafe { Nonsense { stringy: "3" }.int_8 };
- | ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ---------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:108:41
|
LL | const STR_I16_UNION: i16 = unsafe { Nonsense { stringy: "3" }.int_16 };
- | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:112:41
|
LL | const STR_I32_UNION: i32 = unsafe { Nonsense { stringy: "3" }.int_32 };
- | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:116:41
|
LL | const STR_I64_UNION: i64 = unsafe { Nonsense { stringy: "3" }.int_64 };
- | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:120:43
|
LL | const STR_I128_UNION: i128 = unsafe { Nonsense { stringy: "3" }.int_128 };
- | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:124:41
|
LL | const STR_F32_UNION: f32 = unsafe { Nonsense { stringy: "3" }.float_32 };
- | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:128:41
|
LL | const STR_F64_UNION: f64 = unsafe { Nonsense { stringy: "3" }.float_64 };
- | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:132:43
|
LL | const STR_BOOL_UNION: bool = unsafe { Nonsense { stringy: "3" }.truthy_falsey };
- | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:136:43
|
LL | const STR_CHAR_UNION: char = unsafe { Nonsense { stringy: "3" }.character };
- | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-pointer-values-in-various-types.rs:26:49
|
LL | const I32_REF_USIZE_UNION: usize = unsafe { Nonsense { int_32_ref: &3 }.u };
- | --------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | -------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:30:43
|
LL | const I32_REF_U8_UNION: u8 = unsafe { Nonsense { int_32_ref: &3 }.uint_8 };
- | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:34:45
|
LL | const I32_REF_U16_UNION: u16 = unsafe { Nonsense { int_32_ref: &3 }.uint_16 };
- | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:38:45
|
LL | const I32_REF_U32_UNION: u32 = unsafe { Nonsense { int_32_ref: &3 }.uint_32 };
- | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:42:45
|
LL | const I32_REF_U64_UNION: u64 = unsafe { Nonsense { int_32_ref: &3 }.uint_64 };
- | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:49:43
|
LL | const I32_REF_I8_UNION: i8 = unsafe { Nonsense { int_32_ref: &3 }.int_8 };
- | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:53:45
|
LL | const I32_REF_I16_UNION: i16 = unsafe { Nonsense { int_32_ref: &3 }.int_16 };
- | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:57:45
|
LL | const I32_REF_I32_UNION: i32 = unsafe { Nonsense { int_32_ref: &3 }.int_32 };
- | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:61:45
|
LL | const I32_REF_I64_UNION: i64 = unsafe { Nonsense { int_32_ref: &3 }.int_64 };
- | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:68:45
|
LL | const I32_REF_F32_UNION: f32 = unsafe { Nonsense { int_32_ref: &3 }.float_32 };
- | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:72:45
|
LL | const I32_REF_F64_UNION: f64 = unsafe { Nonsense { int_32_ref: &3 }.float_64 };
- | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:76:47
|
LL | const I32_REF_BOOL_UNION: bool = unsafe { Nonsense { int_32_ref: &3 }.truthy_falsey };
- | ------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:80:47
|
LL | const I32_REF_CHAR_UNION: char = unsafe { Nonsense { int_32_ref: &3 }.character };
- | ------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:84:39
|
LL | const STR_U8_UNION: u8 = unsafe { Nonsense { stringy: "3" }.uint_8 };
- | ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ---------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:88:41
|
LL | const STR_U16_UNION: u16 = unsafe { Nonsense { stringy: "3" }.uint_16 };
- | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:92:41
|
LL | const STR_U32_UNION: u32 = unsafe { Nonsense { stringy: "3" }.uint_32 };
- | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:96:41
|
LL | const STR_U64_UNION: u64 = unsafe { Nonsense { stringy: "3" }.uint_64 };
- | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:100:43
|
LL | const STR_U128_UNION: u128 = unsafe { Nonsense { stringy: "3" }.uint_128 };
- | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:104:39
|
LL | const STR_I8_UNION: i8 = unsafe { Nonsense { stringy: "3" }.int_8 };
- | ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ---------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:108:41
|
LL | const STR_I16_UNION: i16 = unsafe { Nonsense { stringy: "3" }.int_16 };
- | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:112:41
|
LL | const STR_I32_UNION: i32 = unsafe { Nonsense { stringy: "3" }.int_32 };
- | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:116:41
|
LL | const STR_I64_UNION: i64 = unsafe { Nonsense { stringy: "3" }.int_64 };
- | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:120:43
|
LL | const STR_I128_UNION: i128 = unsafe { Nonsense { stringy: "3" }.int_128 };
- | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:124:41
|
LL | const STR_F32_UNION: f32 = unsafe { Nonsense { stringy: "3" }.float_32 };
- | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:128:41
|
LL | const STR_F64_UNION: f64 = unsafe { Nonsense { stringy: "3" }.float_64 };
- | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:132:43
|
LL | const STR_BOOL_UNION: bool = unsafe { Nonsense { stringy: "3" }.truthy_falsey };
- | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-pointer-values-in-various-types.rs:136:43
|
LL | const STR_CHAR_UNION: char = unsafe { Nonsense { stringy: "3" }.character };
- | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
| inside `Y` at $DIR/const_fn_ptr_fail2.rs:15:18
...
LL | const Y: usize = bar(X, 2); // FIXME: should fail to typeck someday
- | ---------------------------
+ | --------------
|
note: the lint level is defined here
--> $DIR/const_fn_ptr_fail2.rs:4:10
| inside `Z` at $DIR/const_fn_ptr_fail2.rs:16:18
...
LL | const Z: usize = bar(double, 2); // FIXME: should fail to typeck someday
- | --------------------------------
+ | --------------
|
note: the lint level is defined here
--> $DIR/const_fn_ptr_fail2.rs:4:10
--> $DIR/erroneous-const.rs:6:22
|
LL | const VOID: () = [()][2];
- | -----------------^^^^^^^-
- | |
- | index out of bounds: the length is 1 but the index is 2
+ | -------------- ^^^^^^^ index out of bounds: the length is 1 but the index is 2
|
note: the lint level is defined here
--> $DIR/erroneous-const.rs:2:9
--> $DIR/erroneous-const.rs:6:22
|
LL | const VOID: () = [()][2];
- | -----------------^^^^^^^-
- | |
- | index out of bounds: the length is 1 but the index is 2
+ | -------------- ^^^^^^^ index out of bounds: the length is 1 but the index is 2
|
note: the lint level is defined here
--> $DIR/erroneous-const.rs:2:9
--> $DIR/erroneous-const2.rs:6:22
|
LL | const VOID: () = [()][2];
- | -----------------^^^^^^^-
- | |
- | index out of bounds: the length is 1 but the index is 2
+ | -------------- ^^^^^^^ index out of bounds: the length is 1 but the index is 2
|
note: the lint level is defined here
--> $DIR/erroneous-const2.rs:2:9
--> $DIR/erroneous-const2.rs:6:22
|
LL | const VOID: () = [()][2];
- | -----------------^^^^^^^-
- | |
- | index out of bounds: the length is 1 but the index is 2
+ | -------------- ^^^^^^^ index out of bounds: the length is 1 but the index is 2
|
note: the lint level is defined here
--> $DIR/erroneous-const2.rs:2:9
--> $DIR/alloc_intrinsic_nontransient_fail.rs:6:1
|
LL | const FOO: *const i32 = foo();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/alloc_intrinsic_uninit.rs:8:1
|
LL | const BAR: &i32 = unsafe { &*(intrinsics::const_allocate(4, 4) as *mut i32) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized bytes, but expected initialized bytes
+ | ^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized bytes, but expected initialized bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/alloc_intrinsic_uninit.rs:8:1
|
LL | const BAR: &i32 = unsafe { &*(intrinsics::const_allocate(4, 4) as *mut i32) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized bytes, but expected initialized bytes
+ | ^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized bytes, but expected initialized bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/alloc_intrinsic_untyped.rs:6:1
|
LL | const BAR: *mut i32 = unsafe { intrinsics::const_allocate(4, 4) as *mut i32};
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/index-out-of-bounds-never-type.rs:10:61
|
LL | const VOID: ! = { let x = 0 * std::mem::size_of::<T>(); [][x] };
- | --------------------------------------------------------^^^^^---
- | |
- | index out of bounds: the length is 0 but the index is 0
+ | ------------- ^^^^^ index out of bounds: the length is 0 but the index is 0
|
note: the lint level is defined here
--> $DIR/index-out-of-bounds-never-type.rs:4:9
--> $DIR/index-out-of-bounds-never-type.rs:10:61
|
LL | const VOID: ! = { let x = 0 * std::mem::size_of::<T>(); [][x] };
- | --------------------------------------------------------^^^^^---
- | |
- | index out of bounds: the length is 0 but the index is 0
+ | ------------- ^^^^^ index out of bounds: the length is 0 but the index is 0
|
note: the lint level is defined here
--> $DIR/index-out-of-bounds-never-type.rs:4:9
--> $DIR/issue-43197.rs:10:20
|
LL | const X: u32 = 0 - 1;
- | ---------------^^^^^-
- | |
- | attempt to compute `0_u32 - 1_u32`, which would overflow
+ | ------------ ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
|
note: the lint level is defined here
--> $DIR/issue-43197.rs:3:9
--> $DIR/issue-43197.rs:13:24
|
LL | const Y: u32 = foo(0 - 1);
- | -------------------^^^^^--
- | |
- | attempt to compute `0_u32 - 1_u32`, which would overflow
+ | ------------ ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/issue-43197.rs:10:20
|
LL | const X: u32 = 0 - 1;
- | ---------------^^^^^-
- | |
- | attempt to compute `0_u32 - 1_u32`, which would overflow
+ | ------------ ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
|
note: the lint level is defined here
--> $DIR/issue-43197.rs:3:9
--> $DIR/issue-43197.rs:13:24
|
LL | const Y: u32 = foo(0 - 1);
- | -------------------^^^^^--
- | |
- | attempt to compute `0_u32 - 1_u32`, which would overflow
+ | ------------ ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
|
note: the lint level is defined here
--> $DIR/issue-43197.rs:3:9
--> $DIR/issue-44578.rs:15:24
|
LL | const AMT: usize = [A::AMT][(A::AMT > B::AMT) as usize];
- | -------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
- | |
- | index out of bounds: the length is 1 but the index is 1
+ | ---------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the length is 1 but the index is 1
|
note: the lint level is defined here
--> $DIR/issue-44578.rs:3:10
--> $DIR/issue-50814-2.rs:14:24
|
LL | const BAR: usize = [5, 6, 7][T::BOO];
- | -------------------^^^^^^^^^^^^^^^^^-
- | |
- | index out of bounds: the length is 3 but the index is 42
+ | ---------------- ^^^^^^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 42
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/issue-50814-2.rs:14:24
|
LL | const BAR: usize = [5, 6, 7][T::BOO];
- | -------------------^^^^^^^^^^^^^^^^^-
- | |
- | index out of bounds: the length is 3 but the index is 42
+ | ---------------- ^^^^^^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 42
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/issue-50814.rs:15:21
|
LL | const MAX: u8 = A::MAX + B::MAX;
- | ----------------^^^^^^^^^^^^^^^-
- | |
- | attempt to compute `u8::MAX + u8::MAX`, which would overflow
+ | ------------- ^^^^^^^^^^^^^^^ attempt to compute `u8::MAX + u8::MAX`, which would overflow
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/issue-50814.rs:15:21
|
LL | const MAX: u8 = A::MAX + B::MAX;
- | ----------------^^^^^^^^^^^^^^^-
- | |
- | attempt to compute `u8::MAX + u8::MAX`, which would overflow
+ | ------------- ^^^^^^^^^^^^^^^ attempt to compute `u8::MAX + u8::MAX`, which would overflow
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
error: any use of this value will cause an error
--> $DIR/partial_ptr_overwrite.rs:8:9
|
-LL | / const PARTIAL_OVERWRITE: () = {
-LL | | let mut p = &42;
-LL | | unsafe {
-LL | | let ptr: *mut _ = &mut p;
-LL | | *(ptr as *mut u8) = 123;
- | | ^^^^^^^^^^^^^^^^^^^^^^^ unable to overwrite parts of a pointer in memory at alloc4
-... |
-LL | | let x = *p;
-LL | | };
- | |__-
+LL | const PARTIAL_OVERWRITE: () = {
+ | ---------------------------
+...
+LL | *(ptr as *mut u8) = 123;
+ | ^^^^^^^^^^^^^^^^^^^^^^^ unable to overwrite parts of a pointer in memory at alloc4
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
error: any use of this value will cause an error
--> $DIR/partial_ptr_overwrite.rs:8:9
|
-LL | / const PARTIAL_OVERWRITE: () = {
-LL | | let mut p = &42;
-LL | | unsafe {
-LL | | let ptr: *mut _ = &mut p;
-LL | | *(ptr as *mut u8) = 123;
- | | ^^^^^^^^^^^^^^^^^^^^^^^ unable to overwrite parts of a pointer in memory at alloc4
-... |
-LL | | let x = *p;
-LL | | };
- | |__-
+LL | const PARTIAL_OVERWRITE: () = {
+ | ---------------------------
+...
+LL | *(ptr as *mut u8) = 123;
+ | ^^^^^^^^^^^^^^^^^^^^^^^ unable to overwrite parts of a pointer in memory at alloc4
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: any use of this value will cause an error
--> $DIR/promoted_errors.rs:15:5
|
-LL | 0 - 1
- | ^^^^^
- | |
- | attempt to compute `0_u32 - 1_u32`, which would overflow
- | inside `overflow` at $DIR/promoted_errors.rs:15:5
- | inside `X` at $DIR/promoted_errors.rs:43:29
+LL | 0 - 1
+ | ^^^^^
+ | |
+ | attempt to compute `0_u32 - 1_u32`, which would overflow
+ | inside `overflow` at $DIR/promoted_errors.rs:15:5
+ | inside `X` at $DIR/promoted_errors.rs:43:29
...
-LL | / const X: () = {
-LL | | let _x: &'static u32 = &overflow();
-LL | |
-LL | |
-... |
-LL | | let _x: &'static i32 = &oob();
-LL | | };
- | |__-
+LL | const X: () = {
+ | -----------
|
note: the lint level is defined here
--> $DIR/promoted_errors.rs:11:9
warning: any use of this value will cause an error
--> $DIR/promoted_errors.rs:43:28
|
-LL | / const X: () = {
-LL | | let _x: &'static u32 = &overflow();
- | | ^^^^^^^^^^^ referenced constant has errors
-LL | |
-LL | |
-... |
-LL | | let _x: &'static i32 = &oob();
-LL | | };
- | |__-
+LL | const X: () = {
+ | -----------
+LL | let _x: &'static u32 = &overflow();
+ | ^^^^^^^^^^^ referenced constant has errors
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
warning: any use of this value will cause an error
--> $DIR/promoted_errors.rs:15:5
|
-LL | 0 - 1
- | ^^^^^
- | |
- | attempt to compute `0_u32 - 1_u32`, which would overflow
- | inside `overflow` at $DIR/promoted_errors.rs:15:5
- | inside `X` at $DIR/promoted_errors.rs:43:29
+LL | 0 - 1
+ | ^^^^^
+ | |
+ | attempt to compute `0_u32 - 1_u32`, which would overflow
+ | inside `overflow` at $DIR/promoted_errors.rs:15:5
+ | inside `X` at $DIR/promoted_errors.rs:43:29
...
-LL | / const X: () = {
-LL | | let _x: &'static u32 = &overflow();
-LL | |
-LL | |
-... |
-LL | | let _x: &'static i32 = &oob();
-LL | | };
- | |__-
+LL | const X: () = {
+ | -----------
|
note: the lint level is defined here
--> $DIR/promoted_errors.rs:11:9
warning: any use of this value will cause an error
--> $DIR/promoted_errors.rs:43:28
|
-LL | / const X: () = {
-LL | | let _x: &'static u32 = &overflow();
- | | ^^^^^^^^^^^ referenced constant has errors
-LL | |
-LL | |
-... |
-LL | | let _x: &'static i32 = &oob();
-LL | | };
- | |__-
+LL | const X: () = {
+ | -----------
+LL | let _x: &'static u32 = &overflow();
+ | ^^^^^^^^^^^ referenced constant has errors
|
note: the lint level is defined here
--> $DIR/promoted_errors.rs:11:9
warning: any use of this value will cause an error
--> $DIR/promoted_errors.rs:21:5
|
-LL | 1 / 0
- | ^^^^^
- | |
- | attempt to divide `1_i32` by zero
- | inside `div_by_zero1` at $DIR/promoted_errors.rs:21:5
- | inside `X` at $DIR/promoted_errors.rs:46:29
+LL | 1 / 0
+ | ^^^^^
+ | |
+ | attempt to divide `1_i32` by zero
+ | inside `div_by_zero1` at $DIR/promoted_errors.rs:21:5
+ | inside `X` at $DIR/promoted_errors.rs:46:29
...
-LL | / const X: () = {
-LL | | let _x: &'static u32 = &overflow();
-LL | |
-LL | |
-... |
-LL | | let _x: &'static i32 = &oob();
-LL | | };
- | |__-
+LL | const X: () = {
+ | -----------
|
note: the lint level is defined here
--> $DIR/promoted_errors.rs:11:9
warning: any use of this value will cause an error
--> $DIR/promoted_errors.rs:46:28
|
-LL | / const X: () = {
-LL | | let _x: &'static u32 = &overflow();
-LL | |
-LL | |
-LL | | let _x: &'static i32 = &div_by_zero1();
- | | ^^^^^^^^^^^^^^^ referenced constant has errors
-... |
-LL | | let _x: &'static i32 = &oob();
-LL | | };
- | |__-
+LL | const X: () = {
+ | -----------
+...
+LL | let _x: &'static i32 = &div_by_zero1();
+ | ^^^^^^^^^^^^^^^ referenced constant has errors
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
warning: any use of this value will cause an error
--> $DIR/promoted_errors.rs:21:5
|
-LL | 1 / 0
- | ^^^^^
- | |
- | attempt to divide `1_i32` by zero
- | inside `div_by_zero1` at $DIR/promoted_errors.rs:21:5
- | inside `X` at $DIR/promoted_errors.rs:46:29
+LL | 1 / 0
+ | ^^^^^
+ | |
+ | attempt to divide `1_i32` by zero
+ | inside `div_by_zero1` at $DIR/promoted_errors.rs:21:5
+ | inside `X` at $DIR/promoted_errors.rs:46:29
...
-LL | / const X: () = {
-LL | | let _x: &'static u32 = &overflow();
-LL | |
-LL | |
-... |
-LL | | let _x: &'static i32 = &oob();
-LL | | };
- | |__-
+LL | const X: () = {
+ | -----------
|
note: the lint level is defined here
--> $DIR/promoted_errors.rs:11:9
warning: any use of this value will cause an error
--> $DIR/promoted_errors.rs:46:28
|
-LL | / const X: () = {
-LL | | let _x: &'static u32 = &overflow();
-LL | |
-LL | |
-LL | | let _x: &'static i32 = &div_by_zero1();
- | | ^^^^^^^^^^^^^^^ referenced constant has errors
-... |
-LL | | let _x: &'static i32 = &oob();
-LL | | };
- | |__-
+LL | const X: () = {
+ | -----------
+...
+LL | let _x: &'static i32 = &div_by_zero1();
+ | ^^^^^^^^^^^^^^^ referenced constant has errors
|
note: the lint level is defined here
--> $DIR/promoted_errors.rs:11:9
warning: any use of this value will cause an error
--> $DIR/promoted_errors.rs:15:5
|
-LL | 0 - 1
- | ^^^^^
- | |
- | attempt to compute `0_u32 - 1_u32`, which would overflow
- | inside `overflow` at $DIR/promoted_errors.rs:15:5
- | inside `X` at $DIR/promoted_errors.rs:43:29
+LL | 0 - 1
+ | ^^^^^
+ | |
+ | attempt to compute `0_u32 - 1_u32`, which would overflow
+ | inside `overflow` at $DIR/promoted_errors.rs:15:5
+ | inside `X` at $DIR/promoted_errors.rs:43:29
...
-LL | / const X: () = {
-LL | | let _x: &'static u32 = &overflow();
-LL | |
-LL | |
-... |
-LL | | let _x: &'static i32 = &oob();
-LL | | };
- | |__-
+LL | const X: () = {
+ | -----------
|
note: the lint level is defined here
--> $DIR/promoted_errors.rs:11:9
warning: any use of this value will cause an error
--> $DIR/promoted_errors.rs:43:28
|
-LL | / const X: () = {
-LL | | let _x: &'static u32 = &overflow();
- | | ^^^^^^^^^^^ referenced constant has errors
-LL | |
-LL | |
-... |
-LL | | let _x: &'static i32 = &oob();
-LL | | };
- | |__-
+LL | const X: () = {
+ | -----------
+LL | let _x: &'static u32 = &overflow();
+ | ^^^^^^^^^^^ referenced constant has errors
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
warning: any use of this value will cause an error
--> $DIR/promoted_errors.rs:15:5
|
-LL | 0 - 1
- | ^^^^^
- | |
- | attempt to compute `0_u32 - 1_u32`, which would overflow
- | inside `overflow` at $DIR/promoted_errors.rs:15:5
- | inside `X` at $DIR/promoted_errors.rs:43:29
+LL | 0 - 1
+ | ^^^^^
+ | |
+ | attempt to compute `0_u32 - 1_u32`, which would overflow
+ | inside `overflow` at $DIR/promoted_errors.rs:15:5
+ | inside `X` at $DIR/promoted_errors.rs:43:29
...
-LL | / const X: () = {
-LL | | let _x: &'static u32 = &overflow();
-LL | |
-LL | |
-... |
-LL | | let _x: &'static i32 = &oob();
-LL | | };
- | |__-
+LL | const X: () = {
+ | -----------
|
note: the lint level is defined here
--> $DIR/promoted_errors.rs:11:9
warning: any use of this value will cause an error
--> $DIR/promoted_errors.rs:43:28
|
-LL | / const X: () = {
-LL | | let _x: &'static u32 = &overflow();
- | | ^^^^^^^^^^^ referenced constant has errors
-LL | |
-LL | |
-... |
-LL | | let _x: &'static i32 = &oob();
-LL | | };
- | |__-
+LL | const X: () = {
+ | -----------
+LL | let _x: &'static u32 = &overflow();
+ | ^^^^^^^^^^^ referenced constant has errors
|
note: the lint level is defined here
--> $DIR/promoted_errors.rs:11:9
--> $DIR/pub_const_err.rs:6:20
|
LL | pub const Z: u32 = 0 - 1;
- | -------------------^^^^^-
- | |
- | attempt to compute `0_u32 - 1_u32`, which would overflow
+ | ---------------- ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
|
note: the lint level is defined here
--> $DIR/pub_const_err.rs:2:9
--> $DIR/pub_const_err.rs:6:20
|
LL | pub const Z: u32 = 0 - 1;
- | -------------------^^^^^-
- | |
- | attempt to compute `0_u32 - 1_u32`, which would overflow
+ | ---------------- ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
|
note: the lint level is defined here
--> $DIR/pub_const_err.rs:2:9
--> $DIR/pub_const_err_bin.rs:4:20
|
LL | pub const Z: u32 = 0 - 1;
- | -------------------^^^^^-
- | |
- | attempt to compute `0_u32 - 1_u32`, which would overflow
+ | ---------------- ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
|
note: the lint level is defined here
--> $DIR/pub_const_err_bin.rs:2:9
--> $DIR/pub_const_err_bin.rs:4:20
|
LL | pub const Z: u32 = 0 - 1;
- | -------------------^^^^^-
- | |
- | attempt to compute `0_u32 - 1_u32`, which would overflow
+ | ---------------- ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
|
note: the lint level is defined here
--> $DIR/pub_const_err_bin.rs:2:9
--> $DIR/ref_to_int_match.rs:25:27
|
LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
- | --------------------------^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | -------------- ^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ref_to_int_match.rs:25:27
|
LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
- | --------------------------^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | -------------- ^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ref_to_int_match.rs:25:27
|
LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
- | --------------------------^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | -------------- ^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ref_to_int_match.rs:25:27
|
LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
- | --------------------------^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | -------------- ^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/transmute-const.rs:4:1
|
LL | static FOO: bool = unsafe { mem::transmute(3u8) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x03, but expected a boolean
+ | ^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x03, but expected a boolean
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 1, align: 1) {
--> $DIR/transmute-const.rs:4:1
|
LL | static FOO: bool = unsafe { mem::transmute(3u8) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x03, but expected a boolean
+ | ^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x03, but expected a boolean
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 1, align: 1) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-enum-overwrite.rs:8:1
|
-LL | / const _: u8 = {
-LL | |
-LL | | let mut e = E::A(1);
-LL | | let p = if let E::A(x) = &mut e { x as *mut u8 } else { unreachable!() };
-... |
-LL | | unsafe { *p }
-LL | | };
- | |__^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes
+LL | const _: u8 = {
+ | ^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 1, align: 1) {
--> $DIR/ub-enum.rs:23:1
|
LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x00000001, but expected a valid enum tag
+ | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x00000001, but expected a valid enum tag
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/ub-enum.rs:26:1
|
LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-enum.rs:30:1
|
LL | const BAD_ENUM_WRAPPED: Wrap<Enum> = unsafe { mem::transmute(&1) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-enum.rs:43:1
|
LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x00000000, but expected a valid enum tag
+ | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x00000000, but expected a valid enum tag
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/ub-enum.rs:45:1
|
LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-enum.rs:49:1
|
LL | const BAD_ENUM2_WRAPPED: Wrap<Enum2> = unsafe { mem::transmute(&0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-enum.rs:59:1
|
LL | const BAD_ENUM2_UNDEF : Enum2 = unsafe { MaybeUninit { uninit: () }.init };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered uninitialized bytes, but expected initialized bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered uninitialized bytes, but expected initialized bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/ub-enum.rs:63:1
|
LL | const BAD_ENUM2_OPTION_PTR: Option<Enum2> = unsafe { mem::transmute(&0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-enum.rs:81:1
|
LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute(1u8) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(B)>.0: encountered a value of the never type `!`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(B)>.0: encountered a value of the never type `!`
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 1, align: 1) {
--> $DIR/ub-enum.rs:83:1
|
LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute(3u8) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(D)>.0: encountered a value of uninhabited type Never
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(D)>.0: encountered a value of uninhabited type Never
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 1, align: 1) {
--> $DIR/ub-enum.rs:91:1
|
LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::transmute(!0u32) }));
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0.1: encountered 0xffffffff, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0.1: encountered 0xffffffff, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/ub-enum.rs:26:1
|
LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-enum.rs:30:1
|
LL | const BAD_ENUM_WRAPPED: Wrap<Enum> = unsafe { mem::transmute(&1) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-enum.rs:45:1
|
LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-enum.rs:49:1
|
LL | const BAD_ENUM2_WRAPPED: Wrap<Enum2> = unsafe { mem::transmute(&0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-enum.rs:63:1
|
LL | const BAD_ENUM2_OPTION_PTR: Option<Enum2> = unsafe { mem::transmute(&0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-enum.rs:23:1
|
LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x0000000000000001, but expected a valid enum tag
+ | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x0000000000000001, but expected a valid enum tag
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/ub-enum.rs:26:1
|
LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-enum.rs:30:1
|
LL | const BAD_ENUM_WRAPPED: Wrap<Enum> = unsafe { mem::transmute(&1) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-enum.rs:43:1
|
LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x0000000000000000, but expected a valid enum tag
+ | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x0000000000000000, but expected a valid enum tag
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/ub-enum.rs:45:1
|
LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-enum.rs:49:1
|
LL | const BAD_ENUM2_WRAPPED: Wrap<Enum2> = unsafe { mem::transmute(&0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-enum.rs:59:1
|
LL | const BAD_ENUM2_UNDEF : Enum2 = unsafe { MaybeUninit { uninit: () }.init };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered uninitialized bytes, but expected initialized bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered uninitialized bytes, but expected initialized bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/ub-enum.rs:63:1
|
LL | const BAD_ENUM2_OPTION_PTR: Option<Enum2> = unsafe { mem::transmute(&0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-enum.rs:81:1
|
LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute(1u8) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(B)>.0: encountered a value of the never type `!`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(B)>.0: encountered a value of the never type `!`
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 1, align: 1) {
--> $DIR/ub-enum.rs:83:1
|
LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute(3u8) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(D)>.0: encountered a value of uninhabited type Never
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(D)>.0: encountered a value of uninhabited type Never
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 1, align: 1) {
--> $DIR/ub-enum.rs:91:1
|
LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::transmute(!0u32) }));
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0.1: encountered 0xffffffff, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0.1: encountered 0xffffffff, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/ub-enum.rs:26:1
|
LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-enum.rs:30:1
|
LL | const BAD_ENUM_WRAPPED: Wrap<Enum> = unsafe { mem::transmute(&1) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-enum.rs:45:1
|
LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-enum.rs:49:1
|
LL | const BAD_ENUM2_WRAPPED: Wrap<Enum2> = unsafe { mem::transmute(&0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-enum.rs:63:1
|
LL | const BAD_ENUM2_OPTION_PTR: Option<Enum2> = unsafe { mem::transmute(&0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-incorrect-vtable.rs:34:1
|
-LL | / const INVALID_VTABLE_ALIGNMENT_UB: W<&dyn Trait> =
-LL | | unsafe { std::mem::transmute((&92u8, &(drop_me as fn(*mut usize), 1usize, 1000usize))) };
- | |_____________________________________________________________________________________________^ constructing invalid value at .0: encountered invalid vtable: alignment `1000` is not a power of 2
+LL | const INVALID_VTABLE_ALIGNMENT_UB: W<&dyn Trait> =
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid vtable: alignment `1000` is not a power of 2
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-incorrect-vtable.rs:39:1
|
-LL | / const INVALID_VTABLE_SIZE_UB: W<&dyn Trait> =
-LL | | unsafe { std::mem::transmute((&92u8, &(drop_me as fn(*mut usize), usize::MAX, 1usize))) };
- | |______________________________________________________________________________________________^ constructing invalid value at .0: encountered invalid vtable: size is bigger than largest supported object
+LL | const INVALID_VTABLE_SIZE_UB: W<&dyn Trait> =
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid vtable: size is bigger than largest supported object
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-incorrect-vtable.rs:34:1
|
-LL | / const INVALID_VTABLE_ALIGNMENT_UB: W<&dyn Trait> =
-LL | | unsafe { std::mem::transmute((&92u8, &(drop_me as fn(*mut usize), 1usize, 1000usize))) };
- | |_____________________________________________________________________________________________^ constructing invalid value at .0: encountered invalid vtable: alignment `1000` is not a power of 2
+LL | const INVALID_VTABLE_ALIGNMENT_UB: W<&dyn Trait> =
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid vtable: alignment `1000` is not a power of 2
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-incorrect-vtable.rs:39:1
|
-LL | / const INVALID_VTABLE_SIZE_UB: W<&dyn Trait> =
-LL | | unsafe { std::mem::transmute((&92u8, &(drop_me as fn(*mut usize), usize::MAX, 1usize))) };
- | |______________________________________________________________________________________________^ constructing invalid value at .0: encountered invalid vtable: size is bigger than largest supported object
+LL | const INVALID_VTABLE_SIZE_UB: W<&dyn Trait> =
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid vtable: size is bigger than largest supported object
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-int-array.rs:14:1
|
-LL | / const UNINIT_INT_0: [u32; 3] = unsafe {
-LL | |
-LL | |
-LL | | [
-... |
-LL | | ]
-LL | | };
- | |__^ constructing invalid value at [0]: encountered uninitialized bytes
+LL | const UNINIT_INT_0: [u32; 3] = unsafe {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered uninitialized bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 12, align: 4) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-int-array.rs:23:1
|
-LL | / const UNINIT_INT_1: [u32; 3] = unsafe {
-LL | |
-LL | |
-LL | | mem::transmute(
-... |
-LL | | )
-LL | | };
- | |__^ constructing invalid value at [1]: encountered uninitialized bytes
+LL | const UNINIT_INT_1: [u32; 3] = unsafe {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [1]: encountered uninitialized bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 12, align: 4) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-int-array.rs:43:1
|
-LL | / const UNINIT_INT_2: [u32; 3] = unsafe {
-LL | |
-LL | |
-LL | | mem::transmute(
-... |
-LL | | )
-LL | | };
- | |__^ constructing invalid value at [2]: encountered uninitialized bytes
+LL | const UNINIT_INT_2: [u32; 3] = unsafe {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [2]: encountered uninitialized bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 12, align: 4) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-int-array.rs:14:1
|
-LL | / const UNINIT_INT_0: [u32; 3] = unsafe {
-LL | |
-LL | |
-LL | | [
-... |
-LL | | ]
-LL | | };
- | |__^ constructing invalid value at [0]: encountered uninitialized bytes
+LL | const UNINIT_INT_0: [u32; 3] = unsafe {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered uninitialized bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 12, align: 4) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-int-array.rs:23:1
|
-LL | / const UNINIT_INT_1: [u32; 3] = unsafe {
-LL | |
-LL | |
-LL | | mem::transmute(
-... |
-LL | | )
-LL | | };
- | |__^ constructing invalid value at [1]: encountered uninitialized bytes
+LL | const UNINIT_INT_1: [u32; 3] = unsafe {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [1]: encountered uninitialized bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 12, align: 4) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-int-array.rs:43:1
|
-LL | / const UNINIT_INT_2: [u32; 3] = unsafe {
-LL | |
-LL | |
-LL | | mem::transmute(
-... |
-LL | | )
-LL | | };
- | |__^ constructing invalid value at [2]: encountered uninitialized bytes
+LL | const UNINIT_INT_2: [u32; 3] = unsafe {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [2]: encountered uninitialized bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 12, align: 4) {
--> $DIR/ub-nonnull.rs:12:1
|
LL | const NULL_PTR: NonNull<u8> = unsafe { mem::transmute(0usize) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/ub-nonnull.rs:23:1
|
LL | const NULL_U8: NonZeroU8 = unsafe { mem::transmute(0u8) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 1, align: 1) {
--> $DIR/ub-nonnull.rs:25:1
|
LL | const NULL_USIZE: NonZeroUsize = unsafe { mem::transmute(0usize) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/ub-nonnull.rs:33:1
|
LL | const UNINIT: NonZeroU8 = unsafe { MaybeUninit { uninit: () }.init };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered uninitialized bytes, but expected initialized bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered uninitialized bytes, but expected initialized bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 1, align: 1) {
--> $DIR/ub-nonnull.rs:41:1
|
LL | const BAD_RANGE1: RestrictedRange1 = unsafe { RestrictedRange1(42) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 42, but expected something in the range 10..=30
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 42, but expected something in the range 10..=30
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/ub-nonnull.rs:47:1
|
LL | const BAD_RANGE2: RestrictedRange2 = unsafe { RestrictedRange2(20) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 20, but expected something less or equal to 10, or greater or equal to 30
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 20, but expected something less or equal to 10, or greater or equal to 30
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/ub-nonnull.rs:12:1
|
LL | const NULL_PTR: NonNull<u8> = unsafe { mem::transmute(0usize) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/ub-nonnull.rs:23:1
|
LL | const NULL_U8: NonZeroU8 = unsafe { mem::transmute(0u8) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 1, align: 1) {
--> $DIR/ub-nonnull.rs:25:1
|
LL | const NULL_USIZE: NonZeroUsize = unsafe { mem::transmute(0usize) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/ub-nonnull.rs:33:1
|
LL | const UNINIT: NonZeroU8 = unsafe { MaybeUninit { uninit: () }.init };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered uninitialized bytes, but expected initialized bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered uninitialized bytes, but expected initialized bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 1, align: 1) {
--> $DIR/ub-nonnull.rs:41:1
|
LL | const BAD_RANGE1: RestrictedRange1 = unsafe { RestrictedRange1(42) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 42, but expected something in the range 10..=30
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 42, but expected something in the range 10..=30
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/ub-nonnull.rs:47:1
|
LL | const BAD_RANGE2: RestrictedRange2 = unsafe { RestrictedRange2(20) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 20, but expected something less or equal to 10, or greater or equal to 30
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 20, but expected something less or equal to 10, or greater or equal to 30
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/ub-ref-ptr.rs:13:1
|
LL | const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
+ | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/ub-ref-ptr.rs:17:1
|
LL | const UNALIGNED_BOX: Box<u16> = unsafe { mem::transmute(&[0u8; 4]) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned box (required 2 byte alignment but found 1)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned box (required 2 byte alignment but found 1)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/ub-ref-ptr.rs:21:1
|
LL | const NULL: &u16 = unsafe { mem::transmute(0usize) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null reference
+ | ^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null reference
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/ub-ref-ptr.rs:24:1
|
LL | const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null box
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null box
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/ub-ref-ptr.rs:31:1
|
LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-ref-ptr.rs:35:39
|
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
- | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
- | |
- | unable to turn pointer into raw bytes
+ | ---------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-ref-ptr.rs:35:38
|
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
- | -------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
- | |
- | referenced constant has errors
+ | ---------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-ref-ptr.rs:41:86
|
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
- | -------------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^^^----
- | |
- | unable to turn pointer into raw bytes
+ | ------------------------------------------ ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-ref-ptr.rs:41:85
|
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
- | ------------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^^^^----
- | |
- | referenced constant has errors
+ | ------------------------------------------ ^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-ref-ptr.rs:47:1
|
LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (address 0x539 is unallocated)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (address 0x539 is unallocated)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/ub-ref-ptr.rs:50:1
|
LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (address 0x539 is unallocated)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (address 0x539 is unallocated)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/ub-ref-ptr.rs:53:1
|
LL | const UNINIT_PTR: *const i32 = unsafe { MaybeUninit { uninit: () }.init };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized raw pointer
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized raw pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/ub-ref-ptr.rs:56:1
|
LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null function pointer
+ | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null function pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/ub-ref-ptr.rs:58:1
|
LL | const UNINIT_FN_PTR: fn() = unsafe { MaybeUninit { uninit: () }.init };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a proper pointer or integer value
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a proper pointer or integer value
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/ub-ref-ptr.rs:60:1
|
LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x0000000d, but expected a function pointer
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x0000000d, but expected a function pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/ub-ref-ptr.rs:62:1
|
LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered pointer to alloc43, but expected a function pointer
+ | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered pointer to alloc43, but expected a function pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/ub-ref-ptr.rs:31:1
|
LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-ref-ptr.rs:35:39
|
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
- | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
- | |
- | unable to turn pointer into raw bytes
+ | ---------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-ref-ptr.rs:35:38
|
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
- | -------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
- | |
- | referenced constant has errors
+ | ---------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-ref-ptr.rs:41:86
|
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
- | -------------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^^^----
- | |
- | unable to turn pointer into raw bytes
+ | ------------------------------------------ ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-ref-ptr.rs:41:85
|
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
- | ------------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^^^^----
- | |
- | referenced constant has errors
+ | ------------------------------------------ ^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-ref-ptr.rs:13:1
|
LL | const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
+ | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/ub-ref-ptr.rs:17:1
|
LL | const UNALIGNED_BOX: Box<u16> = unsafe { mem::transmute(&[0u8; 4]) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned box (required 2 byte alignment but found 1)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned box (required 2 byte alignment but found 1)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/ub-ref-ptr.rs:21:1
|
LL | const NULL: &u16 = unsafe { mem::transmute(0usize) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null reference
+ | ^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null reference
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/ub-ref-ptr.rs:24:1
|
LL | const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null box
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null box
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/ub-ref-ptr.rs:31:1
|
LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-ref-ptr.rs:35:39
|
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
- | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
- | |
- | unable to turn pointer into raw bytes
+ | ---------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-ref-ptr.rs:35:38
|
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
- | -------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
- | |
- | referenced constant has errors
+ | ---------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-ref-ptr.rs:41:86
|
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
- | -------------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^^^----
- | |
- | unable to turn pointer into raw bytes
+ | ------------------------------------------ ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-ref-ptr.rs:41:85
|
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
- | ------------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^^^^----
- | |
- | referenced constant has errors
+ | ------------------------------------------ ^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-ref-ptr.rs:47:1
|
LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (address 0x539 is unallocated)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (address 0x539 is unallocated)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/ub-ref-ptr.rs:50:1
|
LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (address 0x539 is unallocated)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (address 0x539 is unallocated)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/ub-ref-ptr.rs:53:1
|
LL | const UNINIT_PTR: *const i32 = unsafe { MaybeUninit { uninit: () }.init };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized raw pointer
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized raw pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/ub-ref-ptr.rs:56:1
|
LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null function pointer
+ | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null function pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/ub-ref-ptr.rs:58:1
|
LL | const UNINIT_FN_PTR: fn() = unsafe { MaybeUninit { uninit: () }.init };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a proper pointer or integer value
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a proper pointer or integer value
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/ub-ref-ptr.rs:60:1
|
LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x000000000000000d, but expected a function pointer
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x000000000000000d, but expected a function pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/ub-ref-ptr.rs:62:1
|
LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered pointer to alloc43, but expected a function pointer
+ | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered pointer to alloc43, but expected a function pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/ub-ref-ptr.rs:31:1
|
LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-ref-ptr.rs:35:39
|
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
- | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
- | |
- | unable to turn pointer into raw bytes
+ | ---------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-ref-ptr.rs:35:38
|
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
- | -------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
- | |
- | referenced constant has errors
+ | ---------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-ref-ptr.rs:41:86
|
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
- | -------------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^^^----
- | |
- | unable to turn pointer into raw bytes
+ | ------------------------------------------ ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-ref-ptr.rs:41:85
|
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
- | ------------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^^^^----
- | |
- | referenced constant has errors
+ | ------------------------------------------ ^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-uninhabit.rs:15:1
|
LL | const BAD_BAD_BAD: Bar = unsafe { MaybeUninit { uninit: () }.init };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of uninhabited type Bar
+ | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of uninhabited type Bar
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 0, align: 1) {}
--> $DIR/ub-uninhabit.rs:18:1
|
LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type Bar
+ | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type Bar
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/ub-uninhabit.rs:21:1
|
LL | const BAD_BAD_ARRAY: [Bar; 1] = unsafe { MaybeUninit { uninit: () }.init };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered a value of uninhabited type Bar
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered a value of uninhabited type Bar
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 0, align: 1) {}
--> $DIR/ub-uninhabit.rs:15:1
|
LL | const BAD_BAD_BAD: Bar = unsafe { MaybeUninit { uninit: () }.init };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of uninhabited type Bar
+ | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of uninhabited type Bar
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 0, align: 1) {}
--> $DIR/ub-uninhabit.rs:18:1
|
LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type Bar
+ | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type Bar
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/ub-uninhabit.rs:21:1
|
LL | const BAD_BAD_ARRAY: [Bar; 1] = unsafe { MaybeUninit { uninit: () }.init };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered a value of uninhabited type Bar
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered a value of uninhabited type Bar
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 0, align: 1) {}
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-upvars.rs:6:1
|
-LL | / const BAD_UPVAR: &dyn FnOnce() = &{
-LL | | let bad_ref: &'static u16 = unsafe { mem::transmute(0usize) };
-LL | | let another_var = 13;
-LL | | move || { let _ = bad_ref; let _ = another_var; }
-LL | | };
- | |__^ constructing invalid value at .<deref>.<dyn-downcast>.<captured-var(bad_ref)>: encountered a null reference
+LL | const BAD_UPVAR: &dyn FnOnce() = &{
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>.<captured-var(bad_ref)>: encountered a null reference
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-upvars.rs:6:1
|
-LL | / const BAD_UPVAR: &dyn FnOnce() = &{
-LL | | let bad_ref: &'static u16 = unsafe { mem::transmute(0usize) };
-LL | | let another_var = 13;
-LL | | move || { let _ = bad_ref; let _ = another_var; }
-LL | | };
- | |__^ constructing invalid value at .<deref>.<dyn-downcast>.<captured-var(bad_ref)>: encountered a null reference
+LL | const BAD_UPVAR: &dyn FnOnce() = &{
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>.<captured-var(bad_ref)>: encountered a null reference
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/ub-wide-ptr.rs:37:1
|
LL | const STR_TOO_LONG: &str = unsafe { mem::transmute((&42u8, 999usize)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/ub-wide-ptr.rs:39:1
|
LL | const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, usize::MAX)) },);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid reference metadata: slice is bigger than largest supported object
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid reference metadata: slice is bigger than largest supported object
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/ub-wide-ptr.rs:42:1
|
LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-wide-ptr.rs:46:1
|
LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-wide-ptr.rs:49:1
|
LL | const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize::MAX)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/ub-wide-ptr.rs:53:1
|
LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized data in `str`
+ | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized data in `str`
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/ub-wide-ptr.rs:56:1
|
LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered uninitialized data in `str`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered uninitialized data in `str`
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:63:1
|
-LL | / const SLICE_LENGTH_UNINIT: &[u8] = unsafe {
-LL | |
-LL | | let uninit_len = MaybeUninit::<usize> { uninit: () };
-LL | | mem::transmute((42, uninit_len))
-LL | | };
- | |__^ constructing invalid value: encountered uninitialized reference
+LL | const SLICE_LENGTH_UNINIT: &[u8] = unsafe {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized reference
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/ub-wide-ptr.rs:69:1
|
LL | const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/ub-wide-ptr.rs:72:1
|
LL | const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, isize::MAX)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/ub-wide-ptr.rs:75:1
|
LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-wide-ptr.rs:79:1
|
LL | const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999usize)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (going beyond the bounds of its allocation)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (going beyond the bounds of its allocation)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/ub-wide-ptr.rs:82:1
|
LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-wide-ptr.rs:87:1
|
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x03, but expected a boolean
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x03, but expected a boolean
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/ub-wide-ptr.rs:87:40
|
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
- | ---------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
- | |
- | referenced constant has errors
+ | ------------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-wide-ptr.rs:95:1
|
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered 0x03, but expected a boolean
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered 0x03, but expected a boolean
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/ub-wide-ptr.rs:95:42
|
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
- | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
- | |
- | referenced constant has errors
+ | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-wide-ptr.rs:100:1
|
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.1[0]: encountered 0x03, but expected a boolean
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.1[0]: encountered 0x03, but expected a boolean
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/ub-wide-ptr.rs:100:42
|
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
- | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
- | |
- | referenced constant has errors
+ | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:109:1
|
-LL | / const RAW_SLICE_LENGTH_UNINIT: *const [u8] = unsafe {
-LL | |
-LL | | let uninit_len = MaybeUninit::<usize> { uninit: () };
-LL | | mem::transmute((42, uninit_len))
-LL | | };
- | |__^ constructing invalid value: encountered uninitialized raw pointer
+LL | const RAW_SLICE_LENGTH_UNINIT: *const [u8] = unsafe {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized raw pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/ub-wide-ptr.rs:117:1
|
LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered too small vtable
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered too small vtable
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/ub-wide-ptr.rs:120:1
|
LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered too small vtable
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered too small vtable
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/ub-wide-ptr.rs:123:1
|
LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, 4usize))) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered dangling vtable pointer in wide pointer
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered dangling vtable pointer in wide pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/ub-wide-ptr.rs:125:1
|
LL | const TRAIT_OBJ_UNALIGNED_VTABLE: &dyn Trait = unsafe { mem::transmute((&92u8, &[0u8; 128])) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered unaligned vtable pointer in wide pointer
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered unaligned vtable pointer in wide pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/ub-wide-ptr.rs:127:1
|
LL | const TRAIT_OBJ_BAD_DROP_FN_NULL: &dyn Trait = unsafe { mem::transmute((&92u8, &[0usize; 8])) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid drop function pointer in vtable (not pointing to a function)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid drop function pointer in vtable (not pointing to a function)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/ub-wide-ptr.rs:129:1
|
LL | const TRAIT_OBJ_BAD_DROP_FN_INT: &dyn Trait = unsafe { mem::transmute((&92u8, &[1usize; 8])) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid drop function pointer in vtable (not pointing to a function)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid drop function pointer in vtable (not pointing to a function)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/ub-wide-ptr.rs:131:1
|
LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid drop function pointer in vtable (not pointing to a function)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid drop function pointer in vtable (not pointing to a function)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/ub-wide-ptr.rs:135:1
|
LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_, &bool>(&3u8) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>: encountered 0x03, but expected a boolean
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>: encountered 0x03, but expected a boolean
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/ub-wide-ptr.rs:139:1
|
LL | const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered dangling vtable pointer in wide pointer
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered dangling vtable pointer in wide pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/ub-wide-ptr.rs:141:1
|
LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered too small vtable
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered too small vtable
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/ub-wide-ptr.rs:42:1
|
LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-wide-ptr.rs:46:1
|
LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-wide-ptr.rs:75:1
|
LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-wide-ptr.rs:82:1
|
LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-wide-ptr.rs:87:40
|
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
- | ---------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
- | |
- | referenced constant has errors
+ | ------------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-wide-ptr.rs:95:42
|
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
- | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
- | |
- | referenced constant has errors
+ | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-wide-ptr.rs:100:42
|
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
- | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
- | |
- | referenced constant has errors
+ | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-wide-ptr.rs:37:1
|
LL | const STR_TOO_LONG: &str = unsafe { mem::transmute((&42u8, 999usize)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/ub-wide-ptr.rs:39:1
|
LL | const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, usize::MAX)) },);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid reference metadata: slice is bigger than largest supported object
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid reference metadata: slice is bigger than largest supported object
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/ub-wide-ptr.rs:42:1
|
LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-wide-ptr.rs:46:1
|
LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-wide-ptr.rs:49:1
|
LL | const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize::MAX)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/ub-wide-ptr.rs:53:1
|
LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized data in `str`
+ | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized data in `str`
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/ub-wide-ptr.rs:56:1
|
LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered uninitialized data in `str`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered uninitialized data in `str`
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:63:1
|
-LL | / const SLICE_LENGTH_UNINIT: &[u8] = unsafe {
-LL | |
-LL | | let uninit_len = MaybeUninit::<usize> { uninit: () };
-LL | | mem::transmute((42, uninit_len))
-LL | | };
- | |__^ constructing invalid value: encountered uninitialized reference
+LL | const SLICE_LENGTH_UNINIT: &[u8] = unsafe {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized reference
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/ub-wide-ptr.rs:69:1
|
LL | const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/ub-wide-ptr.rs:72:1
|
LL | const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, isize::MAX)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/ub-wide-ptr.rs:75:1
|
LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-wide-ptr.rs:79:1
|
LL | const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999usize)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (going beyond the bounds of its allocation)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (going beyond the bounds of its allocation)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/ub-wide-ptr.rs:82:1
|
LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-wide-ptr.rs:87:1
|
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x03, but expected a boolean
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x03, but expected a boolean
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/ub-wide-ptr.rs:87:40
|
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
- | ---------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
- | |
- | referenced constant has errors
+ | ------------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-wide-ptr.rs:95:1
|
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered 0x03, but expected a boolean
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered 0x03, but expected a boolean
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/ub-wide-ptr.rs:95:42
|
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
- | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
- | |
- | referenced constant has errors
+ | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ub-wide-ptr.rs:100:1
|
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.1[0]: encountered 0x03, but expected a boolean
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.1[0]: encountered 0x03, but expected a boolean
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/ub-wide-ptr.rs:100:42
|
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
- | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
- | |
- | referenced constant has errors
+ | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:109:1
|
-LL | / const RAW_SLICE_LENGTH_UNINIT: *const [u8] = unsafe {
-LL | |
-LL | | let uninit_len = MaybeUninit::<usize> { uninit: () };
-LL | | mem::transmute((42, uninit_len))
-LL | | };
- | |__^ constructing invalid value: encountered uninitialized raw pointer
+LL | const RAW_SLICE_LENGTH_UNINIT: *const [u8] = unsafe {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized raw pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/ub-wide-ptr.rs:117:1
|
LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered too small vtable
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered too small vtable
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/ub-wide-ptr.rs:120:1
|
LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered too small vtable
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered too small vtable
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/ub-wide-ptr.rs:123:1
|
LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, 4usize))) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered dangling vtable pointer in wide pointer
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered dangling vtable pointer in wide pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/ub-wide-ptr.rs:125:1
|
LL | const TRAIT_OBJ_UNALIGNED_VTABLE: &dyn Trait = unsafe { mem::transmute((&92u8, &[0u8; 128])) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered unaligned vtable pointer in wide pointer
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered unaligned vtable pointer in wide pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/ub-wide-ptr.rs:127:1
|
LL | const TRAIT_OBJ_BAD_DROP_FN_NULL: &dyn Trait = unsafe { mem::transmute((&92u8, &[0usize; 8])) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid drop function pointer in vtable (not pointing to a function)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid drop function pointer in vtable (not pointing to a function)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/ub-wide-ptr.rs:129:1
|
LL | const TRAIT_OBJ_BAD_DROP_FN_INT: &dyn Trait = unsafe { mem::transmute((&92u8, &[1usize; 8])) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid drop function pointer in vtable (not pointing to a function)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid drop function pointer in vtable (not pointing to a function)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/ub-wide-ptr.rs:131:1
|
LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid drop function pointer in vtable (not pointing to a function)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid drop function pointer in vtable (not pointing to a function)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/ub-wide-ptr.rs:135:1
|
LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_, &bool>(&3u8) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>: encountered 0x03, but expected a boolean
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>: encountered 0x03, but expected a boolean
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/ub-wide-ptr.rs:139:1
|
LL | const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered dangling vtable pointer in wide pointer
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered dangling vtable pointer in wide pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/ub-wide-ptr.rs:141:1
|
LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered too small vtable
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered too small vtable
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/ub-wide-ptr.rs:42:1
|
LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-wide-ptr.rs:46:1
|
LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-wide-ptr.rs:75:1
|
LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-wide-ptr.rs:82:1
|
LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-wide-ptr.rs:87:40
|
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
- | ---------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
- | |
- | referenced constant has errors
+ | ------------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-wide-ptr.rs:95:42
|
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
- | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
- | |
- | referenced constant has errors
+ | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ub-wide-ptr.rs:100:42
|
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
- | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
- | |
- | referenced constant has errors
+ | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/union-const-eval-field.rs:28:5
|
LL | const FIELD3: Field3 = unsafe { UNION.field3 };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes
+ | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/union-ice.rs:14:1
|
LL | const FIELD3: Field3 = unsafe { UNION.field3 };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes
+ | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/union-ice.rs:16:1
|
-LL | / const FIELD_PATH: Struct = Struct {
-LL | | a: 42,
-LL | | b: unsafe { UNION.field3 },
-LL | | };
- | |__^ constructing invalid value at .b: encountered uninitialized bytes, but expected initialized bytes
+LL | const FIELD_PATH: Struct = Struct {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .b: encountered uninitialized bytes, but expected initialized bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/union-ice.rs:26:1
|
-LL | / const FIELD_PATH2: Struct2 = Struct2 {
-LL | | b: [
-LL | | 21,
-LL | | unsafe { UNION.field3 },
-... |
-LL | | a: 42,
-LL | | };
- | |__^ constructing invalid value at .b[1]: encountered uninitialized bytes
+LL | const FIELD_PATH2: Struct2 = Struct2 {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .b[1]: encountered uninitialized bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 40, align: 8) {
--> $DIR/union-ub.rs:33:1
|
LL | const BAD_BOOL: bool = unsafe { DummyUnion { u8: 42 }.bool};
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x2a, but expected a boolean
+ | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x2a, but expected a boolean
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 1, align: 1) {
--> $DIR/union-ub.rs:35:1
|
LL | const UNINIT_BOOL: bool = unsafe { DummyUnion { unit: () }.bool};
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a boolean
+ | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a boolean
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 1, align: 1) {
--> $DIR/union-ub.rs:33:1
|
LL | const BAD_BOOL: bool = unsafe { DummyUnion { u8: 42 }.bool};
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x2a, but expected a boolean
+ | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x2a, but expected a boolean
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 1, align: 1) {
--> $DIR/union-ub.rs:35:1
|
LL | const UNINIT_BOOL: bool = unsafe { DummyUnion { unit: () }.bool};
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a boolean
+ | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a boolean
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 1, align: 1) {
--> $DIR/unused-broken-const.rs:5:18
|
LL | const FOO: i32 = [][0];
- | -----------------^^^^^-
- | |
- | index out of bounds: the length is 0 but the index is 0
+ | -------------- ^^^^^ index out of bounds: the length is 0 but the index is 0
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/unused-broken-const.rs:5:18
|
LL | const FOO: i32 = [][0];
- | -----------------^^^^^-
- | |
- | index out of bounds: the length is 0 but the index is 0
+ | -------------- ^^^^^ index out of bounds: the length is 0 but the index is 0
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/validate_uninhabited_zsts.rs:23:1
|
LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0].0: encountered a value of uninhabited type empty::Void
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0].0: encountered a value of uninhabited type empty::Void
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 0, align: 1) {}
--> $DIR/validate_uninhabited_zsts.rs:23:1
|
LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0].0: encountered a value of uninhabited type empty::Void
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0].0: encountered a value of uninhabited type empty::Void
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 0, align: 1) {}
--> $DIR/const-float-bits-reject-conv.rs:30:34
|
LL | const _: () = assert!($a);
- | --------------------------
+ | -----------
...
LL | const_assert!(f32::from_bits(MASKED_NAN1).is_nan());
| ^^^^^^^^^^^ referenced constant has errors
--> $DIR/const-float-bits-reject-conv.rs:33:34
|
LL | const _: () = assert!($a);
- | --------------------------
+ | -----------
...
LL | const_assert!(f32::from_bits(MASKED_NAN1).is_nan());
| ^^^^^^^^^^^ referenced constant has errors
--> $DIR/const-float-bits-reject-conv.rs:41:38
|
LL | const _: () = assert!($a == $b);
- | --------------------------------
+ | -----------
...
LL | const_assert!(f32::from_bits(MASKED_NAN1).to_bits(), MASKED_NAN1);
| ^^^^^^^^^^^ referenced constant has errors
--> $DIR/const-float-bits-reject-conv.rs:44:38
|
LL | const _: () = assert!($a == $b);
- | --------------------------------
+ | -----------
...
LL | const_assert!(f32::from_bits(MASKED_NAN2).to_bits(), MASKED_NAN2);
| ^^^^^^^^^^^ referenced constant has errors
--> $DIR/const-float-bits-reject-conv.rs:57:34
|
LL | const _: () = assert!($a);
- | --------------------------
+ | -----------
...
LL | const_assert!(f64::from_bits(MASKED_NAN1).is_nan());
| ^^^^^^^^^^^ referenced constant has errors
--> $DIR/const-float-bits-reject-conv.rs:60:34
|
LL | const _: () = assert!($a);
- | --------------------------
+ | -----------
...
LL | const_assert!(f64::from_bits(MASKED_NAN1).is_nan());
| ^^^^^^^^^^^ referenced constant has errors
--> $DIR/const-float-bits-reject-conv.rs:66:38
|
LL | const _: () = assert!($a == $b);
- | --------------------------------
+ | -----------
...
LL | const_assert!(f64::from_bits(MASKED_NAN1).to_bits(), MASKED_NAN1);
| ^^^^^^^^^^^ referenced constant has errors
--> $DIR/const-float-bits-reject-conv.rs:69:38
|
LL | const _: () = assert!($a == $b);
- | --------------------------------
+ | -----------
...
LL | const_assert!(f64::from_bits(MASKED_NAN2).to_bits(), MASKED_NAN2);
| ^^^^^^^^^^^ referenced constant has errors
--> $DIR/const-float-bits-reject-conv.rs:30:34
|
LL | const _: () = assert!($a);
- | --------------------------
+ | -----------
...
LL | const_assert!(f32::from_bits(MASKED_NAN1).is_nan());
| ^^^^^^^^^^^ referenced constant has errors
--> $DIR/const-float-bits-reject-conv.rs:33:34
|
LL | const _: () = assert!($a);
- | --------------------------
+ | -----------
...
LL | const_assert!(f32::from_bits(MASKED_NAN1).is_nan());
| ^^^^^^^^^^^ referenced constant has errors
--> $DIR/const-float-bits-reject-conv.rs:41:38
|
LL | const _: () = assert!($a == $b);
- | --------------------------------
+ | -----------
...
LL | const_assert!(f32::from_bits(MASKED_NAN1).to_bits(), MASKED_NAN1);
| ^^^^^^^^^^^ referenced constant has errors
--> $DIR/const-float-bits-reject-conv.rs:44:38
|
LL | const _: () = assert!($a == $b);
- | --------------------------------
+ | -----------
...
LL | const_assert!(f32::from_bits(MASKED_NAN2).to_bits(), MASKED_NAN2);
| ^^^^^^^^^^^ referenced constant has errors
--> $DIR/const-float-bits-reject-conv.rs:57:34
|
LL | const _: () = assert!($a);
- | --------------------------
+ | -----------
...
LL | const_assert!(f64::from_bits(MASKED_NAN1).is_nan());
| ^^^^^^^^^^^ referenced constant has errors
--> $DIR/const-float-bits-reject-conv.rs:60:34
|
LL | const _: () = assert!($a);
- | --------------------------
+ | -----------
...
LL | const_assert!(f64::from_bits(MASKED_NAN1).is_nan());
| ^^^^^^^^^^^ referenced constant has errors
--> $DIR/const-float-bits-reject-conv.rs:66:38
|
LL | const _: () = assert!($a == $b);
- | --------------------------------
+ | -----------
...
LL | const_assert!(f64::from_bits(MASKED_NAN1).to_bits(), MASKED_NAN1);
| ^^^^^^^^^^^ referenced constant has errors
--> $DIR/const-float-bits-reject-conv.rs:69:38
|
LL | const _: () = assert!($a == $b);
- | --------------------------------
+ | -----------
...
LL | const_assert!(f64::from_bits(MASKED_NAN2).to_bits(), MASKED_NAN2);
| ^^^^^^^^^^^ referenced constant has errors
--> $DIR/const-len-underflow-separate-spans.rs:7:20
|
LL | const LEN: usize = ONE - TWO;
- | -------------------^^^^^^^^^-
- | |
- | attempt to compute `1_usize - 2_usize`, which would overflow
+ | ---------------- ^^^^^^^^^ attempt to compute `1_usize - 2_usize`, which would overflow
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-len-underflow-separate-spans.rs:7:20
|
LL | const LEN: usize = ONE - TWO;
- | -------------------^^^^^^^^^-
- | |
- | attempt to compute `1_usize - 2_usize`, which would overflow
+ | ---------------- ^^^^^^^^^ attempt to compute `1_usize - 2_usize`, which would overflow
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/mut_ref_in_final_dynamic_check.rs:25:1
|
LL | const B: Option<&mut i32> = helper2();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
--> $DIR/const-pattern-irrefutable.rs:12:9
|
LL | const a: u8 = 2;
- | ---------------- constant defined here
+ | ----------- constant defined here
...
LL | let a = 4;
| ^
--> $DIR/const-pattern-irrefutable.rs:13:9
|
LL | pub const b: u8 = 2;
- | -------------------- constant defined here
+ | --------------- constant defined here
...
LL | let c = 4;
| ^
--> $DIR/const-pattern-irrefutable.rs:14:9
|
LL | pub const d: u8 = 2;
- | -------------------- constant defined here
+ | --------------- constant defined here
...
LL | let d = 4;
| ^
--> $DIR/const-points-to-static.rs:6:1
|
LL | const TEST: &u8 = &MY_STATIC;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable
+ | ^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/const-points-to-static.rs:6:1
|
LL | const TEST: &u8 = &MY_STATIC;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable
+ | ^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/const-prop-read-static-in-const.rs:5:18
|
LL | const TEST: u8 = MY_STATIC;
- | -----------------^^^^^^^^^-
- | |
- | constant accesses static
+ | -------------- ^^^^^^^^^ constant accesses static
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-prop-read-static-in-const.rs:5:18
|
LL | const TEST: u8 = MY_STATIC;
- | -----------------^^^^^^^^^-
- | |
- | constant accesses static
+ | -------------- ^^^^^^^^^ constant accesses static
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-size_of_val-align_of_val-extern-type.rs:11:31
|
LL | const _SIZE: usize = unsafe { size_of_val(&4 as *const i32 as *const Opaque) };
- | ------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | `extern type` does not have known layout
+ | ------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `extern type` does not have known layout
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-size_of_val-align_of_val-extern-type.rs:13:32
|
LL | const _ALIGN: usize = unsafe { min_align_of_val(&4 as *const i32 as *const Opaque) };
- | -------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | `extern type` does not have known layout
+ | ------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `extern type` does not have known layout
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/const-size_of_val-align_of_val-extern-type.rs:11:31
|
LL | const _SIZE: usize = unsafe { size_of_val(&4 as *const i32 as *const Opaque) };
- | ------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | `extern type` does not have known layout
+ | ------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `extern type` does not have known layout
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-size_of_val-align_of_val-extern-type.rs:13:32
|
LL | const _ALIGN: usize = unsafe { min_align_of_val(&4 as *const i32 as *const Opaque) };
- | -------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | `extern type` does not have known layout
+ | ------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `extern type` does not have known layout
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-slice-oob.rs:4:18
|
LL | const BAR: u32 = FOO[5];
- | -----------------^^^^^^-
- | |
- | index out of bounds: the length is 3 but the index is 5
+ | -------------- ^^^^^^ index out of bounds: the length is 3 but the index is 5
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/const-slice-oob.rs:4:18
|
LL | const BAR: u32 = FOO[5];
- | -----------------^^^^^^-
- | |
- | index out of bounds: the length is 3 but the index is 5
+ | -------------- ^^^^^^ index out of bounds: the length is 3 but the index is 5
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
error: any use of this value will cause an error
--> $DIR/const_eval_limit_reached.rs:6:11
|
-LL | / const X: usize = {
-LL | | let mut x = 0;
-LL | | while x != 1000 {
- | | ^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
-LL | |
-... |
-LL | | x
-LL | | };
- | |__-
+LL | const X: usize = {
+ | --------------
+LL | let mut x = 0;
+LL | while x != 1000 {
+ | ^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
error: any use of this value will cause an error
--> $DIR/const_eval_limit_reached.rs:6:11
|
-LL | / const X: usize = {
-LL | | let mut x = 0;
-LL | | while x != 1000 {
- | | ^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
-LL | |
-... |
-LL | | x
-LL | | };
- | |__-
+LL | const X: usize = {
+ | --------------
+LL | let mut x = 0;
+LL | while x != 1000 {
+ | ^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
error: encountered dangling pointer in final constant
--> $DIR/dangling-alloc-id-ice.rs:9:1
|
-LL | / const FOO: &() = {
-LL | |
-LL | | let y = ();
-LL | | unsafe { Foo { y: &y }.long_live_the_unit }
-LL | | };
- | |__^
+LL | const FOO: &() = {
+ | ^^^^^^^^^^^^^^
error: aborting due to previous error
error: encountered dangling pointer in final constant
--> $DIR/dangling_raw_ptr.rs:1:1
|
-LL | / const FOO: *const u32 = {
-LL | | let x = 42;
-LL | | &x
-LL | | };
- | |__^
+LL | const FOO: *const u32 = {
+ | ^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/issue-36163.rs:1:1
|
LL | const A: isize = Foo::B as isize;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^
= note: ...which again requires const-evaluating + checking `Foo::B::{constant#0}`, completing the cycle
note: cycle used when simplifying constant for the type system `Foo::B::{constant#0}`
--> $DIR/issue-36163.rs:4:9
error[E0080]: it is undefined behavior to use this value
--> $DIR/issue-63952.rs:17:1
|
-LL | / const SLICE_WAY_TOO_LONG: &[u8] = unsafe {
-LL | | SliceTransmute {
-LL | | repr: SliceRepr {
-LL | | ptr: &42,
-... |
-LL | | .slice
-LL | | };
- | |__^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
+LL | const SLICE_WAY_TOO_LONG: &[u8] = unsafe {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/issue-63952.rs:17:1
|
-LL | / const SLICE_WAY_TOO_LONG: &[u8] = unsafe {
-LL | | SliceTransmute {
-LL | | repr: SliceRepr {
-LL | | ptr: &42,
-... |
-LL | | .slice
-LL | | };
- | |__^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
+LL | const SLICE_WAY_TOO_LONG: &[u8] = unsafe {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/issue-79690.rs:30:1
|
LL | const G: Fat = unsafe { Transmute { t: FOO }.u };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .1.<deref>.size.foo: encountered (potentially part of) a pointer, but expected plain (non-pointer) bytes
+ | ^^^^^^^^^^^^ constructing invalid value at .1.<deref>.size.foo: encountered (potentially part of) a pointer, but expected plain (non-pointer) bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/issue-83182.rs:5:1
|
LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[&()]) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered a pointer in `str`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered a pointer in `str`
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/issue-83182.rs:5:1
|
LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[&()]) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered a pointer in `str`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered a pointer in `str`
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
error: any use of this value will cause an error
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
-LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | |
- | unable to turn pointer into raw bytes
- | inside `std::ptr::read::<u8>` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- | inside `ptr::const_ptr::<impl *const u8>::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- | inside `C` at $DIR/issue-miri-1910.rs:7:5
+LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | |
+ | unable to turn pointer into raw bytes
+ | inside `std::ptr::read::<u8>` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+ | inside `ptr::const_ptr::<impl *const u8>::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
+ | inside `C` at $DIR/issue-miri-1910.rs:7:5
|
::: $DIR/issue-miri-1910.rs:4:1
|
-LL | / const C: () = unsafe {
-LL | | let foo = Some(&42 as *const i32);
-LL | | let one_and_a_half_pointers = std::mem::size_of::<*const i32>()/2*3;
-LL | | (&foo as *const _ as *const u8).add(one_and_a_half_pointers).read();
-LL | | };
- | |__-
+LL | const C: () = unsafe {
+ | -----------
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
error: any use of this value will cause an error
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
-LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | |
- | unable to turn pointer into raw bytes
- | inside `std::ptr::read::<u8>` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- | inside `ptr::const_ptr::<impl *const u8>::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- | inside `C` at $DIR/issue-miri-1910.rs:7:5
+LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | |
+ | unable to turn pointer into raw bytes
+ | inside `std::ptr::read::<u8>` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+ | inside `ptr::const_ptr::<impl *const u8>::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
+ | inside `C` at $DIR/issue-miri-1910.rs:7:5
|
::: $DIR/issue-miri-1910.rs:4:1
|
-LL | / const C: () = unsafe {
-LL | | let foo = Some(&42 as *const i32);
-LL | | let one_and_a_half_pointers = std::mem::size_of::<*const i32>()/2*3;
-LL | | (&foo as *const _ as *const u8).add(one_and_a_half_pointers).read();
-LL | | };
- | |__-
+LL | const C: () = unsafe {
+ | -----------
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
::: $DIR/assoc_const.rs:14:5
|
LL | const F: u32 = (U::X, 42).1;
- | ----------------------------
+ | ------------
|
note: the lint level is defined here
--> $DIR/assoc_const.rs:4:10
--> $DIR/assoc_const_2.rs:12:20
|
LL | const F: u32 = 100 / U::X;
- | ---------------^^^^^^^^^^-
- | |
- | attempt to divide `100_u32` by zero
+ | ------------ ^^^^^^^^^^ attempt to divide `100_u32` by zero
|
note: the lint level is defined here
--> $DIR/assoc_const_2.rs:3:10
warning: any use of this value will cause an error
--> $DIR/const_refers_to_static.rs:13:5
|
-LL | / const MUTATE_INTERIOR_MUT: usize = {
-LL | | static FOO: AtomicUsize = AtomicUsize::new(0);
-LL | | FOO.fetch_add(1, Ordering::Relaxed)
- | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling non-const function `AtomicUsize::fetch_add`
-LL | | };
- | |__-
+LL | const MUTATE_INTERIOR_MUT: usize = {
+ | --------------------------------
+LL | static FOO: AtomicUsize = AtomicUsize::new(0);
+LL | FOO.fetch_add(1, Ordering::Relaxed)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling non-const function `AtomicUsize::fetch_add`
|
note: the lint level is defined here
--> $DIR/const_refers_to_static.rs:3:10
warning: any use of this value will cause an error
--> $DIR/const_refers_to_static.rs:18:14
|
-LL | / const READ_INTERIOR_MUT: usize = {
-LL | | static FOO: AtomicUsize = AtomicUsize::new(0);
-LL | | unsafe { *(&FOO as *const _ as *const usize) }
- | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
-LL | | };
- | |__-
+LL | const READ_INTERIOR_MUT: usize = {
+ | ------------------------------
+LL | static FOO: AtomicUsize = AtomicUsize::new(0);
+LL | unsafe { *(&FOO as *const _ as *const usize) }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
|
note: the lint level is defined here
--> $DIR/const_refers_to_static.rs:3:10
--> $DIR/const_refers_to_static.rs:22:32
|
LL | const READ_MUT: u32 = unsafe { MUTABLE };
- | -------------------------------^^^^^^^---
- | |
- | constant accesses static
+ | ------------------- ^^^^^^^ constant accesses static
|
note: the lint level is defined here
--> $DIR/const_refers_to_static.rs:3:10
error[E0080]: it is undefined behavior to use this value
--> $DIR/const_refers_to_static2.rs:11:1
|
-LL | / const REF_INTERIOR_MUT: &usize = {
-LL | |
-LL | | static FOO: AtomicUsize = AtomicUsize::new(0);
-LL | | unsafe { &*(&FOO as *const _ as *const usize) }
-LL | | };
- | |__^ constructing invalid value: encountered a reference pointing to a static variable
+LL | const REF_INTERIOR_MUT: &usize = {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/const_refers_to_static2.rs:18:1
|
-LL | / const READ_IMMUT: &usize = {
-LL | |
-LL | | static FOO: usize = 0;
-LL | | &FOO
-LL | | };
- | |__^ constructing invalid value: encountered a reference pointing to a static variable
+LL | const READ_IMMUT: &usize = {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/const_refers_to_static2.rs:11:1
|
-LL | / const REF_INTERIOR_MUT: &usize = {
-LL | |
-LL | | static FOO: AtomicUsize = AtomicUsize::new(0);
-LL | | unsafe { &*(&FOO as *const _ as *const usize) }
-LL | | };
- | |__^ constructing invalid value: encountered a reference pointing to a static variable
+LL | const REF_INTERIOR_MUT: &usize = {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/const_refers_to_static2.rs:18:1
|
-LL | / const READ_IMMUT: &usize = {
-LL | |
-LL | | static FOO: usize = 0;
-LL | | &FOO
-LL | | };
- | |__^ constructing invalid value: encountered a reference pointing to a static variable
+LL | const READ_IMMUT: &usize = {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/const_refers_to_static_cross_crate.rs:12:1
|
-LL | / const SLICE_MUT: &[u8; 1] = {
-LL | |
-LL | | unsafe { &static_cross_crate::ZERO }
-LL | | };
- | |__^ constructing invalid value: encountered a reference pointing to a static variable
+LL | const SLICE_MUT: &[u8; 1] = {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/const_refers_to_static_cross_crate.rs:17:1
|
-LL | / const U8_MUT: &u8 = {
-LL | |
-LL | | unsafe { &static_cross_crate::ZERO[0] }
-LL | | };
- | |__^ constructing invalid value: encountered a reference pointing to a static variable
+LL | const U8_MUT: &u8 = {
+ | ^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
warning: any use of this value will cause an error
--> $DIR/const_refers_to_static_cross_crate.rs:25:15
|
-LL | / const U8_MUT2: &u8 = {
-LL | | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
- | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
-LL | |
-LL | |
-LL | |
-LL | | };
- | |__-
+LL | const U8_MUT2: &u8 = {
+ | ------------------
+LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
|
note: the lint level is defined here
--> $DIR/const_refers_to_static_cross_crate.rs:23:8
warning: any use of this value will cause an error
--> $DIR/const_refers_to_static_cross_crate.rs:32:20
|
-LL | / const U8_MUT3: &u8 = {
-LL | | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
- | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
-LL | |
-LL | |
-LL | |
-LL | | };
- | |__-
+LL | const U8_MUT3: &u8 = {
+ | ------------------
+LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
|
note: the lint level is defined here
--> $DIR/const_refers_to_static_cross_crate.rs:30:8
warning: any use of this value will cause an error
--> $DIR/const_refers_to_static_cross_crate.rs:25:15
|
-LL | / const U8_MUT2: &u8 = {
-LL | | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
- | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
-LL | |
-LL | |
-LL | |
-LL | | };
- | |__-
+LL | const U8_MUT2: &u8 = {
+ | ------------------
+LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
|
note: the lint level is defined here
--> $DIR/const_refers_to_static_cross_crate.rs:23:8
warning: any use of this value will cause an error
--> $DIR/const_refers_to_static_cross_crate.rs:32:20
|
-LL | / const U8_MUT3: &u8 = {
-LL | | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
- | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
-LL | |
-LL | |
-LL | |
-LL | | };
- | |__-
+LL | const U8_MUT3: &u8 = {
+ | ------------------
+LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
|
note: the lint level is defined here
--> $DIR/const_refers_to_static_cross_crate.rs:30:8
error[E0080]: it is undefined behavior to use this value
--> $DIR/const_refers_to_static_cross_crate.rs:12:1
|
-LL | / const SLICE_MUT: &[u8; 1] = {
-LL | |
-LL | | unsafe { &static_cross_crate::ZERO }
-LL | | };
- | |__^ constructing invalid value: encountered a reference pointing to a static variable
+LL | const SLICE_MUT: &[u8; 1] = {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/const_refers_to_static_cross_crate.rs:17:1
|
-LL | / const U8_MUT: &u8 = {
-LL | |
-LL | | unsafe { &static_cross_crate::ZERO[0] }
-LL | | };
- | |__^ constructing invalid value: encountered a reference pointing to a static variable
+LL | const U8_MUT: &u8 = {
+ | ^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
warning: any use of this value will cause an error
--> $DIR/const_refers_to_static_cross_crate.rs:25:15
|
-LL | / const U8_MUT2: &u8 = {
-LL | | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
- | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
-LL | |
-LL | |
-LL | |
-LL | | };
- | |__-
+LL | const U8_MUT2: &u8 = {
+ | ------------------
+LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
|
note: the lint level is defined here
--> $DIR/const_refers_to_static_cross_crate.rs:23:8
warning: any use of this value will cause an error
--> $DIR/const_refers_to_static_cross_crate.rs:32:20
|
-LL | / const U8_MUT3: &u8 = {
-LL | | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
- | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
-LL | |
-LL | |
-LL | |
-LL | | };
- | |__-
+LL | const U8_MUT3: &u8 = {
+ | ------------------
+LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
|
note: the lint level is defined here
--> $DIR/const_refers_to_static_cross_crate.rs:30:8
warning: any use of this value will cause an error
--> $DIR/const_refers_to_static_cross_crate.rs:25:15
|
-LL | / const U8_MUT2: &u8 = {
-LL | | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
- | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
-LL | |
-LL | |
-LL | |
-LL | | };
- | |__-
+LL | const U8_MUT2: &u8 = {
+ | ------------------
+LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
|
note: the lint level is defined here
--> $DIR/const_refers_to_static_cross_crate.rs:23:8
warning: any use of this value will cause an error
--> $DIR/const_refers_to_static_cross_crate.rs:32:20
|
-LL | / const U8_MUT3: &u8 = {
-LL | | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
- | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
-LL | |
-LL | |
-LL | |
-LL | | };
- | |__-
+LL | const U8_MUT3: &u8 = {
+ | ------------------
+LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
|
note: the lint level is defined here
--> $DIR/const_refers_to_static_cross_crate.rs:30:8
error[E0080]: it is undefined behavior to use this value
--> $DIR/mutable_references_err.rs:17:1
|
-LL | / const MUH: Meh = Meh {
-LL | | x: &UnsafeCell::new(42),
-LL | | };
- | |__^ constructing invalid value at .x.<deref>: encountered `UnsafeCell` in a `const`
+LL | const MUH: Meh = Meh {
+ | ^^^^^^^^^^^^^^ constructing invalid value at .x.<deref>: encountered `UnsafeCell` in a `const`
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/mutable_references_err.rs:27:1
|
LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>.x: encountered `UnsafeCell` in a `const`
+ | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>.x: encountered `UnsafeCell` in a `const`
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/mutable_references_err.rs:31:1
|
LL | const BLUNT: &mut i32 = &mut 42;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const`
+ | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const`
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
error[E0080]: it is undefined behavior to use this value
--> $DIR/mutable_references_err.rs:17:1
|
-LL | / const MUH: Meh = Meh {
-LL | | x: &UnsafeCell::new(42),
-LL | | };
- | |__^ constructing invalid value at .x.<deref>: encountered `UnsafeCell` in a `const`
+LL | const MUH: Meh = Meh {
+ | ^^^^^^^^^^^^^^ constructing invalid value at .x.<deref>: encountered `UnsafeCell` in a `const`
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/mutable_references_err.rs:27:1
|
LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>.x: encountered `UnsafeCell` in a `const`
+ | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>.x: encountered `UnsafeCell` in a `const`
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/mutable_references_err.rs:31:1
|
LL | const BLUNT: &mut i32 = &mut 42;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const`
+ | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const`
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/raw_mutable_const.rs:7:1
|
LL | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: skipping const checks
|
--> $DIR/ptr_comparisons.rs:65:27
|
LL | const _: usize = unsafe { std::mem::transmute::<*const usize, usize>(FOO) + 4 };
- | --------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | -------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ptr_comparisons.rs:70:27
|
LL | const _: usize = unsafe { *std::mem::transmute::<&&usize, &usize>(&FOO) + 4 };
- | --------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------
- | |
- | unable to turn pointer into raw bytes
+ | -------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
--> $DIR/ptr_comparisons.rs:65:27
|
LL | const _: usize = unsafe { std::mem::transmute::<*const usize, usize>(FOO) + 4 };
- | --------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
- | |
- | unable to turn pointer into raw bytes
+ | -------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/ptr_comparisons.rs:70:27
|
LL | const _: usize = unsafe { *std::mem::transmute::<&&usize, &usize>(&FOO) + 4 };
- | --------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------
- | |
- | unable to turn pointer into raw bytes
+ | -------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/raw-ptr-const.rs:7:1
|
LL | const CONST_RAW: *const Vec<i32> = &Vec::new() as *const _;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/recursive-zst-static.rs:10:1
|
LL | static FOO: () = FOO;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^
|
note: ...which requires const-evaluating + checking `FOO`...
--> $DIR/recursive-zst-static.rs:10:18
--> $DIR/recursive-zst-static.rs:10:1
|
LL | static FOO: () = FOO;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^
|
note: ...which requires const-evaluating + checking `FOO`...
--> $DIR/recursive-zst-static.rs:10:18
| inside `X` at $DIR/recursive.rs:9:15
...
LL | const X: () = f(1);
- | -------------------
+ | -----------
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
| inside `X` at $DIR/recursive.rs:9:15
...
LL | const X: () = f(1);
- | -------------------
+ | -----------
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/alloc.rs:9:1
|
LL | const LAYOUT_INVALID_ZERO: Layout = unsafe { Layout::from_size_align_unchecked(0x1000, 0x00) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .align.0.<enum-tag>: encountered 0x00000000, but expected a valid enum tag
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .align.0.<enum-tag>: encountered 0x00000000, but expected a valid enum tag
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/alloc.rs:13:1
|
LL | const LAYOUT_INVALID_THREE: Layout = unsafe { Layout::from_size_align_unchecked(9, 3) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .align.0.<enum-tag>: encountered 0x00000003, but expected a valid enum tag
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .align.0.<enum-tag>: encountered 0x00000003, but expected a valid enum tag
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/alloc.rs:9:1
|
LL | const LAYOUT_INVALID_ZERO: Layout = unsafe { Layout::from_size_align_unchecked(0x1000, 0x00) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .align.0.<enum-tag>: encountered 0x0000000000000000, but expected a valid enum tag
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .align.0.<enum-tag>: encountered 0x0000000000000000, but expected a valid enum tag
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/alloc.rs:13:1
|
LL | const LAYOUT_INVALID_THREE: Layout = unsafe { Layout::from_size_align_unchecked(9, 3) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .align.0.<enum-tag>: encountered 0x0000000000000003, but expected a valid enum tag
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .align.0.<enum-tag>: encountered 0x0000000000000003, but expected a valid enum tag
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/cell.rs:6:1
|
LL | static FOO: Wrap<*mut u32> = Wrap(Cell::new(42).as_ptr());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: encountered dangling pointer in final constant
--> $DIR/cell.rs:8:1
|
LL | const FOO_CONST: Wrap<*mut u32> = Wrap(Cell::new(42).as_ptr());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: encountered dangling pointer in final constant
--> $DIR/cell.rs:22:1
|
LL | const FOO4_CONST: Wrap<*mut u32> = Wrap(FOO3_CONST.0.as_ptr());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: encountered dangling pointer in final constant
--> $DIR/cell.rs:27:1
|
LL | const FOO2: *mut u32 = Cell::new(42).as_ptr();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^
error: aborting due to 4 previous errors
| inside `<i32 as Const>::CONSTANT` at $DIR/uninhabited-const-issue-61744.rs:13:36
...
LL | const CONSTANT: i32 = unsafe { fake_type() };
- | ---------------------------------------------
+ | -------------------
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
| inside `<i32 as Const>::CONSTANT` at $DIR/uninhabited-const-issue-61744.rs:13:36
...
LL | const CONSTANT: i32 = unsafe { fake_type() };
- | ---------------------------------------------
+ | -------------------
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/validate_never_arrays.rs:4:1
|
LL | const _: &[!; 1] = unsafe { &*(1_usize as *const [!; 1]) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type [!; 1]
+ | ^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type [!; 1]
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
--> $DIR/validate_never_arrays.rs:7:1
|
LL | const _: &[!] = unsafe { &*(1_usize as *const [!; 1]) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered a value of the never type `!`
+ | ^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered a value of the never type `!`
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/validate_never_arrays.rs:8:1
|
LL | const _: &[!] = unsafe { &*(1_usize as *const [!; 42]) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered a value of the never type `!`
+ | ^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered a value of the never type `!`
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
--> $DIR/validate_never_arrays.rs:4:1
|
LL | const _: &[!; 1] = unsafe { &*(1_usize as *const [!; 1]) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type [!; 1]
+ | ^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type [!; 1]
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
--> $DIR/validate_never_arrays.rs:7:1
|
LL | const _: &[!] = unsafe { &*(1_usize as *const [!; 1]) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered a value of the never type `!`
+ | ^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered a value of the never type `!`
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/validate_never_arrays.rs:8:1
|
LL | const _: &[!] = unsafe { &*(1_usize as *const [!; 42]) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered a value of the never type `!`
+ | ^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered a value of the never type `!`
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
--> $DIR/write-to-static-mut-in-static.rs:5:1
|
LL | pub static mut C: u32 = unsafe { C = 1; 0 };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^
|
note: ...which requires const-evaluating + checking `C`...
--> $DIR/write-to-static-mut-in-static.rs:5:34
| doesn't satisfy `Bar<NotClone>: Clone`
...
LL | struct NotClone;
- | ---------------- doesn't satisfy `NotClone: Clone`
+ | --------------- doesn't satisfy `NotClone: Clone`
...
LL | Bar::<NotClone> { x: 1 }.clone();
| ^^^^^ method cannot be called on `Bar<NotClone>` due to unsatisfied trait bounds
--> $DIR/derives-span-PartialEq-enum-struct-variant.rs:4:1
|
LL | struct Error;
- | ^^^^^^^^^^^^^ must implement `PartialEq<_>`
+ | ^^^^^^^^^^^^ must implement `PartialEq<_>`
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(PartialEq)]`
|
--> $DIR/derives-span-PartialEq-enum-struct-variant.rs:4:1
|
LL | struct Error;
- | ^^^^^^^^^^^^^ must implement `PartialEq<_>`
+ | ^^^^^^^^^^^^ must implement `PartialEq<_>`
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(PartialEq)]`
|
--> $DIR/derives-span-PartialEq-enum.rs:4:1
|
LL | struct Error;
- | ^^^^^^^^^^^^^ must implement `PartialEq<_>`
+ | ^^^^^^^^^^^^ must implement `PartialEq<_>`
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(PartialEq)]`
|
--> $DIR/derives-span-PartialEq-enum.rs:4:1
|
LL | struct Error;
- | ^^^^^^^^^^^^^ must implement `PartialEq<_>`
+ | ^^^^^^^^^^^^ must implement `PartialEq<_>`
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(PartialEq)]`
|
--> $DIR/derives-span-PartialEq-struct.rs:4:1
|
LL | struct Error;
- | ^^^^^^^^^^^^^ must implement `PartialEq<_>`
+ | ^^^^^^^^^^^^ must implement `PartialEq<_>`
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(PartialEq)]`
|
--> $DIR/derives-span-PartialEq-struct.rs:4:1
|
LL | struct Error;
- | ^^^^^^^^^^^^^ must implement `PartialEq<_>`
+ | ^^^^^^^^^^^^ must implement `PartialEq<_>`
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(PartialEq)]`
|
--> $DIR/derives-span-PartialEq-tuple-struct.rs:4:1
|
LL | struct Error;
- | ^^^^^^^^^^^^^ must implement `PartialEq<_>`
+ | ^^^^^^^^^^^^ must implement `PartialEq<_>`
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(PartialEq)]`
|
--> $DIR/derives-span-PartialEq-tuple-struct.rs:4:1
|
LL | struct Error;
- | ^^^^^^^^^^^^^ must implement `PartialEq<_>`
+ | ^^^^^^^^^^^^ must implement `PartialEq<_>`
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(PartialEq)]`
|
::: $SRC_DIR/core/src/cmp.rs:LL:COL
|
LL | pub macro Eq($item:item) {
- | ------------------------ similarly named derive macro `Eq` defined here
+ | ------------ similarly named derive macro `Eq` defined here
error: cannot find derive macro `Eqr` in this scope
--> $DIR/deriving-meta-unknown-trait.rs:1:10
::: $SRC_DIR/core/src/cmp.rs:LL:COL
|
LL | pub macro Eq($item:item) {
- | ------------------------ similarly named derive macro `Eq` defined here
+ | ------------ similarly named derive macro `Eq` defined here
error: aborting due to 2 previous errors
--> $DIR/deriving-no-inner-impl-error-message.rs:1:1
|
LL | struct NoCloneOrEq;
- | ^^^^^^^^^^^^^^^^^^^ must implement `PartialEq<_>`
+ | ^^^^^^^^^^^^^^^^^^ must implement `PartialEq<_>`
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `NoCloneOrEq` with `#[derive(PartialEq)]`
|
--> $DIR/deriving-no-inner-impl-error-message.rs:1:1
|
LL | struct NoCloneOrEq;
- | ^^^^^^^^^^^^^^^^^^^ must implement `PartialEq<_>`
+ | ^^^^^^^^^^^^^^^^^^ must implement `PartialEq<_>`
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `NoCloneOrEq` with `#[derive(PartialEq)]`
|
--> $DIR/issue-91492.rs:4:9
|
LL | pub struct NoDerives;
- | --------------------- doesn't satisfy `NoDerives: Clone`
+ | -------------------- doesn't satisfy `NoDerives: Clone`
LL | fn fun1(foo: &mut Vec<NoDerives>, bar: &[NoDerives]) {
LL | foo.extend_from_slice(bar);
| ^^^^^^^^^^^^^^^^^
--> $DIR/issue-91492.rs:12:9
|
LL | pub struct SomeDerives;
- | ----------------------- doesn't satisfy `SomeDerives: Clone`
+ | ---------------------- doesn't satisfy `SomeDerives: Clone`
LL | fn fun2(foo: &mut Vec<SomeDerives>, bar: &[SomeDerives]) {
LL | foo.extend_from_slice(bar);
| ^^^^^^^^^^^^^^^^^
--> $DIR/issue-91492.rs:22:9
|
LL | pub struct NoDerives;
- | --------------------- doesn't satisfy `NoDerives: Clone`
+ | -------------------- doesn't satisfy `NoDerives: Clone`
...
LL | struct Object<T, A>(T, A);
| ------ method `use_clone` not found for this struct
--> $DIR/issue-91550.rs:8:8
|
LL | struct Value(u32);
- | ------------------
+ | ------------
| |
| doesn't satisfy `Value: Eq`
| doesn't satisfy `Value: Hash`
--> $DIR/issue-91550.rs:26:9
|
LL | pub struct NoDerives;
- | --------------------- doesn't satisfy `NoDerives: Eq`
+ | -------------------- doesn't satisfy `NoDerives: Eq`
LL |
LL | struct Object<T>(T);
| ------ method `use_eq` not found for this struct
--> $DIR/issue-91550.rs:27:9
|
LL | pub struct NoDerives;
- | --------------------- doesn't satisfy `NoDerives: Ord`
+ | -------------------- doesn't satisfy `NoDerives: Ord`
LL |
LL | struct Object<T>(T);
| ------ method `use_ord` not found for this struct
--> $DIR/issue-91550.rs:28:9
|
LL | pub struct NoDerives;
- | ---------------------
+ | --------------------
| |
| doesn't satisfy `NoDerives: Ord`
| doesn't satisfy `NoDerives: PartialOrd`
note: the following trait must be implemented
--> $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
-LL | / pub trait AddAssign<Rhs = Self> {
-LL | | /// Performs the `+=` operation.
-LL | | ///
-LL | | /// # Example
-... |
-LL | | fn add_assign(&mut self, rhs: Rhs);
-LL | | }
- | |_^
+LL | pub trait AddAssign<Rhs = Self> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0067]: invalid left-hand side of assignment
--> $DIR/note-unsupported.rs:17:22
--> $DIR/compatible-variants-in-pat.rs:21:9
|
LL | struct S;
- | --------- unit struct defined here
+ | -------- unit struct defined here
...
LL | match s {
| - this expression has type `Option<S>`
--> $DIR/compatible-variants-in-pat.rs:32:9
|
LL | struct S;
- | --------- unit struct defined here
+ | -------- unit struct defined here
...
LL | match s {
| - this expression has type `Result<S, S>`
error[E0366]: `Drop` impls cannot be specialized
--> $DIR/issue-38868.rs:5:1
|
-LL | / impl Drop for List<i32> {
-LL | | fn drop(&mut self) {
-LL | | panic!()
-LL | | }
-LL | | }
- | |_^
+LL | impl Drop for List<i32> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `i32` is not a generic parameter
note: use the same sequence of generic lifetime, type and const parameters as the struct definition
--> $DIR/issue-38868.rs:1:1
|
-LL | / pub struct List<T> {
-LL | | head: T,
-LL | | }
- | |_^
+LL | pub struct List<T> {
+ | ^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/reject-specialized-drops-8142.rs:4:1
|
LL | struct K<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^
error[E0367]: `Drop` impl requires `'adds_bnd: 'al` but the struct it is implemented for does not
--> $DIR/reject-specialized-drops-8142.rs:28:67
--> $DIR/reject-specialized-drops-8142.rs:5:1
|
LL | struct L<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^
error[E0366]: `Drop` impls cannot be specialized
--> $DIR/reject-specialized-drops-8142.rs:34:1
|
LL | impl Drop for N<'static> { fn drop(&mut self) { } } // REJECT
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `'static` is not a generic parameter
note: use the same sequence of generic lifetime, type and const parameters as the struct definition
--> $DIR/reject-specialized-drops-8142.rs:7:1
|
LL | struct N<'n> { x: &'n i8 }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0366]: `Drop` impls cannot be specialized
--> $DIR/reject-specialized-drops-8142.rs:39:1
|
LL | impl Drop for P<i8> { fn drop(&mut self) { } } // REJECT
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `i8` is not a generic parameter
note: use the same sequence of generic lifetime, type and const parameters as the struct definition
--> $DIR/reject-specialized-drops-8142.rs:9:1
|
LL | struct P<Tp> { x: *const Tp }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the struct it is implemented for does not
--> $DIR/reject-specialized-drops-8142.rs:42:14
--> $DIR/reject-specialized-drops-8142.rs:10:1
|
LL | struct Q<Tq> { x: *const Tq }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0367]: `Drop` impl requires `AddsRBnd: 'rbnd` but the struct it is implemented for does not
--> $DIR/reject-specialized-drops-8142.rs:45:21
--> $DIR/reject-specialized-drops-8142.rs:11:1
|
LL | struct R<Tr> { x: *const Tr }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0366]: `Drop` impls cannot be specialized
--> $DIR/reject-specialized-drops-8142.rs:54:1
|
LL | impl<One> Drop for V<One,One> { fn drop(&mut self) { } } // REJECT
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `One` is mentioned multiple times
note: use the same sequence of generic lifetime, type and const parameters as the struct definition
--> $DIR/reject-specialized-drops-8142.rs:15:1
|
LL | struct V<Tva, Tvb> { x: *const Tva, y: *const Tvb }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^
error[E0366]: `Drop` impls cannot be specialized
--> $DIR/reject-specialized-drops-8142.rs:57:1
|
LL | impl<'lw> Drop for W<'lw,'lw> { fn drop(&mut self) { } } // REJECT
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `'lw` is mentioned multiple times
note: use the same sequence of generic lifetime, type and const parameters as the struct definition
--> $DIR/reject-specialized-drops-8142.rs:16:1
|
LL | struct W<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8 }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^
error[E0366]: `Drop` impls cannot be specialized
--> $DIR/reject-specialized-drops-8142.rs:60:1
|
LL | impl Drop for X<3> { fn drop(&mut self) { } } // REJECT
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `3_usize` is not a generic parameter
note: use the same sequence of generic lifetime, type and const parameters as the struct definition
--> $DIR/reject-specialized-drops-8142.rs:17:1
|
LL | struct X<const Ca: usize>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0366]: `Drop` impls cannot be specialized
--> $DIR/reject-specialized-drops-8142.rs:63:1
|
LL | impl<const Ca: usize> Drop for Y<Ca, Ca> { fn drop(&mut self) { } } // REJECT
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `Ca` is mentioned multiple times
note: use the same sequence of generic lifetime, type and const parameters as the struct definition
--> $DIR/reject-specialized-drops-8142.rs:18:1
|
LL | struct Y<const Ca: usize, const Cb: usize>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the enum it is implemented for does not
--> $DIR/reject-specialized-drops-8142.rs:66:14
--> $DIR/reject-specialized-drops-8142.rs:20:1
|
LL | enum Enum<T> { Variant(T) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the struct it is implemented for does not
--> $DIR/reject-specialized-drops-8142.rs:69:14
--> $DIR/reject-specialized-drops-8142.rs:21:1
|
LL | struct TupleStruct<T>(T);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^
error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the union it is implemented for does not
--> $DIR/reject-specialized-drops-8142.rs:72:21
--> $DIR/reject-specialized-drops-8142.rs:22:1
|
LL | union Union<T: Copy> { f: T }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^
error: aborting due to 13 previous errors
note: the implementor must specify the same requirement
--> $DIR/relate_lt_in_type_outlives_bound.rs:1:1
|
-LL | / struct Wrapper<'a, T>(&'a T)
-LL | | where
-LL | | T: 'a;
- | |__________^
+LL | struct Wrapper<'a, T>(&'a T)
+ | ^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/dupe-symbols-6.rs:10:1
|
LL | static HELLO_TWICE: u16 = 0;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
::: $DIR/auxiliary/empty-struct.rs:2:1
|
LL | pub struct XEmpty2;
- | ------------------- similarly named unit struct `XEmpty2` defined here
+ | ------------------ similarly named unit struct `XEmpty2` defined here
|
help: use struct literal syntax instead
|
::: $DIR/auxiliary/empty-struct.rs:2:1
|
LL | pub struct XEmpty2;
- | ------------------- similarly named unit struct `XEmpty2` defined here
+ | ------------------ similarly named unit struct `XEmpty2` defined here
|
help: use struct literal syntax instead
|
LL | pub struct XEmpty1 {}
| ------------------ `XEmpty1` defined here
LL | pub struct XEmpty2;
- | ------------------- similarly named unit struct `XEmpty2` defined here
+ | ------------------ similarly named unit struct `XEmpty2` defined here
|
help: use struct literal syntax instead
|
LL | pub struct XEmpty1 {}
| ------------------ `XEmpty1` defined here
LL | pub struct XEmpty2;
- | ------------------- similarly named unit struct `XEmpty2` defined here
+ | ------------------ similarly named unit struct `XEmpty2` defined here
|
help: use struct literal syntax instead
|
::: $DIR/auxiliary/empty-struct.rs:3:1
|
LL | pub struct XEmpty6();
- | --------------------- similarly named tuple struct `XEmpty6` defined here
+ | ------------------ similarly named tuple struct `XEmpty6` defined here
|
help: use struct pattern syntax instead
|
| ------------------ `XEmpty1` defined here
LL | pub struct XEmpty2;
LL | pub struct XEmpty6();
- | --------------------- similarly named tuple struct `XEmpty6` defined here
+ | ------------------ similarly named tuple struct `XEmpty6` defined here
|
help: use struct pattern syntax instead
|
::: $DIR/auxiliary/empty-struct.rs:3:1
|
LL | pub struct XEmpty6();
- | --------------------- similarly named tuple struct `XEmpty6` defined here
+ | ------------------ similarly named tuple struct `XEmpty6` defined here
|
help: use struct pattern syntax instead
|
| ------------------ `XEmpty1` defined here
LL | pub struct XEmpty2;
LL | pub struct XEmpty6();
- | --------------------- similarly named tuple struct `XEmpty6` defined here
+ | ------------------ similarly named tuple struct `XEmpty6` defined here
|
help: use struct pattern syntax instead
|
--> $DIR/empty-struct-unit-expr.rs:15:14
|
LL | struct Empty2;
- | -------------- `Empty2` defined here
+ | ------------- `Empty2` defined here
...
LL | let e2 = Empty2();
| ^^^^^^--
::: $DIR/auxiliary/empty-struct.rs:3:1
|
LL | pub struct XEmpty6();
- | --------------------- similarly named tuple struct `XEmpty6` defined here
+ | ------------------ similarly named tuple struct `XEmpty6` defined here
|
help: use this syntax instead
|
::: $DIR/auxiliary/empty-struct.rs:2:1
|
LL | pub struct XEmpty2;
- | ------------------- `XEmpty2` defined here
+ | ------------------ `XEmpty2` defined here
LL | pub struct XEmpty6();
- | --------------------- similarly named tuple struct `XEmpty6` defined here
+ | ------------------ similarly named tuple struct `XEmpty6` defined here
|
help: use this syntax instead
|
::: $DIR/auxiliary/empty-struct.rs:3:1
|
LL | pub struct XEmpty6();
- | --------------------- similarly named tuple struct `XEmpty6` defined here
+ | ------------------ similarly named tuple struct `XEmpty6` defined here
|
help: use this syntax instead
|
::: $DIR/auxiliary/empty-struct.rs:2:1
|
LL | pub struct XEmpty2;
- | ------------------- `XEmpty2` defined here
+ | ------------------ `XEmpty2` defined here
LL | pub struct XEmpty6();
- | --------------------- similarly named tuple struct `XEmpty6` defined here
+ | ------------------ similarly named tuple struct `XEmpty6` defined here
|
help: use this syntax instead
|
note: `Option<i32>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
|
-LL | / pub enum Option<T> {
-LL | | /// No value.
-LL | | #[lang = "None"]
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-LL | | None,
- | | ^^^^ not covered
-... |
-LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
- | | ^^^^ not covered
-LL | | }
- | |_-
+LL | pub enum Option<T> {
+ | ------------------
+...
+LL | None,
+ | ^^^^ not covered
+...
+LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
+ | ^^^^ not covered
= note: the matched value is of type `Option<i32>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
note: `Option<i32>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
|
-LL | / pub enum Option<T> {
-LL | | /// No value.
-LL | | #[lang = "None"]
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-LL | | None,
- | | ^^^^ not covered
-... |
-LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
-LL | | }
- | |_-
+LL | pub enum Option<T> {
+ | ------------------
+...
+LL | None,
+ | ^^^^ not covered
= note: the matched value is of type `Option<i32>`
help: you might want to use `if let` to ignore the variant that isn't matched
|
--> $DIR/E0017.rs:2:1
|
LL | const C: i32 = 2;
- | ^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0764]: mutable references are not allowed in the final value of constants
--> $DIR/E0017.rs:5:30
--> $DIR/E0017.rs:2:1
|
LL | const C: i32 = 2;
- | ^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0764]: mutable references are not allowed in the final value of statics
--> $DIR/E0017.rs:11:38
--> $DIR/E0075.rs:4:1
|
LL | struct Bad;
- | ^^^^^^^^^^^
+ | ^^^^^^^^^^
error: aborting due to previous error
--> $DIR/E0076.rs:4:1
|
LL | struct Bad(u16, u32, u32);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ SIMD elements must have the same type
+ | ^^^^^^^^^^ SIMD elements must have the same type
error: aborting due to previous error
--> $DIR/E0077.rs:4:1
|
LL | struct Bad(String);
- | ^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^
error: aborting due to previous error
--> $DIR/E0152.rs:5:1
|
LL | struct Foo<T>(T);
- | ^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^
|
= note: the lang item is first defined in crate `alloc` (which `std` depends on)
= note: first definition in `alloc` loaded from SYSROOT/liballoc-*.rlib
--> $DIR/E0191.rs:5:16
|
LL | type Bar;
- | --------- `Bar` defined here
+ | -------- `Bar` defined here
...
LL | type Foo = dyn Trait;
| ^^^^^ help: specify the associated type: `Trait<Bar = Type>`
--> $DIR/E0201.rs:18:5
|
LL | type Quux = u32;
- | ---------------- previous definition of `Quux` here
+ | --------- previous definition of `Quux` here
...
LL | type Quux = u32;
- | ^^^^^^^^^^^^^^^^ duplicate definition
+ | ^^^^^^^^^ duplicate definition
error: aborting due to 3 previous errors
--> $DIR/E0220.rs:5:16
|
LL | type Bar;
- | --------- `Bar` defined here
+ | -------- `Bar` defined here
...
LL | type Foo = dyn Trait<F=i32>;
| ^^^^^^^^^^^^ help: specify the associated type: `Trait<F=i32, Bar = Type>`
--> $DIR/E0221.rs:11:16
|
LL | type A: T1;
- | ----------- ambiguous `A` from `Foo`
+ | ---------- ambiguous `A` from `Foo`
...
LL | type A: T2;
- | ----------- ambiguous `A` from `Bar`
+ | ---------- ambiguous `A` from `Bar`
LL | fn do_something() {
LL | let _: Self::A;
| ^^^^^^^ ambiguous associated type `A`
--> $DIR/E0221.rs:21:16
|
LL | type Err: T3;
- | ------------- ambiguous `Err` from `My`
+ | ------------ ambiguous `Err` from `My`
LL | fn test() {
LL | let _: Self::Err;
| ^^^^^^^^^ ambiguous associated type `Err`
--> $DIR/E0264.rs:5:5
|
LL | fn cake();
- | ^^^^^^^^^^
+ | ^^^^^^^^^
error: aborting due to previous error
note: `Option<i32>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
|
-LL | / pub enum Option<T> {
-LL | | /// No value.
-LL | | #[lang = "None"]
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-LL | | None,
- | | ^^^^ not covered
-... |
-LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
-LL | | }
- | |_-
+LL | pub enum Option<T> {
+ | ------------------
+...
+LL | None,
+ | ^^^^ not covered
= note: the matched value is of type `Option<i32>`
error: aborting due to previous error
error[E0374]: the trait `CoerceUnsized` may only be implemented for a coercion between structures with one field being coerced, none found
--> $DIR/E0374.rs:8:1
|
-LL | / impl<T, U> CoerceUnsized<Foo<U>> for Foo<T>
-LL | | where T: CoerceUnsized<U> {}
- | |________________________________^
+LL | impl<T, U> CoerceUnsized<Foo<U>> for Foo<T>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/E0376.rs:8:1
|
LL | impl<T, U> CoerceUnsized<U> for Foo<T> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/E0388.rs:2:1
|
LL | const C: i32 = 2;
- | ^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0764]: mutable references are not allowed in the final value of constants
--> $DIR/E0388.rs:4:30
--> $DIR/E0388.rs:2:1
|
LL | const C: i32 = 2;
- | ^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0764]: mutable references are not allowed in the final value of statics
--> $DIR/E0388.rs:10:38
--> $DIR/E0393.rs:3:47
|
LL | trait A<T=Self> {}
- | ------------------ type parameter `T` must be specified for this
+ | --------------- type parameter `T` must be specified for this
LL |
LL | fn together_we_will_rule_the_galaxy(son: &dyn A) {}
| ^ help: set the type parameter to the desired type: `A<T>`
| --------- `Foo` declared as private
...
LL | pub trait Bar : Foo {}
- | ^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
+ | ^^^^^^^^^^^^^^^^^^^ can't leak private trait
error[E0445]: private trait `Foo` in public interface
--> $DIR/E0445.rs:7:1
| --------- `Foo` declared as private
...
LL | pub struct Bar2<T: Foo>(pub T);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
+ | ^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
error[E0445]: private trait `Foo` in public interface
--> $DIR/E0445.rs:9:1
--> $DIR/E0446.rs:4:5
|
LL | struct Bar(u32);
- | ---------------- `Bar` declared as private
+ | ---------- `Bar` declared as private
LL |
LL | pub fn bar() -> Bar {
| ^^^^^^^^^^^^^^^^^^^ can't leak private type
error[E0520]: `fly` specializes an item from a parent `impl`, but that item is not marked `default`
--> $DIR/E0520.rs:17:5
|
-LL | / impl<T: Clone> SpaceLlama for T {
-LL | | fn fly(&self) {}
-LL | | }
- | |_- parent `impl` is here
+LL | impl<T: Clone> SpaceLlama for T {
+ | ------------------------------- parent `impl` is here
...
-LL | default fn fly(&self) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `fly`
+LL | default fn fly(&self) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `fly`
|
= note: to specialize, `fly` in the parent `impl` must be marked `default`
note: the following trait must be implemented
--> $SRC_DIR/core/src/ops/bit.rs:LL:COL
|
-LL | / pub trait Not {
-LL | | /// The resulting type after applying the `!` operator.
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-LL | | type Output;
-... |
-LL | | fn not(self) -> Self::Output;
-LL | | }
- | |_^
+LL | pub trait Not {
+ | ^^^^^^^^^^^^^
error[E0604]: only `u8` can be cast as `char`, not `u32`
--> $DIR/error-festival.rs:25:5
--> $DIR/extern-main-issue-86110.rs:4:5
|
LL | fn main();
- | ^^^^^^^^^^
+ | ^^^^^^^^^
error: aborting due to previous error
--> $DIR/extern-types-distinct-types.rs:9:5
|
LL | type A;
- | ------- the found foreign type
+ | ------ the found foreign type
LL | type B;
- | ------- the expected foreign type
+ | ------ the expected foreign type
...
LL | fn foo(r: &A) -> &B {
| -- expected `&B` because of return type
note: `Result<u32, !>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
|
-LL | / pub enum Result<T, E> {
-LL | | /// Contains the success value
-LL | | #[lang = "Ok"]
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-... |
-LL | | Err(#[stable(feature = "rust1", since = "1.0.0")] E),
- | | ^^^ not covered
-LL | | }
- | |_-
+LL | pub enum Result<T, E> {
+ | ---------------------
+...
+LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E),
+ | ^^^ not covered
= note: the matched value is of type `Result<u32, !>`
help: you might want to use `if let` to ignore the variant that isn't matched
|
--> $DIR/generic-associated-types-where.rs:22:5
|
LL | type Assoc3<T>;
- | --------------- definition of `Assoc3` from trait
+ | -------------- definition of `Assoc3` from trait
...
LL | type Assoc3<T> = Vec<T> where T: Iterator;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: Iterator`
+ | ^^^^^^^^^^^^^^ impl has extra requirement `T: Iterator`
error: aborting due to 2 previous errors
--> $DIR/impl_bounds.rs:15:5
|
LL | type A<'a> where Self: 'a;
- | -------------------------- expected
+ | ---------- expected
...
LL | type A<'a> = (&'a ()) where Self: 'static;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found
+ | ^^^^^^^^^^ found
error: `impl` associated type signature for `B` doesn't match `trait` associated type signature
--> $DIR/impl_bounds.rs:17:5
|
LL | type B<'a, 'b> where 'a: 'b;
- | ---------------------------- expected
+ | -------------- expected
...
LL | type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found
+ | ^^^^^^^^^^^^^^ found
error[E0478]: lifetime bound not satisfied
--> $DIR/impl_bounds.rs:17:22
|
LL | type B<'a, 'b> where 'a: 'b;
- | ---------------------------- definition of `B` from trait
+ | -------------- definition of `B` from trait
...
LL | type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a;
| ^^^^^^^^^^^^^^^ - help: try copying this clause from the trait: `, 'a: 'b`
--> $DIR/impl_bounds.rs:20:5
|
LL | type C = String where Self: Copy;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
+ | ^^^^^^ the trait `Copy` is not implemented for `T`
|
note: required because of the requirements on the impl of `Copy` for `Fooy<T>`
--> $DIR/impl_bounds.rs:11:10
| --- in this trait
...
LL | type C where Self: Clone;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ this trait associated type doesn't have the requirement `Fooy<T>: Copy`
+ | ^^^^^^ this trait associated type doesn't have the requirement `Fooy<T>: Copy`
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider restricting type parameter `T`
|
--> $DIR/issue-47206-where-clause.rs:12:5
|
LL | type Assoc3<T>;
- | --------------- definition of `Assoc3` from trait
+ | -------------- definition of `Assoc3` from trait
...
LL | type Assoc3<T> = Vec<T> where T: Iterator;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: Iterator`
+ | ^^^^^^^^^^^^^^ impl has extra requirement `T: Iterator`
error: aborting due to previous error
--> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:21:1
|
LL | impl C for Box<dyn A + 'static> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: incompatible lifetime on type
--> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:37:18
--> $DIR/issue-90014.rs:14:20
|
LL | type Fut<'a> where Self: 'a;
- | ---------------------------- definition of `Fut` from trait
+ | ------------ definition of `Fut` from trait
...
LL | type Fut<'a> = impl Future<Output = ()>;
| ^^^^^^^^^^^^^^^^^^^^^^^^- help: try copying this clause from the trait: `where Self: 'a`
error[E0478]: lifetime bound not satisfied
--> $DIR/issue-91883.rs:32:24
|
-LL | / type Cursor<'tx>: Cursor<'tx>
-LL | | where
-LL | | 'db: 'tx,
-LL | | Self: 'tx;
- | |__________________- definition of `Cursor` from trait
+LL | type Cursor<'tx>: Cursor<'tx>
+ | ----------------------------- definition of `Cursor` from trait
...
-LL | type Cursor<'tx> = CursorImpl<'tx>;
- | ^^^^^^^^^^^^^^^- help: try copying these clauses from the trait: `where 'db: 'tx, Self: 'tx`
+LL | type Cursor<'tx> = CursorImpl<'tx>;
+ | ^^^^^^^^^^^^^^^- help: try copying these clauses from the trait: `where 'db: 'tx, Self: 'tx`
|
note: lifetime parameter instantiated with the lifetime `'db` as defined here
--> $DIR/issue-91883.rs:31:6
error[E0477]: the type `&'s Texture` does not fulfill the required lifetime
--> $DIR/issue-92033.rs:22:28
|
-LL | / type TextureIter<'a>: Iterator<Item = &'a Texture>
-LL | | where
-LL | | Self: 'a;
- | |_________________- definition of `TextureIter` from trait
+LL | type TextureIter<'a>: Iterator<Item = &'a Texture>
+ | -------------------------------------------------- definition of `TextureIter` from trait
...
-LL | type TextureIter<'a> = std::option::IntoIter<&'a Texture>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- help: try copying this clause from the trait: `where Self: 'a`
+LL | type TextureIter<'a> = std::option::IntoIter<&'a Texture>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- help: try copying this clause from the trait: `where Self: 'a`
|
note: type must outlive the lifetime `'a` as defined here
--> $DIR/issue-92033.rs:22:22
--> $DIR/method-unsatified-assoc-type-predicate.rs:30:7
|
LL | struct S;
- | ---------
+ | --------
| | |
| | method `f` not found for this struct
| doesn't satisfy `<S as X>::Y<i32> = i32`
--> $DIR/missing-where-clause-on-trait.rs:9:5
|
LL | type Assoc<'a, 'b>;
- | ------------------- expected
+ | ------------------ expected
...
LL | type Assoc<'a, 'b> = () where 'a: 'b;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found
+ | ^^^^^^^^^^^^^^^^^^ found
error: aborting due to previous error
| ^^^ function or associated item cannot be called on `SafeImpl<(), RawImpl<()>>` due to unsatisfied trait bounds
...
LL | pub struct RawImpl<T>(PhantomData<T>);
- | -------------------------------------- doesn't satisfy `RawImpl<()>: Raw<()>`
+ | --------------------- doesn't satisfy `RawImpl<()>: Raw<()>`
...
LL | pub struct SafeImpl<T: ?Sized, A: Raw<T>>(PhantomData<(A, T)>);
| -------- function or associated item `foo` not found for this struct
note: the following trait must be implemented
--> $DIR/issue-62742.rs:12:1
|
-LL | / pub trait Raw<T: ?Sized> {
-LL | | type Value;
-LL | | }
- | |_^
+LL | pub trait Raw<T: ?Sized> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `RawImpl<()>: Raw<()>` is not satisfied
--> $DIR/issue-62742.rs:6:5
--> $DIR/infinite-struct.rs:1:1
|
LL | struct Take(Take);
- | ^^^^^^^^^^^^----^^
- | | |
- | | recursive without indirection
+ | ^^^^^^^^^^^ ---- recursive without indirection
+ | |
| recursive type has infinite size
|
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Take` representable
--> $DIR/infinite-struct.rs:1:1
|
LL | struct Take(Take);
- | ^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
|
= note: ...which immediately requires computing drop-check constraints for `Take` again
= note: cycle used when computing dropck types for `Canonical { max_universe: U0, variables: [], value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing, constness: NotConst }, value: Take } }`
--> $DIR/infinite-trait-alias-recursion.rs:3:1
|
LL | trait T1 = T2;
- | ^^^^^^^^^^^^^^
+ | ^^^^^^^^
|
note: ...which requires computing the super traits of `T1`...
--> $DIR/infinite-trait-alias-recursion.rs:3:12
--> $DIR/infinite-trait-alias-recursion.rs:6:1
|
LL | trait T2 = T3;
- | ^^^^^^^^^^^^^^
+ | ^^^^^^^^
note: ...which requires computing the super traits of `T2`...
--> $DIR/infinite-trait-alias-recursion.rs:6:12
|
--> $DIR/infinite-trait-alias-recursion.rs:8:1
|
LL | trait T3 = T1 + T3;
- | ^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^
note: ...which requires computing the super traits of `T3`...
--> $DIR/infinite-trait-alias-recursion.rs:8:12
|
error[E0378]: the trait `DispatchFromDyn` may only be implemented for structs containing the field being coerced, ZST fields with 1 byte alignment, and nothing else
--> $DIR/invalid_dispatch_from_dyn_impls.rs:10:1
|
-LL | / impl<T, U> DispatchFromDyn<WrapperWithExtraField<U>> for WrapperWithExtraField<T>
-LL | | where
-LL | | T: DispatchFromDyn<U>,
-LL | | {}
- | |__^
+LL | impl<T, U> DispatchFromDyn<WrapperWithExtraField<U>> for WrapperWithExtraField<T>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: extra field `1` of type `i32` is not allowed
error[E0378]: implementing the `DispatchFromDyn` trait requires multiple coercions
--> $DIR/invalid_dispatch_from_dyn_impls.rs:21:1
|
-LL | / impl<T: ?Sized, U: ?Sized> DispatchFromDyn<MultiplePointers<U>> for MultiplePointers<T>
-LL | | where
-LL | | T: Unsize<U>,
-LL | | {}
- | |__^
+LL | impl<T: ?Sized, U: ?Sized> DispatchFromDyn<MultiplePointers<U>> for MultiplePointers<T>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the trait `DispatchFromDyn` may only be implemented for a coercion between structures with a single field being coerced
= note: currently, 2 fields need coercions: `ptr1` (`*const T` to `*const U`), `ptr2` (`*const T` to `*const U`)
--> $DIR/invalid_dispatch_from_dyn_impls.rs:31:1
|
LL | impl<T: ?Sized, U: ?Sized> DispatchFromDyn<NothingToCoerce<T>> for NothingToCoerce<U> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0378]: structs implementing `DispatchFromDyn` may not have `#[repr(packed)]` or `#[repr(C)]`
--> $DIR/invalid_dispatch_from_dyn_impls.rs:37:1
|
-LL | / impl<T: ?Sized, U: ?Sized> DispatchFromDyn<HasReprC<U>> for HasReprC<T>
-LL | | where
-LL | | T: Unsize<U>,
-LL | | {}
- | |__^
+LL | impl<T: ?Sized, U: ?Sized> DispatchFromDyn<HasReprC<U>> for HasReprC<T>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0378]: the trait `DispatchFromDyn` may only be implemented for structs containing the field being coerced, ZST fields with 1 byte alignment, and nothing else
--> $DIR/invalid_dispatch_from_dyn_impls.rs:46:1
|
-LL | / impl<T: ?Sized, U: ?Sized> DispatchFromDyn<OverAligned<U>> for OverAligned<T>
-LL | | where
-LL | | T: Unsize<U>,
-LL | | {}
- | |__^
+LL | impl<T: ?Sized, U: ?Sized> DispatchFromDyn<OverAligned<U>> for OverAligned<T>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: extra field `1` of type `OverAlignedZst` is not allowed
--> $DIR/issue-14091-2.rs:6:1
|
LL | pub struct BytePos(pub u32);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ must implement `Not`
+ | ^^^^^^^^^^^^^^^^^^ must implement `Not`
note: the following trait must be implemented
--> $SRC_DIR/core/src/ops/bit.rs:LL:COL
|
-LL | / pub trait Not {
-LL | | /// The resulting type after applying the `!` operator.
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-LL | | type Output;
-... |
-LL | | fn not(self) -> Self::Output;
-LL | | }
- | |_^
+LL | pub trait Not {
+ | ^^^^^^^^^^^^^
= note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
--> $DIR/issue-16250.rs:3:1
|
LL | pub struct Foo;
- | ^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/auxiliary/issue-16725.rs:2:5
|
LL | fn bar();
- | ^^^^^^^^^
+ | ^^^^^^^^
error: aborting due to previous error
--> $DIR/issue-17252.rs:1:1
|
LL | const FOO: usize = FOO;
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^
|
= note: ...which immediately requires const-evaluating + checking `FOO` again
note: cycle used when const-evaluating + checking `main::{constant#0}`
--> $DIR/auxiliary/issue-17718-const-privacy.rs:4:1
|
LL | const BAR: usize = 3;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
note: the implementor must specify the same requirement
--> $DIR/issue-17959.rs:7:1
|
-LL | / struct G<T: ?Sized> {
-LL | | _ptr: *const T
-LL | | }
- | |_^
+LL | struct G<T: ?Sized> {
+ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
LL | |
LL | | <Self as Public>::P,
LL | | <Self as Public>::R
-... |
-LL | | fn call_inner(&self);
-LL | | }
+LL | | > {
| |_^ can't leak private trait
error: aborting due to previous error
--> $DIR/issue-19482.rs:10:16
|
LL | type A;
- | ------- `A` defined here
+ | ------ `A` defined here
...
LL | fn bar(x: &dyn Foo) {}
| ^^^ help: specify the associated type: `Foo<A = Type>`
--> $DIR/issue-20714.rs:4:13
|
LL | struct G;
- | --------- `G` defined here
+ | -------- `G` defined here
...
LL | let g = G();
| ^--
error[E0391]: cycle detected when computing the super traits of `T` with associated type name `Item`
--> $DIR/issue-20772.rs:1:1
|
-LL | / trait T : Iterator<Item=Self::Item>
-LL | |
-LL | | {}
- | |__^
+LL | trait T : Iterator<Item=Self::Item>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: ...which immediately requires computing the super traits of `T` with associated type name `Item` again
note: cycle used when computing the super traits of `T`
--> $DIR/issue-20772.rs:1:1
|
-LL | / trait T : Iterator<Item=Self::Item>
-LL | |
-LL | | {}
- | |__^
+LL | trait T : Iterator<Item=Self::Item>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/issue-21701.rs:9:13
|
LL | struct Bar;
- | ----------- `Bar` defined here
+ | ---------- `Bar` defined here
...
LL | let f = Bar();
| ^^^--
error[E0393]: the type parameter `Rhs` must be explicitly specified
--> $DIR/issue-21950.rs:10:25
|
-LL | / trait Add<Rhs=Self> {
-LL | | type Output;
-LL | | }
- | |_- type parameter `Rhs` must be specified for this
+LL | trait Add<Rhs=Self> {
+ | ------------------- type parameter `Rhs` must be specified for this
...
-LL | let x = &10 as &dyn Add;
- | ^^^ help: set the type parameter to the desired type: `Add<Rhs>`
+LL | let x = &10 as &dyn Add;
+ | ^^^ help: set the type parameter to the desired type: `Add<Rhs>`
|
= note: because of the default `Self` reference, type parameters must be specified on object types
--> $DIR/issue-21950.rs:10:25
|
LL | type Output;
- | ------------ `Output` defined here
+ | ----------- `Output` defined here
...
LL | let x = &10 as &dyn Add;
| ^^^ help: specify the associated type: `Add<Output = Type>`
--> $DIR/issue-22370.rs:3:14
|
LL | trait A<T=Self> {}
- | ------------------ type parameter `T` must be specified for this
+ | --------------- type parameter `T` must be specified for this
LL |
LL | fn f(a: &dyn A) {}
| ^ help: set the type parameter to the desired type: `A<T>`
--> $DIR/issue-22434.rs:5:23
|
LL | type A;
- | ------- `A` defined here
+ | ------ `A` defined here
...
LL | type I<'a> = &'a (dyn Foo + 'a);
| ^^^ help: specify the associated type: `Foo<A = Type>`
--> $DIR/issue-23302-3.rs:1:1
|
LL | const A: i32 = B;
- | ^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
|
note: ...which requires const-evaluating + checking `B`...
--> $DIR/issue-23302-3.rs:3:1
|
LL | const B: i32 = A;
- | ^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
= note: ...which again requires const-evaluating + checking `A`, completing the cycle
note: cycle used when simplifying constant for the type system `A`
--> $DIR/issue-23302-3.rs:1:1
|
LL | const A: i32 = B;
- | ^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/issue-25901.rs:10:5
|
LL | type Target = B;
- | ^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
note: impl defined here, but it is not `const`
--> $DIR/issue-25901.rs:9:1
|
--> $DIR/issue-2718-a.rs:8:5
|
LL | pub struct Pong(SendPacket<Ping>);
- | ^^^^^^^^^^^^^^^^----------------^^
- | | |
- | | recursive without indirection
+ | ^^^^^^^^^^^^^^^ ---------------- recursive without indirection
+ | |
| recursive type has infinite size
|
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Pong` representable
--> $DIR/issue-33504.rs:7:13
|
LL | struct Test;
- | ------------ unit struct defined here
+ | ----------- unit struct defined here
...
LL | let Test = 1;
| ^^^^ - this expression has type `{integer}`
--> $DIR/issue-35241.rs:3:20
|
LL | struct Foo(u32);
- | ---------------- fn(u32) -> Foo {Foo} defined here
+ | ---------- fn(u32) -> Foo {Foo} defined here
LL |
LL | fn test() -> Foo { Foo }
| --- ^^^ expected struct `Foo`, found fn item
--> $SRC_DIR/std/src/lib.rs:LL:COL
|
LL | mod sys;
- | ^^^^^^^^
+ | ^^^^^^^
error: aborting due to 2 previous errors
--> $DIR/issue-43355.rs:13:1
|
LL | impl<X, T> Trait1<X> for T where T: Trait2<X> {
- | --------------------------------------------- first implementation here
+ | -------------------------- first implementation here
...
LL | impl<X> Trait1<Box<X>> for A {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `A`
--> $DIR/issue-46771.rs:3:23
|
LL | struct Foo;
- | ----------- `Foo` defined here
+ | ---------- `Foo` defined here
LL | (1 .. 2).find(|_| Foo(0) == 0);
| ^^^---
| |
--> $DIR/issue-4968.rs:5:16
|
LL | const A: (isize,isize) = (4,2);
- | ------------------------------- constant defined here
+ | ---------------------- constant defined here
LL | fn main() {
LL | match 42 { A => () }
| -- ^
--> $DIR/issue-69602-type-err-during-codegen-ice.rs:16:1
|
LL | type MyA: TraitA;
- | ----------------- `MyA` from trait
+ | ---------------- `MyA` from trait
...
LL | impl TraitB for B {
| ^^^^^^^^^^^^^^^^^ missing `MyA` in implementation
error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type
--> $DIR/issue-73112.rs:9:5
|
-LL | / struct SomeStruct {
-LL | |
-LL | | page_table: PageTable,
-LL | | }
- | |_____^
+LL | struct SomeStruct {
+ | ^^^^^^^^^^^^^^^^^
|
note: `PageTable` has a `#[repr(align)]` attribute
--> $DIR/auxiliary/issue-73112.rs:8:1
|
-LL | / pub struct PageTable {
-LL | | entries: [PageTableEntry; 512],
-LL | | }
- | |_^
+LL | pub struct PageTable {
+ | ^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/issue-76191.rs:13:9
|
LL | const RANGE: RangeInclusive<i32> = 0..=255;
- | ------------------------------------------- constant defined here
+ | -------------------------------- constant defined here
...
LL | match n {
| - this expression has type `i32`
--> $DIR/issue-76191.rs:15:9
|
LL | const RANGE2: RangeInclusive<i32> = panic!();
- | --------------------------------------------- constant defined here
+ | --------------------------------- constant defined here
...
LL | match n {
| - this expression has type `i32`
--> $DIR/issue-77919.rs:12:1
|
LL | const VAL: T;
- | ------------- `VAL` from trait
+ | ------------ `VAL` from trait
...
LL | impl<N, M> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `VAL` in implementation
--> $DIR/keyword-self-as-type-param.rs:3:1
|
LL | struct Foo<Self>(Self);
- | ^^^^^^^^^^^^^^^^^----^^
- | | |
- | | recursive without indirection
+ | ^^^^^^^^^^^^^^^^ ---- recursive without indirection
+ | |
| recursive type has infinite size
|
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
--> $DIR/debug.rs:6:1
|
LL | enum E { Foo, Bar(!, i32, i32) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^
error: layout_of(S) = Layout {
fields: Arbitrary {
--> $DIR/debug.rs:9:1
|
LL | struct S { f1: i32, f2: (), f3: i32 }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^
error: layout_of(U) = Layout {
fields: Union(
--> $DIR/debug.rs:12:1
|
LL | union U { f1: (i32, i32), f3: i32 }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^
error: layout_of(std::result::Result<i32, i32>) = Layout {
fields: Arbitrary {
--> $DIR/debug.rs:15:1
|
LL | type Test = Result<i32, i32>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^
error: layout_of(i32) = Layout {
fields: Primitive,
--> $DIR/debug.rs:18:1
|
LL | type T = impl std::fmt::Debug;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^
error: aborting due to 5 previous errors
--> $DIR/hexagon-enum.rs:16:1
|
LL | enum A { Apple }
- | ^^^^^^^^^^^^^^^^
+ | ^^^^^^
error: layout_of(B) = Layout {
fields: Arbitrary {
--> $DIR/hexagon-enum.rs:20:1
|
LL | enum B { Banana = 255, }
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^
error: layout_of(C) = Layout {
fields: Arbitrary {
--> $DIR/hexagon-enum.rs:24:1
|
LL | enum C { Chaenomeles = 256, }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^
error: layout_of(P) = Layout {
fields: Arbitrary {
--> $DIR/hexagon-enum.rs:28:1
|
LL | enum P { Peach = 0x1000_0000isize, }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^
error: layout_of(T) = Layout {
fields: Arbitrary {
--> $DIR/hexagon-enum.rs:34:1
|
LL | enum T { Tangerine = TANGERINE as isize }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^
error: aborting due to 5 previous errors
--> $DIR/homogeneous-aggr-zero-sized-c-struct.rs:22:1
|
LL | pub type TestMiddle = Middle;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^
error: homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) }))
--> $DIR/homogeneous-aggr-zero-sized-c-struct.rs:33:1
|
LL | pub type TestFinal = Final;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
--> $DIR/homogeneous-aggr-zero-sized-repr-rust.rs:53:1
|
LL | pub type Test1 = BaseCase;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^
error: homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) }))
--> $DIR/homogeneous-aggr-zero-sized-repr-rust.rs:57:1
|
LL | pub type Test2 = WithPhantomData;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^
error: homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) }))
--> $DIR/homogeneous-aggr-zero-sized-repr-rust.rs:61:1
|
LL | pub type Test3 = WithEmptyRustStruct;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^
error: homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) }))
--> $DIR/homogeneous-aggr-zero-sized-repr-rust.rs:65:1
|
LL | pub type Test4 = WithTransitivelyEmptyRustStruct;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^
error: homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) }))
--> $DIR/homogeneous-aggr-zero-sized-repr-rust.rs:69:1
|
LL | pub type Test5 = WithEmptyRustEnum;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^
error: aborting due to 5 previous errors
}
--> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:16:1
|
-LL | / pub enum MissingPayloadField {
-LL | | Some(u8),
-LL | | None
-LL | | }
- | |_^
+LL | pub enum MissingPayloadField {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: layout_of(CommonPayloadField) = Layout {
fields: Arbitrary {
}
--> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:25:1
|
-LL | / pub enum CommonPayloadField {
-LL | | A(u8),
-LL | | B(u8),
-LL | | }
- | |_^
+LL | pub enum CommonPayloadField {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: layout_of(CommonPayloadFieldIsMaybeUninit) = Layout {
fields: Arbitrary {
}
--> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:33:1
|
-LL | / pub enum CommonPayloadFieldIsMaybeUninit {
-LL | | A(u8),
-LL | | B(MaybeUninit<u8>),
-LL | | }
- | |_^
+LL | pub enum CommonPayloadFieldIsMaybeUninit {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: layout_of(NicheFirst) = Layout {
fields: Arbitrary {
}
--> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:41:1
|
-LL | / pub enum NicheFirst {
-LL | | A(HasNiche, u8),
-LL | | B,
-LL | | C
-LL | | }
- | |_^
+LL | pub enum NicheFirst {
+ | ^^^^^^^^^^^^^^^^^^^
error: layout_of(NicheSecond) = Layout {
fields: Arbitrary {
}
--> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:50:1
|
-LL | / pub enum NicheSecond {
-LL | | A(u8, HasNiche),
-LL | | B,
-LL | | C,
-LL | | }
- | |_^
+LL | pub enum NicheSecond {
+ | ^^^^^^^^^^^^^^^^^^^^
error: aborting due to 5 previous errors
--> $DIR/thumb-enum.rs:16:1
|
LL | enum A { Apple }
- | ^^^^^^^^^^^^^^^^
+ | ^^^^^^
error: layout_of(B) = Layout {
fields: Arbitrary {
--> $DIR/thumb-enum.rs:20:1
|
LL | enum B { Banana = 255, }
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^
error: layout_of(C) = Layout {
fields: Arbitrary {
--> $DIR/thumb-enum.rs:24:1
|
LL | enum C { Chaenomeles = 256, }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^
error: layout_of(P) = Layout {
fields: Arbitrary {
--> $DIR/thumb-enum.rs:28:1
|
LL | enum P { Peach = 0x1000_0000isize, }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^
error: layout_of(T) = Layout {
fields: Arbitrary {
--> $DIR/thumb-enum.rs:34:1
|
LL | enum T { Tangerine = TANGERINE as isize }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^
error: aborting due to 5 previous errors
--> $DIR/zero-sized-array-union.rs:59:1
|
LL | type TestBaz1 = Baz1;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^
error: homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) }))
--> $DIR/zero-sized-array-union.rs:70:1
|
LL | type TestBaz2 = Baz2;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^
error: homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) }))
--> $DIR/zero-sized-array-union.rs:81:1
|
LL | type TestBaz3 = Baz3;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^
error: homogeneous_aggregate: Ok(Homogeneous(Reg { kind: Float, size: Size(4 bytes) }))
--> $DIR/zero-sized-array-union.rs:92:1
|
LL | type TestBaz4 = Baz4;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^
error: aborting due to 4 previous errors
--> $DIR/issue-56762.rs:19:1
|
LL | static MY_TOO_BIG_ARRAY_1: TooBigArray = TooBigArray::new();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0080]: values of the type `[u8; 2305843009213693951]` are too big for the current architecture
--> $DIR/issue-56762.rs:21:1
|
LL | static MY_TOO_BIG_ARRAY_2: [u8; HUGE_SIZE] = [0x00; HUGE_SIZE];
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
--> $DIR/auxiliary/def_colliding_external.rs:6:5
|
LL | pub static collision: *const i32;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/linkage-detect-local-generated-name-collision.rs:10:9
|
LL | pub static collision: *const i32;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/auxiliary/def_illtyped_external.rs:5:1
|
LL | pub static EXTERN: u32 = 0;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/linkage2.rs:12:5
|
LL | static foo: i32;
- | ^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/linkage3.rs:11:5
|
LL | static foo: *const i32;
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/allowed-cli-deny-by-default-lint.rs:6:16
|
LL | const C: i32 = 1 / 0;
- | ---------------^^^^^-
- | |
- | attempt to divide `1_i32` by zero
+ | ------------ ^^^^^ attempt to divide `1_i32` by zero
|
= note: requested on the command line with `--force-warn const-err`
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/allowed-cli-deny-by-default-lint.rs:6:16
|
LL | const C: i32 = 1 / 0;
- | ---------------^^^^^-
- | |
- | attempt to divide `1_i32` by zero
+ | ------------ ^^^^^ attempt to divide `1_i32` by zero
|
= note: requested on the command line with `--force-warn const-err`
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/allowed-deny-by-default-lint.rs:7:16
|
LL | const C: i32 = 1 / 0;
- | ---------------^^^^^-
- | |
- | attempt to divide `1_i32` by zero
+ | ------------ ^^^^^ attempt to divide `1_i32` by zero
|
= note: requested on the command line with `--force-warn const-err`
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/allowed-deny-by-default-lint.rs:7:16
|
LL | const C: i32 = 1 / 0;
- | ---------------^^^^^-
- | |
- | attempt to divide `1_i32` by zero
+ | ------------ ^^^^^ attempt to divide `1_i32` by zero
|
= note: requested on the command line with `--force-warn const-err`
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/deny-by-default-lint.rs:5:16
|
LL | const C: i32 = 1 / 0;
- | ---------------^^^^^-
- | |
- | attempt to divide `1_i32` by zero
+ | ------------ ^^^^^ attempt to divide `1_i32` by zero
|
= note: requested on the command line with `--force-warn const-err`
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/deny-by-default-lint.rs:5:16
|
LL | const C: i32 = 1 / 0;
- | ---------------^^^^^-
- | |
- | attempt to divide `1_i32` by zero
+ | ------------ ^^^^^ attempt to divide `1_i32` by zero
|
= note: requested on the command line with `--force-warn const-err`
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
note: the type is defined here
--> $DIR/issue-14309.rs:4:1
|
-LL | / struct A {
-LL | | x: i32
-LL | | }
- | |_^
+LL | struct A {
+ | ^^^^^^^^
error: `extern` block uses type `A`, which is not FFI-safe
--> $DIR/issue-14309.rs:31:15
note: the type is defined here
--> $DIR/issue-14309.rs:4:1
|
-LL | / struct A {
-LL | | x: i32
-LL | | }
- | |_^
+LL | struct A {
+ | ^^^^^^^^
error: `extern` block uses type `A`, which is not FFI-safe
--> $DIR/issue-14309.rs:33:15
note: the type is defined here
--> $DIR/issue-14309.rs:4:1
|
-LL | / struct A {
-LL | | x: i32
-LL | | }
- | |_^
+LL | struct A {
+ | ^^^^^^^^
error: `extern` block uses type `A`, which is not FFI-safe
--> $DIR/issue-14309.rs:34:16
note: the type is defined here
--> $DIR/issue-14309.rs:4:1
|
-LL | / struct A {
-LL | | x: i32
-LL | | }
- | |_^
+LL | struct A {
+ | ^^^^^^^^
error: `extern` block uses type `A`, which is not FFI-safe
--> $DIR/issue-14309.rs:36:16
note: the type is defined here
--> $DIR/issue-14309.rs:4:1
|
-LL | / struct A {
-LL | | x: i32
-LL | | }
- | |_^
+LL | struct A {
+ | ^^^^^^^^
error: aborting due to 5 previous errors
--> $DIR/lint-const-item-mutation.rs:26:1
|
LL | const ARRAY: [u8; 1] = [25];
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^
warning: attempting to modify a `const` item
--> $DIR/lint-const-item-mutation.rs:38:5
--> $DIR/lint-const-item-mutation.rs:27:1
|
LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'], raw_ptr: 2 as *mut u8 };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: attempting to modify a `const` item
--> $DIR/lint-const-item-mutation.rs:39:5
--> $DIR/lint-const-item-mutation.rs:27:1
|
LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'], raw_ptr: 2 as *mut u8 };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: taking a mutable reference to a `const` item
--> $DIR/lint-const-item-mutation.rs:40:5
--> $DIR/lint-const-item-mutation.rs:27:1
|
LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'], raw_ptr: 2 as *mut u8 };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: taking a mutable reference to a `const` item
--> $DIR/lint-const-item-mutation.rs:41:5
--> $DIR/lint-const-item-mutation.rs:27:1
|
LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'], raw_ptr: 2 as *mut u8 };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: taking a mutable reference to a `const` item
--> $DIR/lint-const-item-mutation.rs:42:5
--> $DIR/lint-const-item-mutation.rs:27:1
|
LL | const MY_STRUCT: MyStruct = MyStruct { field: true, inner_array: ['a'], raw_ptr: 2 as *mut u8 };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: attempting to modify a `const` item
--> $DIR/lint-const-item-mutation.rs:54:5
--> $DIR/lint-const-item-mutation.rs:30:1
|
LL | const MUTABLE2: Mutable2 = Mutable2 { msg: "", other: String::new() };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
warning: taking a mutable reference to a `const` item
--> $DIR/lint-const-item-mutation.rs:55:5
--> $DIR/lint-const-item-mutation.rs:31:1
|
LL | const VEC: Vec<i32> = Vec::new();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^
warning: 8 warnings emitted
note: the type is defined here
--> $DIR/lint-ctypes-enum.rs:9:1
|
-LL | / enum U {
-LL | | A,
-LL | | }
- | |_^
+LL | enum U {
+ | ^^^^^^
error: `extern` block uses type `B`, which is not FFI-safe
--> $DIR/lint-ctypes-enum.rs:61:13
note: the type is defined here
--> $DIR/lint-ctypes-enum.rs:12:1
|
-LL | / enum B {
-LL | | C,
-LL | | D,
-LL | | }
- | |_^
+LL | enum B {
+ | ^^^^^^
error: `extern` block uses type `T`, which is not FFI-safe
--> $DIR/lint-ctypes-enum.rs:62:13
note: the type is defined here
--> $DIR/lint-ctypes-enum.rs:16:1
|
-LL | / enum T {
-LL | | E,
-LL | | F,
-LL | | G,
-LL | | }
- | |_^
+LL | enum T {
+ | ^^^^^^
error: `extern` block uses type `u128`, which is not FFI-safe
--> $DIR/lint-ctypes-enum.rs:74:23
--> $DIR/lint-ctypes-fn.rs:28:1
|
LL | pub struct ZeroSize;
- | ^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^
error: `extern` fn uses type `ZeroSizeWithPhantomData`, which is not FFI-safe
--> $DIR/lint-ctypes-fn.rs:110:40
--> $DIR/lint-ctypes-fn.rs:63:1
|
LL | pub struct ZeroSizeWithPhantomData(PhantomData<i32>);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `extern` fn uses type `PhantomData<bool>`, which is not FFI-safe
--> $DIR/lint-ctypes-fn.rs:113:51
--> $DIR/lint-ctypes.rs:26:1
|
LL | pub struct Foo;
- | ^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^
error: `extern` block uses type `Foo`, which is not FFI-safe
--> $DIR/lint-ctypes.rs:49:28
--> $DIR/lint-ctypes.rs:26:1
|
LL | pub struct Foo;
- | ^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^
error: `extern` block uses type `((),)`, which is not FFI-safe
--> $DIR/lint-ctypes.rs:51:25
--> $DIR/lint-ctypes.rs:22:1
|
LL | pub struct ZeroSize;
- | ^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^
error: `extern` block uses type `ZeroSizeWithPhantomData`, which is not FFI-safe
--> $DIR/lint-ctypes.rs:64:33
--> $DIR/lint-ctypes.rs:45:1
|
LL | pub struct ZeroSizeWithPhantomData(::std::marker::PhantomData<i32>);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `extern` block uses type `PhantomData<bool>`, which is not FFI-safe
--> $DIR/lint-ctypes.rs:67:12
note: enums have to be initialized to a variant
--> $DIR/uninitialized-zeroed.rs:26:1
|
-LL | / enum Fruit {
-LL | | Apple,
-LL | | Banana,
-LL | | }
- | |_^
+LL | enum Fruit {
+ | ^^^^^^^^^^
error: the type `[bool; 2]` does not permit being left uninitialized
--> $DIR/uninitialized-zeroed.rs:101:31
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error`
--> $DIR/main.rs:10:20
|
-LL | / macro_rules! pong {
-LL | | () => { syntax error };
- | | ^^^^^ expected one of 8 possible tokens
-LL | | }
- | |__- in this expansion of `pong!` (#2)
+LL | / macro_rules! pong {
+LL | | () => { syntax error };
+ | | ^^^^^ expected one of 8 possible tokens
+LL | | }
+ | |_- in this expansion of `pong!` (#2)
...
-LL | ping!();
- | ------- in this macro invocation (#1)
+LL | ping!();
+ | ------- in this macro invocation (#1)
|
::: $DIR/auxiliary/ping.rs:5:1
|
-LL | / macro_rules! ping {
-LL | | () => {
-LL | | pong!();
- | | ------- in this macro invocation (#2)
-LL | | }
-LL | | }
- | |_- in this expansion of `ping!` (#1)
+LL | macro_rules! ping {
+ | ----------------- in this expansion of `ping!` (#1)
+LL | () => {
+LL | pong!();
+ | ------- in this macro invocation (#2)
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error`
--> $DIR/main.rs:10:20
|
-LL | / macro_rules! pong {
-LL | | () => { syntax error };
- | | ^^^^^ expected one of 8 possible tokens
-LL | | }
- | |__- in this expansion of `pong!` (#5)
+LL | / macro_rules! pong {
+LL | | () => { syntax error };
+ | | ^^^^^ expected one of 8 possible tokens
+LL | | }
+ | |_- in this expansion of `pong!` (#5)
...
-LL | deep!();
- | ------- in this macro invocation (#1)
+LL | deep!();
+ | ------- in this macro invocation (#1)
|
::: $DIR/auxiliary/ping.rs:5:1
|
-LL | / macro_rules! ping {
-LL | | () => {
-LL | | pong!();
- | | ------- in this macro invocation (#5)
-LL | | }
-LL | | }
- | |_- in this expansion of `ping!` (#4)
+LL | macro_rules! ping {
+ | ----------------- in this expansion of `ping!` (#4)
+LL | () => {
+LL | pong!();
+ | ------- in this macro invocation (#5)
...
-LL | / macro_rules! deep {
-LL | | () => {
-LL | | foo!();
- | | ------ in this macro invocation (#2)
-LL | | }
-LL | | }
- | |__- in this expansion of `deep!` (#1)
+LL | macro_rules! deep {
+ | ----------------- in this expansion of `deep!` (#1)
+LL | () => {
+LL | foo!();
+ | ------ in this macro invocation (#2)
...
-LL | / macro_rules! foo {
-LL | | () => {
-LL | | bar!();
- | | ------ in this macro invocation (#3)
-LL | | }
-LL | | }
- | |__- in this expansion of `foo!` (#2)
+LL | macro_rules! foo {
+ | ---------------- in this expansion of `foo!` (#2)
+LL | () => {
+LL | bar!();
+ | ------ in this macro invocation (#3)
...
-LL | / macro_rules! bar {
-LL | | () => {
-LL | | ping!();
- | | ------- in this macro invocation (#4)
-LL | | }
-LL | | }
- | |__- in this expansion of `bar!` (#3)
+LL | macro_rules! bar {
+ | ---------------- in this expansion of `bar!` (#3)
+LL | () => {
+LL | ping!();
+ | ------- in this macro invocation (#4)
error: aborting due to 3 previous errors
error[E0773]: attempted to define built-in macro more than once
--> $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
-LL | / macro_rules! line {
-LL | | () => {
-LL | | /* compiler built-in */
-LL | | };
-LL | | }
- | |_____^
+LL | macro_rules! line {
+ | ^^^^^^^^^^^^^^^^^
|
note: previously defined here
--> $DIR/unknown-builtin.rs:9:1
--> $DIR/marker-trait-with-associated-items.rs:6:5
|
LL | const N: usize;
- | ^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^
error[E0714]: marker traits cannot have associated items
--> $DIR/marker-trait-with-associated-items.rs:12:5
|
LL | type Output;
- | ^^^^^^^^^^^^
+ | ^^^^^^^^^^^
error[E0714]: marker traits cannot have associated items
--> $DIR/marker-trait-with-associated-items.rs:18:5
--> $DIR/marker-trait-with-associated-items.rs:24:5
|
LL | const N: usize = 43;
- | ^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^
error[E0714]: marker traits cannot have associated items
--> $DIR/marker-trait-with-associated-items.rs:30:5
|
LL | type Output = ();
- | ^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
error[E0714]: marker traits cannot have associated items
--> $DIR/marker-trait-with-associated-items.rs:36:5
--> $DIR/auxiliary/match_non_exhaustive_lib.rs:2:1
|
LL | pub enum E1 {}
- | ^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
= note: the matched value is of type `E1`, which is marked as non-exhaustive
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
--> $DIR/auxiliary/match_non_exhaustive_lib.rs:5:1
|
LL | pub enum E2 { A, B }
- | ^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
= note: the matched value is of type `E2`, which is marked as non-exhaustive
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
--> $DIR/method-call-err-msg.rs:19:7
|
LL | pub struct Foo;
- | ---------------
+ | --------------
| | |
| | method `take` not found for this struct
| doesn't satisfy `Foo: Iterator`
note: the following trait must be implemented
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
-LL | / pub trait Iterator {
-LL | | /// The type of the elements being iterated over.
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-LL | | type Item;
-... |
-LL | | }
-LL | | }
- | |_^
+LL | pub trait Iterator {
+ | ^^^^^^^^^^^^^^^^^^
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `take`, perhaps you need to implement it:
candidate #1: `Iterator`
--> $DIR/assignment-operator-unimplemented.rs:1:1
|
LL | struct Foo;
- | ^^^^^^^^^^^ must implement `AddAssign<_>`
+ | ^^^^^^^^^^ must implement `AddAssign<_>`
note: the following trait must be implemented
--> $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
-LL | / pub trait AddAssign<Rhs = Self> {
-LL | | /// Performs the `+=` operation.
-LL | | ///
-LL | | /// # Example
-... |
-LL | | fn add_assign(&mut self, rhs: Rhs);
-LL | | }
- | |_^
+LL | pub trait AddAssign<Rhs = Self> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
| required by a bound introduced by this call
...
LL | struct Foo(u8);
- | --------------- takes 1 argument
+ | ---------- takes 1 argument
|
note: required by a bound in `call`
--> $DIR/closure-arg-count.rs:42:30
::: $DIR/auxiliary/issue-69725.rs:2:1
|
LL | pub struct Struct<A>(A);
- | ------------------------ doesn't satisfy `Struct<A>: Clone`
+ | -------------------- doesn't satisfy `Struct<A>: Clone`
|
= note: the following trait bounds were not satisfied:
`A: Clone`
--> $DIR/missing-trait-bounds-for-method-call.rs:27:14
|
LL | struct Fin<T> where T: Bar {
- | -------------------------- doesn't satisfy `Fin<T>: Bar`
+ | ------------- doesn't satisfy `Fin<T>: Bar`
...
LL | self.foo();
| ^^^ method cannot be called on `&Fin<T>` due to unsatisfied trait bounds
--> $DIR/move-deref-coercion.rs:17:5
|
LL | type Target = NotCopy;
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
error[E0382]: borrow of partially moved value: `val`
--> $DIR/move-deref-coercion.rs:30:5
--> $DIR/move-deref-coercion.rs:17:5
|
LL | type Target = NotCopy;
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
error: aborting due to 2 previous errors
::: $DIR/auxiliary/namespace-mix.rs:3:5
|
LL | pub struct TS();
- | ---------------- similarly named tuple struct `TS` defined here
+ | ------------- similarly named tuple struct `TS` defined here
|
= note: can't use a type alias as a constructor
help: a tuple struct with a similar name exists
| ---------------------- first implementation here
LL | // This will conflict with the first impl if we impl `for<T> T: From<!>`.
LL | impl<T> MyTrait for T where T: From<!> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyFoo`
+ | ^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyFoo`
|
= note: permitting this impl would forbid us from adding `impl<T> From<!> for T` later; see rust-lang/rust#64715 for details
--> $SRC_DIR/alloc/src/sync.rs:LL:COL
|
LL | type Target = T;
- | ^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
error: aborting due to previous error
--> $SRC_DIR/alloc/src/sync.rs:LL:COL
|
LL | type Target = T;
- | ^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
error: aborting due to previous error
note: the following trait must be implemented
--> $SRC_DIR/core/src/ops/bit.rs:LL:COL
|
-LL | / pub trait BitOr<Rhs = Self> {
-LL | | /// The resulting type after applying the `|` operator.
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-LL | | type Output;
-... |
-LL | | fn bitor(self, rhs: Rhs) -> Self::Output;
-LL | | }
- | |_^
+LL | pub trait BitOr<Rhs = Self> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 5 previous errors
LL | const async unsafe extern "C" fn ft5() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `(): Future`
-error[E0391]: cycle detected when computing type of `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 40:6>::ft5::{opaque#0}`
+error[E0391]: cycle detected when computing type of `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5::{opaque#0}`
--> $DIR/fn-header-semantic-fail.rs:34:48
|
LL | const async unsafe extern "C" fn ft5() {}
| ^
|
-note: ...which requires borrow-checking `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 40:6>::ft5`...
+note: ...which requires borrow-checking `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5`...
--> $DIR/fn-header-semantic-fail.rs:34:9
|
LL | const async unsafe extern "C" fn ft5() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires processing `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 40:6>::ft5`...
+note: ...which requires processing `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5`...
--> $DIR/fn-header-semantic-fail.rs:34:9
|
LL | const async unsafe extern "C" fn ft5() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires const checking `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 40:6>::ft5`...
+note: ...which requires const checking `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5`...
--> $DIR/fn-header-semantic-fail.rs:34:9
|
LL | const async unsafe extern "C" fn ft5() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: ...which requires computing whether `impl core::future::future::Future<Output = ()>` is freeze...
= note: ...which requires evaluating trait selection obligation `impl core::future::future::Future<Output = ()>: core::marker::Freeze`...
- = note: ...which again requires computing type of `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 40:6>::ft5::{opaque#0}`, completing the cycle
+ = note: ...which again requires computing type of `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5::{opaque#0}`, completing the cycle
note: cycle used when checking item types in top-level module
--> $DIR/fn-header-semantic-fail.rs:5:1
|
LL | | }
| |_^
-error[E0391]: cycle detected when computing type of `main::<impl at $DIR/fn-header-semantic-fail.rs:42:5: 50:6>::fi5::{opaque#0}`
+error[E0391]: cycle detected when computing type of `main::<impl at $DIR/fn-header-semantic-fail.rs:42:5: 42:11>::fi5::{opaque#0}`
--> $DIR/fn-header-semantic-fail.rs:47:48
|
LL | const async unsafe extern "C" fn fi5() {}
| ^
|
-note: ...which requires borrow-checking `main::<impl at $DIR/fn-header-semantic-fail.rs:42:5: 50:6>::fi5`...
+note: ...which requires borrow-checking `main::<impl at $DIR/fn-header-semantic-fail.rs:42:5: 42:11>::fi5`...
--> $DIR/fn-header-semantic-fail.rs:47:9
|
LL | const async unsafe extern "C" fn fi5() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires processing `main::<impl at $DIR/fn-header-semantic-fail.rs:42:5: 50:6>::fi5`...
+note: ...which requires processing `main::<impl at $DIR/fn-header-semantic-fail.rs:42:5: 42:11>::fi5`...
--> $DIR/fn-header-semantic-fail.rs:47:9
|
LL | const async unsafe extern "C" fn fi5() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires const checking `main::<impl at $DIR/fn-header-semantic-fail.rs:42:5: 50:6>::fi5`...
+note: ...which requires const checking `main::<impl at $DIR/fn-header-semantic-fail.rs:42:5: 42:11>::fi5`...
--> $DIR/fn-header-semantic-fail.rs:47:9
|
LL | const async unsafe extern "C" fn fi5() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: ...which requires computing whether `impl core::future::future::Future<Output = ()>` is freeze...
= note: ...which requires evaluating trait selection obligation `impl core::future::future::Future<Output = ()>: core::marker::Freeze`...
- = note: ...which again requires computing type of `main::<impl at $DIR/fn-header-semantic-fail.rs:42:5: 50:6>::fi5::{opaque#0}`, completing the cycle
+ = note: ...which again requires computing type of `main::<impl at $DIR/fn-header-semantic-fail.rs:42:5: 42:11>::fi5::{opaque#0}`, completing the cycle
note: cycle used when checking item types in top-level module
--> $DIR/fn-header-semantic-fail.rs:5:1
|
::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:1:1
|
LL | pub struct Z0;
- | -------------- `Z0` defined here
+ | ------------- `Z0` defined here
LL | pub struct Z1();
- | ---------------- similarly named tuple struct `Z1` defined here
+ | ------------- similarly named tuple struct `Z1` defined here
|
help: use this syntax instead
|
::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:1:1
|
LL | pub struct Z0;
- | -------------- `Z0` defined here
+ | ------------- `Z0` defined here
LL | pub struct Z1();
- | ---------------- similarly named tuple struct `Z1` defined here
+ | ------------- similarly named tuple struct `Z1` defined here
|
help: use this syntax instead
|
::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:2:1
|
LL | pub struct Z1();
- | ---------------- tuple struct has 0 fields
+ | ------------- tuple struct has 0 fields
error[E0023]: this pattern has 0 fields, but the corresponding tuple struct has 3 fields
--> $DIR/pat-tuple-field-count-cross.rs:18:9
--> $DIR/pat-tuple-overfield.rs:59:12
|
LL | struct Z1();
- | ------------ tuple struct has 0 fields
+ | --------- tuple struct has 0 fields
...
LL | Z1(_) => {}
| ^ expected 0 fields, found 1
--> $DIR/pat-tuple-overfield.rs:60:12
|
LL | struct Z1();
- | ------------ tuple struct has 0 fields
+ | --------- tuple struct has 0 fields
...
LL | Z1(_, _) => {}
| ^ ^ expected 0 fields, found 2
note: `HiddenEnum` defined here
--> $DIR/auxiliary/hidden.rs:1:1
|
-LL | / pub enum HiddenEnum {
-LL | | A,
-LL | | B,
-LL | | #[doc(hidden)]
-LL | | C,
-LL | | }
- | |_^
+LL | pub enum HiddenEnum {
+ | ^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `HiddenEnum`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
note: `HiddenEnum` defined here
--> $DIR/auxiliary/hidden.rs:3:5
|
-LL | / pub enum HiddenEnum {
-LL | | A,
-LL | | B,
- | | ^ not covered
-LL | | #[doc(hidden)]
-LL | | C,
-LL | | }
- | |_-
+LL | pub enum HiddenEnum {
+ | -------------------
+LL | A,
+LL | B,
+ | ^ not covered
= note: the matched value is of type `HiddenEnum`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
note: `HiddenEnum` defined here
--> $DIR/auxiliary/hidden.rs:3:5
|
-LL | / pub enum HiddenEnum {
-LL | | A,
-LL | | B,
- | | ^ not covered
-LL | | #[doc(hidden)]
-LL | | C,
-LL | | }
- | |_-
+LL | pub enum HiddenEnum {
+ | -------------------
+LL | A,
+LL | B,
+ | ^ not covered
= note: the matched value is of type `HiddenEnum`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
note: `Option<HiddenEnum>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
|
-LL | / pub enum Option<T> {
-LL | | /// No value.
-LL | | #[lang = "None"]
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-... |
-LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
- | | ^^^^ not covered
-LL | | }
- | |_-
+LL | pub enum Option<T> {
+ | ------------------
+...
+LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
+ | ^^^^ not covered
= note: the matched value is of type `Option<HiddenEnum>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
note: `Option<Enum>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
|
-LL | / pub enum Option<T> {
-LL | | /// No value.
-LL | | #[lang = "None"]
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-... |
-LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
-LL | | }
- | |_^
+LL | pub enum Option<T> {
+ | ^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `Option<Enum>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
|
LL | | T: ?Sized,
LL | | #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global,
LL | | >(Unique<T>, A);
- | |________________^
+ | |_^
= note: the matched value is of type `Box<ElementKind>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
note: `Option<Option<Direction>>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
|
-LL | / pub enum Option<T> {
-LL | | /// No value.
-LL | | #[lang = "None"]
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-... |
-LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
- | | ^^^^
- | | |
- | | not covered
- | | not covered
-LL | | }
- | |_-
+LL | pub enum Option<T> {
+ | ------------------
+...
+LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
+ | ^^^^
+ | |
+ | not covered
+ | not covered
= note: the matched value is of type `Option<Option<Direction>>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
note: `Option<Private>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
|
-LL | / pub enum Option<T> {
-LL | | /// No value.
-LL | | #[lang = "None"]
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-... |
-LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
- | | ^^^^ not covered
-LL | | }
- | |_-
+LL | pub enum Option<T> {
+ | ------------------
+...
+LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
+ | ^^^^ not covered
= note: the matched value is of type `Option<Private>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
note: `Option<i32>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
|
-LL | / pub enum Option<T> {
-LL | | /// No value.
-LL | | #[lang = "None"]
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-... |
-LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
- | | ^^^^ not covered
-LL | | }
- | |_-
+LL | pub enum Option<T> {
+ | ------------------
+...
+LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
+ | ^^^^ not covered
= note: the matched value is of type `Option<i32>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
note: `UnstableEnum` defined here
--> $DIR/auxiliary/unstable.rs:9:5
|
-LL | / pub enum UnstableEnum {
-LL | | #[stable(feature = "stable_test_feature", since = "1.0.0")]
-LL | | Stable,
-LL | | #[stable(feature = "stable_test_feature", since = "1.0.0")]
-LL | | Stable2,
- | | ^^^^^^^ not covered
-LL | | #[unstable(feature = "unstable_test_feature", issue = "none")]
-LL | | Unstable,
-LL | | }
- | |_-
+LL | pub enum UnstableEnum {
+ | ---------------------
+...
+LL | Stable2,
+ | ^^^^^^^ not covered
= note: the matched value is of type `UnstableEnum`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
note: `UnstableEnum` defined here
--> $DIR/auxiliary/unstable.rs:5:1
|
-LL | / pub enum UnstableEnum {
-LL | | #[stable(feature = "stable_test_feature", since = "1.0.0")]
-LL | | Stable,
-LL | | #[stable(feature = "stable_test_feature", since = "1.0.0")]
-... |
-LL | | Unstable,
-LL | | }
- | |_^
+LL | pub enum UnstableEnum {
+ | ^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `UnstableEnum`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
note: `UnstableEnum` defined here
--> $DIR/auxiliary/unstable.rs:11:5
|
-LL | / pub enum UnstableEnum {
-LL | | #[stable(feature = "stable_test_feature", since = "1.0.0")]
-LL | | Stable,
-LL | | #[stable(feature = "stable_test_feature", since = "1.0.0")]
-... |
-LL | | Unstable,
- | | ^^^^^^^^ not covered
-LL | | }
- | |_-
+LL | pub enum UnstableEnum {
+ | ---------------------
+...
+LL | Unstable,
+ | ^^^^^^^^ not covered
= note: the matched value is of type `UnstableEnum`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
--> $DIR/issue-30079.rs:18:9
|
LL | struct Priv;
- | ------------ `m2::Priv` declared as private
+ | ----------- `m2::Priv` declared as private
LL | impl ::std::ops::Deref for ::SemiPriv {
LL | type Target = Priv;
- | ^^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^ can't leak private type
error[E0446]: private type `m3::Priv` in public interface
--> $DIR/issue-30079.rs:35:9
|
LL | struct Priv;
- | ------------ `m3::Priv` declared as private
+ | ----------- `m3::Priv` declared as private
LL | impl ::SemiPrivTrait for () {
LL | type Assoc = Priv;
- | ^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^ can't leak private type
error: aborting due to 2 previous errors; 1 warning emitted
--> $DIR/auxiliary/privacy_tuple_struct.rs:1:1
|
LL | pub struct A(());
- | ^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0603]: tuple struct constructor `B` is private
--> $DIR/privacy5.rs:91:20
--> $DIR/auxiliary/privacy_tuple_struct.rs:2:1
|
LL | pub struct B(isize);
- | ^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:92:20
--> $DIR/auxiliary/privacy_tuple_struct.rs:3:1
|
LL | pub struct C(pub isize, isize);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0603]: tuple struct constructor `A` is private
--> $DIR/privacy5.rs:95:16
--> $DIR/auxiliary/privacy_tuple_struct.rs:1:1
|
LL | pub struct A(());
- | ^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0603]: tuple struct constructor `A` is private
--> $DIR/privacy5.rs:96:16
--> $DIR/auxiliary/privacy_tuple_struct.rs:1:1
|
LL | pub struct A(());
- | ^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0603]: tuple struct constructor `A` is private
--> $DIR/privacy5.rs:97:22
--> $DIR/auxiliary/privacy_tuple_struct.rs:1:1
|
LL | pub struct A(());
- | ^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0603]: tuple struct constructor `A` is private
--> $DIR/privacy5.rs:98:22
--> $DIR/auxiliary/privacy_tuple_struct.rs:1:1
|
LL | pub struct A(());
- | ^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0603]: tuple struct constructor `B` is private
--> $DIR/privacy5.rs:100:16
--> $DIR/auxiliary/privacy_tuple_struct.rs:2:1
|
LL | pub struct B(isize);
- | ^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0603]: tuple struct constructor `B` is private
--> $DIR/privacy5.rs:101:16
--> $DIR/auxiliary/privacy_tuple_struct.rs:2:1
|
LL | pub struct B(isize);
- | ^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0603]: tuple struct constructor `B` is private
--> $DIR/privacy5.rs:102:22
--> $DIR/auxiliary/privacy_tuple_struct.rs:2:1
|
LL | pub struct B(isize);
- | ^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0603]: tuple struct constructor `B` is private
--> $DIR/privacy5.rs:103:22
--> $DIR/auxiliary/privacy_tuple_struct.rs:2:1
|
LL | pub struct B(isize);
- | ^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0603]: tuple struct constructor `B` is private
--> $DIR/privacy5.rs:104:22
--> $DIR/auxiliary/privacy_tuple_struct.rs:2:1
|
LL | pub struct B(isize);
- | ^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0603]: tuple struct constructor `B` is private
--> $DIR/privacy5.rs:105:16
--> $DIR/auxiliary/privacy_tuple_struct.rs:2:1
|
LL | pub struct B(isize);
- | ^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:107:16
--> $DIR/auxiliary/privacy_tuple_struct.rs:3:1
|
LL | pub struct C(pub isize, isize);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:108:16
--> $DIR/auxiliary/privacy_tuple_struct.rs:3:1
|
LL | pub struct C(pub isize, isize);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:109:16
--> $DIR/auxiliary/privacy_tuple_struct.rs:3:1
|
LL | pub struct C(pub isize, isize);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:110:16
--> $DIR/auxiliary/privacy_tuple_struct.rs:3:1
|
LL | pub struct C(pub isize, isize);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:111:22
--> $DIR/auxiliary/privacy_tuple_struct.rs:3:1
|
LL | pub struct C(pub isize, isize);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:112:22
--> $DIR/auxiliary/privacy_tuple_struct.rs:3:1
|
LL | pub struct C(pub isize, isize);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:113:22
--> $DIR/auxiliary/privacy_tuple_struct.rs:3:1
|
LL | pub struct C(pub isize, isize);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:114:22
--> $DIR/auxiliary/privacy_tuple_struct.rs:3:1
|
LL | pub struct C(pub isize, isize);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0603]: tuple struct constructor `A` is private
--> $DIR/privacy5.rs:122:21
--> $DIR/auxiliary/privacy_tuple_struct.rs:1:1
|
LL | pub struct A(());
- | ^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0603]: tuple struct constructor `B` is private
--> $DIR/privacy5.rs:123:21
--> $DIR/auxiliary/privacy_tuple_struct.rs:2:1
|
LL | pub struct B(isize);
- | ^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:124:21
--> $DIR/auxiliary/privacy_tuple_struct.rs:3:1
|
LL | pub struct C(pub isize, isize);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error: aborting due to 48 previous errors
--> $DIR/private-in-public-assoc-ty.rs:17:9
|
LL | struct Priv;
- | ------------ `Priv` declared as private
+ | ----------- `Priv` declared as private
...
LL | type A = Priv;
- | ^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^ can't leak private type
warning: private trait `PrivTr` in public interface (error E0445)
--> $DIR/private-in-public-assoc-ty.rs:24:9
|
LL | type Alias1: PrivTr;
- | ^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(private_in_public)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
--> $DIR/private-in-public-assoc-ty.rs:27:9
|
LL | type Alias2: PubTrAux1<Priv> = u8;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
--> $DIR/private-in-public-assoc-ty.rs:30:9
|
LL | type Alias3: PubTrAux2<A = Priv> = u8;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
--> $DIR/private-in-public-assoc-ty.rs:34:9
|
LL | struct Priv;
- | ------------ `Priv` declared as private
+ | ----------- `Priv` declared as private
...
LL | type Alias4 = Priv;
- | ^^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^ can't leak private type
error[E0446]: private type `Priv` in public interface
--> $DIR/private-in-public-assoc-ty.rs:41:9
|
LL | struct Priv;
- | ------------ `Priv` declared as private
+ | ----------- `Priv` declared as private
...
LL | type Alias1 = Priv;
- | ^^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^ can't leak private type
error[E0445]: private trait `PrivTr` in public interface
--> $DIR/private-in-public-assoc-ty.rs:44:9
| ------------ `PrivTr` declared as private
...
LL | type Exist = impl PrivTr;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
+ | ^^^^^^^^^^ can't leak private trait
error: aborting due to 4 previous errors; 3 warnings emitted
--> $DIR/private-in-public-lint.rs:6:9
|
LL | struct Priv;
- | ------------ `m1::Priv` declared as private
+ | ----------- `m1::Priv` declared as private
...
LL | pub fn f() -> Priv {Priv}
| ^^^^^^^^^^^^^^^^^^ can't leak private type
--> $DIR/private-in-public-lint.rs:15:9
|
LL | struct Priv;
- | ------------ `m2::Priv` declared as private
+ | ----------- `m2::Priv` declared as private
...
LL | pub fn f() -> Priv {Priv}
| ^^^^^^^^^^^^^^^^^^ can't leak private type
--> $DIR/private-in-public-warn.rs:15:5
|
LL | pub type Alias = Priv;
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/private-in-public-warn.rs:5:9
--> $DIR/private-in-public-warn.rs:24:9
|
LL | const C: Priv = Priv;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
--> $DIR/private-in-public-warn.rs:26:9
|
LL | struct Priv;
- | ------------ `types::Priv` declared as private
+ | ----------- `types::Priv` declared as private
...
LL | type Alias = Priv;
- | ^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^ can't leak private type
error: private type `types::Priv` in public interface (error E0446)
--> $DIR/private-in-public-warn.rs:27:9
--> $DIR/private-in-public-warn.rs:33:9
|
LL | pub static ES: Priv;
- | ^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
--> $DIR/private-in-public-warn.rs:35:9
|
LL | pub fn ef1(arg: Priv);
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
--> $DIR/private-in-public-warn.rs:37:9
|
LL | pub fn ef2() -> Priv;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
--> $DIR/private-in-public-warn.rs:41:9
|
LL | struct Priv;
- | ------------ `types::Priv` declared as private
+ | ----------- `types::Priv` declared as private
...
LL | type Alias = Priv;
- | ^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^ can't leak private type
error: private trait `traits::PrivTr` in public interface (error E0445)
--> $DIR/private-in-public-warn.rs:50:5
|
LL | pub type Alias<T: PrivTr> = T;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
--> $DIR/private-in-public-warn.rs:53:5
|
LL | pub trait Tr1: PrivTr {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
--> $DIR/private-in-public-warn.rs:55:5
|
LL | pub trait Tr2<T: PrivTr> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
--> $DIR/private-in-public-warn.rs:58:9
|
LL | type Alias: PrivTr;
- | ^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
--> $DIR/private-in-public-warn.rs:64:5
|
LL | impl<T: PrivTr> Pub<T> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
--> $DIR/private-in-public-warn.rs:74:5
|
LL | pub type Alias<T> where T: PrivTr = T;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
--> $DIR/private-in-public-warn.rs:78:5
|
LL | pub trait Tr2<T> where T: PrivTr {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
--> $DIR/private-in-public-warn.rs:86:5
|
LL | impl<T> Pub<T> where T: PrivTr {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
--> $DIR/private-in-public-warn.rs:98:5
|
LL | pub trait Tr1: PrivTr<Pub> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
--> $DIR/private-in-public-warn.rs:101:5
|
LL | pub trait Tr2: PubTr<Priv> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
--> $DIR/private-in-public-warn.rs:103:5
|
LL | pub trait Tr3: PubTr<[Priv; 1]> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
--> $DIR/private-in-public-warn.rs:105:5
|
LL | pub trait Tr4: PubTr<Pub<Priv>> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
--> $DIR/private-in-public-warn.rs:132:9
|
LL | struct Priv;
- | ------------ `impls::Priv` declared as private
+ | ----------- `impls::Priv` declared as private
...
LL | type Alias = Priv;
- | ^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^ can't leak private type
error: private type `aliases_pub::Priv` in public interface (error E0446)
--> $DIR/private-in-public-warn.rs:203:9
--> $DIR/private-in-public-warn.rs:207:9
|
LL | struct Priv;
- | ------------ `aliases_pub::Priv` declared as private
+ | ----------- `aliases_pub::Priv` declared as private
...
LL | type Check = Priv;
- | ^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^ can't leak private type
error[E0446]: private type `aliases_pub::Priv` in public interface
--> $DIR/private-in-public-warn.rs:210:9
|
LL | struct Priv;
- | ------------ `aliases_pub::Priv` declared as private
+ | ----------- `aliases_pub::Priv` declared as private
...
LL | type Check = Priv;
- | ^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^ can't leak private type
error[E0446]: private type `aliases_pub::Priv` in public interface
--> $DIR/private-in-public-warn.rs:213:9
|
LL | struct Priv;
- | ------------ `aliases_pub::Priv` declared as private
+ | ----------- `aliases_pub::Priv` declared as private
...
LL | type Check = Priv;
- | ^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^ can't leak private type
error[E0446]: private type `aliases_pub::Priv` in public interface
--> $DIR/private-in-public-warn.rs:216:9
|
LL | struct Priv;
- | ------------ `aliases_pub::Priv` declared as private
+ | ----------- `aliases_pub::Priv` declared as private
...
LL | type Check = Priv;
- | ^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^ can't leak private type
error: private trait `PrivTr1` in public interface (error E0445)
--> $DIR/private-in-public-warn.rs:246:5
|
LL | pub trait Tr1: PrivUseAliasTr {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
--> $DIR/private-in-public-warn.rs:249:5
|
LL | pub trait Tr2: PrivUseAliasTr<PrivAlias> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
--> $DIR/private-in-public-warn.rs:249:5
|
LL | pub trait Tr2: PrivUseAliasTr<PrivAlias> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
--> $DIR/private-in-public.rs:13:5
|
LL | struct Priv;
- | ------------ `types::Priv` declared as private
+ | ----------- `types::Priv` declared as private
...
LL | pub const C: Priv = Priv;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^^^^^^^ can't leak private type
error[E0446]: private type `types::Priv` in public interface
--> $DIR/private-in-public.rs:14:5
|
LL | struct Priv;
- | ------------ `types::Priv` declared as private
+ | ----------- `types::Priv` declared as private
...
LL | pub static S: Priv = Priv;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^^^^^^^^ can't leak private type
error[E0446]: private type `types::Priv` in public interface
--> $DIR/private-in-public.rs:15:5
|
LL | struct Priv;
- | ------------ `types::Priv` declared as private
+ | ----------- `types::Priv` declared as private
...
LL | pub fn f1(arg: Priv) {}
| ^^^^^^^^^^^^^^^^^^^^ can't leak private type
--> $DIR/private-in-public.rs:16:5
|
LL | struct Priv;
- | ------------ `types::Priv` declared as private
+ | ----------- `types::Priv` declared as private
...
LL | pub fn f2() -> Priv { panic!() }
| ^^^^^^^^^^^^^^^^^^^ can't leak private type
--> $DIR/private-in-public.rs:17:19
|
LL | struct Priv;
- | ------------ `types::Priv` declared as private
+ | ----------- `types::Priv` declared as private
...
LL | pub struct S1(pub Priv);
| ^^^^^^^^ can't leak private type
--> $DIR/private-in-public.rs:18:21
|
LL | struct Priv;
- | ------------ `types::Priv` declared as private
+ | ----------- `types::Priv` declared as private
...
LL | pub struct S2 { pub field: Priv }
| ^^^^^^^^^^^^^^^ can't leak private type
--> $DIR/private-in-public.rs:20:9
|
LL | struct Priv;
- | ------------ `types::Priv` declared as private
+ | ----------- `types::Priv` declared as private
...
LL | pub const C: Priv = Priv;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^^^^^^^ can't leak private type
error[E0446]: private type `types::Priv` in public interface
--> $DIR/private-in-public.rs:21:9
|
LL | struct Priv;
- | ------------ `types::Priv` declared as private
+ | ----------- `types::Priv` declared as private
...
LL | pub fn f1(arg: Priv) {}
| ^^^^^^^^^^^^^^^^^^^^ can't leak private type
--> $DIR/private-in-public.rs:22:9
|
LL | struct Priv;
- | ------------ `types::Priv` declared as private
+ | ----------- `types::Priv` declared as private
...
LL | pub fn f2() -> Priv { panic!() }
| ^^^^^^^^^^^^^^^^^^^ can't leak private type
| ------------ `traits::PrivTr` declared as private
...
LL | pub enum E<T: PrivTr> { V(T) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
+ | ^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
error[E0445]: private trait `traits::PrivTr` in public interface
--> $DIR/private-in-public.rs:32:5
| ------------ `traits::PrivTr` declared as private
...
LL | pub struct S1<T: PrivTr>(T);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
error[E0445]: private trait `traits::PrivTr` in public interface
--> $DIR/private-in-public.rs:34:5
|
-LL | trait PrivTr {}
- | ------------ `traits::PrivTr` declared as private
+LL | trait PrivTr {}
+ | ------------ `traits::PrivTr` declared as private
...
-LL | / impl<T: PrivTr> Pub<T> {
-LL | | pub fn f<U: PrivTr>(arg: U) {}
-LL | | }
- | |_____^ can't leak private trait
+LL | impl<T: PrivTr> Pub<T> {
+ | ^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
error[E0445]: private trait `traits::PrivTr` in public interface
--> $DIR/private-in-public.rs:35:9
| ------------ `traits_where::PrivTr` declared as private
...
LL | pub enum E<T> where T: PrivTr { V(T) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
+ | ^^^^^^^^^^^^^ can't leak private trait
error[E0445]: private trait `traits_where::PrivTr` in public interface
--> $DIR/private-in-public.rs:46:5
| ------------ `traits_where::PrivTr` declared as private
...
LL | pub struct S1<T>(T) where T: PrivTr;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
+ | ^^^^^^^^^^^^^^^^ can't leak private trait
error[E0445]: private trait `traits_where::PrivTr` in public interface
--> $DIR/private-in-public.rs:50:5
|
-LL | trait PrivTr {}
- | ------------ `traits_where::PrivTr` declared as private
+LL | trait PrivTr {}
+ | ------------ `traits_where::PrivTr` declared as private
...
-LL | / impl<T> Pub<T> where T: PrivTr {
-LL | |
-LL | | pub fn f<U>(arg: U) where U: PrivTr {}
-LL | |
-LL | | }
- | |_____^ can't leak private trait
+LL | impl<T> Pub<T> where T: PrivTr {
+ | ^^^^^^^^^^^^^^ can't leak private trait
error[E0445]: private trait `traits_where::PrivTr` in public interface
--> $DIR/private-in-public.rs:52:9
--> $DIR/private-in-public.rs:63:5
|
LL | struct Priv<T = u8>(T);
- | ----------------------- `generics::Priv` declared as private
+ | ------------------- `generics::Priv` declared as private
...
LL | pub fn f1(arg: [Priv; 1]) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
--> $DIR/private-in-public.rs:64:5
|
LL | struct Priv<T = u8>(T);
- | ----------------------- `generics::Priv` declared as private
+ | ------------------- `generics::Priv` declared as private
...
LL | pub fn f2(arg: Pub<Priv>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
--> $DIR/private-in-public.rs:65:5
|
LL | struct Priv<T = u8>(T);
- | ----------------------- `generics::Priv<generics::Pub>` declared as private
+ | ------------------- `generics::Priv<generics::Pub>` declared as private
...
LL | pub fn f3(arg: Priv<Pub>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
--> $DIR/private-in-public.rs:80:9
|
LL | struct Priv;
- | ------------ `impls::Priv` declared as private
+ | ----------- `impls::Priv` declared as private
...
LL | pub fn f(arg: Priv) {}
| ^^^^^^^^^^^^^^^^^^^ can't leak private type
--> $DIR/private-in-public.rs:104:5
|
LL | struct Priv;
- | ------------ `aliases_pub::Priv` declared as private
+ | ----------- `aliases_pub::Priv` declared as private
...
LL | pub fn f3(arg: <Priv as PrivTr>::Assoc) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
--> $DIR/private-in-public.rs:109:9
|
LL | struct Priv;
- | ------------ `aliases_pub::Priv` declared as private
+ | ----------- `aliases_pub::Priv` declared as private
...
LL | pub fn f(arg: Priv) {}
| ^^^^^^^^^^^^^^^^^^^ can't leak private type
--> $DIR/private-in-public.rs:131:5
|
LL | struct Priv1;
- | ------------- `Priv1` declared as private
+ | ------------ `Priv1` declared as private
...
LL | pub fn f1(arg: PrivUseAlias) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
--> $DIR/private-in-public.rs:132:5
|
LL | struct Priv2;
- | ------------- `Priv2` declared as private
+ | ------------ `Priv2` declared as private
...
LL | pub fn f2(arg: PrivAlias) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
--> $DIR/private-in-public.rs:133:5
|
LL | struct Priv;
- | ------------ `aliases_priv::Priv` declared as private
+ | ----------- `aliases_priv::Priv` declared as private
...
LL | pub fn f3(arg: <Priv as PrivTr>::Assoc) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
--> $DIR/private-in-public.rs:143:5
|
LL | struct Priv;
- | ------------ `aliases_params::Priv` declared as private
+ | ----------- `aliases_params::Priv` declared as private
...
LL | pub fn f2(arg: PrivAliasGeneric) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
--> $DIR/private-in-public.rs:145:5
|
LL | struct Priv;
- | ------------ `aliases_params::Priv` declared as private
+ | ----------- `aliases_params::Priv` declared as private
...
LL | pub fn f3(arg: Result<u8>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
--> $DIR/private-inferred-type.rs:61:36
|
LL | struct Priv;
- | ------------ `Priv` declared as private
+ | ----------- `Priv` declared as private
...
LL | impl TraitWithAssocTy for u8 { type AssocTy = Priv; }
- | ^^^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^^ can't leak private type
error[E0446]: private type `S2` in public interface
--> $DIR/private-inferred-type.rs:83:9
|
LL | struct S2;
- | ---------- `S2` declared as private
+ | --------- `S2` declared as private
...
LL | type Target = S2Alias;
- | ^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^ can't leak private type
error: type `Priv` is private
--> $DIR/private-inferred-type.rs:97:9
--> $DIR/pub-priv1.rs:35:5
|
LL | type Foo: OtherTrait;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^
error: aborting due to 3 previous errors
--> $DIR/private-in-public.rs:6:9
|
LL | struct Priv;
- | ------------ `Priv` declared as private
+ | ----------- `Priv` declared as private
...
LL | pub(crate) fn g(_: Priv) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
--> $DIR/private-in-public.rs:7:9
|
LL | struct Priv;
- | ------------ `Priv` declared as private
+ | ----------- `Priv` declared as private
...
LL | pub(crate) fn h(_: Priv) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
--> $DIR/auxiliary/pub_restricted.rs:1:1
|
LL | pub(crate) struct Crate;
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: function `f` is private
--> $DIR/test.rs:30:19
warning: private type `PrivTy` in public interface (error E0446)
--> $DIR/where-priv-type.rs:19:1
|
-LL | / pub struct S
-LL | |
-LL | |
-LL | | where
-LL | | PrivTy:
-LL | | {}
- | |__^
+LL | pub struct S
+ | ^^^^^^^^^^^^
|
= note: `#[warn(private_in_public)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: private type `PrivTy` in public interface (error E0446)
--> $DIR/where-priv-type.rs:27:1
|
-LL | / pub enum E
-LL | |
-LL | |
-LL | | where
-LL | | PrivTy:
-LL | | {}
- | |__^
+LL | pub enum E
+ | ^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
error[E0446]: private type `PrivTy` in public interface
--> $DIR/where-priv-type.rs:43:1
|
-LL | struct PrivTy;
- | -------------- `PrivTy` declared as private
+LL | struct PrivTy;
+ | ------------- `PrivTy` declared as private
...
-LL | / impl S
-LL | |
-LL | | where
-LL | | PrivTy:
-... |
-LL | | {}
-LL | | }
- | |_^ can't leak private type
+LL | impl S
+ | ^^^^^^ can't leak private type
warning: private type `PrivTy` in public interface (error E0446)
--> $DIR/where-priv-type.rs:48:5
--> $DIR/where-priv-type.rs:80:5
|
LL | type AssocTy = Const<{ my_const_fn(U) }>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^^ can't leak private type
...
LL | const fn my_const_fn(val: u8) -> u8 {
| ----------------------------------- `fn(u8) -> u8 {my_const_fn}` declared as private
error[E0445]: private trait `PrivTr` in public interface
--> $DIR/where-pub-type-impls-priv-trait.rs:19:1
|
-LL | trait PrivTr {}
- | ------------ `PrivTr` declared as private
+LL | trait PrivTr {}
+ | ------------ `PrivTr` declared as private
...
-LL | / pub struct S
-LL | |
-LL | | where
-LL | | PubTy: PrivTr
-LL | | {}
- | |__^ can't leak private trait
+LL | pub struct S
+ | ^^^^^^^^^^^^ can't leak private trait
error[E0445]: private trait `PrivTr` in public interface
--> $DIR/where-pub-type-impls-priv-trait.rs:26:1
|
-LL | trait PrivTr {}
- | ------------ `PrivTr` declared as private
+LL | trait PrivTr {}
+ | ------------ `PrivTr` declared as private
...
-LL | / pub enum E
-LL | |
-LL | | where
-LL | | PubTy: PrivTr
-LL | | {}
- | |__^ can't leak private trait
+LL | pub enum E
+ | ^^^^^^^^^^ can't leak private trait
error[E0445]: private trait `PrivTr` in public interface
--> $DIR/where-pub-type-impls-priv-trait.rs:33:1
error[E0445]: private trait `PrivTr` in public interface
--> $DIR/where-pub-type-impls-priv-trait.rs:40:1
|
-LL | trait PrivTr {}
- | ------------ `PrivTr` declared as private
+LL | trait PrivTr {}
+ | ------------ `PrivTr` declared as private
...
-LL | / impl S
-LL | |
-LL | | where
-LL | | PubTy: PrivTr
-... |
-LL | | {}
-LL | | }
- | |_^ can't leak private trait
+LL | impl S
+ | ^^^^^^ can't leak private trait
error[E0445]: private trait `PrivTr` in public interface
--> $DIR/where-pub-type-impls-priv-trait.rs:45:5
::: $SRC_DIR/core/src/clone.rs:LL:COL
|
LL | pub macro Clone($item:item) {
- | --------------------------- similarly named derive macro `Clone` defined here
+ | --------------- similarly named derive macro `Clone` defined here
error: cannot find derive macro `Dlone` in this scope
--> $DIR/resolve-error.rs:35:10
::: $SRC_DIR/core/src/clone.rs:LL:COL
|
LL | pub macro Clone($item:item) {
- | --------------------------- similarly named derive macro `Clone` defined here
+ | --------------- similarly named derive macro `Clone` defined here
error: cannot find attribute `FooWithLongNan` in this scope
--> $DIR/resolve-error.rs:32:3
--> $DIR/issue-33174-restricted-type-in-public-interface.rs:18:1
|
LL | pub(crate) struct Snail;
- | ------------------------ `Snail` declared as private
+ | ----------------------- `Snail` declared as private
...
LL | pub type Helix_pomatia = Shell<Snail>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
error[E0446]: crate-private type `Turtle` in public interface
--> $DIR/issue-33174-restricted-type-in-public-interface.rs:21:1
|
LL | pub(super) struct Turtle;
- | ------------------------- `Turtle` declared as crate-private
+ | ------------------------ `Turtle` declared as crate-private
...
LL | pub type Dermochelys_coriacea = Shell<sea::Turtle>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak crate-private type
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak crate-private type
error[E0446]: private type `Tortoise` in public interface
--> $DIR/issue-33174-restricted-type-in-public-interface.rs:24:1
|
LL | struct Tortoise;
- | ---------------- `Tortoise` declared as private
+ | --------------- `Tortoise` declared as private
...
LL | pub type Testudo_graeca = Shell<Tortoise>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
error: aborting due to 3 previous errors
--> $DIR/recursive-static-definition.rs:1:1
|
LL | pub static FOO: u32 = FOO;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^
|
note: ...which requires const-evaluating + checking `FOO`...
--> $DIR/recursive-static-definition.rs:1:23
note: `Result<u32, &R>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
|
-LL | / pub enum Result<T, E> {
-LL | | /// Contains the success value
-LL | | #[lang = "Ok"]
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-... |
-LL | | Err(#[stable(feature = "rust1", since = "1.0.0")] E),
- | | ^^^ not covered
-LL | | }
- | |_-
+LL | pub enum Result<T, E> {
+ | ---------------------
+...
+LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E),
+ | ^^^ not covered
= note: the matched value is of type `Result<u32, &R>`
help: you might want to use `if let` to ignore the variant that isn't matched
|
--> $DIR/repr-packed-contains-align.rs:19:1
|
LL | struct SC(SA);
- | ^^^^^^^^^^^^^^
+ | ^^^^^^^^^
|
note: `SA` has a `#[repr(align)]` attribute
--> $DIR/repr-packed-contains-align.rs:5:1
|
LL | struct SA(i32);
- | ^^^^^^^^^^^^^^^
+ | ^^^^^^^^^
error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type
--> $DIR/repr-packed-contains-align.rs:22:1
|
LL | struct SD(SB);
- | ^^^^^^^^^^^^^^
+ | ^^^^^^^^^
|
note: `SA` has a `#[repr(align)]` attribute
--> $DIR/repr-packed-contains-align.rs:5:1
|
LL | struct SA(i32);
- | ^^^^^^^^^^^^^^^
+ | ^^^^^^^^^
note: `SD` contains a field of type `SB`
--> $DIR/repr-packed-contains-align.rs:22:11
|
--> $DIR/repr-packed-contains-align.rs:25:1
|
LL | struct SE(UA);
- | ^^^^^^^^^^^^^^
+ | ^^^^^^^^^
|
note: `UA` has a `#[repr(align)]` attribute
--> $DIR/repr-packed-contains-align.rs:10:1
|
-LL | / union UA {
-LL | | i: i32
-LL | | }
- | |_^
+LL | union UA {
+ | ^^^^^^^^
error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type
--> $DIR/repr-packed-contains-align.rs:28:1
|
LL | struct SF(UB);
- | ^^^^^^^^^^^^^^
+ | ^^^^^^^^^
|
note: `UA` has a `#[repr(align)]` attribute
--> $DIR/repr-packed-contains-align.rs:10:1
|
-LL | / union UA {
-LL | | i: i32
-LL | | }
- | |_^
+LL | union UA {
+ | ^^^^^^^^
note: `SF` contains a field of type `UB`
--> $DIR/repr-packed-contains-align.rs:28:11
|
error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type
--> $DIR/repr-packed-contains-align.rs:31:1
|
-LL | / union UC {
-LL | | a: UA
-LL | | }
- | |_^
+LL | union UC {
+ | ^^^^^^^^
|
note: `UA` has a `#[repr(align)]` attribute
--> $DIR/repr-packed-contains-align.rs:10:1
|
-LL | / union UA {
-LL | | i: i32
-LL | | }
- | |_^
+LL | union UA {
+ | ^^^^^^^^
error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type
--> $DIR/repr-packed-contains-align.rs:36:1
|
-LL | / union UD {
-LL | | n: UB
-LL | | }
- | |_^
+LL | union UD {
+ | ^^^^^^^^
|
note: `UA` has a `#[repr(align)]` attribute
--> $DIR/repr-packed-contains-align.rs:10:1
|
-LL | / union UA {
-LL | | i: i32
-LL | | }
- | |_^
+LL | union UA {
+ | ^^^^^^^^
note: `UD` contains a field of type `UB`
--> $DIR/repr-packed-contains-align.rs:37:5
|
error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type
--> $DIR/repr-packed-contains-align.rs:41:1
|
-LL | / union UE {
-LL | | a: SA
-LL | | }
- | |_^
+LL | union UE {
+ | ^^^^^^^^
|
note: `SA` has a `#[repr(align)]` attribute
--> $DIR/repr-packed-contains-align.rs:5:1
|
LL | struct SA(i32);
- | ^^^^^^^^^^^^^^^
+ | ^^^^^^^^^
error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type
--> $DIR/repr-packed-contains-align.rs:46:1
|
-LL | / union UF {
-LL | | n: SB
-LL | | }
- | |_^
+LL | union UF {
+ | ^^^^^^^^
|
note: `SA` has a `#[repr(align)]` attribute
--> $DIR/repr-packed-contains-align.rs:5:1
|
LL | struct SA(i32);
- | ^^^^^^^^^^^^^^^
+ | ^^^^^^^^^
note: `UF` contains a field of type `SB`
--> $DIR/repr-packed-contains-align.rs:47:5
|
--> $DIR/repr-transparent-issue-87496.rs:6:1
|
LL | struct TransparentCustomZst(());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: 1 warning emitted
--> $DIR/repr-transparent.rs:26:1
|
LL | struct MultipleNonZst(u8, u8);
- | ^^^^^^^^^^^^^^^^^^^^^^--^^--^^
- | | | |
- | | | this field is non-zero-sized
+ | ^^^^^^^^^^^^^^^^^^^^^ -- -- this field is non-zero-sized
+ | | |
| | this field is non-zero-sized
| needs at most one non-zero-sized field, but has 2
--> $DIR/repr-transparent.rs:32:1
|
LL | pub struct StructWithProjection(f32, <f32 as Mirror>::It);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^^-------------------^^
- | | | |
- | | | this field is non-zero-sized
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --- ------------------- this field is non-zero-sized
+ | | |
| | this field is non-zero-sized
| needs at most one non-zero-sized field, but has 2
-error[E0391]: cycle detected when computing type of `<impl at $DIR/issue-23305.rs:5:1: 5:24>`
+error[E0391]: cycle detected when computing type of `<impl at $DIR/issue-23305.rs:5:1: 5:21>`
--> $DIR/issue-23305.rs:5:16
|
LL | impl dyn ToNbt<Self> {}
| ^^^^
|
- = note: ...which immediately requires computing type of `<impl at $DIR/issue-23305.rs:5:1: 5:24>` again
+ = note: ...which immediately requires computing type of `<impl at $DIR/issue-23305.rs:5:1: 5:21>` again
note: cycle used when collecting item types in top-level module
--> $DIR/issue-23305.rs:1:1
|
--> $DIR/auxiliary/privacy-struct-ctor.rs:2:5
|
LL | pub struct S(u8);
- | ^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0603]: tuple struct constructor `Z` is private
--> $DIR/privacy-struct-ctor.rs:45:19
--> $DIR/auxiliary/privacy-struct-ctor.rs:5:9
|
LL | pub(in m) struct Z(pub(in m::n) u8);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^
error: aborting due to 10 previous errors
-error[E0391]: cycle detected when computing type of `<impl at $DIR/resolve-self-in-impl.rs:14:1: 14:20>`
+error[E0391]: cycle detected when computing type of `<impl at $DIR/resolve-self-in-impl.rs:14:1: 14:17>`
--> $DIR/resolve-self-in-impl.rs:14:13
|
LL | impl Tr for Self {}
| ^^^^
|
- = note: ...which immediately requires computing type of `<impl at $DIR/resolve-self-in-impl.rs:14:1: 14:20>` again
+ = note: ...which immediately requires computing type of `<impl at $DIR/resolve-self-in-impl.rs:14:1: 14:17>` again
note: cycle used when collecting item types in top-level module
--> $DIR/resolve-self-in-impl.rs:1:1
|
LL | | fn main() {}
| |____________^
-error[E0391]: cycle detected when computing type of `<impl at $DIR/resolve-self-in-impl.rs:15:1: 15:23>`
+error[E0391]: cycle detected when computing type of `<impl at $DIR/resolve-self-in-impl.rs:15:1: 15:20>`
--> $DIR/resolve-self-in-impl.rs:15:15
|
LL | impl Tr for S<Self> {}
| ^^^^
|
- = note: ...which immediately requires computing type of `<impl at $DIR/resolve-self-in-impl.rs:15:1: 15:23>` again
+ = note: ...which immediately requires computing type of `<impl at $DIR/resolve-self-in-impl.rs:15:1: 15:20>` again
note: cycle used when collecting item types in top-level module
--> $DIR/resolve-self-in-impl.rs:1:1
|
LL | | fn main() {}
| |____________^
-error[E0391]: cycle detected when computing type of `<impl at $DIR/resolve-self-in-impl.rs:16:1: 16:13>`
+error[E0391]: cycle detected when computing type of `<impl at $DIR/resolve-self-in-impl.rs:16:1: 16:10>`
--> $DIR/resolve-self-in-impl.rs:16:6
|
LL | impl Self {}
| ^^^^
|
- = note: ...which immediately requires computing type of `<impl at $DIR/resolve-self-in-impl.rs:16:1: 16:13>` again
+ = note: ...which immediately requires computing type of `<impl at $DIR/resolve-self-in-impl.rs:16:1: 16:10>` again
note: cycle used when collecting item types in top-level module
--> $DIR/resolve-self-in-impl.rs:1:1
|
LL | | fn main() {}
| |____________^
-error[E0391]: cycle detected when computing type of `<impl at $DIR/resolve-self-in-impl.rs:17:1: 17:16>`
+error[E0391]: cycle detected when computing type of `<impl at $DIR/resolve-self-in-impl.rs:17:1: 17:13>`
--> $DIR/resolve-self-in-impl.rs:17:8
|
LL | impl S<Self> {}
| ^^^^
|
- = note: ...which immediately requires computing type of `<impl at $DIR/resolve-self-in-impl.rs:17:1: 17:16>` again
+ = note: ...which immediately requires computing type of `<impl at $DIR/resolve-self-in-impl.rs:17:1: 17:13>` again
note: cycle used when collecting item types in top-level module
--> $DIR/resolve-self-in-impl.rs:1:1
|
LL | | fn main() {}
| |____________^
-error[E0391]: cycle detected when computing trait implemented by `<impl at $DIR/resolve-self-in-impl.rs:18:1: 18:26>`
+error[E0391]: cycle detected when computing trait implemented by `<impl at $DIR/resolve-self-in-impl.rs:18:1: 18:23>`
--> $DIR/resolve-self-in-impl.rs:18:1
|
LL | impl Tr<Self::A> for S {}
| ^^^^^^^^^^^^^^^^^^^^^^
|
- = note: ...which immediately requires computing trait implemented by `<impl at $DIR/resolve-self-in-impl.rs:18:1: 18:26>` again
+ = note: ...which immediately requires computing trait implemented by `<impl at $DIR/resolve-self-in-impl.rs:18:1: 18:23>` again
note: cycle used when collecting item types in top-level module
--> $DIR/resolve-self-in-impl.rs:1:1
|
--> $DIR/const.rs:14:9
|
LL | const FOO: Foo = Foo{bar: 5};
- | ----------------------------- constant defined here
+ | -------------- constant defined here
...
LL | match &f {
| -- this expression has type `&Foo`
--> $DIR/auxiliary/enums.rs:18:1
|
LL | pub enum EmptyNonExhaustiveEnum {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `EmptyNonExhaustiveEnum`, which is marked as non-exhaustive
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
note: `NonExhaustiveEnum` defined here
--> $DIR/auxiliary/enums.rs:4:1
|
-LL | / pub enum NonExhaustiveEnum {
-LL | | Unit,
-LL | | Tuple(u32),
-LL | | Struct { field: u32 },
-LL | | }
- | |_^
+LL | pub enum NonExhaustiveEnum {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `NonExhaustiveEnum`, which is marked as non-exhaustive
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
note: `NonExhaustiveEnum` defined here
--> $DIR/auxiliary/enums.rs:4:1
|
-LL | / pub enum NonExhaustiveEnum {
-LL | | Unit,
-LL | | Tuple(u32),
-LL | | Struct { field: u32 },
-LL | | }
- | |_^
+LL | pub enum NonExhaustiveEnum {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `NonExhaustiveEnum`, which is marked as non-exhaustive
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
--> $DIR/auxiliary/structs.rs:12:1
|
LL | pub struct TupleStruct(pub u16, pub u16);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: unit struct `UnitStruct` is private
--> $DIR/struct.rs:32:32
--> $DIR/auxiliary/structs.rs:9:1
|
LL | pub struct UnitStruct;
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^
error[E0639]: cannot create non-exhaustive struct using struct expression
--> $DIR/struct.rs:7:14
--> $DIR/auxiliary/uninhabited.rs:26:1
|
LL | pub struct IndirectUninhabitedEnum(UninhabitedEnum);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `IndirectUninhabitedEnum`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
--> $DIR/auxiliary/uninhabited.rs:28:1
|
LL | pub struct IndirectUninhabitedStruct(UninhabitedStruct);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `IndirectUninhabitedStruct`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
--> $DIR/auxiliary/uninhabited.rs:30:1
|
LL | pub struct IndirectUninhabitedTupleStruct(UninhabitedTupleStruct);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `IndirectUninhabitedTupleStruct`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
--> $DIR/auxiliary/uninhabited.rs:32:1
|
LL | pub struct IndirectUninhabitedVariants(UninhabitedVariants);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `IndirectUninhabitedVariants`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
--> $DIR/auxiliary/uninhabited.rs:26:1
|
LL | pub struct IndirectUninhabitedEnum(UninhabitedEnum);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `IndirectUninhabitedEnum`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
--> $DIR/auxiliary/uninhabited.rs:28:1
|
LL | pub struct IndirectUninhabitedStruct(UninhabitedStruct);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `IndirectUninhabitedStruct`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
--> $DIR/auxiliary/uninhabited.rs:30:1
|
LL | pub struct IndirectUninhabitedTupleStruct(UninhabitedTupleStruct);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `IndirectUninhabitedTupleStruct`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
--> $DIR/auxiliary/uninhabited.rs:32:1
|
LL | pub struct IndirectUninhabitedVariants(UninhabitedVariants);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `IndirectUninhabitedVariants`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
note: `UninhabitedEnum` defined here
--> $DIR/auxiliary/uninhabited.rs:5:1
|
-LL | / pub enum UninhabitedEnum {
-LL | | }
- | |_^
+LL | pub enum UninhabitedEnum {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `UninhabitedEnum`, which is marked as non-exhaustive
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
note: `UninhabitedStruct` defined here
--> $DIR/auxiliary/uninhabited.rs:9:1
|
-LL | / pub struct UninhabitedStruct {
-LL | | _priv: !,
-LL | | }
- | |_^
+LL | pub struct UninhabitedStruct {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `UninhabitedStruct`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
--> $DIR/auxiliary/uninhabited.rs:14:1
|
LL | pub struct UninhabitedTupleStruct(!);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `UninhabitedTupleStruct`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
note: `UninhabitedVariants` defined here
--> $DIR/auxiliary/uninhabited.rs:17:23
|
-LL | / pub enum UninhabitedVariants {
-LL | | #[non_exhaustive] Tuple(!),
- | | ^^^^^ not covered
-LL | | #[non_exhaustive] Struct { x: ! }
- | | ^^^^^^ not covered
-LL | | }
- | |_-
+LL | pub enum UninhabitedVariants {
+ | ----------------------------
+LL | #[non_exhaustive] Tuple(!),
+ | ^^^^^ not covered
+LL | #[non_exhaustive] Struct { x: ! }
+ | ^^^^^^ not covered
= note: the matched value is of type `UninhabitedVariants`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
note: `UninhabitedEnum` defined here
--> $DIR/auxiliary/uninhabited.rs:5:1
|
-LL | / pub enum UninhabitedEnum {
-LL | | }
- | |_^
+LL | pub enum UninhabitedEnum {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `UninhabitedEnum`, which is marked as non-exhaustive
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
note: `UninhabitedStruct` defined here
--> $DIR/auxiliary/uninhabited.rs:9:1
|
-LL | / pub struct UninhabitedStruct {
-LL | | _priv: !,
-LL | | }
- | |_^
+LL | pub struct UninhabitedStruct {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `UninhabitedStruct`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
--> $DIR/auxiliary/uninhabited.rs:14:1
|
LL | pub struct UninhabitedTupleStruct(!);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `UninhabitedTupleStruct`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
note: `UninhabitedVariants` defined here
--> $DIR/auxiliary/uninhabited.rs:17:23
|
-LL | / pub enum UninhabitedVariants {
-LL | | #[non_exhaustive] Tuple(!),
- | | ^^^^^ not covered
-LL | | #[non_exhaustive] Struct { x: ! }
- | | ^^^^^^ not covered
-LL | | }
- | |_-
+LL | pub enum UninhabitedVariants {
+ | ----------------------------
+LL | #[non_exhaustive] Tuple(!),
+ | ^^^^^ not covered
+LL | #[non_exhaustive] Struct { x: ! }
+ | ^^^^^^ not covered
= note: the matched value is of type `UninhabitedVariants`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
error: rustc_outlives
--> $DIR/cross-crate.rs:4:1
|
-LL | / struct Foo<'a, T> {
-LL | | bar: std::slice::IterMut<'a, T>
-LL | | }
- | |_^
+LL | struct Foo<'a, T> {
+ | ^^^^^^^^^^^^^^^^^
|
= note: T: 'a
error: rustc_outlives
--> $DIR/enum.rs:7:1
|
-LL | / enum Foo<'a, T> {
-LL | | One(Bar<'a, T>)
-LL | | }
- | |_^
+LL | enum Foo<'a, T> {
+ | ^^^^^^^^^^^^^^^
|
= note: T: 'a
error: rustc_outlives
--> $DIR/enum.rs:13:1
|
-LL | / struct Bar<'b, U> {
-LL | | field2: &'b U
-LL | | }
- | |_^
+LL | struct Bar<'b, U> {
+ | ^^^^^^^^^^^^^^^^^
|
= note: U: 'b
error: rustc_outlives
--> $DIR/enum.rs:19:1
|
-LL | / enum Ying<'c, K> {
-LL | | One(&'c Yang<K>)
-LL | | }
- | |_^
+LL | enum Ying<'c, K> {
+ | ^^^^^^^^^^^^^^^^
|
= note: K: 'c
error: rustc_outlives
--> $DIR/explicit-dyn.rs:7:1
|
-LL | / struct Foo<'a, A>
-LL | | {
-LL | | foo: Box<dyn Trait<'a, A>>
-LL | | }
- | |_^
+LL | struct Foo<'a, A>
+ | ^^^^^^^^^^^^^^^^^
|
= note: A: 'a
error: rustc_outlives
--> $DIR/explicit-enum.rs:4:1
|
-LL | / enum Foo<'a, U> {
-LL | | One(Bar<'a, U>)
-LL | | }
- | |_^
+LL | enum Foo<'a, U> {
+ | ^^^^^^^^^^^^^^^
|
= note: U: 'a
error: rustc_outlives
--> $DIR/explicit-projection.rs:8:1
|
-LL | / struct Foo<'a, A, B> where A: Trait<'a, B>
-LL | | {
-LL | | foo: <A as Trait<'a, B>>::Type
-LL | | }
- | |_^
+LL | struct Foo<'a, A, B> where A: Trait<'a, B>
+ | ^^^^^^^^^^^^^^^^^^^^
|
= note: B: 'a
error: rustc_outlives
--> $DIR/explicit-struct.rs:4:1
|
-LL | / struct Foo<'b, U> {
-LL | | bar: Bar<'b, U>
-LL | | }
- | |_^
+LL | struct Foo<'b, U> {
+ | ^^^^^^^^^^^^^^^^^
|
= note: U: 'b
error: rustc_outlives
--> $DIR/explicit-union.rs:5:1
|
-LL | / union Foo<'b, U: Copy> {
-LL | | bar: Bar<'b, U>
-LL | | }
- | |_^
+LL | union Foo<'b, U: Copy> {
+ | ^^^^^^^^^^^^^^^^^^^^^^
|
= note: U: 'b
error: rustc_outlives
--> $DIR/nested-enum.rs:4:1
|
-LL | / enum Foo<'a, T> {
-LL | |
-LL | | One(Bar<'a, T>)
-LL | | }
- | |_^
+LL | enum Foo<'a, T> {
+ | ^^^^^^^^^^^^^^^
|
= note: T: 'a
error: rustc_outlives
--> $DIR/nested-regions.rs:4:1
|
-LL | / struct Foo<'a, 'b, T> {
-LL | | x: &'a &'b T
-LL | | }
- | |_^
+LL | struct Foo<'a, 'b, T> {
+ | ^^^^^^^^^^^^^^^^^^^^^
|
= note: 'b: 'a
= note: T: 'a
error: rustc_outlives
--> $DIR/nested-structs.rs:4:1
|
-LL | / struct Foo<'a, T> {
-LL | | field1: Bar<'a, T>
-LL | | }
- | |_^
+LL | struct Foo<'a, T> {
+ | ^^^^^^^^^^^^^^^^^
|
= note: T: 'a
error: rustc_outlives
--> $DIR/nested-union.rs:5:1
|
-LL | / union Foo<'a, T: Copy> {
-LL | | field1: Bar<'a, T>
-LL | | }
- | |_^
+LL | union Foo<'a, T: Copy> {
+ | ^^^^^^^^^^^^^^^^^^^^^^
|
= note: T: 'a
error: rustc_outlives
--> $DIR/projection.rs:4:1
|
-LL | / struct Foo<'a, T: Iterator> {
-LL | | bar: &'a T::Item
-LL | | }
- | |_^
+LL | struct Foo<'a, T: Iterator> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: <T as Iterator>::Item: 'a
error: rustc_outlives
--> $DIR/reference.rs:4:1
|
-LL | / struct Foo<'a, T> {
-LL | | bar: &'a T,
-LL | | }
- | |_^
+LL | struct Foo<'a, T> {
+ | ^^^^^^^^^^^^^^^^^
|
= note: T: 'a
error: rustc_outlives
--> $DIR/self-dyn.rs:8:1
|
-LL | / struct Foo<'a, 'b, A>
-LL | | {
-LL | | foo: Box<dyn Trait<'a, 'b, A>>
-LL | | }
- | |_^
+LL | struct Foo<'a, 'b, A>
+ | ^^^^^^^^^^^^^^^^^^^^^
|
= note: A: 'a
error: rustc_outlives
--> $DIR/self-structs.rs:4:1
|
-LL | / struct Foo<'a, 'b, T> {
-LL | | field1: dyn Bar<'a, 'b, T>
-LL | | }
- | |_^
+LL | struct Foo<'a, 'b, T> {
+ | ^^^^^^^^^^^^^^^^^^^^^
|
= note: T: 'a
--> $DIR/type-len.rs:6:1
|
LL | struct empty;
- | ^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0075]: SIMD vector cannot be empty
--> $DIR/type-len.rs:9:1
|
LL | struct empty2([f32; 0]);
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^
error[E0076]: SIMD vector should be homogeneous
--> $DIR/type-len.rs:15:1
|
LL | struct i64f64(i64, f64);
- | ^^^^^^^^^^^^^^^^^^^^^^^^ SIMD elements must have the same type
+ | ^^^^^^^^^^^^^ SIMD elements must have the same type
error[E0077]: SIMD vector element type should be a primitive scalar (integer/float/pointer) type
--> $DIR/type-len.rs:20:1
|
LL | struct FooV(Foo, Foo);
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
error[E0077]: SIMD vector element type should be a primitive scalar (integer/float/pointer) type
--> $DIR/type-len.rs:23:1
|
LL | struct FooV2([Foo; 2]);
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0075]: SIMD vector cannot have more than 32768 elements
--> $DIR/type-len.rs:26:1
|
LL | struct TooBig([f32; 65536]);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^
error: aborting due to 6 previous errors
--> $DIR/impl-wrong-item-for-trait.rs:19:1
|
LL | const MY_CONST: u32;
- | -------------------- `MY_CONST` from trait
+ | ------------------- `MY_CONST` from trait
...
LL | impl Foo for FooMethodForConst {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `MY_CONST` in implementation
note: the following trait must be implemented
--> $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
-LL | / pub trait Add<Rhs = Self> {
-LL | | /// The resulting type after applying the `+` operator.
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-LL | | type Output;
-... |
-LL | | fn add(self, rhs: Rhs) -> Self::Output;
-LL | | }
- | |_^
+LL | pub trait Add<Rhs = Self> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0369]: cannot add `String` to `&str`
--> $DIR/issue-39018.rs:11:22
|
LL | / struct
LL | | ListNode
-LL | | {
-LL | | head: u8,
-LL | | tail: Option<ListNode>,
- | | ---------------- recursive without indirection
-LL | | }
- | |_^ recursive type has infinite size
+ | |________^ recursive type has infinite size
+...
+LL | tail: Option<ListNode>,
+ | ---------------- recursive without indirection
|
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `ListNode` representable
|
error: expected one of `!` or `::`, found `error`
--> $DIR/auxiliary/transitive_dep_three.rs:6:27
|
-LL | / macro_rules! parse_error {
-LL | | () => { parse error }
- | | ^^^^^ expected one of `!` or `::`
-LL | | }
- | |_________- in this expansion of `transitive_dep_two::parse_error!`
+LL | macro_rules! parse_error {
+ | ------------------------ in this expansion of `transitive_dep_two::parse_error!`
+LL | () => { parse error }
+ | ^^^^^ expected one of `!` or `::`
|
::: $DIR/transitive-dep-span.rs:13:1
|
-LL | transitive_dep_two::parse_error!();
- | ----------------------------------
- | |
- | in this macro invocation
- | in this macro invocation
+LL | transitive_dep_two::parse_error!();
+ | ----------------------------------
+ | |
+ | in this macro invocation
+ | in this macro invocation
error: aborting due to previous error
error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default`
--> $DIR/specialization-no-default.rs:20:5
|
-LL | / impl<T> Foo for T {
-LL | | fn foo(&self) {}
-LL | | fn bar(&self) {}
-LL | | }
- | |_- parent `impl` is here
+LL | impl<T> Foo for T {
+ | ----------------- parent `impl` is here
...
-LL | fn foo(&self) {}
- | ^^^^^^^^^^^^^^^^ cannot specialize default item `foo`
+LL | fn foo(&self) {}
+ | ^^^^^^^^^^^^^^^^ cannot specialize default item `foo`
|
= note: to specialize, `foo` in the parent `impl` must be marked `default`
error[E0520]: `bar` specializes an item from a parent `impl`, but that item is not marked `default`
--> $DIR/specialization-no-default.rs:23:5
|
-LL | / impl<T> Foo for T {
-LL | | fn foo(&self) {}
-LL | | fn bar(&self) {}
-LL | | }
- | |_- parent `impl` is here
+LL | impl<T> Foo for T {
+ | ----------------- parent `impl` is here
...
-LL | fn bar(&self) {}
- | ^^^^^^^^^^^^^^^^ cannot specialize default item `bar`
+LL | fn bar(&self) {}
+ | ^^^^^^^^^^^^^^^^ cannot specialize default item `bar`
|
= note: to specialize, `bar` in the parent `impl` must be marked `default`
error[E0520]: `T` specializes an item from a parent `impl`, but that item is not marked `default`
--> $DIR/specialization-no-default.rs:37:5
|
-LL | / impl<T> Bar for T {
-LL | | type T = u8;
-LL | | }
- | |_- parent `impl` is here
+LL | impl<T> Bar for T {
+ | ----------------- parent `impl` is here
...
-LL | type T = ();
- | ^^^^^^^^^^^^ cannot specialize default item `T`
+LL | type T = ();
+ | ^^^^^^^^^^^^ cannot specialize default item `T`
|
= note: to specialize, `T` in the parent `impl` must be marked `default`
error[E0520]: `baz` specializes an item from a parent `impl`, but that item is not marked `default`
--> $DIR/specialization-no-default.rs:55:5
|
-LL | / impl<T: Clone> Baz for T {
-LL | | fn baz(&self) {}
-LL | | }
- | |_- parent `impl` is here
+LL | impl<T: Clone> Baz for T {
+ | ------------------------ parent `impl` is here
...
-LL | fn baz(&self) {}
- | ^^^^^^^^^^^^^^^^ cannot specialize default item `baz`
+LL | fn baz(&self) {}
+ | ^^^^^^^^^^^^^^^^ cannot specialize default item `baz`
|
= note: to specialize, `baz` in the parent `impl` must be marked `default`
error[E0520]: `redundant` specializes an item from a parent `impl`, but that item is not marked `default`
--> $DIR/specialization-no-default.rs:74:5
|
-LL | / impl<T: Clone> Redundant for T {
-LL | | fn redundant(&self) {}
-LL | | }
- | |_- parent `impl` is here
+LL | impl<T: Clone> Redundant for T {
+ | ------------------------------ parent `impl` is here
...
-LL | fn redundant(&self) {}
- | ^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `redundant`
+LL | fn redundant(&self) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `redundant`
|
= note: to specialize, `redundant` in the parent `impl` must be marked `default`
--> $DIR/specialization-trait-not-implemented.rs:22:29
|
LL | struct MyStruct;
- | ----------------
+ | ---------------
| | |
| | method `foo_one` not found for this struct
| doesn't satisfy `MyStruct: Foo`
| ^^^^^^^ method cannot be called on `MyStruct` due to unsatisfied trait bounds
|
note: trait bound `MyStruct: Foo` was not satisfied
- --> $DIR/specialization-trait-not-implemented.rs:14:17
+ --> $DIR/specialization-trait-not-implemented.rs:14:1
|
LL | default impl<T> Foo for T {
- | ^^^ ^
+ | ^^^^^^^^^^^^^^^^---^^^^^-
+ | |
+ | unsatisfied trait bound introduced here
note: the following trait must be implemented
--> $DIR/specialization-trait-not-implemented.rs:7:1
|
-LL | / trait Foo {
-LL | | fn foo_one(&self) -> &'static str;
-LL | | fn foo_two(&self) -> &'static str;
-LL | | }
- | |_^
+LL | trait Foo {
+ | ^^^^^^^^^
= help: items from traits can only be used if the trait is implemented and in scope
note: `Foo` defines an item `foo_one`, perhaps you need to implement it
--> $DIR/specialization-trait-not-implemented.rs:7:1
error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default`
--> $DIR/issue-50452-fail.rs:10:5
|
-LL | fn foo() {}
- | ^^^^^^^^^^^ cannot specialize default item `foo`
+LL | fn foo() {}
+ | ^^^^^^^^^^^ cannot specialize default item `foo`
...
-LL | / impl<T> Foo for T {
-LL | | fn foo() {}
-LL | | }
- | |_- parent `impl` is here
+LL | impl<T> Foo for T {
+ | ----------------- parent `impl` is here
|
= note: to specialize, `foo` in the parent `impl` must be marked `default`
error[E0119]: conflicting implementations of trait `IntoPyDictPointer` for type `()`
--> $DIR/issue-52050.rs:28:1
|
-LL | / impl<I> IntoPyDictPointer for I
-LL | | where
-LL | | I: Iterator,
-LL | | {
-LL | | }
- | |_- first implementation here
-LL |
-LL | impl IntoPyDictPointer for ()
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `()`
+LL | impl<I> IntoPyDictPointer for I
+ | ------------------------------- first implementation here
+...
+LL | impl IntoPyDictPointer for ()
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `()`
|
= note: upstream crates may add a new impl of trait `std::iter::Iterator` for type `()` in future versions
error: specializing impl repeats parameter `T`
--> $DIR/dyn-trait-assoc-types.rs:22:1
|
-LL | / impl<'a, T> Specializable for dyn B<T, Y = T> + 'a {
-LL | |
-LL | | fn f() {}
-LL | | }
- | |_^
+LL | impl<'a, T> Specializable for dyn B<T, Y = T> + 'a {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: specializing impl repeats parameter `T`
--> $DIR/dyn-trait-assoc-types.rs:27:1
|
-LL | / impl<'a, T> Specializable for dyn C<Y = (T, T)> + 'a {
-LL | |
-LL | | fn f() {}
-LL | | }
- | |_^
+LL | impl<'a, T> Specializable for dyn C<Y = (T, T)> + 'a {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
error: cannot specialize on `Binder(ProjectionPredicate(ProjectionTy { substs: [V], item_def_id: DefId(0:6 ~ repeated_projection_type[54ea]::Id::This) }, Ty((I,))), [])`
--> $DIR/repeated_projection_type.rs:19:1
|
-LL | / impl<I, V: Id<This = (I,)>> X for V {
-LL | |
-LL | | fn f() {}
-LL | | }
- | |_^
+LL | impl<I, V: Id<This = (I,)>> X for V {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
error: specializing impl repeats parameter `'a`
--> $DIR/repeating_lifetimes.rs:14:1
|
-LL | / impl<'a> X for (&'a u8, &'a u8) {
-LL | |
-LL | | fn f() {}
-LL | | }
- | |_^
+LL | impl<'a> X for (&'a u8, &'a u8) {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
error: specializing impl repeats parameter `T`
--> $DIR/repeating_param.rs:12:1
|
-LL | / impl<T> X for (T, T) {
-LL | |
-LL | | fn f() {}
-LL | | }
- | |_^
+LL | impl<T> X for (T, T) {
+ | ^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
error: cannot specialize on trait `HasMethod`
--> $DIR/spec-marker-supertraits.rs:22:1
|
-LL | / impl<T: Marker> Spec for T {
-LL | |
-LL | | fn spec_me(&self) {
-LL | | self.method();
-LL | | }
-LL | | }
- | |_^
+LL | impl<T: Marker> Spec for T {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
--> $DIR/specialization_marker.rs:13:5
|
LL | type X;
- | ^^^^^^^
+ | ^^^^^^
error: aborting due to 2 previous errors
error: cannot specialize on trait `Default`
--> $DIR/specialization_super_trait.rs:13:1
|
-LL | / impl<T: Default> SpecMarker for T {
-LL | |
-LL | | fn f() {}
-LL | | }
- | |_^
+LL | impl<T: Default> SpecMarker for T {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
error: cannot specialize on `'static` lifetime
--> $DIR/specialization_trait.rs:11:1
|
-LL | / impl SpecMarker for &'static u8 {
-LL | |
-LL | | fn f() {}
-LL | | }
- | |_^
+LL | impl SpecMarker for &'static u8 {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: specializing impl repeats parameter `T`
--> $DIR/specialization_trait.rs:16:1
|
-LL | / impl<T> SpecMarker for (T, T) {
-LL | |
-LL | | fn f() {}
-LL | | }
- | |_^
+LL | impl<T> SpecMarker for (T, T) {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: cannot specialize on trait `Clone`
--> $DIR/specialization_trait.rs:21:1
|
-LL | / impl<T: Clone> SpecMarker for [T] {
-LL | |
-LL | | fn f() {}
-LL | | }
- | |_^
+LL | impl<T: Clone> SpecMarker for [T] {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 3 previous errors
error: cannot specialize on `'static` lifetime
--> $DIR/specialize_on_static.rs:13:1
|
-LL | / impl X for &'static u8 {
-LL | |
-LL | | fn f() {}
-LL | | }
- | |_^
+LL | impl X for &'static u8 {
+ | ^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
error: cannot specialize on trait `SpecMarker`
--> $DIR/specialize_on_trait.rs:15:1
|
-LL | / impl<T: SpecMarker> X for T {
-LL | |
-LL | | fn f() {}
-LL | | }
- | |_^
+LL | impl<T: SpecMarker> X for T {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
error[E0520]: `Ty` specializes an item from a parent `impl`, but that item is not marked `default`
--> $DIR/non-defaulted-item-fail.rs:30:5
|
-LL | / impl<T> Foo for Box<T> {
-LL | | type Ty = bool;
-LL | | const CONST: u8 = 0;
-LL | | fn foo(&self) -> bool { false }
-LL | | }
- | |_- parent `impl` is here
+LL | impl<T> Foo for Box<T> {
+ | ---------------------- parent `impl` is here
...
-LL | type Ty = Vec<()>;
- | ^^^^^^^^^^^^^^^^^^ cannot specialize default item `Ty`
+LL | type Ty = Vec<()>;
+ | ^^^^^^^^^^^^^^^^^^ cannot specialize default item `Ty`
|
= note: to specialize, `Ty` in the parent `impl` must be marked `default`
error[E0520]: `CONST` specializes an item from a parent `impl`, but that item is not marked `default`
--> $DIR/non-defaulted-item-fail.rs:32:5
|
-LL | / impl<T> Foo for Box<T> {
-LL | | type Ty = bool;
-LL | | const CONST: u8 = 0;
-LL | | fn foo(&self) -> bool { false }
-LL | | }
- | |_- parent `impl` is here
+LL | impl<T> Foo for Box<T> {
+ | ---------------------- parent `impl` is here
...
-LL | const CONST: u8 = 42;
- | ^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `CONST`
+LL | const CONST: u8 = 42;
+ | ^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `CONST`
|
= note: to specialize, `CONST` in the parent `impl` must be marked `default`
error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default`
--> $DIR/non-defaulted-item-fail.rs:34:5
|
-LL | / impl<T> Foo for Box<T> {
-LL | | type Ty = bool;
-LL | | const CONST: u8 = 0;
-LL | | fn foo(&self) -> bool { false }
-LL | | }
- | |_- parent `impl` is here
+LL | impl<T> Foo for Box<T> {
+ | ---------------------- parent `impl` is here
...
-LL | fn foo(&self) -> bool { true }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo`
+LL | fn foo(&self) -> bool { true }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo`
|
= note: to specialize, `foo` in the parent `impl` must be marked `default`
--> $DIR/non-defaulted-item-fail.rs:46:5
|
LL | impl<T> Foo for Vec<T> {}
- | ------------------------- parent `impl` is here
+ | ---------------------- parent `impl` is here
...
LL | type Ty = Vec<()>;
| ^^^^^^^^^^^^^^^^^^ cannot specialize default item `Ty`
--> $DIR/non-defaulted-item-fail.rs:48:5
|
LL | impl<T> Foo for Vec<T> {}
- | ------------------------- parent `impl` is here
+ | ---------------------- parent `impl` is here
...
LL | const CONST: u8 = 42;
| ^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `CONST`
--> $DIR/non-defaulted-item-fail.rs:50:5
|
LL | impl<T> Foo for Vec<T> {}
- | ------------------------- parent `impl` is here
+ | ---------------------- parent `impl` is here
...
LL | fn foo(&self) -> bool { true }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo`
error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default`
--> $DIR/specialization-no-default.rs:20:5
|
-LL | / impl<T> Foo for T {
-LL | | fn foo(&self) {}
-LL | | fn bar(&self) {}
-LL | | }
- | |_- parent `impl` is here
+LL | impl<T> Foo for T {
+ | ----------------- parent `impl` is here
...
-LL | fn foo(&self) {}
- | ^^^^^^^^^^^^^^^^ cannot specialize default item `foo`
+LL | fn foo(&self) {}
+ | ^^^^^^^^^^^^^^^^ cannot specialize default item `foo`
|
= note: to specialize, `foo` in the parent `impl` must be marked `default`
error[E0520]: `bar` specializes an item from a parent `impl`, but that item is not marked `default`
--> $DIR/specialization-no-default.rs:23:5
|
-LL | / impl<T> Foo for T {
-LL | | fn foo(&self) {}
-LL | | fn bar(&self) {}
-LL | | }
- | |_- parent `impl` is here
+LL | impl<T> Foo for T {
+ | ----------------- parent `impl` is here
...
-LL | fn bar(&self) {}
- | ^^^^^^^^^^^^^^^^ cannot specialize default item `bar`
+LL | fn bar(&self) {}
+ | ^^^^^^^^^^^^^^^^ cannot specialize default item `bar`
|
= note: to specialize, `bar` in the parent `impl` must be marked `default`
error[E0520]: `T` specializes an item from a parent `impl`, but that item is not marked `default`
--> $DIR/specialization-no-default.rs:37:5
|
-LL | / impl<T> Bar for T {
-LL | | type T = u8;
-LL | | }
- | |_- parent `impl` is here
+LL | impl<T> Bar for T {
+ | ----------------- parent `impl` is here
...
-LL | type T = ();
- | ^^^^^^^^^^^^ cannot specialize default item `T`
+LL | type T = ();
+ | ^^^^^^^^^^^^ cannot specialize default item `T`
|
= note: to specialize, `T` in the parent `impl` must be marked `default`
error[E0520]: `baz` specializes an item from a parent `impl`, but that item is not marked `default`
--> $DIR/specialization-no-default.rs:55:5
|
-LL | / impl<T: Clone> Baz for T {
-LL | | fn baz(&self) {}
-LL | | }
- | |_- parent `impl` is here
+LL | impl<T: Clone> Baz for T {
+ | ------------------------ parent `impl` is here
...
-LL | fn baz(&self) {}
- | ^^^^^^^^^^^^^^^^ cannot specialize default item `baz`
+LL | fn baz(&self) {}
+ | ^^^^^^^^^^^^^^^^ cannot specialize default item `baz`
|
= note: to specialize, `baz` in the parent `impl` must be marked `default`
error[E0520]: `redundant` specializes an item from a parent `impl`, but that item is not marked `default`
--> $DIR/specialization-no-default.rs:74:5
|
-LL | / impl<T: Clone> Redundant for T {
-LL | | fn redundant(&self) {}
-LL | | }
- | |_- parent `impl` is here
+LL | impl<T: Clone> Redundant for T {
+ | ------------------------------ parent `impl` is here
...
-LL | default fn redundant(&self) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `redundant`
+LL | default fn redundant(&self) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `redundant`
|
= note: to specialize, `redundant` in the parent `impl` must be marked `default`
--> $DIR/auxiliary/static_priv_by_default.rs:3:1
|
LL | static private: isize = 0;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
--> $DIR/uninhabited-static.rs:12:1
|
LL | static VOID2: Void = unsafe { std::mem::transmute(()) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #74840 <https://github.com/rust-lang/rust/issues/74840>
--> $DIR/uninhabited-static.rs:16:1
|
LL | static NEVER2: Void = unsafe { std::mem::transmute(()) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #74840 <https://github.com/rust-lang/rust/issues/74840>
::: $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
LL | pub macro test($item:item) {
- | -------------------------- similarly named attribute macro `test` defined here
+ | -------------- similarly named attribute macro `test` defined here
error: cannot find attribute `deprcated` in this scope
--> $DIR/attribute-typos.rs:1:3
--> $DIR/const-in-struct-pat.rs:8:17
|
LL | struct foo;
- | ----------- unit struct defined here
+ | ---------- unit struct defined here
...
LL | let Thing { foo } = t;
| ^^^ - this expression has type `Thing`
| help: introduce a variable instead: `a_var`
...
LL | const A: i32 = 2;
- | ----------------- constant defined here
+ | ------------ constant defined here
|
= note: the matched value is of type `i32`
note: the following trait must be implemented
--> $SRC_DIR/core/src/default.rs:LL:COL
|
-LL | / pub trait Default: Sized {
-LL | | /// Returns the "default value" for a type.
-LL | | ///
-LL | | /// Default values are often some kind of initial value, identity value, or anything else that
-... |
-LL | | fn default() -> Self;
-LL | | }
- | |_^
+LL | pub trait Default: Sized {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
help: consider annotating `Enum` with `#[derive(Clone)]`
|
LL | #[derive(Clone)]
::: $SRC_DIR/std/src/time.rs:LL:COL
|
LL | pub struct Instant(time::Instant);
- | ---------------------------------- doesn't satisfy `Instant: Default`
+ | ------------------ doesn't satisfy `Instant: Default`
|
::: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
|
--> $DIR/fn-or-tuple-struct-without-args.rs:30:16
|
LL | struct S(usize, usize);
- | ----------------------- fn(usize, usize) -> S {S} defined here
+ | -------- fn(usize, usize) -> S {S} defined here
...
LL | let _: S = S;
| - ^ expected struct `S`, found fn item
--> $DIR/fn-or-tuple-struct-without-args.rs:32:16
|
LL | struct V();
- | ----------- fn() -> V {V} defined here
+ | -------- fn() -> V {V} defined here
...
LL | let _: V = V;
| - ^ expected struct `V`, found fn item
--> $DIR/invalid-bin-op.rs:5:1
|
LL | struct S<T>(T);
- | ^^^^^^^^^^^^^^^ must implement `PartialEq<_>`
+ | ^^^^^^^^^^^ must implement `PartialEq<_>`
help: consider annotating `S<T>` with `#[derive(PartialEq)]`
|
LL | #[derive(PartialEq)]
--> $DIR/missing-assoc-fn-applicable-suggestions.rs:15:1
|
LL | type Type;
- | ---------- `Type` from trait
+ | --------- `Type` from trait
LL | fn bar<T>(_: T) -> Self;
| ------------------------ `bar` from trait
LL | fn baz<T>(_: T) -> Self where T: TraitB, <T as TraitB>::Item: Copy;
--> $DIR/suggest-trait-items.rs:11:1
|
LL | type Type;
- | ---------- `Type` from trait
+ | --------- `Type` from trait
LL |
LL | fn foo();
| --------- `foo` from trait
--> $DIR/suggest-trait-items.rs:40:1
|
LL | const Const: i32;
- | ----------------- `Const` from trait
+ | ---------------- `Const` from trait
...
LL | impl Bar for B {
| ^^^^^^^^^^^^^^ missing `Const` in implementation
--> $DIR/use-type-argument-instead-of-assoc-type.rs:7:16
|
LL | type A;
- | ------- `A` defined here
+ | ------ `A` defined here
LL | type B;
LL | type C;
- | ------- `C` defined here
+ | ------ `C` defined here
...
LL | i: Box<dyn T<usize, usize, usize, usize, B=usize>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ associated types `A`, `C` must be specified
--> $DIR/only-maybe-bound.rs:13:12
|
LL | trait _1 = _0;
- | -------------- this alias does not contain a trait
+ | -------- this alias does not contain a trait
...
LL | type _T0 = dyn _1;
| ^^^^^^
--> $DIR/only-maybe-bound.rs:19:12
|
LL | trait _2 = _1 + _1;
- | ------------------- this alias does not contain a trait
+ | -------- this alias does not contain a trait
LL |
LL | type _T1 = dyn _2;
| ^^^^^^
--> $DIR/auxiliary/crate_a2.rs:5:1
|
LL | impl Bar for Foo {}
- | ^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^
= note: perhaps two different versions of crate `crate_a2` are being used?
= help: the trait `main::a::Bar` is implemented for `ImplementsTraitForUsize<usize>`
note: required by a bound in `try_foo`
--> $DIR/auxiliary/crate_a2.rs:13:1
|
LL | impl Bar for ImplementsWrongTraitConditionally<isize> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: perhaps two different versions of crate `crate_a2` are being used?
= help: the trait `main::a::Bar` is implemented for `ImplementsTraitForUsize<usize>`
note: required by a bound in `try_foo`
--> $DIR/copy-impl-cannot-normalize.rs:22:1
|
LL | impl<T> Copy for Foo<T> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `TraitFoo` is not implemented for `T`
+ | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `TraitFoo` is not implemented for `T`
|
help: consider restricting type parameter `T`
|
LL | impl Trait5 for dyn Send {}
| ------------------------ first implementation here
LL | impl Trait5 for dyn Send where u32: Copy {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)`
error: aborting due to 8 previous errors
--> $DIR/issue-65673.rs:9:16
|
LL | trait Alias<T> = where T: Trait;
- | -------------------------------- this alias does not contain a trait
+ | -------------- this alias does not contain a trait
...
LL | type Ctx = dyn Alias<T>;
| ^^^^^^^^^^^^
--> $DIR/issue-71036.rs:11:1
|
LL | impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Foo<'a, U>> for Foo<'a, T> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unsize<&'a U>` is not implemented for `&'a T`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unsize<&'a U>` is not implemented for `&'a T`
|
= note: all implementations of `Unsize` are provided automatically by the compiler, see <https://doc.rust-lang.org/stable/std/marker/trait.Unsize.html> for more information
= note: required because of the requirements on the impl of `DispatchFromDyn<&'a &'a U>` for `&'a &'a T`
--> $DIR/issue-78372.rs:3:1
|
LL | impl<T> DispatchFromDyn<Smaht<U, MISC>> for T {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 6 previous errors
--> $DIR/item-privacy.rs:101:14
|
LL | const A: u8 = 0;
- | ---------------- private associated constant defined here
+ | ----------- private associated constant defined here
...
LL | <dyn C>::A;
| ^ private associated constant
--> $DIR/with-self-in-projection-output-bad.rs:45:21
|
LL | type Output;
- | ------------ `Output` defined here
+ | ----------- `Output` defined here
...
LL | let _x: Box<dyn Helper<Target=i32>> = Box::new(2u32);
| ^^^^^^^^^^^^^^^^^^ help: specify the associated type: `Helper<Target=i32, Output = Type>`
--> $DIR/with-self-in-projection-output-bad.rs:48:21
|
LL | type Output;
- | ------------ `Output` defined here
+ | ----------- `Output` defined here
...
LL | let _y: Box<dyn NormalizableHelper<Target=i32>> = Box::new(2u32);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: specify the associated type: `NormalizableHelper<Target=i32, Output = Type>`
]
--> $DIR/vtable-diamond.rs:21:1
|
-LL | / trait D: B + C {
-LL | |
-LL | | fn foo_d(&self) {}
-LL | | }
- | |_^
+LL | trait D: B + C {
+ | ^^^^^^^^^^^^^^
error: vtable entries for `<S as C>`: [
MetadataDropInPlace,
]
--> $DIR/vtable-diamond.rs:15:1
|
-LL | / trait C: A {
-LL | |
-LL | | fn foo_c(&self) {}
-LL | | }
- | |_^
+LL | trait C: A {
+ | ^^^^^^^^^^
error: aborting due to 2 previous errors
]
--> $DIR/vtable-multi-level.rs:95:1
|
-LL | / trait O: G + N {
-LL | |
-LL | | fn foo_o(&self) {}
-LL | | }
- | |_^
+LL | trait O: G + N {
+ | ^^^^^^^^^^^^^^
error: vtable entries for `<S as B>`: [
MetadataDropInPlace,
]
--> $DIR/vtable-multi-level.rs:19:1
|
-LL | / trait B {
-LL | |
-LL | | fn foo_b(&self) {}
-LL | | }
- | |_^
+LL | trait B {
+ | ^^^^^^^
error: vtable entries for `<S as D>`: [
MetadataDropInPlace,
]
--> $DIR/vtable-multi-level.rs:30:1
|
-LL | / trait D {
-LL | |
-LL | | fn foo_d(&self) {}
-LL | | }
- | |_^
+LL | trait D {
+ | ^^^^^^^
error: vtable entries for `<S as E>`: [
MetadataDropInPlace,
]
--> $DIR/vtable-multi-level.rs:36:1
|
-LL | / trait E {
-LL | |
-LL | | fn foo_e(&self) {}
-LL | | }
- | |_^
+LL | trait E {
+ | ^^^^^^^
error: vtable entries for `<S as F>`: [
MetadataDropInPlace,
]
--> $DIR/vtable-multi-level.rs:42:1
|
-LL | / trait F: D + E {
-LL | |
-LL | | fn foo_f(&self) {}
-LL | | }
- | |_^
+LL | trait F: D + E {
+ | ^^^^^^^^^^^^^^
error: vtable entries for `<S as H>`: [
MetadataDropInPlace,
]
--> $DIR/vtable-multi-level.rs:53:1
|
-LL | / trait H {
-LL | |
-LL | | fn foo_h(&self) {}
-LL | | }
- | |_^
+LL | trait H {
+ | ^^^^^^^
error: vtable entries for `<S as I>`: [
MetadataDropInPlace,
]
--> $DIR/vtable-multi-level.rs:59:1
|
-LL | / trait I {
-LL | |
-LL | | fn foo_i(&self) {}
-LL | | }
- | |_^
+LL | trait I {
+ | ^^^^^^^
error: vtable entries for `<S as J>`: [
MetadataDropInPlace,
]
--> $DIR/vtable-multi-level.rs:65:1
|
-LL | / trait J: H + I {
-LL | |
-LL | | fn foo_j(&self) {}
-LL | | }
- | |_^
+LL | trait J: H + I {
+ | ^^^^^^^^^^^^^^
error: vtable entries for `<S as K>`: [
MetadataDropInPlace,
]
--> $DIR/vtable-multi-level.rs:71:1
|
-LL | / trait K {
-LL | |
-LL | | fn foo_k(&self) {}
-LL | | }
- | |_^
+LL | trait K {
+ | ^^^^^^^
error: vtable entries for `<S as L>`: [
MetadataDropInPlace,
]
--> $DIR/vtable-multi-level.rs:77:1
|
-LL | / trait L {
-LL | |
-LL | | fn foo_l(&self) {}
-LL | | }
- | |_^
+LL | trait L {
+ | ^^^^^^^
error: vtable entries for `<S as M>`: [
MetadataDropInPlace,
]
--> $DIR/vtable-multi-level.rs:83:1
|
-LL | / trait M: K + L {
-LL | |
-LL | | fn foo_m(&self) {}
-LL | | }
- | |_^
+LL | trait M: K + L {
+ | ^^^^^^^^^^^^^^
error: vtable entries for `<S as N>`: [
MetadataDropInPlace,
]
--> $DIR/vtable-multi-level.rs:89:1
|
-LL | / trait N: J + M {
-LL | |
-LL | | fn foo_n(&self) {}
-LL | | }
- | |_^
+LL | trait N: J + M {
+ | ^^^^^^^^^^^^^^
error: aborting due to 12 previous errors
]
--> $DIR/vtable-multiple.rs:16:1
|
-LL | / trait C: A + B {
-LL | |
-LL | | fn foo_c(&self) {}
-LL | | }
- | |_^
+LL | trait C: A + B {
+ | ^^^^^^^^^^^^^^
error: vtable entries for `<S as B>`: [
MetadataDropInPlace,
]
--> $DIR/vtable-multiple.rs:10:1
|
-LL | / trait B {
-LL | |
-LL | | fn foo_b(&self) {}
-LL | | }
- | |_^
+LL | trait B {
+ | ^^^^^^^
error: aborting due to 2 previous errors
--> $DIR/vtable-non-object-safe.rs:8:1
|
LL | trait A: Iterator {}
- | ^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^
error: aborting due to previous error
]
--> $DIR/vtable-vacant.rs:15:1
|
-LL | / trait B: A {
-LL | |
-LL | | fn foo_b1(&self) {}
-LL | | fn foo_b2(&self) where Self: Send {}
-LL | | }
- | |_^
+LL | trait B: A {
+ | ^^^^^^^^^^
error: aborting due to previous error
--> $DIR/enum-variant-priority-lint-ambiguous_associated_items.rs:26:5
|
LL | type V;
- | ^^^^^^^
+ | ^^^^^^
error: ambiguous associated item
--> $DIR/enum-variant-priority-lint-ambiguous_associated_items.rs:32:15
--> $DIR/enum-variant-priority-lint-ambiguous_associated_items.rs:26:5
|
LL | type V;
- | ^^^^^^^
+ | ^^^^^^
error: aborting due to 2 previous errors
--> $DIR/issue-53092-2.rs:6:1
|
LL | const CONST_BUG: Bug<u8, ()> = unsafe { std::mem::transmute(|_: u8| ()) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: ...which requires computing layout of `Bug<u8, ()>`...
= note: ...which requires normalizing `Bug<u8, ()>`...
= note: ...which again requires computing type of `Bug::{opaque#0}`, completing the cycle
--> $DIR/type-ascription-precedence.rs:9:1
|
LL | struct Z;
- | ^^^^^^^^^ must implement `std::ops::Neg`
+ | ^^^^^^^^ must implement `std::ops::Neg`
note: the following trait must be implemented
--> $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
-LL | / pub trait Neg {
-LL | | /// The resulting type after applying the `-` operator.
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-LL | | type Output;
-... |
-LL | | fn neg(self) -> Self::Output;
-LL | | }
- | |_^
+LL | pub trait Neg {
+ | ^^^^^^^^^^^^^
error[E0308]: mismatched types
--> $DIR/type-ascription-precedence.rs:45:5
error[E0393]: the type parameter `T` must be explicitly specified
--> $DIR/type-parameter-defaults-referencing-Self.rs:8:16
|
-LL | / trait Foo<T=Self> {
-LL | | fn method(&self);
-LL | | }
- | |_- type parameter `T` must be specified for this
-LL |
-LL | fn foo(x: &dyn Foo) { }
- | ^^^ help: set the type parameter to the desired type: `Foo<T>`
+LL | trait Foo<T=Self> {
+ | ----------------- type parameter `T` must be specified for this
+...
+LL | fn foo(x: &dyn Foo) { }
+ | ^^^ help: set the type parameter to the desired type: `Foo<T>`
|
= note: because of the default `Self` reference, type parameters must be specified on object types
error[E0308]: mismatched types
--> $DIR/type-params-in-different-spaces-1.rs:5:17
|
-LL | / trait BrokenAdd: Copy + Add<Output=Self> {
-LL | | fn broken_add<T>(&self, rhs: T) -> Self {
- | | - found type parameter
-LL | | *self + rhs
- | | ^^^ expected type parameter `Self`, found type parameter `T`
-LL | |
-... |
-LL | | }
-LL | | }
- | |_- expected type parameter
+LL | trait BrokenAdd: Copy + Add<Output=Self> {
+ | ---------------------------------------- expected type parameter
+LL | fn broken_add<T>(&self, rhs: T) -> Self {
+ | - found type parameter
+LL | *self + rhs
+ | ^^^ expected type parameter `Self`, found type parameter `T`
|
= note: expected type parameter `Self`
found type parameter `T`
error[E0308]: mismatched types
--> $DIR/type-params-in-different-spaces-3.rs:3:9
|
-LL | / trait Tr : Sized {
-LL | | fn test<X>(u: X) -> Self {
- | | - ---- expected `Self` because of return type
- | | |
- | | found type parameter
-LL | | u
- | | ^ expected type parameter `Self`, found type parameter `X`
-LL | | }
-LL | | }
- | |_- expected type parameter
+LL | trait Tr : Sized {
+ | ---------------- expected type parameter
+LL | fn test<X>(u: X) -> Self {
+ | - ---- expected `Self` because of return type
+ | |
+ | found type parameter
+LL | u
+ | ^ expected type parameter `Self`, found type parameter `X`
|
= note: expected type parameter `Self`
found type parameter `X`
--> $DIR/type-recursive.rs:16:1
|
LL | struct T4(Option<T4>);
- | ^^^^^^^^^^----------^^
- | | |
- | | recursive without indirection
+ | ^^^^^^^^^ ---------- recursive without indirection
+ | |
| recursive type has infinite size
|
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `T4` representable
note: `Result<u32, &Void>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
|
-LL | / pub enum Result<T, E> {
-LL | | /// Contains the success value
-LL | | #[lang = "Ok"]
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-... |
-LL | | Err(#[stable(feature = "rust1", since = "1.0.0")] E),
- | | ^^^ not covered
-LL | | }
- | |_-
+LL | pub enum Result<T, E> {
+ | ---------------------
+...
+LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E),
+ | ^^^ not covered
= note: the matched value is of type `Result<u32, &Void>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
note: `Result<u32, Void>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
|
-LL | / pub enum Result<T, E> {
-LL | | /// Contains the success value
-LL | | #[lang = "Ok"]
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-... |
-LL | | Err(#[stable(feature = "rust1", since = "1.0.0")] E),
- | | ^^^ not covered
-LL | | }
- | |_-
+LL | pub enum Result<T, E> {
+ | ---------------------
+...
+LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E),
+ | ^^^ not covered
= note: the matched value is of type `Result<u32, Void>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
note: `Result<u32, Void>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
|
-LL | / pub enum Result<T, E> {
-LL | | /// Contains the success value
-LL | | #[lang = "Ok"]
-LL | | #[stable(feature = "rust1", since = "1.0.0")]
-... |
-LL | | Err(#[stable(feature = "rust1", since = "1.0.0")] E),
- | | ^^^ not covered
-LL | | }
- | |_-
+LL | pub enum Result<T, E> {
+ | ---------------------
+...
+LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E),
+ | ^^^ not covered
= note: the matched value is of type `Result<u32, Void>`
help: you might want to use `if let` to ignore the variant that isn't matched
|
| doesn't satisfy `U5<CloneNoCopy>: Clone`
...
LL | struct CloneNoCopy;
- | ------------------- doesn't satisfy `CloneNoCopy: Copy`
+ | ------------------ doesn't satisfy `CloneNoCopy: Copy`
...
LL | let w = u.clone();
| ^^^^^ method cannot be called on `U5<CloneNoCopy>` due to unsatisfied trait bounds
| doesn't satisfy `U5<CloneNoCopy>: Clone`
...
LL | struct CloneNoCopy;
- | ------------------- doesn't satisfy `CloneNoCopy: Copy`
+ | ------------------ doesn't satisfy `CloneNoCopy: Copy`
...
LL | let w = u.clone();
| ^^^^^ method cannot be called on `U5<CloneNoCopy>` due to unsatisfied trait bounds
note: the type is defined here
--> $DIR/union-repr-c.rs:9:1
|
-LL | / union W {
-LL | | a: u8,
-LL | | }
- | |_^
+LL | union W {
+ | ^^^^^^^
error: aborting due to previous error
LL | | T: ?Sized,
LL | | #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global,
LL | | >(Unique<T>, A);
- | |________________- doesn't satisfy `Box<dyn Foo>: Clone`
+ | |_- doesn't satisfy `Box<dyn Foo>: Clone`
|
= note: the following trait bounds were not satisfied:
`dyn Foo: Sized`
LL | | T: ?Sized,
LL | | #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global,
LL | | >(Unique<T>, A);
- | |________________- doesn't satisfy `Box<R>: Clone`
+ | |_- doesn't satisfy `Box<R>: Clone`
|
= note: the following trait bounds were not satisfied:
`R: Clone`
error[E0393]: the type parameter `A` must be explicitly specified
--> $DIR/unspecified-self-in-trait-ref.rs:26:13
|
-LL | / pub trait Bar<X=usize, A=Self> {
-LL | | fn foo(&self);
-LL | | }
- | |_- type parameter `A` must be specified for this
+LL | pub trait Bar<X=usize, A=Self> {
+ | ------------------------------ type parameter `A` must be specified for this
...
-LL | let e = Bar::<usize>::lol();
- | ^^^^^^^^^^^^ missing reference to `A`
+LL | let e = Bar::<usize>::lol();
+ | ^^^^^^^^^^^^ missing reference to `A`
|
= note: because of the default `Self` reference, type parameters must be specified on object types
--> $DIR/auxiliary/use-from-trait-xc.rs:9:1
|
LL | struct Foo;
- | ^^^^^^^^^^^
+ | ^^^^^^^^^^
error[E0603]: struct `Foo` is private
--> $DIR/use-from-trait-xc.rs:17:24
--> $DIR/auxiliary/use-from-trait-xc.rs:9:1
|
LL | struct Foo;
- | ^^^^^^^^^^^
+ | ^^^^^^^^^^
error: aborting due to 9 previous errors
error[E0208]: [o]
--> $DIR/variance-associated-consts.rs:13:1
|
-LL | / struct Foo<T: Trait> {
-LL | | field: [u8; <T as Trait>::Const]
-LL | | }
- | |_^
+LL | struct Foo<T: Trait> {
+ | ^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
error[E0208]: [-, +]
--> $DIR/variance-associated-types.rs:13:1
|
-LL | / struct Foo<'a, T : Trait<'a>> {
-LL | | field: (T, &'a ())
-LL | | }
- | |_^
+LL | struct Foo<'a, T : Trait<'a>> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0208]: [o, o]
--> $DIR/variance-associated-types.rs:18:1
|
-LL | / struct Bar<'a, T : Trait<'a>> {
-LL | | field: <T as Trait<'a>>::Type
-LL | | }
- | |_^
+LL | struct Bar<'a, T : Trait<'a>> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
error[E0208]: [o]
--> $DIR/variance-object-types.rs:7:1
|
-LL | / struct Foo<'a> {
-LL | | x: Box<dyn Fn(i32) -> &'a i32 + 'static>
-LL | | }
- | |_^
+LL | struct Foo<'a> {
+ | ^^^^^^^^^^^^^^
error: aborting due to previous error
error[E0208]: [-, -, -]
--> $DIR/variance-regions-direct.rs:9:1
|
-LL | / struct Test2<'a, 'b, 'c> {
-LL | | x: &'a isize,
-LL | | y: &'b [isize],
-LL | | c: &'c str
-LL | | }
- | |_^
+LL | struct Test2<'a, 'b, 'c> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
error[E0208]: [+, +, +]
--> $DIR/variance-regions-direct.rs:18:1
|
-LL | / struct Test3<'a, 'b, 'c> {
-LL | | x: extern "Rust" fn(&'a isize),
-LL | | y: extern "Rust" fn(&'b [isize]),
-LL | | c: extern "Rust" fn(&'c str),
-LL | | }
- | |_^
+LL | struct Test3<'a, 'b, 'c> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
error[E0208]: [-, o]
--> $DIR/variance-regions-direct.rs:27:1
|
-LL | / struct Test4<'a, 'b:'a> {
-LL | | x: &'a mut &'b isize,
-LL | | }
- | |_^
+LL | struct Test4<'a, 'b:'a> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^
error[E0208]: [+, o]
--> $DIR/variance-regions-direct.rs:35:1
|
-LL | / struct Test5<'a, 'b:'a> {
-LL | | x: extern "Rust" fn(&'a mut &'b isize),
-LL | | }
- | |_^
+LL | struct Test5<'a, 'b:'a> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^
error[E0208]: [-, o]
--> $DIR/variance-regions-direct.rs:45:1
|
-LL | / struct Test6<'a, 'b:'a> {
-LL | | x: &'a mut extern "Rust" fn(&'b isize),
-LL | | }
- | |_^
+LL | struct Test6<'a, 'b:'a> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^
error[E0208]: [*]
--> $DIR/variance-regions-direct.rs:52:1
|
-LL | / struct Test7<'a> {
-LL | | x: isize
-LL | | }
- | |_^
+LL | struct Test7<'a> {
+ | ^^^^^^^^^^^^^^^^
error[E0208]: [+, -, o]
--> $DIR/variance-regions-direct.rs:59:1
|
-LL | / enum Test8<'a, 'b, 'c:'b> {
-LL | | Test8A(extern "Rust" fn(&'a isize)),
-LL | | Test8B(&'b [isize]),
-LL | | Test8C(&'b mut &'c str),
-LL | | }
- | |_^
+LL | enum Test8<'a, 'b, 'c:'b> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 7 previous errors
error[E0208]: [+, -, o, *]
--> $DIR/variance-regions-indirect.rs:8:1
|
-LL | / enum Base<'a, 'b, 'c:'b, 'd> {
-LL | | Test8A(extern "Rust" fn(&'a isize)),
-LL | | Test8B(&'b [isize]),
-LL | | Test8C(&'b mut &'c str),
-LL | | }
- | |_^
+LL | enum Base<'a, 'b, 'c:'b, 'd> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0208]: [*, o, -, +]
--> $DIR/variance-regions-indirect.rs:15:1
|
-LL | / struct Derived1<'w, 'x:'y, 'y, 'z> {
-LL | | f: Base<'z, 'y, 'x, 'w>
-LL | | }
- | |_^
+LL | struct Derived1<'w, 'x:'y, 'y, 'z> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0208]: [o, o, *]
--> $DIR/variance-regions-indirect.rs:20:1
|
-LL | / struct Derived2<'a, 'b:'a, 'c> {
-LL | | f: Base<'a, 'a, 'b, 'c>
-LL | | }
- | |_^
+LL | struct Derived2<'a, 'b:'a, 'c> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0208]: [o, -, *]
--> $DIR/variance-regions-indirect.rs:25:1
|
-LL | / struct Derived3<'a:'b, 'b, 'c> {
-LL | | f: Base<'a, 'b, 'a, 'c>
-LL | | }
- | |_^
+LL | struct Derived3<'a:'b, 'b, 'c> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0208]: [+, -, o]
--> $DIR/variance-regions-indirect.rs:30:1
|
-LL | / struct Derived4<'a, 'b, 'c:'b> {
-LL | | f: Base<'a, 'b, 'c, 'a>
-LL | | }
- | |_^
+LL | struct Derived4<'a, 'b, 'c:'b> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 5 previous errors
error[E0208]: [+, +]
--> $DIR/variance-trait-bounds.rs:16:1
|
-LL | / struct TestStruct<U,T:Setter<U>> {
-LL | | t: T, u: U
-LL | | }
- | |_^
+LL | struct TestStruct<U,T:Setter<U>> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0208]: [*, +]
--> $DIR/variance-trait-bounds.rs:21:1
|
-LL | / enum TestEnum<U,T:Setter<U>> {
-LL | | Foo(T)
-LL | | }
- | |_^
+LL | enum TestEnum<U,T:Setter<U>> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0208]: [*, +]
--> $DIR/variance-trait-bounds.rs:26:1
|
-LL | / struct TestContraStruct<U,T:Setter<U>> {
-LL | | t: T
-LL | | }
- | |_^
+LL | struct TestContraStruct<U,T:Setter<U>> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0208]: [*, +]
--> $DIR/variance-trait-bounds.rs:31:1
|
-LL | / struct TestBox<U,T:Getter<U>+Setter<U>> {
-LL | | t: T
-LL | | }
- | |_^
+LL | struct TestBox<U,T:Getter<U>+Setter<U>> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 4 previous errors
error[E0208]: [-]
--> $DIR/variance-trait-object-bound.rs:14:1
|
-LL | / struct TOption<'a> {
-LL | | v: Option<Box<dyn T + 'a>>,
-LL | | }
- | |_^
+LL | struct TOption<'a> {
+ | ^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
error[E0208]: [+, +]
--> $DIR/variance-types-bounds.rs:7:1
|
-LL | / struct TestImm<A, B> {
-LL | | x: A,
-LL | | y: B,
-LL | | }
- | |_^
+LL | struct TestImm<A, B> {
+ | ^^^^^^^^^^^^^^^^^^^^
error[E0208]: [+, o]
--> $DIR/variance-types-bounds.rs:13:1
|
-LL | / struct TestMut<A, B:'static> {
-LL | | x: A,
-LL | | y: &'static mut B,
-LL | | }
- | |_^
+LL | struct TestMut<A, B:'static> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0208]: [+, o]
--> $DIR/variance-types-bounds.rs:19:1
|
-LL | / struct TestIndirect<A:'static, B:'static> {
-LL | | m: TestMut<A, B>
-LL | | }
- | |_^
+LL | struct TestIndirect<A:'static, B:'static> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0208]: [o, o]
--> $DIR/variance-types-bounds.rs:24:1
|
-LL | / struct TestIndirect2<A:'static, B:'static> {
-LL | | n: TestMut<A, B>,
-LL | | m: TestMut<B, A>
-LL | | }
- | |_^
+LL | struct TestIndirect2<A:'static, B:'static> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0208]: [o, o]
--> $DIR/variance-types-bounds.rs:38:1
|
-LL | / struct TestObject<A, R> {
-LL | | n: Box<dyn Setter<A>+Send>,
-LL | | m: Box<dyn Getter<R>+Send>,
-LL | | }
- | |_^
+LL | struct TestObject<A, R> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 5 previous errors
error[E0208]: [-, o, o]
--> $DIR/variance-types.rs:10:1
|
-LL | / struct InvariantMut<'a,A:'a,B:'a> {
-LL | | t: &'a mut (A,B)
-LL | | }
- | |_^
+LL | struct InvariantMut<'a,A:'a,B:'a> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0208]: [o]
--> $DIR/variance-types.rs:15:1
|
-LL | / struct InvariantCell<A> {
-LL | | t: Cell<A>
-LL | | }
- | |_^
+LL | struct InvariantCell<A> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^
error[E0208]: [o]
--> $DIR/variance-types.rs:20:1
|
-LL | / struct InvariantIndirect<A> {
-LL | | t: InvariantCell<A>
-LL | | }
- | |_^
+LL | struct InvariantIndirect<A> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0208]: [+]
--> $DIR/variance-types.rs:25:1
|
-LL | / struct Covariant<A> {
-LL | | t: A, u: fn() -> A
-LL | | }
- | |_^
+LL | struct Covariant<A> {
+ | ^^^^^^^^^^^^^^^^^^^
error[E0208]: [-]
--> $DIR/variance-types.rs:30:1
|
-LL | / struct Contravariant<A> {
-LL | | t: fn(A)
-LL | | }
- | |_^
+LL | struct Contravariant<A> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^
error[E0208]: [+, -, o]
--> $DIR/variance-types.rs:35:1
|
-LL | / enum Enum<A,B,C> {
-LL | | Foo(Covariant<A>),
-LL | | Bar(Contravariant<B>),
-LL | | Zed(Covariant<C>,Contravariant<C>)
-LL | | }
- | |_^
+LL | enum Enum<A,B,C> {
+ | ^^^^^^^^^^^^^^^^
error: aborting due to 6 previous errors
--> $DIR/wasm-custom-section-relocations.rs:4:1
|
LL | pub static A: &[u8] = &[1];
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^
error: statics with a custom `#[link_section]` must be a simple list of bytes on the wasm target with no extra levels of indirection such as references
--> $DIR/wasm-custom-section-relocations.rs:13:1
|
LL | pub static D: &usize = &C;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
--> $DIR/wf-in-foreign-fn-decls-issue-80468.rs:16:5
|
LL | pub fn repro(_: Wrapper<Ref>);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...does not necessarily outlive the static lifetime introduced by the compatible `impl`
--> $DIR/wf-in-foreign-fn-decls-issue-80468.rs:13:1
|
LL | impl Trait for Ref {}
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
--> $DIR/auxiliary/static_priv_by_default.rs:47:1
|
LL | static j: isize = 0;
- | ^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^
error[E0603]: function `k` is private
--> $DIR/xcrate-private-by-default.rs:25:29
--> $DIR/auxiliary/static_priv_by_default.rs:49:1
|
LL | struct l;
- | ^^^^^^^^^
+ | ^^^^^^^^
error[E0603]: enum `m` is private
--> $DIR/xcrate-private-by-default.rs:29:35
--> $DIR/auxiliary/static_priv_by_default.rs:51:1
|
LL | type n = isize;
- | ^^^^^^^^^^^^^^^
+ | ^^^^^^
error[E0603]: module `foo` is private
--> $DIR/xcrate-private-by-default.rs:35:29
}
pub fn enter_body(&mut self, cx: &LateContext<'_>, body: &hir::Body<'_>) {
- let body_owner = cx.tcx.hir().body_owner_def_id(body.id());
+ let body_owner = cx.tcx.hir().body_owner(body.id());
+ let body_owner_def_id = cx.tcx.hir().local_def_id(body_owner);
- match cx.tcx.hir().body_owner_kind(body_owner) {
+ match cx.tcx.hir().body_owner_kind(body_owner_def_id) {
hir::BodyOwnerKind::Static(_) | hir::BodyOwnerKind::Const => {
- let body_span = cx.tcx.def_span(body_owner);
+ let body_span = cx.tcx.hir().span_with_body(body_owner);
if let Some(span) = self.const_span {
if span.contains(body_span) {
pub fn body_post(&mut self, cx: &LateContext<'_>, body: &hir::Body<'_>) {
let body_owner = cx.tcx.hir().body_owner(body.id());
- let body_span = cx.tcx.hir().span(body_owner);
+ let body_span = cx.tcx.hir().span_with_body(body_owner);
if let Some(span) = self.const_span {
if span.contains(body_span) {
--> $DIR/ice-6252.rs:10:1
|
LL | const VAL: T;
- | ------------- `VAL` from trait
+ | ------------ `VAL` from trait
...
LL | impl<N, M> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `VAL` in implementation
note: `PartialEq` implemented here
--> $DIR/derive_hash_xor_eq.rs:15:1
|
-LL | / impl PartialEq for Bar {
-LL | | fn eq(&self, _: &Bar) -> bool {
-LL | | true
-LL | | }
-LL | | }
- | |_^
+LL | impl PartialEq for Bar {
+ | ^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
error: you are deriving `Hash` but have implemented `PartialEq` explicitly
note: `PartialEq` implemented here
--> $DIR/derive_hash_xor_eq.rs:24:1
|
-LL | / impl PartialEq<Baz> for Baz {
-LL | | fn eq(&self, _: &Baz) -> bool {
-LL | | true
-LL | | }
-LL | | }
- | |_^
+LL | impl PartialEq<Baz> for Baz {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
error: you are implementing `Hash` explicitly but have derived `PartialEq`
note: `PartialOrd` implemented here
--> $DIR/derive_ord_xor_partial_ord.rs:24:1
|
-LL | / impl PartialOrd for DeriveOrd {
-LL | | fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
-LL | | Some(other.cmp(self))
-LL | | }
-LL | | }
- | |_^
+LL | impl PartialOrd for DeriveOrd {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
error: you are deriving `Ord` but have implemented `PartialOrd` explicitly
note: `PartialOrd` implemented here
--> $DIR/derive_ord_xor_partial_ord.rs:33:1
|
-LL | / impl PartialOrd<DeriveOrdWithExplicitTypeVariable> for DeriveOrdWithExplicitTypeVariable {
-LL | | fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
-LL | | Some(other.cmp(self))
-LL | | }
-LL | | }
- | |_^
+LL | impl PartialOrd<DeriveOrdWithExplicitTypeVariable> for DeriveOrdWithExplicitTypeVariable {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
error: you are implementing `Ord` explicitly but have derived `PartialOrd`
--> $DIR/needless_pass_by_value.rs:123:1
|
LL | struct CopyWrapper(u32);
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^
error: this argument is passed by value, but not consumed in the function body
--> $DIR/needless_pass_by_value.rs:131:29
--> $DIR/needless_pass_by_value.rs:123:1
|
LL | struct CopyWrapper(u32);
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^
error: this argument is passed by value, but not consumed in the function body
--> $DIR/needless_pass_by_value.rs:131:45
--> $DIR/needless_pass_by_value.rs:123:1
|
LL | struct CopyWrapper(u32);
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^
error: this argument is passed by value, but not consumed in the function body
--> $DIR/needless_pass_by_value.rs:131:61
--> $DIR/needless_pass_by_value.rs:123:1
|
LL | struct CopyWrapper(u32);
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^
error: this argument is passed by value, but not consumed in the function body
--> $DIR/needless_pass_by_value.rs:143:40