Auto merge of #68067 - JohnTitor:rollup-vsj5won, r=JohnTitor

Rollup of 10 pull requests

Successful merges:

 - #66254 (Make Layout::new const)
 - #67122 (Do not deduplicate diagnostics in UI tests)
 - #67358 (Add HashSet::get_or_insert_owned)
 - #67725 (Simplify into_key_slice_mut)
 - #67935 (Relax the Sized bounds on Pin::map_unchecked(_mut))
 - #67967 (Delay bug to prevent ICE in MIR borrowck)
 - #67975 (Export public scalar statics in wasm)
 - #68006 (Recognise riscv64 in compiletest)
 - #68040 (Cleanup)
 - #68054 (doc: add Null-unchecked version section to mut pointer as_mut method)

Failed merges:

 - #67258 (Introduce `X..`, `..X`, and `..=X` range patterns)

r? @ghost
This commit is contained in:
bors 2020-01-09 19:21:58 +00:00
commit 72b2bd55ed
235 changed files with 3080 additions and 420 deletions

View file

@ -3079,8 +3079,6 @@ dependencies = [
"graphviz",
"jobserver",
"log",
"measureme",
"num_cpus",
"parking_lot",
"polonius-engine",
"rustc-rayon",
@ -3090,7 +3088,6 @@ dependencies = [
"rustc_error_codes",
"rustc_errors",
"rustc_feature",
"rustc_fs_util",
"rustc_hir",
"rustc_index",
"rustc_macros",
@ -3278,7 +3275,6 @@ dependencies = [
"jemalloc-sys",
"rustc_codegen_ssa",
"rustc_driver",
"rustc_target",
]
[[package]]
@ -3409,7 +3405,6 @@ dependencies = [
"rustc_codegen_utils",
"rustc_data_structures",
"rustc_errors",
"rustc_expand",
"rustc_feature",
"rustc_fs_util",
"rustc_hir",
@ -3497,7 +3492,6 @@ name = "rustc_driver"
version = "0.0.0"
dependencies = [
"env_logger 0.7.1",
"graphviz",
"lazy_static 1.3.0",
"log",
"rustc",
@ -3513,7 +3507,6 @@ dependencies = [
"rustc_mir",
"rustc_parse",
"rustc_plugin_impl",
"rustc_resolve",
"rustc_save_analysis",
"rustc_span",
"rustc_target",
@ -3660,7 +3653,6 @@ dependencies = [
"log",
"rustc",
"rustc_data_structures",
"rustc_error_codes",
"rustc_feature",
"rustc_hir",
"rustc_index",
@ -4464,8 +4456,6 @@ dependencies = [
name = "syntax"
version = "0.0.0"
dependencies = [
"bitflags",
"lazy_static 1.3.0",
"log",
"rustc_data_structures",
"rustc_error_codes",

View file

@ -397,6 +397,7 @@ impl<BorrowType, K, V, Type> NodeRef<BorrowType, K, V, Type> {
/// Borrows a view into the values stored in the node.
/// The caller must ensure that the node is not the shared root.
/// This function is not public, so doesn't have to support shared roots like `keys` does.
fn vals(&self) -> &[V] {
self.reborrow().into_val_slice()
}
@ -514,6 +515,7 @@ impl<'a, K, V, Type> NodeRef<marker::Mut<'a>, K, V, Type> {
}
/// The caller must ensure that the node is not the shared root.
/// This function is not public, so doesn't have to support shared roots like `keys` does.
fn keys_mut(&mut self) -> &mut [K] {
unsafe { self.reborrow_mut().into_key_slice_mut() }
}
@ -589,20 +591,15 @@ impl<'a, K: 'a, V: 'a, Type> NodeRef<marker::Mut<'a>, K, V, Type> {
unsafe { &mut *(self.root as *mut Root<K, V>) }
}
/// The caller must ensure that the node is not the shared root.
fn into_key_slice_mut(mut self) -> &'a mut [K] {
// Same as for `into_key_slice` above, we try to avoid a run-time check.
if (mem::align_of::<NodeHeader<K, V, K>>() > mem::align_of::<NodeHeader<K, V>>()
|| mem::size_of::<NodeHeader<K, V, K>>() != mem::size_of::<NodeHeader<K, V>>())
&& self.is_shared_root()
{
&mut []
} else {
unsafe {
slice::from_raw_parts_mut(
MaybeUninit::first_ptr_mut(&mut (*self.as_leaf_mut()).keys),
self.len(),
)
}
debug_assert!(!self.is_shared_root());
// We cannot be the shared root, so `as_leaf_mut` is okay.
unsafe {
slice::from_raw_parts_mut(
MaybeUninit::first_ptr_mut(&mut (*self.as_leaf_mut()).keys),
self.len(),
)
}
}

View file

@ -46,6 +46,11 @@ where
}
}
/// Returns the index in the node at which the key (or an equivalent) exists
/// or could exist, and whether it exists in the node itself. If it doesn't
/// exist in the node itself, it may exist in the subtree with that index
/// (if the node has subtrees). If the key doesn't exist in node or subtree,
/// the returned index is the position or subtree to insert at.
pub fn search_linear<BorrowType, K, V, Type, Q: ?Sized>(
node: &NodeRef<BorrowType, K, V, Type>,
key: &Q,
@ -54,6 +59,12 @@ where
Q: Ord,
K: Borrow<Q>,
{
// This function is defined over all borrow types (immutable, mutable, owned),
// and may be called on the shared root in each case.
// Crucially, we use `keys()` here, i.e., we work with immutable data.
// `keys_mut()` does not support the shared root, so we cannot use it.
// Using `keys()` is fine here even if BorrowType is mutable, as all we return
// is an index -- not a reference.
for (i, k) in node.keys().iter().enumerate() {
match key.cmp(k.borrow()) {
Ordering::Greater => {}

View file

@ -17,7 +17,7 @@ use crate::usize;
#[derive(Debug)]
pub struct Excess(pub NonNull<u8>, pub usize);
fn size_align<T>() -> (usize, usize) {
const fn size_align<T>() -> (usize, usize) {
(mem::size_of::<T>(), mem::align_of::<T>())
}
@ -120,14 +120,14 @@ impl Layout {
/// Constructs a `Layout` suitable for holding a value of type `T`.
#[stable(feature = "alloc_layout", since = "1.28.0")]
#[rustc_const_stable(feature = "alloc_layout_const_new", since = "1.42.0")]
#[inline]
pub fn new<T>() -> Self {
pub const fn new<T>() -> Self {
let (size, align) = size_align::<T>();
// Note that the align is guaranteed by rustc to be a power of two and
// the size+align combo is guaranteed to fit in our address space. As a
// result use the unchecked constructor here to avoid inserting code
// that panics if it isn't optimized well enough.
debug_assert!(Layout::from_size_align(size, align).is_ok());
unsafe { Layout::from_size_align_unchecked(size, align) }
}

View file

@ -672,6 +672,7 @@ impl<'a, T: ?Sized> Pin<&'a T> {
#[stable(feature = "pin", since = "1.33.0")]
pub unsafe fn map_unchecked<U, F>(self, func: F) -> Pin<&'a U>
where
U: ?Sized,
F: FnOnce(&T) -> &U,
{
let pointer = &*self.pointer;
@ -763,6 +764,7 @@ impl<'a, T: ?Sized> Pin<&'a mut T> {
#[stable(feature = "pin", since = "1.33.0")]
pub unsafe fn map_unchecked_mut<U, F>(self, func: F) -> Pin<&'a mut U>
where
U: ?Sized,
F: FnOnce(&mut T) -> &mut U,
{
let pointer = Pin::get_unchecked_mut(self);

View file

@ -250,6 +250,20 @@ impl<T: ?Sized> *mut T {
/// *first_value = 4;
/// println!("{:?}", s); // It'll print: "[4, 2, 3]".
/// ```
///
/// # Null-unchecked version
///
/// If you are sure the pointer can never be null and are looking for some kind of
/// `as_mut_unchecked` that returns the `&mut T` instead of `Option<&mut T>`, know that
/// you can dereference the pointer directly.
///
/// ```
/// let mut s = [1, 2, 3];
/// let ptr: *mut u32 = s.as_mut_ptr();
/// let first_value = unsafe { &mut *ptr };
/// *first_value = 4;
/// println!("{:?}", s); // It'll print: "[4, 2, 3]".
/// ```
#[stable(feature = "ptr_as_ref", since = "1.9.0")]
#[inline]
pub unsafe fn as_mut<'a>(self) -> Option<&'a mut T> {

View file

@ -15,7 +15,6 @@ bitflags = "1.2.1"
fmt_macros = { path = "../libfmt_macros" }
graphviz = { path = "../libgraphviz" }
jobserver = "0.1"
num_cpus = "1.0"
scoped-tls = "1.0"
log = { version = "0.4", features = ["release_max_level_info", "std"] }
rustc-rayon = "0.3.0"
@ -36,8 +35,6 @@ backtrace = "0.3.40"
parking_lot = "0.9"
byteorder = { version = "1.3" }
chalk-engine = { version = "0.9.0", default-features=false }
rustc_fs_util = { path = "../librustc_fs_util" }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
measureme = "0.5"
rustc_error_codes = { path = "../librustc_error_codes" }
rustc_session = { path = "../librustc_session" }

View file

@ -808,13 +808,6 @@ pub struct UpvarBorrow<'tcx> {
pub type UpvarListMap = FxHashMap<DefId, FxIndexMap<hir::HirId, UpvarId>>;
pub type UpvarCaptureMap<'tcx> = FxHashMap<UpvarId, UpvarCapture<'tcx>>;
#[derive(Copy, Clone, TypeFoldable)]
pub struct ClosureUpvar<'tcx> {
pub res: Res,
pub span: Span,
pub ty: Ty<'tcx>,
}
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum IntVarValue {
IntType(ast::IntTy),

View file

@ -45,12 +45,6 @@ impl fmt::Debug for ty::AdtDef {
}
}
impl fmt::Debug for ty::ClosureUpvar<'tcx> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "ClosureUpvar({:?},{:?})", self.res, self.ty)
}
}
impl fmt::Debug for ty::UpvarId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let name = ty::tls::with(|tcx| tcx.hir().name(self.var_path.hir_id));

View file

@ -31,5 +31,4 @@ rustc_session = { path = "../librustc_session" }
rustc_target = { path = "../librustc_target" }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
syntax = { path = "../libsyntax" }
rustc_expand = { path = "../librustc_expand" }
rustc_span = { path = "../librustc_span" }

View file

@ -345,7 +345,7 @@ fn symbol_export_level(tcx: TyCtxt<'_>, sym_def_id: DefId) -> SymbolExportLevel
if is_extern && !std_internal {
let target = &tcx.sess.target.target.llvm_target;
// WebAssembly cannot export data symbols, so reduce their export level
if target.contains("wasm32") || target.contains("emscripten") {
if target.contains("emscripten") {
if let Some(Node::Item(&hir::Item { kind: hir::ItemKind::Static(..), .. })) =
tcx.hir().get_if_local(sym_def_id)
{

View file

@ -10,7 +10,6 @@ path = "lib.rs"
crate-type = ["dylib"]
[dependencies]
graphviz = { path = "../libgraphviz" }
lazy_static = "1.0"
log = "0.4"
env_logger = { version = "0.7", default-features = false }
@ -30,7 +29,6 @@ rustc_codegen_utils = { path = "../librustc_codegen_utils" }
rustc_error_codes = { path = "../librustc_error_codes" }
rustc_interface = { path = "../librustc_interface" }
rustc_serialize = { path = "../libserialize", package = "serialize" }
rustc_resolve = { path = "../librustc_resolve" }
syntax = { path = "../libsyntax" }
rustc_span = { path = "../librustc_span" }

View file

@ -19,5 +19,4 @@ rustc_span = { path = "../librustc_span" }
rustc_data_structures = { path = "../librustc_data_structures" }
rustc_feature = { path = "../librustc_feature" }
rustc_index = { path = "../librustc_index" }
rustc_error_codes = { path = "../librustc_error_codes" }
rustc_session = { path = "../librustc_session" }

View file

@ -28,7 +28,13 @@ impl<'tcx> MirPass<'tcx> for ElaborateDrops {
let param_env = tcx.param_env(src.def_id()).with_reveal_all();
let move_data = match MoveData::gather_moves(body, tcx, param_env) {
Ok(move_data) => move_data,
Err(_) => bug!("No `move_errors` should be allowed in MIR borrowck"),
Err((move_data, _)) => {
tcx.sess.delay_span_bug(
body.span,
"No `move_errors` should be allowed in MIR borrowck",
);
move_data
}
};
let elaborate_patch = {
let body = &*body;

View file

@ -212,7 +212,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}
}
// Returns a list of `ClosureUpvar`s for each upvar.
// Returns a list of `Ty`s for each upvar.
fn final_upvar_tys(&self, closure_id: hir::HirId) -> Vec<Ty<'tcx>> {
// Presently an unboxed closure type cannot "escape" out of a
// function, so we will only encounter ones that originated in the

View file

@ -631,6 +631,38 @@ where
self.map.raw_entry_mut().from_key(&value).or_insert(value, ()).0
}
/// Inserts an owned copy of the given `value` into the set if it is not
/// present, then returns a reference to the value in the set.
///
/// # Examples
///
/// ```
/// #![feature(hash_set_entry)]
///
/// use std::collections::HashSet;
///
/// let mut set: HashSet<String> = ["cat", "dog", "horse"]
/// .iter().map(|&pet| pet.to_owned()).collect();
///
/// assert_eq!(set.len(), 3);
/// for &pet in &["cat", "dog", "fish"] {
/// let value = set.get_or_insert_owned(pet);
/// assert_eq!(value, pet);
/// }
/// assert_eq!(set.len(), 4); // a new "fish" was inserted
/// ```
#[inline]
#[unstable(feature = "hash_set_entry", issue = "60896")]
pub fn get_or_insert_owned<Q: ?Sized>(&mut self, value: &Q) -> &T
where
T: Borrow<Q>,
Q: Hash + Eq + ToOwned<Owned = T>,
{
// Although the raw entry gives us `&mut T`, we only return `&T` to be consistent with
// `get`. Key mutation is "raw" because you're not supposed to affect `Eq` or `Hash`.
self.map.raw_entry_mut().from_key(value).or_insert_with(|| (value.to_owned(), ())).0
}
/// Inserts a value computed from `f` into the set if the given `value` is
/// not present, then returns a reference to the value in the set.
///

View file

@ -10,11 +10,9 @@ path = "lib.rs"
doctest = false
[dependencies]
bitflags = "1.2.1"
rustc_serialize = { path = "../libserialize", package = "serialize" }
log = "0.4"
scoped-tls = "1.0"
lazy_static = "1.0.0"
rustc_span = { path = "../librustc_span" }
errors = { path = "../librustc_errors", package = "rustc_errors" }
rustc_data_structures = { path = "../librustc_data_structures" }

View file

@ -9,7 +9,6 @@ name = "rustc_binary"
path = "rustc.rs"
[dependencies]
rustc_target = { path = "../librustc_target" }
rustc_driver = { path = "../librustc_driver" }
# Make sure rustc_codegen_ssa ends up in the sysroot, because this

View file

@ -6,6 +6,7 @@ const fn f(x: usize) -> usize {
let mut sum = 0;
for i in 0..x {
//~^ ERROR E0015
//~| ERROR E0015
//~| ERROR E0658
//~| ERROR E0080
//~| ERROR E0744

View file

@ -8,6 +8,7 @@ fn main() {
//~| WARN denote infinite loops with
[(); { for _ in 0usize.. {}; 0}];
//~^ ERROR calls in constants are limited to constant functions
//~| ERROR calls in constants are limited to constant functions
//~| ERROR `for` is not allowed in a `const`
//~| ERROR references in constants may only refer to immutable values
//~| ERROR evaluation of constant value failed

View file

@ -2,3 +2,6 @@
#[no_mangle]
pub extern fn foo() {}
#[no_mangle]
pub static FOO: u64 = 42;

View file

@ -9,16 +9,20 @@ console.log('exports', list);
const my_exports = {};
let nexports = 0;
for (const entry of list) {
if (entry.kind !== 'function')
continue;
my_exports[entry.name] = true;
nexports += 1;
if (entry.kind == 'function'){
nexports += 1;
}
my_exports[entry.name] = entry.kind;
}
if (my_exports.foo === undefined)
if (my_exports.foo != "function")
throw new Error("`foo` wasn't defined");
if (my_exports.FOO != "global")
throw new Error("`FOO` wasn't defined");
if (my_exports.main === undefined) {
if (nexports != 1)
throw new Error("should only have one function export");

View file

@ -10,6 +10,8 @@ fn lintme() { } //~ ERROR item is named 'lintme'
#[allow(test_lint)]
//~^ ERROR allow(test_lint) overruled by outer forbid(test_lint)
//~| ERROR allow(test_lint) overruled by outer forbid(test_lint)
//~| ERROR allow(test_lint) overruled by outer forbid(test_lint)
pub fn main() {
lintme();
}

View file

@ -7,6 +7,15 @@ LL | #![forbid(test_lint)]
LL | #[allow(test_lint)]
| ^^^^^^^^^ overruled by previous forbid
error[E0453]: allow(test_lint) overruled by outer forbid(test_lint)
--> $DIR/lint-plugin-forbid-attrs.rs:11:9
|
LL | #![forbid(test_lint)]
| --------- `forbid` level set here
...
LL | #[allow(test_lint)]
| ^^^^^^^^^ overruled by previous forbid
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
--> $DIR/lint-plugin-forbid-attrs.rs:5:1
|
@ -27,6 +36,15 @@ note: lint level defined here
LL | #![forbid(test_lint)]
| ^^^^^^^^^
error: aborting due to 2 previous errors
error[E0453]: allow(test_lint) overruled by outer forbid(test_lint)
--> $DIR/lint-plugin-forbid-attrs.rs:11:9
|
LL | #![forbid(test_lint)]
| --------- `forbid` level set here
...
LL | #[allow(test_lint)]
| ^^^^^^^^^ overruled by previous forbid
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0453`.

View file

@ -8,6 +8,8 @@
fn lintme() { } //~ ERROR item is named 'lintme'
#[allow(test_lint)] //~ ERROR allow(test_lint) overruled by outer forbid(test_lint)
//~| ERROR allow(test_lint) overruled by outer forbid(test_lint)
//~| ERROR allow(test_lint) overruled by outer forbid(test_lint)
pub fn main() {
lintme();
}

View file

@ -6,6 +6,14 @@ LL | #[allow(test_lint)]
|
= note: `forbid` lint level was set on command line
error[E0453]: allow(test_lint) overruled by outer forbid(test_lint)
--> $DIR/lint-plugin-forbid-cmdline.rs:10:9
|
LL | #[allow(test_lint)]
| ^^^^^^^^^ overruled by previous forbid
|
= note: `forbid` lint level was set on command line
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
--> $DIR/lint-plugin-forbid-cmdline.rs:6:1
|
@ -22,6 +30,14 @@ LL | fn lintme() { }
|
= note: requested on the command line with `-F test-lint`
error: aborting due to 2 previous errors
error[E0453]: allow(test_lint) overruled by outer forbid(test_lint)
--> $DIR/lint-plugin-forbid-cmdline.rs:10:9
|
LL | #[allow(test_lint)]
| ^^^^^^^^^ overruled by previous forbid
|
= note: `forbid` lint level was set on command line
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0453`.

View file

@ -2,6 +2,10 @@ warning: lint name `test_lint` is deprecated and does not have an effect anymore
|
= note: requested on the command line with `-A test_lint`
warning: lint name `test_lint` is deprecated and does not have an effect anymore. Use: clippy::test_lint
|
= note: requested on the command line with `-A test_lint`
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
--> $DIR/lint-tool-cmdline-allow.rs:7:1
|
@ -10,6 +14,10 @@ LL | #![plugin(lint_tool_test)]
|
= note: `#[warn(deprecated)]` on by default
warning: lint name `test_lint` is deprecated and does not have an effect anymore. Use: clippy::test_lint
|
= note: requested on the command line with `-A test_lint`
warning: item is named 'lintme'
--> $DIR/lint-tool-cmdline-allow.rs:9:1
|
@ -18,3 +26,7 @@ LL | fn lintme() {}
|
= note: `#[warn(clippy::test_lint)]` on by default
warning: lint name `test_lint` is deprecated and does not have an effect anymore. Use: clippy::test_lint
|
= note: requested on the command line with `-A test_lint`

View file

@ -8,9 +8,12 @@
#![allow(dead_code)]
#![cfg_attr(foo, warn(test_lint))]
//~^ WARNING lint name `test_lint` is deprecated and may not have an effect in the future
//~^^ WARNING lint name `test_lint` is deprecated and may not have an effect in the future
//~| WARNING lint name `test_lint` is deprecated and may not have an effect in the future
//~| WARNING lint name `test_lint` is deprecated and may not have an effect in the future
#![deny(clippy_group)]
//~^ WARNING lint name `clippy_group` is deprecated and may not have an effect in the future
//~| WARNING lint name `clippy_group` is deprecated and may not have an effect in the future
//~| WARNING lint name `clippy_group` is deprecated and may not have an effect in the future
fn lintme() { } //~ ERROR item is named 'lintme'
@ -25,6 +28,8 @@ pub fn main() {
#[allow(test_group)]
//~^ WARNING lint name `test_group` is deprecated and may not have an effect in the future
//~| WARNING lint name `test_group` is deprecated and may not have an effect in the future
//~| WARNING lint name `test_group` is deprecated and may not have an effect in the future
#[deny(this_lint_does_not_exist)] //~ WARNING unknown lint: `this_lint_does_not_exist`
fn hello() {
fn lintmetoo() { }

View file

@ -7,19 +7,19 @@ LL | #![cfg_attr(foo, warn(test_lint))]
= note: `#[warn(renamed_and_removed_lints)]` on by default
warning: lint name `clippy_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:12:9
--> $DIR/lint-tool-test.rs:13:9
|
LL | #![deny(clippy_group)]
| ^^^^^^^^^^^^ help: change it to: `clippy::group`
warning: lint name `test_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:26:9
--> $DIR/lint-tool-test.rs:29:9
|
LL | #[allow(test_group)]
| ^^^^^^^^^^ help: change it to: `clippy::test_group`
warning: unknown lint: `this_lint_does_not_exist`
--> $DIR/lint-tool-test.rs:28:8
--> $DIR/lint-tool-test.rs:33:8
|
LL | #[deny(this_lint_does_not_exist)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
@ -32,6 +32,18 @@ warning: lint name `test_lint` is deprecated and may not have an effect in the f
LL | #![cfg_attr(foo, warn(test_lint))]
| ^^^^^^^^^ help: change it to: `clippy::test_lint`
warning: lint name `clippy_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:13:9
|
LL | #![deny(clippy_group)]
| ^^^^^^^^^^^^ help: change it to: `clippy::group`
warning: lint name `test_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:29:9
|
LL | #[allow(test_group)]
| ^^^^^^^^^^ help: change it to: `clippy::test_group`
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
--> $DIR/lint-tool-test.rs:6:1
|
@ -40,31 +52,49 @@ LL | #![plugin(lint_tool_test)]
|
= note: `#[warn(deprecated)]` on by default
warning: lint name `test_lint` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:9:23
|
LL | #![cfg_attr(foo, warn(test_lint))]
| ^^^^^^^^^ help: change it to: `clippy::test_lint`
warning: lint name `clippy_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:13:9
|
LL | #![deny(clippy_group)]
| ^^^^^^^^^^^^ help: change it to: `clippy::group`
error: item is named 'lintme'
--> $DIR/lint-tool-test.rs:15:1
--> $DIR/lint-tool-test.rs:18:1
|
LL | fn lintme() { }
| ^^^^^^^^^^^^^^^
|
note: lint level defined here
--> $DIR/lint-tool-test.rs:12:9
--> $DIR/lint-tool-test.rs:13:9
|
LL | #![deny(clippy_group)]
| ^^^^^^^^^^^^
= note: `#[deny(clippy::test_lint)]` implied by `#[deny(clippy::group)]`
error: item is named 'lintmetoo'
--> $DIR/lint-tool-test.rs:23:5
--> $DIR/lint-tool-test.rs:26:5
|
LL | fn lintmetoo() { }
| ^^^^^^^^^^^^^^^^^^
|
note: lint level defined here
--> $DIR/lint-tool-test.rs:12:9
--> $DIR/lint-tool-test.rs:13:9
|
LL | #![deny(clippy_group)]
| ^^^^^^^^^^^^
= note: `#[deny(clippy::test_group)]` implied by `#[deny(clippy::group)]`
warning: lint name `test_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:29:9
|
LL | #[allow(test_group)]
| ^^^^^^^^^^ help: change it to: `clippy::test_group`
error: aborting due to 2 previous errors

View file

@ -157,10 +157,13 @@ trait TRW3<T> where T: Iterator<Item: 'static, Item: 'static> {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719]
trait TRSW1 where Self: Iterator<Item: Copy, Item: Send> {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719]
//~| ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719]
trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719]
//~| ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719]
trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719]
//~| ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719]
trait TRA1 { type A: Iterator<Item: Copy, Item: Send>; }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719]
trait TRA2 { type A: Iterator<Item: Copy, Item: Copy>; }

View file

@ -531,7 +531,15 @@ LL | trait TRSW1 where Self: Iterator<Item: Copy, Item: Send> {}
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:160:46
--> $DIR/duplicate.rs:158:46
|
LL | trait TRSW1 where Self: Iterator<Item: Copy, Item: Send> {}
| ---------- ^^^^^^^^^^ re-bound here
| |
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:161:46
|
LL | trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {}
| ---------- ^^^^^^^^^^ re-bound here
@ -539,7 +547,15 @@ LL | trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {}
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:162:49
--> $DIR/duplicate.rs:161:46
|
LL | trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {}
| ---------- ^^^^^^^^^^ re-bound here
| |
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:164:49
|
LL | trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {}
| ------------- ^^^^^^^^^^^^^ re-bound here
@ -547,7 +563,15 @@ LL | trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {}
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:164:43
--> $DIR/duplicate.rs:164:49
|
LL | trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {}
| ------------- ^^^^^^^^^^^^^ re-bound here
| |
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:167:43
|
LL | trait TRA1 { type A: Iterator<Item: Copy, Item: Send>; }
| ---------- ^^^^^^^^^^ re-bound here
@ -555,7 +579,7 @@ LL | trait TRA1 { type A: Iterator<Item: Copy, Item: Send>; }
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:166:43
--> $DIR/duplicate.rs:169:43
|
LL | trait TRA2 { type A: Iterator<Item: Copy, Item: Copy>; }
| ---------- ^^^^^^^^^^ re-bound here
@ -563,7 +587,7 @@ LL | trait TRA2 { type A: Iterator<Item: Copy, Item: Copy>; }
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:168:46
--> $DIR/duplicate.rs:171:46
|
LL | trait TRA3 { type A: Iterator<Item: 'static, Item: 'static>; }
| ------------- ^^^^^^^^^^^^^ re-bound here
@ -571,7 +595,7 @@ LL | trait TRA3 { type A: Iterator<Item: 'static, Item: 'static>; }
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:171:40
--> $DIR/duplicate.rs:174:40
|
LL | type TADyn1 = dyn Iterator<Item: Copy, Item: Send>;
| ---------- ^^^^^^^^^^ re-bound here
@ -579,7 +603,7 @@ LL | type TADyn1 = dyn Iterator<Item: Copy, Item: Send>;
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:175:44
--> $DIR/duplicate.rs:178:44
|
LL | type TADyn2 = Box<dyn Iterator<Item: Copy, Item: Copy>>;
| ---------- ^^^^^^^^^^ re-bound here
@ -587,7 +611,7 @@ LL | type TADyn2 = Box<dyn Iterator<Item: Copy, Item: Copy>>;
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:179:43
--> $DIR/duplicate.rs:182:43
|
LL | type TADyn3 = dyn Iterator<Item: 'static, Item: 'static>;
| ------------- ^^^^^^^^^^^^^ re-bound here
@ -667,40 +691,40 @@ LL | type ETAI6 = impl Iterator<Item: 'static, Item: 'static>;
| ^^^^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:171:28
--> $DIR/duplicate.rs:174:28
|
LL | type TADyn1 = dyn Iterator<Item: Copy, Item: Send>;
| ^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:171:40
--> $DIR/duplicate.rs:174:40
|
LL | type TADyn1 = dyn Iterator<Item: Copy, Item: Send>;
| ^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:175:32
--> $DIR/duplicate.rs:178:32
|
LL | type TADyn2 = Box<dyn Iterator<Item: Copy, Item: Copy>>;
| ^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:175:44
--> $DIR/duplicate.rs:178:44
|
LL | type TADyn2 = Box<dyn Iterator<Item: Copy, Item: Copy>>;
| ^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:179:28
--> $DIR/duplicate.rs:182:28
|
LL | type TADyn3 = dyn Iterator<Item: 'static, Item: 'static>;
| ^^^^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:179:43
--> $DIR/duplicate.rs:182:43
|
LL | type TADyn3 = dyn Iterator<Item: 'static, Item: 'static>;
| ^^^^^^^^^^^^^
error: aborting due to 93 previous errors
error: aborting due to 96 previous errors

View file

@ -8,6 +8,7 @@ impl<T> Trait<'_, '_> for T { }
async fn async_ret_impl_trait<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a, 'b> {
//~^ ERROR ambiguous lifetime bound
//~| ERROR ambiguous lifetime bound
(a, b)
}

View file

@ -6,5 +6,13 @@ LL | async fn async_ret_impl_trait<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'
|
= help: add #![feature(member_constraints)] to the crate attributes to enable
error: aborting due to previous error
error: ambiguous lifetime bound in `impl Trait`
--> $DIR/ret-impl-trait-no-fg.rs:9:64
|
LL | async fn async_ret_impl_trait<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a, 'b> {
| ^^^^^^^^^^^^^^^^^^ neither `'a` nor `'b` outlives the other
|
= help: add #![feature(member_constraints)] to the crate attributes to enable
error: aborting due to 2 previous errors

View file

@ -8,8 +8,16 @@ async fn bar<T>() -> () {}
async fn foo() {
bar().await;
//~^ ERROR type inside `async fn` body must be known in this context
//~| ERROR type inside `async fn` body must be known in this context
//~| ERROR type inside `async fn` body must be known in this context
//~| NOTE cannot infer type for type parameter `T`
//~| NOTE cannot infer type for type parameter `T`
//~| NOTE cannot infer type for type parameter `T`
//~| NOTE the type is part of the `async fn` body because of this `await`
//~| NOTE the type is part of the `async fn` body because of this `await`
//~| NOTE the type is part of the `async fn` body because of this `await`
//~| NOTE in this expansion of desugaring of `await`
//~| NOTE in this expansion of desugaring of `await`
//~| NOTE in this expansion of desugaring of `await`
}
fn main() {}

View file

@ -10,6 +10,30 @@ note: the type is part of the `async fn` body because of this `await`
LL | bar().await;
| ^^^^^^^^^^^
error: aborting due to previous error
error[E0698]: type inside `async fn` body must be known in this context
--> $DIR/unresolved_type_param.rs:9:5
|
LL | bar().await;
| ^^^ cannot infer type for type parameter `T` declared on the function `bar`
|
note: the type is part of the `async fn` body because of this `await`
--> $DIR/unresolved_type_param.rs:9:5
|
LL | bar().await;
| ^^^^^^^^^^^
error[E0698]: type inside `async fn` body must be known in this context
--> $DIR/unresolved_type_param.rs:9:5
|
LL | bar().await;
| ^^^ cannot infer type for type parameter `T` declared on the function `bar`
|
note: the type is part of the `async fn` body because of this `await`
--> $DIR/unresolved_type_param.rs:9:5
|
LL | bar().await;
| ^^^^^^^^^^^
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0698`.

View file

@ -11,4 +11,5 @@ use tool as renamed_tool; // OK
#[renamed_attr] //~ ERROR cannot use an explicitly registered attribute through an import
#[renamed_tool::attr] //~ ERROR cannot use a tool module through an import
//~| ERROR cannot use a tool module through an import
fn main() {}

View file

@ -22,5 +22,17 @@ note: the tool module imported here
LL | use tool as renamed_tool; // OK
| ^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
error: cannot use a tool module through an import
--> $DIR/register-attr-tool-import.rs:13:3
|
LL | #[renamed_tool::attr]
| ^^^^^^^^^^^^
|
note: the tool module imported here
--> $DIR/register-attr-tool-import.rs:10:5
|
LL | use tool as renamed_tool; // OK
| ^^^^^^^^^^^^^^^^^^^^
error: aborting due to 3 previous errors

View file

@ -26,6 +26,7 @@ impl<'a, 't> Foo<'a, 't> for &'a isize {
fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) {
//~^ ERROR method not compatible with trait
//~| ERROR method not compatible with trait
//
// Note: This is a terrible error message. It is caused
// because, in the trait, 'b is early bound, and in the impl,

View file

@ -35,8 +35,27 @@ note: ...does not necessarily outlive the lifetime `'c` as defined on the method
LL | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) {
| ^^
error[E0308]: method not compatible with trait
--> $DIR/regions-bound-missing-bound-in-impl.rs:27:5
|
LL | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
|
= note: expected fn pointer `fn(&'a isize, Inv<'c>, Inv<'c>, Inv<'_>)`
found fn pointer `fn(&'a isize, Inv<'_>, Inv<'c>, Inv<'_>)`
note: the lifetime `'c` as defined on the method body at 27:24...
--> $DIR/regions-bound-missing-bound-in-impl.rs:27:24
|
LL | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) {
| ^^
note: ...does not necessarily outlive the lifetime `'c` as defined on the method body at 27:24
--> $DIR/regions-bound-missing-bound-in-impl.rs:27:24
|
LL | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) {
| ^^
error[E0195]: lifetime parameters or bounds on method `wrong_bound2` do not match the trait declaration
--> $DIR/regions-bound-missing-bound-in-impl.rs:41:20
--> $DIR/regions-bound-missing-bound-in-impl.rs:42:20
|
LL | fn wrong_bound2<'b,'c,'d:'a+'b>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>);
| ---------------- lifetimes in impl do not match this method in trait
@ -45,7 +64,7 @@ LL | fn wrong_bound2(self, b: Inv, c: Inv, d: Inv) {
| ^ lifetimes do not match method in trait
error[E0276]: impl has stricter requirements than trait
--> $DIR/regions-bound-missing-bound-in-impl.rs:48:5
--> $DIR/regions-bound-missing-bound-in-impl.rs:49:5
|
LL | fn another_bound<'x: 'a>(self, x: Inv<'x>, y: Inv<'t>);
| ------------------------------------------------------- definition of `another_bound` from trait
@ -53,7 +72,7 @@ LL | fn another_bound<'x: 'a>(self, x: Inv<'x>, y: Inv<'t>);
LL | fn another_bound<'x: 't>(self, x: Inv<'x>, y: Inv<'t>) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `'x: 't`
error: aborting due to 5 previous errors
error: aborting due to 6 previous errors
Some errors have detailed explanations: E0195, E0276, E0308.
For more information about an error, try `rustc --explain E0195`.

View file

@ -14,6 +14,7 @@ fn main() {
match -128i8 {
NEG_NEG_128 => println!("A"),
//~^ ERROR could not evaluate constant pattern
//~| ERROR could not evaluate constant pattern
_ => println!("B"),
}
}

View file

@ -4,5 +4,11 @@ error: could not evaluate constant pattern
LL | NEG_NEG_128 => println!("A"),
| ^^^^^^^^^^^
error: aborting due to previous error
error: could not evaluate constant pattern
--> $DIR/const-eval-overflow-2.rs:15:9
|
LL | NEG_NEG_128 => println!("A"),
| ^^^^^^^^^^^
error: aborting due to 2 previous errors

View file

@ -5,6 +5,7 @@ fn main() {
match n {
0..=10 => {},
10..=BAR => {}, //~ ERROR could not evaluate constant pattern
//~| ERROR could not evaluate constant pattern
_ => {},
}
}

View file

@ -1,5 +1,5 @@
error[E0080]: it is undefined behavior to use this value
--> $DIR/ref_to_int_match.rs:24:1
--> $DIR/ref_to_int_match.rs:25:1
|
LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
@ -12,6 +12,12 @@ error: could not evaluate constant pattern
LL | 10..=BAR => {},
| ^^^
error: aborting due to 2 previous errors
error: could not evaluate constant pattern
--> $DIR/ref_to_int_match.rs:7:14
|
LL | 10..=BAR => {},
| ^^^
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0080`.

View file

@ -17,6 +17,7 @@ macro_rules! mac {
enum E {
$( $v = $s::V, )*
//~^ ERROR mismatched types
//~| ERROR mismatched types
}
}
}

View file

@ -15,6 +15,23 @@ help: you can convert an `i32` to `isize` and panic if the converted value would
LL | $( $v = $s::V.try_into().unwrap(), )*
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
error[E0308]: mismatched types
--> $DIR/enum-discr-type-err.rs:18:21
|
LL | $( $v = $s::V, )*
| ^^^^^ expected `isize`, found `i32`
...
LL | / mac! {
LL | | A = F,
LL | | B = T,
LL | | }
| |_- in this macro invocation
|
help: you can convert an `i32` to `isize` and panic if the converted value wouldn't fit
|
LL | $( $v = $s::V.try_into().unwrap(), )*
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0308`.

View file

@ -10,6 +10,7 @@ fn main() {
match C {
C => {}
//~^ ERROR to use a constant of type `S` in a pattern, `S` must be annotated with
//~| ERROR to use a constant of type `S` in a pattern, `S` must be annotated with
}
const K: &T = &T;
match K { //~ ERROR non-exhaustive patterns: `&T` not covered

View file

@ -5,7 +5,7 @@ LL | C => {}
| ^
error[E0004]: non-exhaustive patterns: `&T` not covered
--> $DIR/match_ice.rs:15:11
--> $DIR/match_ice.rs:16:11
|
LL | struct T;
| --------- `T` defined here
@ -15,6 +15,12 @@ LL | match K {
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
error: aborting due to 2 previous errors
error: to use a constant of type `S` in a pattern, `S` must be annotated with `#[derive(PartialEq, Eq)]`
--> $DIR/match_ice.rs:11:9
|
LL | C => {}
| ^
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0004`.

View file

@ -28,6 +28,7 @@ const READ_INTERIOR_MUT: usize = {
static mut MUTABLE: u32 = 0;
const READ_MUT: u32 = unsafe { MUTABLE }; //~ WARN any use of this value will cause an error
//~^ WARN skipping const checks
//~| WARN skipping const checks
// ok some day perhaps
const READ_IMMUT: &usize = { //~ ERROR it is undefined behavior to use this value

View file

@ -29,7 +29,13 @@ LL | const READ_MUT: u32 = unsafe { MUTABLE };
| ^^^^^^^
warning: skipping const checks
--> $DIR/const_refers_to_static.rs:35:6
--> $DIR/const_refers_to_static.rs:29:32
|
LL | const READ_MUT: u32 = unsafe { MUTABLE };
| ^^^^^^^
warning: skipping const checks
--> $DIR/const_refers_to_static.rs:36:6
|
LL | &FOO
| ^^^
@ -84,7 +90,7 @@ LL | const READ_MUT: u32 = unsafe { MUTABLE };
| constant accesses static
error[E0080]: it is undefined behavior to use this value
--> $DIR/const_refers_to_static.rs:33:1
--> $DIR/const_refers_to_static.rs:34:1
|
LL | / const READ_IMMUT: &usize = {
LL | | static FOO: usize = 0;

View file

@ -8,6 +8,7 @@
fn main() {
match &b""[..] {
ZST => {} //~ ERROR could not evaluate constant pattern
//~| ERROR could not evaluate constant pattern
}
}

View file

@ -1,5 +1,5 @@
error: any use of this value will cause an error
--> $DIR/transmute-size-mismatch-before-typeck.rs:14:29
--> $DIR/transmute-size-mismatch-before-typeck.rs:15:29
|
LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
| ----------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^---
@ -15,7 +15,7 @@ LL | ZST => {}
| ^^^
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-size-mismatch-before-typeck.rs:14:29
--> $DIR/transmute-size-mismatch-before-typeck.rs:15:29
|
LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
| ^^^^^^^^^^^^^^^^^^^
@ -23,6 +23,12 @@ LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
= note: source type: `usize` (word size)
= note: target type: `&'static [u8]` (2 * word size)
error: aborting due to 3 previous errors
error: could not evaluate constant pattern
--> $DIR/transmute-size-mismatch-before-typeck.rs:10:9
|
LL | ZST => {}
| ^^^
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0512`.

View file

@ -3,6 +3,7 @@
trait Foo<X = Box<dyn Foo>> {
//~^ ERROR cycle detected
//~| ERROR cycle detected
}
fn main() { }

View file

@ -11,6 +11,19 @@ note: cycle used when collecting item types in top-level module
LL | trait Foo<X = Box<dyn Foo>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
error[E0391]: cycle detected when processing `Foo::X`
--> $DIR/cycle-trait-default-type-trait.rs:4:23
|
LL | trait Foo<X = Box<dyn Foo>> {
| ^^^
|
= note: ...which again requires processing `Foo::X`, completing the cycle
note: cycle used when collecting item types in top-level module
--> $DIR/cycle-trait-default-type-trait.rs:4:1
|
LL | trait Foo<X = Box<dyn Foo>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0391`.

View file

@ -0,0 +1,28 @@
warning: floating-point types cannot be used in patterns
--> $DIR/deduplicate-diagnostics-2.rs:7:9
|
LL | 1.0 => {}
| ^^^
|
= note: `#[warn(illegal_floating_point_literal_pattern)]` 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!
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
warning: floating-point types cannot be used in patterns
--> $DIR/deduplicate-diagnostics-2.rs:11:9
|
LL | 2.0 => {}
| ^^^
|
= 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 #41620 <https://github.com/rust-lang/rust/issues/41620>
warning: floating-point types cannot be used in patterns
--> $DIR/deduplicate-diagnostics-2.rs:7:9
|
LL | 1.0 => {}
| ^^^
|
= 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 #41620 <https://github.com/rust-lang/rust/issues/41620>

View file

@ -0,0 +1,37 @@
warning: floating-point types cannot be used in patterns
--> $DIR/deduplicate-diagnostics-2.rs:7:9
|
LL | 1.0 => {}
| ^^^
|
= note: `#[warn(illegal_floating_point_literal_pattern)]` 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!
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
warning: floating-point types cannot be used in patterns
--> $DIR/deduplicate-diagnostics-2.rs:11:9
|
LL | 2.0 => {}
| ^^^
|
= 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 #41620 <https://github.com/rust-lang/rust/issues/41620>
warning: floating-point types cannot be used in patterns
--> $DIR/deduplicate-diagnostics-2.rs:7:9
|
LL | 1.0 => {}
| ^^^
|
= 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 #41620 <https://github.com/rust-lang/rust/issues/41620>
warning: floating-point types cannot be used in patterns
--> $DIR/deduplicate-diagnostics-2.rs:11:9
|
LL | 2.0 => {}
| ^^^
|
= 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 #41620 <https://github.com/rust-lang/rust/issues/41620>

View file

@ -0,0 +1,17 @@
// build-pass
// revisions: duplicate deduplicate
//[deduplicate] compile-flags: -Z deduplicate-diagnostics=yes
fn main() {
match 0.0 {
1.0 => {} //~ WARNING floating-point types cannot be used in patterns
//~| WARNING this was previously accepted
//~| WARNING floating-point types cannot be used in patterns
//~| WARNING this was previously accepted
2.0 => {} //~ WARNING floating-point types cannot be used in patterns
//~| WARNING this was previously accepted
//[duplicate]~| WARNING floating-point types cannot be used in patterns
//[duplicate]~| WARNING this was previously accepted
_ => {}
}
}

View file

@ -1,8 +1,15 @@
error[E0452]: malformed lint attribute input
--> $DIR/deduplicate-diagnostics.rs:8:8
|
LL | #[deny("literal")]
| ^^^^^^^^^ bad attribute argument
error: cannot find derive macro `Unresolved` in this scope
--> $DIR/deduplicate-diagnostics.rs:4:10
|
LL | #[derive(Unresolved)]
| ^^^^^^^^^^
error: aborting due to previous error
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0452`.

View file

@ -1,3 +1,9 @@
error[E0452]: malformed lint attribute input
--> $DIR/deduplicate-diagnostics.rs:8:8
|
LL | #[deny("literal")]
| ^^^^^^^^^ bad attribute argument
error: cannot find derive macro `Unresolved` in this scope
--> $DIR/deduplicate-diagnostics.rs:4:10
|
@ -10,5 +16,18 @@ error: cannot find derive macro `Unresolved` in this scope
LL | #[derive(Unresolved)]
| ^^^^^^^^^^
error: aborting due to 2 previous errors
error[E0452]: malformed lint attribute input
--> $DIR/deduplicate-diagnostics.rs:8:8
|
LL | #[deny("literal")]
| ^^^^^^^^^ bad attribute argument
error[E0452]: malformed lint attribute input
--> $DIR/deduplicate-diagnostics.rs:8:8
|
LL | #[deny("literal")]
| ^^^^^^^^^ bad attribute argument
error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0452`.

View file

@ -1,8 +1,11 @@
// revisions: duplicate deduplicate
//[duplicate] compile-flags: -Z deduplicate-diagnostics=no
//[deduplicate] compile-flags: -Z deduplicate-diagnostics=yes
#[derive(Unresolved)] //~ ERROR cannot find derive macro `Unresolved` in this scope
//[duplicate]~| ERROR cannot find derive macro `Unresolved` in this scope
struct S;
#[deny("literal")] //~ ERROR malformed lint attribute input
//[duplicate]~| ERROR malformed lint attribute input
//[duplicate]~| ERROR malformed lint attribute input
fn main() {}

View file

@ -10,7 +10,11 @@ struct Error;
#[derive(PartialOrd,PartialEq)]
enum Enum {
A {
x: Error //~ ERROR
x: Error //~ ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
}
}

View file

@ -7,6 +7,42 @@ LL | x: Error
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error: aborting due to previous error
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-enum-struct-variant.rs:13:6
|
LL | x: Error
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-enum-struct-variant.rs:13:6
|
LL | x: Error
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-enum-struct-variant.rs:13:6
|
LL | x: Error
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-enum-struct-variant.rs:13:6
|
LL | x: Error
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0277`.

View file

@ -10,7 +10,11 @@ struct Error;
#[derive(PartialOrd,PartialEq)]
enum Enum {
A(
Error //~ ERROR
Error //~ ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
)
}

View file

@ -7,6 +7,42 @@ LL | Error
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error: aborting due to previous error
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-enum.rs:13:6
|
LL | Error
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-enum.rs:13:6
|
LL | Error
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-enum.rs:13:6
|
LL | Error
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-enum.rs:13:6
|
LL | Error
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0277`.

View file

@ -9,7 +9,11 @@ struct Error;
#[derive(PartialOrd,PartialEq)]
struct Struct {
x: Error //~ ERROR
x: Error //~ ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
}
fn main() {}

View file

@ -7,6 +7,42 @@ LL | x: Error
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error: aborting due to previous error
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-struct.rs:12:5
|
LL | x: Error
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-struct.rs:12:5
|
LL | x: Error
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-struct.rs:12:5
|
LL | x: Error
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-struct.rs:12:5
|
LL | x: Error
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0277`.

View file

@ -9,7 +9,11 @@ struct Error;
#[derive(PartialOrd,PartialEq)]
struct Struct(
Error //~ ERROR
Error //~ ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
);
fn main() {}

View file

@ -7,6 +7,42 @@ LL | Error
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error: aborting due to previous error
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-tuple-struct.rs:12:5
|
LL | Error
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-tuple-struct.rs:12:5
|
LL | Error
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-tuple-struct.rs:12:5
|
LL | Error
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-tuple-struct.rs:12:5
|
LL | Error
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0277`.

View file

@ -1,9 +1,11 @@
#[derive(Send)]
//~^ ERROR cannot find derive macro `Send` in this scope
//~| ERROR cannot find derive macro `Send` in this scope
struct Test;
#[derive(Sync)]
//~^ ERROR cannot find derive macro `Sync` in this scope
//~| ERROR cannot find derive macro `Sync` in this scope
struct Test1;
pub fn main() {}

View file

@ -1,11 +1,23 @@
error: cannot find derive macro `Sync` in this scope
--> $DIR/deriving-bounds.rs:5:10
--> $DIR/deriving-bounds.rs:6:10
|
LL | #[derive(Sync)]
| ^^^^
|
note: unsafe traits like `Sync` should be implemented explicitly
--> $DIR/deriving-bounds.rs:5:10
--> $DIR/deriving-bounds.rs:6:10
|
LL | #[derive(Sync)]
| ^^^^
error: cannot find derive macro `Sync` in this scope
--> $DIR/deriving-bounds.rs:6:10
|
LL | #[derive(Sync)]
| ^^^^
|
note: unsafe traits like `Sync` should be implemented explicitly
--> $DIR/deriving-bounds.rs:6:10
|
LL | #[derive(Sync)]
| ^^^^
@ -22,5 +34,17 @@ note: unsafe traits like `Send` should be implemented explicitly
LL | #[derive(Send)]
| ^^^^
error: aborting due to 2 previous errors
error: cannot find derive macro `Send` in this scope
--> $DIR/deriving-bounds.rs:1:10
|
LL | #[derive(Send)]
| ^^^^
|
note: unsafe traits like `Send` should be implemented explicitly
--> $DIR/deriving-bounds.rs:1:10
|
LL | #[derive(Send)]
| ^^^^
error: aborting due to 4 previous errors

View file

@ -1,5 +1,6 @@
#[derive(Eqr)]
//~^ ERROR cannot find derive macro `Eqr` in this scope
//~| ERROR cannot find derive macro `Eqr` in this scope
struct Foo;
pub fn main() {}

View file

@ -4,5 +4,11 @@ error: cannot find derive macro `Eqr` in this scope
LL | #[derive(Eqr)]
| ^^^ help: a derive macro with a similar name exists: `Eq`
error: aborting due to previous error
error: cannot find derive macro `Eqr` in this scope
--> $DIR/deriving-meta-unknown-trait.rs:1:10
|
LL | #[derive(Eqr)]
| ^^^ help: a derive macro with a similar name exists: `Eq`
error: aborting due to 2 previous errors

View file

@ -1,4 +1,5 @@
#[derive(FromPrimitive)] //~ ERROR cannot find derive macro `FromPrimitive` in this scope
//~| ERROR cannot find derive macro `FromPrimitive` in this scope
enum Foo {}
fn main() {}

View file

@ -4,5 +4,11 @@ error: cannot find derive macro `FromPrimitive` in this scope
LL | #[derive(FromPrimitive)]
| ^^^^^^^^^^^^^
error: aborting due to previous error
error: cannot find derive macro `FromPrimitive` in this scope
--> $DIR/deriving-primitive.rs:1:10
|
LL | #[derive(FromPrimitive)]
| ^^^^^^^^^^^^^
error: aborting due to 2 previous errors

View file

@ -5,8 +5,10 @@ fn test_and() {
let b = false;
let _ = a and b; //~ ERROR `and` is not a logical operator
//~| ERROR `and` is not a logical operator
if a and b { //~ ERROR `and` is not a logical operator
//~| ERROR `and` is not a logical operator
println!("both");
}
@ -18,8 +20,10 @@ fn test_or() {
let b = false;
let _ = a or b; //~ ERROR `or` is not a logical operator
//~| ERROR `or` is not a logical operator
if a or b { //~ ERROR `or` is not a logical operator
//~| ERROR `or` is not a logical operator
println!("both");
}
}
@ -28,6 +32,7 @@ fn test_and_par() {
let a = true;
let b = false;
if (a and b) { //~ ERROR `and` is not a logical operator
//~| ERROR `and` is not a logical operator
println!("both");
}
}
@ -36,6 +41,7 @@ fn test_or_par() {
let a = true;
let b = false;
if (a or b) { //~ ERROR `or` is not a logical operator
//~| ERROR `or` is not a logical operator
println!("both");
}
}
@ -44,6 +50,7 @@ fn test_while_and() {
let a = true;
let b = false;
while a and b { //~ ERROR `and` is not a logical operator
//~| ERROR `and` is not a logical operator
println!("both");
}
}
@ -52,6 +59,7 @@ fn test_while_or() {
let a = true;
let b = false;
while a or b { //~ ERROR `or` is not a logical operator
//~| ERROR `or` is not a logical operator
println!("both");
}
}

View file

@ -7,7 +7,23 @@ LL | let _ = a and b;
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:9:10
--> $DIR/issue-54109-and_instead_of_ampersands.rs:7:15
|
LL | let _ = a and b;
| ^^^ help: use `&&` to perform logical conjunction
|
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:10:10
|
LL | if a and b {
| ^^^ help: use `&&` to perform logical conjunction
|
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:10:10
|
LL | if a and b {
| ^^^ help: use `&&` to perform logical conjunction
@ -15,7 +31,7 @@ LL | if a and b {
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:20:15
--> $DIR/issue-54109-and_instead_of_ampersands.rs:22:15
|
LL | let _ = a or b;
| ^^ help: use `||` to perform logical disjunction
@ -23,7 +39,23 @@ LL | let _ = a or b;
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:22:10
--> $DIR/issue-54109-and_instead_of_ampersands.rs:22:15
|
LL | let _ = a or b;
| ^^ help: use `||` to perform logical disjunction
|
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:25:10
|
LL | if a or b {
| ^^ help: use `||` to perform logical disjunction
|
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:25:10
|
LL | if a or b {
| ^^ help: use `||` to perform logical disjunction
@ -31,7 +63,15 @@ LL | if a or b {
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:30:11
--> $DIR/issue-54109-and_instead_of_ampersands.rs:34:11
|
LL | if (a and b) {
| ^^^ help: use `&&` to perform logical conjunction
|
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:34:11
|
LL | if (a and b) {
| ^^^ help: use `&&` to perform logical conjunction
@ -39,7 +79,15 @@ LL | if (a and b) {
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:38:11
--> $DIR/issue-54109-and_instead_of_ampersands.rs:43:11
|
LL | if (a or b) {
| ^^ help: use `||` to perform logical disjunction
|
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:43:11
|
LL | if (a or b) {
| ^^ help: use `||` to perform logical disjunction
@ -47,7 +95,15 @@ LL | if (a or b) {
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:46:13
--> $DIR/issue-54109-and_instead_of_ampersands.rs:52:13
|
LL | while a and b {
| ^^^ help: use `&&` to perform logical conjunction
|
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:52:13
|
LL | while a and b {
| ^^^ help: use `&&` to perform logical conjunction
@ -55,7 +111,15 @@ LL | while a and b {
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:54:13
--> $DIR/issue-54109-and_instead_of_ampersands.rs:61:13
|
LL | while a or b {
| ^^ help: use `||` to perform logical disjunction
|
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:61:13
|
LL | while a or b {
| ^^ help: use `||` to perform logical disjunction
@ -63,13 +127,13 @@ LL | while a or b {
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error[E0308]: mismatched types
--> $DIR/issue-54109-and_instead_of_ampersands.rs:13:33
--> $DIR/issue-54109-and_instead_of_ampersands.rs:15:33
|
LL | let _recovery_witness: () = 0;
| -- ^ expected `()`, found integer
| |
| expected due to this
error: aborting due to 9 previous errors
error: aborting due to 17 previous errors
For more information about this error, try `rustc --explain E0308`.

View file

@ -2,5 +2,6 @@ fn main() {
match 5u32 {
1000 ..= 5 => {}
//~^ ERROR lower range bound must be less than or equal to upper
//~| ERROR lower range bound must be less than or equal to upper
}
}

View file

@ -4,6 +4,12 @@ error[E0030]: lower range bound must be less than or equal to upper
LL | 1000 ..= 5 => {}
| ^^^^ lower bound larger than upper bound
error: aborting due to previous error
error[E0030]: lower range bound must be less than or equal to upper
--> $DIR/E0030.rs:3:9
|
LL | 1000 ..= 5 => {}
| ^^^^ lower bound larger than upper bound
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0030`.

View file

@ -1,4 +1,8 @@
#![allow(foo = "")] //~ ERROR E0452
//~| ERROR E0452
//~| ERROR E0452
//~| ERROR E0452
//~| ERROR E0452
//~| ERROR E0452
fn main() {
}

View file

@ -4,6 +4,36 @@ error[E0452]: malformed lint attribute input
LL | #![allow(foo = "")]
| ^^^^^^^^ bad attribute argument
error: aborting due to previous error
error[E0452]: malformed lint attribute input
--> $DIR/E0452.rs:1:10
|
LL | #![allow(foo = "")]
| ^^^^^^^^ bad attribute argument
error[E0452]: malformed lint attribute input
--> $DIR/E0452.rs:1:10
|
LL | #![allow(foo = "")]
| ^^^^^^^^ bad attribute argument
error[E0452]: malformed lint attribute input
--> $DIR/E0452.rs:1:10
|
LL | #![allow(foo = "")]
| ^^^^^^^^ bad attribute argument
error[E0452]: malformed lint attribute input
--> $DIR/E0452.rs:1:10
|
LL | #![allow(foo = "")]
| ^^^^^^^^ bad attribute argument
error[E0452]: malformed lint attribute input
--> $DIR/E0452.rs:1:10
|
LL | #![allow(foo = "")]
| ^^^^^^^^ bad attribute argument
error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0452`.

View file

@ -2,5 +2,7 @@
#[allow(non_snake_case)]
//~^ ERROR allow(non_snake_case) overruled by outer forbid(non_snake_case)
//~| ERROR allow(non_snake_case) overruled by outer forbid(non_snake_case)
//~| ERROR allow(non_snake_case) overruled by outer forbid(non_snake_case)
fn main() {
}

View file

@ -7,6 +7,24 @@ LL |
LL | #[allow(non_snake_case)]
| ^^^^^^^^^^^^^^ overruled by previous forbid
error: aborting due to previous error
error[E0453]: allow(non_snake_case) overruled by outer forbid(non_snake_case)
--> $DIR/E0453.rs:3:9
|
LL | #![forbid(non_snake_case)]
| -------------- `forbid` level set here
LL |
LL | #[allow(non_snake_case)]
| ^^^^^^^^^^^^^^ overruled by previous forbid
error[E0453]: allow(non_snake_case) overruled by outer forbid(non_snake_case)
--> $DIR/E0453.rs:3:9
|
LL | #![forbid(non_snake_case)]
| -------------- `forbid` level set here
LL |
LL | #[allow(non_snake_case)]
| ^^^^^^^^^^^^^^ overruled by previous forbid
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0453`.

View file

@ -1,5 +1,6 @@
// repr currently doesn't support literals
#[repr("C")] //~ ERROR E0565
//~| ERROR E0565
struct A { }
fn main() { }

View file

@ -4,6 +4,12 @@ error[E0565]: meta item in `repr` must be an identifier
LL | #[repr("C")]
| ^^^
error: aborting due to previous error
error[E0565]: meta item in `repr` must be an identifier
--> $DIR/E0565.rs:2:8
|
LL | #[repr("C")]
| ^^^
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0565`.

View file

@ -2,6 +2,14 @@ error[E0602]: unknown lint: `bogus`
|
= note: requested on the command line with `-D bogus`
error: aborting due to previous error
error[E0602]: unknown lint: `bogus`
|
= note: requested on the command line with `-D bogus`
error[E0602]: unknown lint: `bogus`
|
= note: requested on the command line with `-D bogus`
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0602`.

View file

@ -3,14 +3,17 @@
mod derive {
#[derive(x3300)]
//~^ ERROR cannot find derive macro `x3300` in this scope
//~| ERROR cannot find derive macro `x3300` in this scope
union U { f: i32 }
#[derive(x3300)]
//~^ ERROR cannot find derive macro `x3300` in this scope
//~| ERROR cannot find derive macro `x3300` in this scope
enum E { }
#[derive(x3300)]
//~^ ERROR cannot find derive macro `x3300` in this scope
//~| ERROR cannot find derive macro `x3300` in this scope
struct S;
}

View file

@ -1,11 +1,23 @@
error: cannot find derive macro `x3300` in this scope
--> $DIR/issue-43106-gating-of-derive-2.rs:12:14
--> $DIR/issue-43106-gating-of-derive-2.rs:14:14
|
LL | #[derive(x3300)]
| ^^^^^
error: cannot find derive macro `x3300` in this scope
--> $DIR/issue-43106-gating-of-derive-2.rs:8:14
--> $DIR/issue-43106-gating-of-derive-2.rs:14:14
|
LL | #[derive(x3300)]
| ^^^^^
error: cannot find derive macro `x3300` in this scope
--> $DIR/issue-43106-gating-of-derive-2.rs:9:14
|
LL | #[derive(x3300)]
| ^^^^^
error: cannot find derive macro `x3300` in this scope
--> $DIR/issue-43106-gating-of-derive-2.rs:9:14
|
LL | #[derive(x3300)]
| ^^^^^
@ -16,5 +28,11 @@ error: cannot find derive macro `x3300` in this scope
LL | #[derive(x3300)]
| ^^^^^
error: aborting due to 3 previous errors
error: cannot find derive macro `x3300` in this scope
--> $DIR/issue-43106-gating-of-derive-2.rs:4:14
|
LL | #[derive(x3300)]
| ^^^^^
error: aborting due to 6 previous errors

View file

@ -18,6 +18,7 @@ mod rustc_deprecated {
#[rustc_deprecated()] struct S;
//~^ ERROR stability attributes may not be used outside of the standard library
//~| ERROR stability attributes may not be used outside of the standard library
#[rustc_deprecated()] type T = S;
//~^ ERROR stability attributes may not be used outside of the standard library

View file

@ -29,17 +29,23 @@ LL | #[rustc_deprecated()] struct S;
| ^^^^^^^^^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:22:5
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:19:5
|
LL | #[rustc_deprecated()] struct S;
| ^^^^^^^^^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:23:5
|
LL | #[rustc_deprecated()] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:25:5
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:26:5
|
LL | #[rustc_deprecated()] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 7 previous errors
error: aborting due to 8 previous errors
For more information about this error, try `rustc --explain E0734`.

View file

@ -18,6 +18,7 @@ mod stable {
#[stable()] struct S;
//~^ ERROR stability attributes may not be used outside of the standard library
//~| ERROR stability attributes may not be used outside of the standard library
#[stable()] type T = S;
//~^ ERROR stability attributes may not be used outside of the standard library

View file

@ -29,17 +29,23 @@ LL | #[stable()] struct S;
| ^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-stable.rs:22:5
--> $DIR/issue-43106-gating-of-stable.rs:19:5
|
LL | #[stable()] struct S;
| ^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-stable.rs:23:5
|
LL | #[stable()] type T = S;
| ^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-stable.rs:25:5
--> $DIR/issue-43106-gating-of-stable.rs:26:5
|
LL | #[stable()] impl S { }
| ^^^^^^^^^^^
error: aborting due to 7 previous errors
error: aborting due to 8 previous errors
For more information about this error, try `rustc --explain E0734`.

View file

@ -18,6 +18,7 @@ mod unstable {
#[unstable()] struct S;
//~^ ERROR stability attributes may not be used outside of the standard library
//~| ERROR stability attributes may not be used outside of the standard library
#[unstable()] type T = S;
//~^ ERROR stability attributes may not be used outside of the standard library

View file

@ -29,17 +29,23 @@ LL | #[unstable()] struct S;
| ^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-unstable.rs:22:5
--> $DIR/issue-43106-gating-of-unstable.rs:19:5
|
LL | #[unstable()] struct S;
| ^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-unstable.rs:23:5
|
LL | #[unstable()] type T = S;
| ^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-unstable.rs:25:5
--> $DIR/issue-43106-gating-of-unstable.rs:26:5
|
LL | #[unstable()] impl S { }
| ^^^^^^^^^^^^^
error: aborting due to 7 previous errors
error: aborting due to 8 previous errors
For more information about this error, try `rustc --explain E0734`.

View file

@ -1,2 +1,3 @@
#[doc(include="asdf.md")] //~ ERROR: `#[doc(include)]` is experimental
//~| ERROR: `#[doc(include)]` is experimental
fn main() {}

View file

@ -7,6 +7,15 @@ LL | #[doc(include="asdf.md")]
= note: for more information, see https://github.com/rust-lang/rust/issues/44732
= help: add `#![feature(external_doc)]` to the crate attributes to enable
error: aborting due to previous error
error[E0658]: `#[doc(include)]` is experimental
--> $DIR/feature-gate-external_doc.rs:1:1
|
LL | #[doc(include="asdf.md")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/44732
= help: add `#![feature(external_doc)]` to the crate attributes to enable
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0658`.

View file

@ -1,4 +1,6 @@
#![warn(nonstandard_style, reason = "the standard should be respected")]
//~^ ERROR lint reasons are experimental
//~| ERROR lint reasons are experimental
//~| ERROR lint reasons are experimental
fn main() {}

View file

@ -7,6 +7,24 @@ LL | #![warn(nonstandard_style, reason = "the standard should be respected")]
= note: for more information, see https://github.com/rust-lang/rust/issues/54503
= help: add `#![feature(lint_reasons)]` to the crate attributes to enable
error: aborting due to previous error
error[E0658]: lint reasons are experimental
--> $DIR/feature-gate-lint-reasons.rs:1:28
|
LL | #![warn(nonstandard_style, reason = "the standard should be respected")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/54503
= help: add `#![feature(lint_reasons)]` to the crate attributes to enable
error[E0658]: lint reasons are experimental
--> $DIR/feature-gate-lint-reasons.rs:1:28
|
LL | #![warn(nonstandard_style, reason = "the standard should be respected")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/54503
= help: add `#![feature(lint_reasons)]` to the crate attributes to enable
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0658`.

View file

@ -1,5 +1,5 @@
error[E0716]: temporary value dropped while borrowed
--> $DIR/auto-trait-regions.rs:44:24
--> $DIR/auto-trait-regions.rs:45:24
|
LL | let a = A(&mut true, &mut true, No);
| ^^^^ - temporary value is freed at the end of this statement
@ -12,7 +12,7 @@ LL | assert_foo(a);
= note: consider using a `let` binding to create a longer lived value
error[E0716]: temporary value dropped while borrowed
--> $DIR/auto-trait-regions.rs:44:35
--> $DIR/auto-trait-regions.rs:45:35
|
LL | let a = A(&mut true, &mut true, No);
| ^^^^ - temporary value is freed at the end of this statement
@ -31,7 +31,7 @@ LL | assert_foo(gen);
| ^^^^^^^^^^^^^^^
error: higher-ranked subtype error
--> $DIR/auto-trait-regions.rs:48:5
--> $DIR/auto-trait-regions.rs:49:5
|
LL | assert_foo(gen);
| ^^^^^^^^^^^^^^^

View file

@ -29,6 +29,7 @@ fn main() {
};
assert_foo(gen);
//~^ ERROR implementation of `Foo` is not general enough
//~| ERROR implementation of `Foo` is not general enough
// Allow impls which matches any lifetime
let x = &OnlyFooIfRef(No);
@ -47,4 +48,5 @@ fn main() {
};
assert_foo(gen);
//~^ ERROR not general enough
//~| ERROR not general enough
}

View file

@ -11,7 +11,19 @@ LL | assert_foo(gen);
= note: ...but `Foo` is actually implemented for the type `&'1 OnlyFooIfStaticRef`, for some specific lifetime `'1`
error: implementation of `Foo` is not general enough
--> $DIR/auto-trait-regions.rs:48:5
--> $DIR/auto-trait-regions.rs:30:5
|
LL | auto trait Foo {}
| ----------------- trait `Foo` defined here
...
LL | assert_foo(gen);
| ^^^^^^^^^^ implementation of `Foo` is not general enough
|
= note: `Foo` would have to be implemented for the type `&'0 OnlyFooIfStaticRef`, for any lifetime `'0`...
= note: ...but `Foo` is actually implemented for the type `&'1 OnlyFooIfStaticRef`, for some specific lifetime `'1`
error: implementation of `Foo` is not general enough
--> $DIR/auto-trait-regions.rs:49:5
|
LL | auto trait Foo {}
| ----------------- trait `Foo` defined here
@ -22,5 +34,17 @@ LL | assert_foo(gen);
= note: `Foo` would have to be implemented for the type `A<'0, '1>`, for any two lifetimes `'0` and `'1`...
= note: ...but `Foo` is actually implemented for the type `A<'_, '2>`, for some specific lifetime `'2`
error: aborting due to 2 previous errors
error: implementation of `Foo` is not general enough
--> $DIR/auto-trait-regions.rs:49:5
|
LL | auto trait Foo {}
| ----------------- trait `Foo` defined here
...
LL | assert_foo(gen);
| ^^^^^^^^^^ implementation of `Foo` is not general enough
|
= note: `Foo` would have to be implemented for the type `A<'0, '1>`, for any two lifetimes `'0` and `'1`...
= note: ...but `Foo` is actually implemented for the type `A<'_, '2>`, for some specific lifetime `'2`
error: aborting due to 4 previous errors

View file

@ -39,6 +39,7 @@ LL | | // Not OK -- The forwarding impl for `Foo` requires that `Bar` also
... |
LL | | foo_hrtb_bar_not(&mut t);
| | ------------------------ recursive call site
LL | |
LL | | }
| |_^ cannot return without recursing
|
@ -62,7 +63,7 @@ LL | foo_hrtb_bar_not(&mut t);
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: function cannot return without recursing
--> $DIR/hrtb-perfect-forwarding.rs:49:1
--> $DIR/hrtb-perfect-forwarding.rs:50:1
|
LL | / fn foo_hrtb_bar_hrtb<T>(mut t: T)
LL | | where T : for<'a> Foo<&'a isize> + for<'b> Bar<&'b isize>

Some files were not shown because too many files have changed in this diff Show more