1
Fork 0

Auto merge of #48925 - zackmdavis:fn_must_stabilize, r=nikomatsakis

stabilize `#[must_use]` for functions and must-use comparison operators (RFC 1940)

r? @nikomatsakis
This commit is contained in:
bors 2018-04-30 22:02:33 +00:00
commit 357bf00f1c
20 changed files with 167 additions and 337 deletions

View file

@ -1,30 +0,0 @@
# `fn_must_use`
The tracking issue for this feature is [#43302].
[#43302]: https://github.com/rust-lang/rust/issues/43302
------------------------
The `fn_must_use` feature allows functions and methods to be annotated with
`#[must_use]`, indicating that the `unused_must_use` lint should require their
return values to be used (similarly to how types annotated with `must_use`,
most notably `Result`, are linted if not used).
## Examples
```rust
#![feature(fn_must_use)]
#[must_use]
fn double(x: i32) -> i32 {
2 * x
}
fn main() {
double(4); // warning: unused return value of `double` which must be used
let _ = double(4); // (no warning)
}
```

View file

@ -96,7 +96,7 @@
#![feature(dropck_eyepatch)] #![feature(dropck_eyepatch)]
#![feature(exact_size_is_empty)] #![feature(exact_size_is_empty)]
#![feature(fmt_internals)] #![feature(fmt_internals)]
#![feature(fn_must_use)] #![cfg_attr(stage0, feature(fn_must_use))]
#![feature(from_ref)] #![feature(from_ref)]
#![feature(fundamental)] #![feature(fundamental)]
#![feature(lang_items)] #![feature(lang_items)]

View file

@ -1282,6 +1282,7 @@ fn test_box_slice_clone() {
} }
#[test] #[test]
#[allow(unused_must_use)] // here, we care about the side effects of `.clone()`
#[cfg_attr(target_os = "emscripten", ignore)] #[cfg_attr(target_os = "emscripten", ignore)]
fn test_box_slice_clone_panics() { fn test_box_slice_clone_panics() {
use std::sync::Arc; use std::sync::Arc;

View file

@ -76,7 +76,6 @@
#![feature(doc_cfg)] #![feature(doc_cfg)]
#![feature(doc_spotlight)] #![feature(doc_spotlight)]
#![feature(extern_types)] #![feature(extern_types)]
#![feature(fn_must_use)]
#![feature(fundamental)] #![feature(fundamental)]
#![feature(intrinsics)] #![feature(intrinsics)]
#![feature(iterator_flatten)] #![feature(iterator_flatten)]
@ -114,6 +113,7 @@
#![cfg_attr(stage0, feature(target_feature))] #![cfg_attr(stage0, feature(target_feature))]
#![cfg_attr(stage0, feature(cfg_target_feature))] #![cfg_attr(stage0, feature(cfg_target_feature))]
#![cfg_attr(stage0, feature(fn_must_use))]
#[prelude_import] #[prelude_import]
#[allow(unused)] #[allow(unused)]

View file

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
use rustc::hir::def::Def;
use rustc::hir::def_id::DefId; use rustc::hir::def_id::DefId;
use rustc::ty; use rustc::ty;
use rustc::ty::adjustment; use rustc::ty::adjustment;
@ -72,54 +73,59 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedResults {
let mut fn_warned = false; let mut fn_warned = false;
let mut op_warned = false; let mut op_warned = false;
if cx.tcx.features().fn_must_use { let maybe_def = match expr.node {
let maybe_def = match expr.node { hir::ExprCall(ref callee, _) => {
hir::ExprCall(ref callee, _) => { match callee.node {
match callee.node { hir::ExprPath(ref qpath) => {
hir::ExprPath(ref qpath) => { let def = cx.tables.qpath_def(qpath, callee.hir_id);
Some(cx.tables.qpath_def(qpath, callee.hir_id)) if let Def::Fn(_) = def {
}, Some(def)
_ => None } else { // `Def::Local` if it was a closure, for which we
} None // do not currently support must-use linting
}, }
hir::ExprMethodCall(..) => { },
cx.tables.type_dependent_defs().get(expr.hir_id).cloned() _ => None
}, }
_ => None },
}; hir::ExprMethodCall(..) => {
if let Some(def) = maybe_def { cx.tables.type_dependent_defs().get(expr.hir_id).cloned()
let def_id = def.def_id(); },
fn_warned = check_must_use(cx, def_id, s.span, "return value of "); _ => None
} };
let must_use_op = match expr.node { if let Some(def) = maybe_def {
// Hardcoding operators here seemed more expedient than the let def_id = def.def_id();
// refactoring that would be needed to look up the `#[must_use]` fn_warned = check_must_use(cx, def_id, s.span, "return value of ");
// attribute which does exist on the comparison trait methods
hir::ExprBinary(bin_op, ..) => {
match bin_op.node {
hir::BiEq | hir::BiLt | hir::BiLe | hir::BiNe | hir::BiGe | hir::BiGt => {
Some("comparison")
},
hir::BiAdd | hir::BiSub | hir::BiDiv | hir::BiMul | hir::BiRem => {
Some("arithmetic operation")
},
hir::BiAnd | hir::BiOr => {
Some("logical operation")
},
hir::BiBitXor | hir::BiBitAnd | hir::BiBitOr | hir::BiShl | hir::BiShr => {
Some("bitwise operation")
},
}
},
hir::ExprUnary(..) => Some("unary operation"),
_ => None
};
if let Some(must_use_op) = must_use_op {
cx.span_lint(UNUSED_MUST_USE, expr.span,
&format!("unused {} which must be used", must_use_op));
op_warned = true;
}
} }
let must_use_op = match expr.node {
// Hardcoding operators here seemed more expedient than the
// refactoring that would be needed to look up the `#[must_use]`
// attribute which does exist on the comparison trait methods
hir::ExprBinary(bin_op, ..) => {
match bin_op.node {
hir::BiEq | hir::BiLt | hir::BiLe | hir::BiNe | hir::BiGe | hir::BiGt => {
Some("comparison")
},
hir::BiAdd | hir::BiSub | hir::BiDiv | hir::BiMul | hir::BiRem => {
Some("arithmetic operation")
},
hir::BiAnd | hir::BiOr => {
Some("logical operation")
},
hir::BiBitXor | hir::BiBitAnd | hir::BiBitOr | hir::BiShl | hir::BiShr => {
Some("bitwise operation")
},
}
},
hir::ExprUnary(..) => Some("unary operation"),
_ => None
};
if let Some(must_use_op) = must_use_op {
cx.span_lint(UNUSED_MUST_USE, expr.span,
&format!("unused {} which must be used", must_use_op));
op_warned = true;
}
if !(ty_warned || fn_warned || op_warned) { if !(ty_warned || fn_warned || op_warned) {
cx.span_lint(UNUSED_RESULTS, s.span, "unused result"); cx.span_lint(UNUSED_RESULTS, s.span, "unused result");
} }

View file

@ -988,6 +988,7 @@ impl CStr {
/// behavior when `ptr` is used inside the `unsafe` block: /// behavior when `ptr` is used inside the `unsafe` block:
/// ///
/// ```no_run /// ```no_run
/// # #![allow(unused_must_use)]
/// use std::ffi::{CString}; /// use std::ffi::{CString};
/// ///
/// let ptr = CString::new("Hello").unwrap().as_ptr(); /// let ptr = CString::new("Hello").unwrap().as_ptr();
@ -1003,6 +1004,7 @@ impl CStr {
/// To fix the problem, bind the `CString` to a local variable: /// To fix the problem, bind the `CString` to a local variable:
/// ///
/// ```no_run /// ```no_run
/// # #![allow(unused_must_use)]
/// use std::ffi::{CString}; /// use std::ffi::{CString};
/// ///
/// let hello = CString::new("Hello").unwrap(); /// let hello = CString::new("Hello").unwrap();

View file

@ -518,6 +518,7 @@ mod tests {
} }
} }
#[allow(unused_must_use)]
#[test] #[test]
fn cloning() { fn cloning() {
let (tx1, rx1) = channel::<i32>(); let (tx1, rx1) = channel::<i32>();
@ -540,6 +541,7 @@ mod tests {
tx3.send(()).unwrap(); tx3.send(()).unwrap();
} }
#[allow(unused_must_use)]
#[test] #[test]
fn cloning2() { fn cloning2() {
let (tx1, rx1) = channel::<i32>(); let (tx1, rx1) = channel::<i32>();

View file

@ -369,9 +369,6 @@ declare_features! (
// #[doc(include="some-file")] // #[doc(include="some-file")]
(active, external_doc, "1.22.0", Some(44732), None), (active, external_doc, "1.22.0", Some(44732), None),
// allow `#[must_use]` on functions and comparison operators (RFC 1940)
(active, fn_must_use, "1.21.0", Some(43302), None),
// Future-proofing enums/structs with #[non_exhaustive] attribute (RFC 2008) // Future-proofing enums/structs with #[non_exhaustive] attribute (RFC 2008)
(active, non_exhaustive, "1.22.0", Some(44109), None), (active, non_exhaustive, "1.22.0", Some(44109), None),
@ -591,6 +588,8 @@ declare_features! (
(accepted, target_feature, "1.27.0", None, None), (accepted, target_feature, "1.27.0", None, None),
// Trait object syntax with `dyn` prefix // Trait object syntax with `dyn` prefix
(accepted, dyn_trait, "1.27.0", Some(44662), None), (accepted, dyn_trait, "1.27.0", Some(44662), None),
// allow `#[must_use]` on functions; and, must-use operators (RFC 1940)
(accepted, fn_must_use, "1.27.0", Some(43302), None),
); );
// If you change this, please modify src/doc/unstable-book as well. You must // If you change this, please modify src/doc/unstable-book as well. You must
@ -1545,11 +1544,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
function may change over time, for now \ function may change over time, for now \
a top-level `fn main()` is required"); a top-level `fn main()` is required");
} }
if let Some(attr) = attr::find_by_name(&i.attrs[..], "must_use") {
gate_feature_post!(&self, fn_must_use, attr.span,
"`#[must_use]` on functions is experimental",
GateStrength::Soft);
}
} }
ast::ItemKind::Struct(..) => { ast::ItemKind::Struct(..) => {
@ -1581,7 +1575,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
"trait aliases are not yet fully implemented"); "trait aliases are not yet fully implemented");
} }
ast::ItemKind::Impl(_, polarity, defaultness, _, _, _, ref impl_items) => { ast::ItemKind::Impl(_, polarity, defaultness, _, _, _, _) => {
if polarity == ast::ImplPolarity::Negative { if polarity == ast::ImplPolarity::Negative {
gate_feature_post!(&self, optin_builtin_traits, gate_feature_post!(&self, optin_builtin_traits,
i.span, i.span,
@ -1594,16 +1588,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
i.span, i.span,
"specialization is unstable"); "specialization is unstable");
} }
for impl_item in impl_items {
if let ast::ImplItemKind::Method(..) = impl_item.node {
if let Some(attr) = attr::find_by_name(&impl_item.attrs[..], "must_use") {
gate_feature_post!(&self, fn_must_use, attr.span,
"`#[must_use]` on methods is experimental",
GateStrength::Soft);
}
}
}
} }
ast::ItemKind::Trait(ast::IsAuto::Yes, ..) => { ast::ItemKind::Trait(ast::IsAuto::Yes, ..) => {

View file

@ -1,22 +0,0 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: --cap-lints allow
// This tests that the fn_must_use feature-gate warning respects the lint
// cap. (See discussion in Issue #44213.)
#![feature(rustc_attrs)]
#[must_use] // (no feature-gate warning because of the lint cap!)
fn need_to_use_it() -> bool { true }
#[rustc_error]
fn main() {} //~ ERROR compilation successful

View file

@ -1,8 +0,0 @@
error: compilation successful
--> $DIR/feature-gate-fn_must_use-cap-lints-allow.rs:22:1
|
LL | fn main() {} //~ ERROR compilation successful
| ^^^^^^^^^^^^
error: aborting due to previous error

View file

@ -1,31 +0,0 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
struct MyStruct;
impl MyStruct {
#[must_use] //~ WARN `#[must_use]` on methods is experimental
fn need_to_use_method() -> bool { true }
}
#[must_use] //~ WARN `#[must_use]` on functions is experimental
fn need_to_use_it() -> bool { true }
// Feature gates are tidy-required to have a specially named (or
// comment-annotated) compile-fail test (which MUST fail), but for
// backwards-compatibility reasons, we want `#[must_use]` on functions to be
// compilable even if the `fn_must_use` feature is absent, thus necessitating
// the usage of `#[rustc_error]` here, pragmatically if awkwardly solving this
// dilemma until a superior solution can be devised.
#[rustc_error]
fn main() {} //~ ERROR compilation successful

View file

@ -1,24 +0,0 @@
warning: `#[must_use]` on methods is experimental (see issue #43302)
--> $DIR/feature-gate-fn_must_use.rs:16:5
|
LL | #[must_use] //~ WARN `#[must_use]` on methods is experimental
| ^^^^^^^^^^^
|
= help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on functions is experimental (see issue #43302)
--> $DIR/feature-gate-fn_must_use.rs:20:1
|
LL | #[must_use] //~ WARN `#[must_use]` on functions is experimental
| ^^^^^^^^^^^
|
= help: add #![feature(fn_must_use)] to the crate attributes to enable
error: compilation successful
--> $DIR/feature-gate-fn_must_use.rs:31:1
|
LL | fn main() {} //~ ERROR compilation successful
| ^^^^^^^^^^^^
error: aborting due to previous error

View file

@ -661,7 +661,6 @@ mod must_use {
mod inner { #![must_use="1400"] } mod inner { #![must_use="1400"] }
#[must_use = "1400"] fn f() { } #[must_use = "1400"] fn f() { }
//~^ WARN `#[must_use]` on functions is experimental
#[must_use = "1400"] struct S; #[must_use = "1400"] struct S;

View file

@ -12,14 +12,6 @@ LL | mod inner { #![macro_escape] }
| |
= help: consider an outer attribute, #[macro_use] mod ... = help: consider an outer attribute, #[macro_use] mod ...
warning: `#[must_use]` on functions is experimental (see issue #43302)
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:663:5
|
LL | #[must_use = "1400"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^
|
= help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: unknown lint: `x5400` warning: unknown lint: `x5400`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:49:33 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:49:33
| |
@ -799,433 +791,433 @@ LL | #[no_std = "2600"]
| ^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:692:17 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:691:17
| |
LL | mod inner { #![crate_name="0900"] } LL | mod inner { #![crate_name="0900"] }
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module warning: crate-level attribute should be in the root module
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:692:17 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:691:17
| |
LL | mod inner { #![crate_name="0900"] } LL | mod inner { #![crate_name="0900"] }
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:696:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:695:5
| |
LL | #[crate_name = "0900"] fn f() { } LL | #[crate_name = "0900"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:696:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:695:5
| |
LL | #[crate_name = "0900"] fn f() { } LL | #[crate_name = "0900"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:700:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:699:5
| |
LL | #[crate_name = "0900"] struct S; LL | #[crate_name = "0900"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:700:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:699:5
| |
LL | #[crate_name = "0900"] struct S; LL | #[crate_name = "0900"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:704:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:703:5
| |
LL | #[crate_name = "0900"] type T = S; LL | #[crate_name = "0900"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:704:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:703:5
| |
LL | #[crate_name = "0900"] type T = S; LL | #[crate_name = "0900"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:708:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:707:5
| |
LL | #[crate_name = "0900"] impl S { } LL | #[crate_name = "0900"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:708:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:707:5
| |
LL | #[crate_name = "0900"] impl S { } LL | #[crate_name = "0900"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:688:1 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:687:1
| |
LL | #[crate_name = "0900"] LL | #[crate_name = "0900"]
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:688:1 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:687:1
| |
LL | #[crate_name = "0900"] LL | #[crate_name = "0900"]
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:717:17 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:716:17
| |
LL | mod inner { #![crate_type="0800"] } LL | mod inner { #![crate_type="0800"] }
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module warning: crate-level attribute should be in the root module
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:717:17 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:716:17
| |
LL | mod inner { #![crate_type="0800"] } LL | mod inner { #![crate_type="0800"] }
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:721:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:720:5
| |
LL | #[crate_type = "0800"] fn f() { } LL | #[crate_type = "0800"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:721:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:720:5
| |
LL | #[crate_type = "0800"] fn f() { } LL | #[crate_type = "0800"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:725:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:724:5
| |
LL | #[crate_type = "0800"] struct S; LL | #[crate_type = "0800"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:725:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:724:5
| |
LL | #[crate_type = "0800"] struct S; LL | #[crate_type = "0800"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:729:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:728:5
| |
LL | #[crate_type = "0800"] type T = S; LL | #[crate_type = "0800"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:729:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:728:5
| |
LL | #[crate_type = "0800"] type T = S; LL | #[crate_type = "0800"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:733:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:732:5
| |
LL | #[crate_type = "0800"] impl S { } LL | #[crate_type = "0800"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:733:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:732:5
| |
LL | #[crate_type = "0800"] impl S { } LL | #[crate_type = "0800"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:713:1 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:712:1
| |
LL | #[crate_type = "0800"] LL | #[crate_type = "0800"]
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:713:1 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:712:1
| |
LL | #[crate_type = "0800"] LL | #[crate_type = "0800"]
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:742:17 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:741:17
| |
LL | mod inner { #![feature(x0600)] } LL | mod inner { #![feature(x0600)] }
| ^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module warning: crate-level attribute should be in the root module
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:742:17 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:741:17
| |
LL | mod inner { #![feature(x0600)] } LL | mod inner { #![feature(x0600)] }
| ^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:746:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:745:5
| |
LL | #[feature(x0600)] fn f() { } LL | #[feature(x0600)] fn f() { }
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:746:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:745:5
| |
LL | #[feature(x0600)] fn f() { } LL | #[feature(x0600)] fn f() { }
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:750:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:749:5
| |
LL | #[feature(x0600)] struct S; LL | #[feature(x0600)] struct S;
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:750:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:749:5
| |
LL | #[feature(x0600)] struct S; LL | #[feature(x0600)] struct S;
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:754:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:753:5
| |
LL | #[feature(x0600)] type T = S; LL | #[feature(x0600)] type T = S;
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:754:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:753:5
| |
LL | #[feature(x0600)] type T = S; LL | #[feature(x0600)] type T = S;
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:758:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:757:5
| |
LL | #[feature(x0600)] impl S { } LL | #[feature(x0600)] impl S { }
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:758:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:757:5
| |
LL | #[feature(x0600)] impl S { } LL | #[feature(x0600)] impl S { }
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:738:1 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:737:1
| |
LL | #[feature(x0600)] LL | #[feature(x0600)]
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:738:1 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:737:1
| |
LL | #[feature(x0600)] LL | #[feature(x0600)]
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:768:17 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:767:17
| |
LL | mod inner { #![no_main="0400"] } LL | mod inner { #![no_main="0400"] }
| ^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module warning: crate-level attribute should be in the root module
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:768:17 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:767:17
| |
LL | mod inner { #![no_main="0400"] } LL | mod inner { #![no_main="0400"] }
| ^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:772:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:771:5
| |
LL | #[no_main = "0400"] fn f() { } LL | #[no_main = "0400"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:772:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:771:5
| |
LL | #[no_main = "0400"] fn f() { } LL | #[no_main = "0400"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:776:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:775:5
| |
LL | #[no_main = "0400"] struct S; LL | #[no_main = "0400"] struct S;
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:776:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:775:5
| |
LL | #[no_main = "0400"] struct S; LL | #[no_main = "0400"] struct S;
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:780:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:779:5
| |
LL | #[no_main = "0400"] type T = S; LL | #[no_main = "0400"] type T = S;
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:780:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:779:5
| |
LL | #[no_main = "0400"] type T = S; LL | #[no_main = "0400"] type T = S;
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:784:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:783:5
| |
LL | #[no_main = "0400"] impl S { } LL | #[no_main = "0400"] impl S { }
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:784:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:783:5
| |
LL | #[no_main = "0400"] impl S { } LL | #[no_main = "0400"] impl S { }
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:764:1 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:763:1
| |
LL | #[no_main = "0400"] LL | #[no_main = "0400"]
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:764:1 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:763:1
| |
LL | #[no_main = "0400"] LL | #[no_main = "0400"]
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:806:17 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:805:17
| |
LL | mod inner { #![recursion_limit="0200"] } LL | mod inner { #![recursion_limit="0200"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module warning: crate-level attribute should be in the root module
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:806:17 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:805:17
| |
LL | mod inner { #![recursion_limit="0200"] } LL | mod inner { #![recursion_limit="0200"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:810:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:809:5
| |
LL | #[recursion_limit="0200"] fn f() { } LL | #[recursion_limit="0200"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:810:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:809:5
| |
LL | #[recursion_limit="0200"] fn f() { } LL | #[recursion_limit="0200"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:814:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:813:5
| |
LL | #[recursion_limit="0200"] struct S; LL | #[recursion_limit="0200"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:814:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:813:5
| |
LL | #[recursion_limit="0200"] struct S; LL | #[recursion_limit="0200"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:818:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:817:5
| |
LL | #[recursion_limit="0200"] type T = S; LL | #[recursion_limit="0200"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:818:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:817:5
| |
LL | #[recursion_limit="0200"] type T = S; LL | #[recursion_limit="0200"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:822:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:821:5
| |
LL | #[recursion_limit="0200"] impl S { } LL | #[recursion_limit="0200"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:822:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:821:5
| |
LL | #[recursion_limit="0200"] impl S { } LL | #[recursion_limit="0200"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:802:1 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:801:1
| |
LL | #[recursion_limit="0200"] LL | #[recursion_limit="0200"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:802:1 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:801:1
| |
LL | #[recursion_limit="0200"] LL | #[recursion_limit="0200"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:831:17 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:830:17
| |
LL | mod inner { #![type_length_limit="0100"] } LL | mod inner { #![type_length_limit="0100"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module warning: crate-level attribute should be in the root module
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:831:17 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:830:17
| |
LL | mod inner { #![type_length_limit="0100"] } LL | mod inner { #![type_length_limit="0100"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:835:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:834:5
| |
LL | #[type_length_limit="0100"] fn f() { } LL | #[type_length_limit="0100"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:835:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:834:5
| |
LL | #[type_length_limit="0100"] fn f() { } LL | #[type_length_limit="0100"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:839:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:838:5
| |
LL | #[type_length_limit="0100"] struct S; LL | #[type_length_limit="0100"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:839:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:838:5
| |
LL | #[type_length_limit="0100"] struct S; LL | #[type_length_limit="0100"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:843:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:842:5
| |
LL | #[type_length_limit="0100"] type T = S; LL | #[type_length_limit="0100"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:843:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:842:5
| |
LL | #[type_length_limit="0100"] type T = S; LL | #[type_length_limit="0100"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:847:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:846:5
| |
LL | #[type_length_limit="0100"] impl S { } LL | #[type_length_limit="0100"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:847:5 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:846:5
| |
LL | #[type_length_limit="0100"] impl S { } LL | #[type_length_limit="0100"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute warning: unused attribute
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:827:1 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:826:1
| |
LL | #[type_length_limit="0100"] LL | #[type_length_limit="0100"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:827:1 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:826:1
| |
LL | #[type_length_limit="0100"] LL | #[type_length_limit="0100"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -1309,7 +1301,7 @@ LL | #![proc_macro_derive = "2500"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: compilation successful error: compilation successful
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:858:1 --> $DIR/issue-43106-gating-of-builtin-attrs.rs:857:1
| |
LL | / fn main() { //~ ERROR compilation successful LL | / fn main() { //~ ERROR compilation successful
LL | | println!("Hello World"); LL | | println!("Hello World");

View file

@ -10,7 +10,6 @@
// compile-pass // compile-pass
#![feature(fn_must_use)]
#![warn(unused_must_use)] #![warn(unused_must_use)]
#[derive(PartialEq, Eq)] #[derive(PartialEq, Eq)]

View file

@ -1,47 +1,47 @@
warning: unused return value of `need_to_use_this_value` which must be used: it's important warning: unused return value of `need_to_use_this_value` which must be used: it's important
--> $DIR/fn_must_use.rs:61:5 --> $DIR/fn_must_use.rs:60:5
| |
LL | need_to_use_this_value(); //~ WARN unused return value LL | need_to_use_this_value(); //~ WARN unused return value
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
| |
note: lint level defined here note: lint level defined here
--> $DIR/fn_must_use.rs:14:9 --> $DIR/fn_must_use.rs:13:9
| |
LL | #![warn(unused_must_use)] LL | #![warn(unused_must_use)]
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
warning: unused return value of `MyStruct::need_to_use_this_method_value` which must be used warning: unused return value of `MyStruct::need_to_use_this_method_value` which must be used
--> $DIR/fn_must_use.rs:66:5 --> $DIR/fn_must_use.rs:65:5
| |
LL | m.need_to_use_this_method_value(); //~ WARN unused return value LL | m.need_to_use_this_method_value(); //~ WARN unused return value
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused return value of `EvenNature::is_even` which must be used: no side effects warning: unused return value of `EvenNature::is_even` which must be used: no side effects
--> $DIR/fn_must_use.rs:67:5 --> $DIR/fn_must_use.rs:66:5
| |
LL | m.is_even(); // trait method! LL | m.is_even(); // trait method!
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
warning: unused return value of `std::cmp::PartialEq::eq` which must be used warning: unused return value of `std::cmp::PartialEq::eq` which must be used
--> $DIR/fn_must_use.rs:73:5 --> $DIR/fn_must_use.rs:72:5
| |
LL | 2.eq(&3); //~ WARN unused return value LL | 2.eq(&3); //~ WARN unused return value
| ^^^^^^^^^ | ^^^^^^^^^
warning: unused return value of `std::cmp::PartialEq::eq` which must be used warning: unused return value of `std::cmp::PartialEq::eq` which must be used
--> $DIR/fn_must_use.rs:74:5 --> $DIR/fn_must_use.rs:73:5
| |
LL | m.eq(&n); //~ WARN unused return value LL | m.eq(&n); //~ WARN unused return value
| ^^^^^^^^^ | ^^^^^^^^^
warning: unused comparison which must be used warning: unused comparison which must be used
--> $DIR/fn_must_use.rs:77:5 --> $DIR/fn_must_use.rs:76:5
| |
LL | 2 == 3; //~ WARN unused comparison LL | 2 == 3; //~ WARN unused comparison
| ^^^^^^ | ^^^^^^
warning: unused comparison which must be used warning: unused comparison which must be used
--> $DIR/fn_must_use.rs:78:5 --> $DIR/fn_must_use.rs:77:5
| |
LL | m == n; //~ WARN unused comparison LL | m == n; //~ WARN unused comparison
| ^^^^^^ | ^^^^^^

View file

@ -12,7 +12,6 @@
// compile-pass // compile-pass
#![feature(fn_must_use)]
#![warn(unused_must_use)] #![warn(unused_must_use)]
fn main() { fn main() {

View file

@ -1,131 +1,131 @@
warning: unused comparison which must be used warning: unused comparison which must be used
--> $DIR/must-use-ops.rs:23:5 --> $DIR/must-use-ops.rs:22:5
| |
LL | val == 1; LL | val == 1;
| ^^^^^^^^ | ^^^^^^^^
| |
note: lint level defined here note: lint level defined here
--> $DIR/must-use-ops.rs:16:9 --> $DIR/must-use-ops.rs:15:9
| |
LL | #![warn(unused_must_use)] LL | #![warn(unused_must_use)]
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
warning: unused comparison which must be used warning: unused comparison which must be used
--> $DIR/must-use-ops.rs:24:5 --> $DIR/must-use-ops.rs:23:5
| |
LL | val < 1; LL | val < 1;
| ^^^^^^^ | ^^^^^^^
warning: unused comparison which must be used warning: unused comparison which must be used
--> $DIR/must-use-ops.rs:25:5 --> $DIR/must-use-ops.rs:24:5
| |
LL | val <= 1; LL | val <= 1;
| ^^^^^^^^ | ^^^^^^^^
warning: unused comparison which must be used warning: unused comparison which must be used
--> $DIR/must-use-ops.rs:26:5 --> $DIR/must-use-ops.rs:25:5
| |
LL | val != 1; LL | val != 1;
| ^^^^^^^^ | ^^^^^^^^
warning: unused comparison which must be used warning: unused comparison which must be used
--> $DIR/must-use-ops.rs:27:5 --> $DIR/must-use-ops.rs:26:5
| |
LL | val >= 1; LL | val >= 1;
| ^^^^^^^^ | ^^^^^^^^
warning: unused comparison which must be used warning: unused comparison which must be used
--> $DIR/must-use-ops.rs:28:5 --> $DIR/must-use-ops.rs:27:5
| |
LL | val > 1; LL | val > 1;
| ^^^^^^^ | ^^^^^^^
warning: unused arithmetic operation which must be used warning: unused arithmetic operation which must be used
--> $DIR/must-use-ops.rs:31:5 --> $DIR/must-use-ops.rs:30:5
| |
LL | val + 2; LL | val + 2;
| ^^^^^^^ | ^^^^^^^
warning: unused arithmetic operation which must be used warning: unused arithmetic operation which must be used
--> $DIR/must-use-ops.rs:32:5 --> $DIR/must-use-ops.rs:31:5
| |
LL | val - 2; LL | val - 2;
| ^^^^^^^ | ^^^^^^^
warning: unused arithmetic operation which must be used warning: unused arithmetic operation which must be used
--> $DIR/must-use-ops.rs:33:5 --> $DIR/must-use-ops.rs:32:5
| |
LL | val / 2; LL | val / 2;
| ^^^^^^^ | ^^^^^^^
warning: unused arithmetic operation which must be used warning: unused arithmetic operation which must be used
--> $DIR/must-use-ops.rs:34:5 --> $DIR/must-use-ops.rs:33:5
| |
LL | val * 2; LL | val * 2;
| ^^^^^^^ | ^^^^^^^
warning: unused arithmetic operation which must be used warning: unused arithmetic operation which must be used
--> $DIR/must-use-ops.rs:35:5 --> $DIR/must-use-ops.rs:34:5
| |
LL | val % 2; LL | val % 2;
| ^^^^^^^ | ^^^^^^^
warning: unused logical operation which must be used warning: unused logical operation which must be used
--> $DIR/must-use-ops.rs:38:5 --> $DIR/must-use-ops.rs:37:5
| |
LL | true && true; LL | true && true;
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
warning: unused logical operation which must be used warning: unused logical operation which must be used
--> $DIR/must-use-ops.rs:39:5 --> $DIR/must-use-ops.rs:38:5
| |
LL | false || true; LL | false || true;
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^
warning: unused bitwise operation which must be used warning: unused bitwise operation which must be used
--> $DIR/must-use-ops.rs:42:5 --> $DIR/must-use-ops.rs:41:5
| |
LL | 5 ^ val; LL | 5 ^ val;
| ^^^^^^^ | ^^^^^^^
warning: unused bitwise operation which must be used warning: unused bitwise operation which must be used
--> $DIR/must-use-ops.rs:43:5 --> $DIR/must-use-ops.rs:42:5
| |
LL | 5 & val; LL | 5 & val;
| ^^^^^^^ | ^^^^^^^
warning: unused bitwise operation which must be used warning: unused bitwise operation which must be used
--> $DIR/must-use-ops.rs:44:5 --> $DIR/must-use-ops.rs:43:5
| |
LL | 5 | val; LL | 5 | val;
| ^^^^^^^ | ^^^^^^^
warning: unused bitwise operation which must be used warning: unused bitwise operation which must be used
--> $DIR/must-use-ops.rs:45:5 --> $DIR/must-use-ops.rs:44:5
| |
LL | 5 << val; LL | 5 << val;
| ^^^^^^^^ | ^^^^^^^^
warning: unused bitwise operation which must be used warning: unused bitwise operation which must be used
--> $DIR/must-use-ops.rs:46:5 --> $DIR/must-use-ops.rs:45:5
| |
LL | 5 >> val; LL | 5 >> val;
| ^^^^^^^^ | ^^^^^^^^
warning: unused unary operation which must be used warning: unused unary operation which must be used
--> $DIR/must-use-ops.rs:49:5 --> $DIR/must-use-ops.rs:48:5
| |
LL | !val; LL | !val;
| ^^^^ | ^^^^
warning: unused unary operation which must be used warning: unused unary operation which must be used
--> $DIR/must-use-ops.rs:50:5 --> $DIR/must-use-ops.rs:49:5
| |
LL | -val; LL | -val;
| ^^^^ | ^^^^
warning: unused unary operation which must be used warning: unused unary operation which must be used
--> $DIR/must-use-ops.rs:51:5 --> $DIR/must-use-ops.rs:50:5
| |
LL | *val_pointer; LL | *val_pointer;
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^

View file

@ -8,33 +8,10 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#![feature(attr_literals)]
#[repr(align(16))]
struct Gem {
mohs_hardness: u8,
poofed: bool,
weapon: Weapon,
}
#[repr(simd)] //~ ERROR are experimental #[repr(simd)] //~ ERROR are experimental
struct Weapon { struct Weapon {
name: String, name: String,
damage: u32 damage: u32
} }
impl Gem {
#[must_use] fn summon_weapon(&self) -> Weapon { self.weapon }
//~^ WARN is experimental
}
#[must_use] //~ WARN is experimental
fn bubble(gem: Gem) -> Result<Gem, ()> {
if gem.poofed {
Ok(gem)
} else {
Err(())
}
}
fn main() {} fn main() {}

View file

@ -1,27 +1,11 @@
error[E0658]: SIMD types are experimental and possibly buggy (see issue #27731) error[E0658]: SIMD types are experimental and possibly buggy (see issue #27731)
--> $DIR/gated-features-attr-spans.rs:20:1 --> $DIR/gated-features-attr-spans.rs:11:1
| |
LL | #[repr(simd)] //~ ERROR are experimental LL | #[repr(simd)] //~ ERROR are experimental
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^
| |
= help: add #![feature(repr_simd)] to the crate attributes to enable = help: add #![feature(repr_simd)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
--> $DIR/gated-features-attr-spans.rs:27:5
|
LL | #[must_use] fn summon_weapon(&self) -> Weapon { self.weapon }
| ^^^^^^^^^^^
|
= help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on functions is experimental (see issue #43302)
--> $DIR/gated-features-attr-spans.rs:31:1
|
LL | #[must_use] //~ WARN is experimental
| ^^^^^^^^^^^
|
= help: add #![feature(fn_must_use)] to the crate attributes to enable
error: aborting due to previous error error: aborting due to previous error
For more information about this error, try `rustc --explain E0658`. For more information about this error, try `rustc --explain E0658`.