Auto merge of #124752 - GuillaumeGomez:rollup-a4qagbd, r=GuillaumeGomez
Rollup of 6 pull requests Successful merges: - #124148 (rustdoc-search: search for references) - #124668 (Fix bootstrap panic when build from tarball) - #124736 (compiler: upgrade time from 0.3.34 to 0.3.36) - #124748 (Fix unwinding on 32-bit watchOS ARM (v2)) - #124749 (Stabilize exclusive_range_pattern (v2)) - #124750 (Document That `f16` And `f128` Hardware Support is Limited (v2)) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
@@ -5597,9 +5597,9 @@ version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "time"
|
||||
version = "0.3.34"
|
||||
version = "0.3.36"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749"
|
||||
checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
|
||||
dependencies = [
|
||||
"deranged",
|
||||
"itoa",
|
||||
@@ -5618,9 +5618,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
|
||||
|
||||
[[package]]
|
||||
name = "time-macros"
|
||||
version = "0.2.17"
|
||||
version = "0.2.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774"
|
||||
checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"
|
||||
dependencies = [
|
||||
"num-conv",
|
||||
"time-core",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use rustc_ast as ast;
|
||||
use rustc_ast::visit::{self, AssocCtxt, FnCtxt, FnKind, Visitor};
|
||||
use rustc_ast::{attr, AssocConstraint, AssocConstraintKind, NodeId};
|
||||
use rustc_ast::{token, PatKind, RangeEnd};
|
||||
use rustc_ast::{token, PatKind};
|
||||
use rustc_feature::{AttributeGate, BuiltinAttribute, Features, GateIssue, BUILTIN_ATTRIBUTE_MAP};
|
||||
use rustc_session::parse::{feature_err, feature_err_issue, feature_warn};
|
||||
use rustc_session::Session;
|
||||
@@ -418,15 +418,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
|
||||
PatKind::Box(..) => {
|
||||
gate!(&self, box_patterns, pattern.span, "box pattern syntax is experimental");
|
||||
}
|
||||
PatKind::Range(_, Some(_), Spanned { node: RangeEnd::Excluded, .. }) => {
|
||||
gate!(
|
||||
&self,
|
||||
exclusive_range_pattern,
|
||||
pattern.span,
|
||||
"exclusive range pattern syntax is experimental",
|
||||
"use an inclusive range pattern, like N..=M"
|
||||
);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
visit::walk_pat(self, pattern)
|
||||
@@ -619,10 +610,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
|
||||
// be too.
|
||||
gate_all_legacy_dont_use!(return_type_notation, "return type notation is experimental");
|
||||
gate_all_legacy_dont_use!(decl_macro, "`macro` is experimental");
|
||||
gate_all_legacy_dont_use!(
|
||||
exclusive_range_pattern,
|
||||
"exclusive range pattern syntax is experimental"
|
||||
);
|
||||
gate_all_legacy_dont_use!(try_blocks, "`try` blocks are unstable");
|
||||
gate_all_legacy_dont_use!(auto_traits, "`auto` traits are unstable");
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ rustc_trait_selection = { path = "../rustc_trait_selection" }
|
||||
rustc_ty_utils = { path = "../rustc_ty_utils" }
|
||||
serde_json = "1.0.59"
|
||||
shlex = "1.0"
|
||||
time = { version = "0.3", default-features = false, features = ["alloc", "formatting", "parsing", "macros"] }
|
||||
time = { version = "0.3.36", default-features = false, features = ["alloc", "formatting", "parsing", "macros"] }
|
||||
tracing = { version = "0.1.35" }
|
||||
# tidy-alphabetical-end
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ A lower range wasn't less than the upper range.
|
||||
Erroneous code example:
|
||||
|
||||
```compile_fail,E0579
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {
|
||||
match 5u32 {
|
||||
|
||||
@@ -162,6 +162,8 @@ declare_features! (
|
||||
(accepted, drop_types_in_const, "1.22.0", Some(33156)),
|
||||
/// Allows using `dyn Trait` as a syntax for trait objects.
|
||||
(accepted, dyn_trait, "1.27.0", Some(44662)),
|
||||
/// Allows `X..Y` patterns.
|
||||
(accepted, exclusive_range_pattern, "CURRENT_RUSTC_VERSION", Some(37854)),
|
||||
/// Allows integer match exhaustiveness checking (RFC 2591).
|
||||
(accepted, exhaustive_integer_patterns, "1.33.0", Some(50907)),
|
||||
/// Allows explicit generic arguments specification with `impl Trait` present.
|
||||
|
||||
@@ -454,8 +454,6 @@ declare_features! (
|
||||
(incomplete, dyn_star, "1.65.0", Some(102425)),
|
||||
/// Uses generic effect parameters for ~const bounds
|
||||
(unstable, effects, "1.72.0", Some(102090)),
|
||||
/// Allows `X..Y` patterns.
|
||||
(unstable, exclusive_range_pattern, "1.11.0", Some(37854)),
|
||||
/// Allows exhaustive pattern matching on types that contain uninhabited types.
|
||||
(unstable, exhaustive_patterns, "1.13.0", Some(51085)),
|
||||
/// Allows explicit tail calls via `become` expression.
|
||||
|
||||
@@ -844,7 +844,6 @@ declare_lint! {
|
||||
/// ### Example
|
||||
///
|
||||
/// ```rust
|
||||
/// # #![feature(exclusive_range_pattern)]
|
||||
/// let x = 123u32;
|
||||
/// match x {
|
||||
/// 0..100 => { println!("small"); }
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
//! This is enough to compute usefulness: a pattern in a `match` expression is redundant iff it is
|
||||
//! not useful w.r.t. the patterns above it:
|
||||
//! ```compile_fail,E0004
|
||||
//! # #![feature(exclusive_range_pattern)]
|
||||
//! # fn foo() {
|
||||
//! match Some(0u32) {
|
||||
//! Some(0..100) => {},
|
||||
|
||||
@@ -165,6 +165,7 @@
|
||||
//
|
||||
// Language features:
|
||||
// tidy-alphabetical-start
|
||||
#![cfg_attr(bootstrap, feature(exclusive_range_pattern))]
|
||||
#![cfg_attr(not(test), feature(coroutine_trait))]
|
||||
#![cfg_attr(test, feature(panic_update_hook))]
|
||||
#![cfg_attr(test, feature(test))]
|
||||
@@ -179,7 +180,6 @@
|
||||
#![feature(const_try)]
|
||||
#![feature(decl_macro)]
|
||||
#![feature(dropck_eyepatch)]
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![feature(fundamental)]
|
||||
#![feature(hashmap_internals)]
|
||||
#![feature(lang_items)]
|
||||
|
||||
@@ -1133,6 +1133,12 @@ impl<T> (T,) {}
|
||||
/// bits. Please see [the documentation for [`prim@f32`] or [Wikipedia on
|
||||
/// half-precision values][wikipedia] for more information.
|
||||
///
|
||||
/// Note that most common platforms will not support `f16` in hardware without enabling extra target
|
||||
/// features, with the notable exception of Apple Silicon (also known as M1, M2, etc.) processors.
|
||||
/// Hardware support on x86-64 requires the avx512fp16 feature, while RISC-V requires Zhf.
|
||||
/// Usually the fallback implementation will be to use `f32` hardware if it exists, and convert
|
||||
/// between `f16` and `f32` when performing math.
|
||||
///
|
||||
/// *[See also the `std::f16::consts` module](crate::f16::consts).*
|
||||
///
|
||||
/// [wikipedia]: https://en.wikipedia.org/wiki/Half-precision_floating-point_format
|
||||
@@ -1232,6 +1238,12 @@ mod prim_f64 {}
|
||||
/// as many bits as `f64`. Please see [the documentation for [`prim@f32`] or [Wikipedia on
|
||||
/// quad-precision values][wikipedia] for more information.
|
||||
///
|
||||
/// Note that no platforms have hardware support for `f128` without enabling target specific features,
|
||||
/// as for all instruction set architectures `f128` is considered an optional feature.
|
||||
/// Only Power ISA ("PowerPC") and RISCV specify it, and only certain microarchitectures
|
||||
/// actually implement it. For x86-64 and AArch64, ISA support is not even specified,
|
||||
/// so it will always be a software implementation significantly slower than `f64`.
|
||||
///
|
||||
/// *[See also the `std::f128::consts` module](crate::f128::consts).*
|
||||
///
|
||||
/// [wikipedia]: https://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format
|
||||
|
||||
@@ -54,7 +54,14 @@ pub enum EHAction {
|
||||
Terminate,
|
||||
}
|
||||
|
||||
pub const USING_SJLJ_EXCEPTIONS: bool = cfg!(all(target_os = "ios", target_arch = "arm"));
|
||||
/// 32-bit Apple ARM uses SjLj exceptions, except for watchOS.
|
||||
///
|
||||
/// I.e. iOS and tvOS, as those are the only Apple OSes that used 32-bit ARM
|
||||
/// devices.
|
||||
///
|
||||
/// <https://github.com/llvm/llvm-project/blob/llvmorg-18.1.4/clang/lib/Driver/ToolChains/Darwin.cpp#L3107-L3119>
|
||||
pub const USING_SJLJ_EXCEPTIONS: bool =
|
||||
cfg!(all(target_vendor = "apple", not(target_os = "watchos"), target_arch = "arm"));
|
||||
|
||||
pub unsafe fn find_eh_action(lsda: *const u8, context: &EHContext<'_>) -> Result<EHAction, ()> {
|
||||
if lsda.is_null() {
|
||||
|
||||
@@ -92,11 +92,12 @@ const UNWIND_DATA_REG: (i32, i32) = (4, 5); // a0, a1
|
||||
// https://github.com/gcc-mirror/gcc/blob/trunk/libgcc/unwind-c.c
|
||||
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(all(target_arch = "arm", not(target_os = "ios"), not(target_os = "tvos"), not(target_os = "watchos"), not(target_os = "visionos"), not(target_os = "netbsd")))] {
|
||||
if #[cfg(all(not(all(target_vendor = "apple", not(target_os = "watchos"))), target_arch = "arm", not(target_os = "netbsd")))] {
|
||||
// ARM EHABI personality routine.
|
||||
// https://web.archive.org/web/20190728160938/https://infocenter.arm.com/help/topic/com.arm.doc.ihi0038b/IHI0038B_ehabi.pdf
|
||||
//
|
||||
// iOS uses the default routine instead since it uses SjLj unwinding.
|
||||
// Apple 32-bit ARM (but not watchOS) uses the default routine instead
|
||||
// since it uses SjLj unwinding.
|
||||
#[lang = "eh_personality"]
|
||||
unsafe extern "C" fn rust_eh_personality(
|
||||
state: uw::_Unwind_State,
|
||||
|
||||
@@ -33,10 +33,10 @@ pub const unwinder_private_data_size: usize = 2;
|
||||
#[cfg(all(target_arch = "x86_64", target_os = "windows"))]
|
||||
pub const unwinder_private_data_size: usize = 6;
|
||||
|
||||
#[cfg(all(target_arch = "arm", not(any(target_os = "ios", target_os = "watchos"))))]
|
||||
#[cfg(all(target_arch = "arm", not(all(target_vendor = "apple", not(target_os = "watchos")))))]
|
||||
pub const unwinder_private_data_size: usize = 20;
|
||||
|
||||
#[cfg(all(target_arch = "arm", any(target_os = "ios", target_os = "watchos")))]
|
||||
#[cfg(all(target_arch = "arm", all(target_vendor = "apple", not(target_os = "watchos"))))]
|
||||
pub const unwinder_private_data_size: usize = 5;
|
||||
|
||||
#[cfg(all(target_arch = "aarch64", target_pointer_width = "64", not(target_os = "windows")))]
|
||||
@@ -123,7 +123,7 @@ extern "C" {
|
||||
}
|
||||
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(any(target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos", target_os = "netbsd", not(target_arch = "arm")))] {
|
||||
if #[cfg(any(all(target_vendor = "apple", not(target_os = "watchos")), target_os = "netbsd", not(target_arch = "arm")))] {
|
||||
// Not ARM EHABI
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
@@ -258,8 +258,15 @@ if #[cfg(any(target_os = "ios", target_os = "tvos", target_os = "watchos", targe
|
||||
} // cfg_if!
|
||||
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(not(all(target_os = "ios", target_arch = "arm")))] {
|
||||
// Not 32-bit iOS
|
||||
if #[cfg(all(target_vendor = "apple", not(target_os = "watchos"), target_arch = "arm"))] {
|
||||
// 32-bit ARM Apple (except for watchOS) uses SjLj and does not provide
|
||||
// _Unwind_Backtrace()
|
||||
extern "C-unwind" {
|
||||
pub fn _Unwind_SjLj_RaiseException(e: *mut _Unwind_Exception) -> _Unwind_Reason_Code;
|
||||
}
|
||||
|
||||
pub use _Unwind_SjLj_RaiseException as _Unwind_RaiseException;
|
||||
} else {
|
||||
#[cfg_attr(
|
||||
all(feature = "llvm-libunwind", any(target_os = "fuchsia", target_os = "linux", target_os = "xous")),
|
||||
link(name = "unwind", kind = "static", modifiers = "-bundle")
|
||||
@@ -276,13 +283,6 @@ if #[cfg(not(all(target_os = "ios", target_arch = "arm")))] {
|
||||
trace_argument: *mut c_void)
|
||||
-> _Unwind_Reason_Code;
|
||||
}
|
||||
} else {
|
||||
// 32-bit iOS uses SjLj and does not provide _Unwind_Backtrace()
|
||||
extern "C-unwind" {
|
||||
pub fn _Unwind_SjLj_RaiseException(e: *mut _Unwind_Exception) -> _Unwind_Reason_Code;
|
||||
}
|
||||
|
||||
pub use _Unwind_SjLj_RaiseException as _Unwind_RaiseException;
|
||||
}
|
||||
} // cfg_if!
|
||||
|
||||
|
||||
@@ -2221,13 +2221,8 @@ impl<'a> Builder<'a> {
|
||||
out
|
||||
}
|
||||
|
||||
/// Return paths of all submodules managed by git.
|
||||
/// If the current checkout is not managed by git, returns an empty slice.
|
||||
/// Return paths of all submodules.
|
||||
pub fn get_all_submodules(&self) -> &[String] {
|
||||
if !self.rust_info().is_managed_git_subrepository() {
|
||||
return &[];
|
||||
}
|
||||
|
||||
static SUBMODULES_PATHS: OnceLock<Vec<String>> = OnceLock::new();
|
||||
|
||||
let init_submodules_paths = |src: &PathBuf| {
|
||||
|
||||
@@ -146,6 +146,7 @@ and number of matches. For example, a function with the signature
|
||||
`fn read_all(&mut self: impl Read) -> Result<Vec<u8>, Error>`
|
||||
will match these queries:
|
||||
|
||||
* `&mut Read -> Result<Vec<u8>, Error>`
|
||||
* `Read -> Result<Vec<u8>, Error>`
|
||||
* `Read -> Result<Error, Vec>`
|
||||
* `Read -> Result<Vec<u8>>`
|
||||
@@ -166,6 +167,10 @@ but you need to know which one you want.
|
||||
|
||||
| Shorthand | Explicit names |
|
||||
| ---------------- | ------------------------------------------------- |
|
||||
| `&` | `primitive:reference` |
|
||||
| `&T` | `primitive:reference<T>` |
|
||||
| `&mut` | `primitive:reference<keyword:mut>` |
|
||||
| `&mut T` | `primitive:reference<keyword:mut, T>` |
|
||||
| `[]` | `primitive:slice` and/or `primitive:array` |
|
||||
| `[T]` | `primitive:slice<T>` and/or `primitive:array<T>` |
|
||||
| `()` | `primitive:unit` and/or `primitive:tuple` |
|
||||
@@ -253,7 +258,8 @@ ident = *(ALPHA / DIGIT / "_")
|
||||
path = ident *(DOUBLE-COLON ident) [BANG]
|
||||
slice-like = OPEN-SQUARE-BRACKET [ nonempty-arg-list ] CLOSE-SQUARE-BRACKET
|
||||
tuple-like = OPEN-PAREN [ nonempty-arg-list ] CLOSE-PAREN
|
||||
arg = [type-filter *WS COLON *WS] (path [generics] / slice-like / tuple-like)
|
||||
borrow-ref = AMP *WS [MUT] *WS [arg]
|
||||
arg = [type-filter *WS COLON *WS] (path [generics] / slice-like / tuple-like / borrow-ref)
|
||||
type-sep = COMMA/WS *(COMMA/WS)
|
||||
nonempty-arg-list = *(type-sep) arg *(type-sep arg) *(type-sep) [ return-args ]
|
||||
generic-arg-list = *(type-sep) arg [ EQUAL arg ] *(type-sep arg [ EQUAL arg ]) *(type-sep)
|
||||
@@ -310,6 +316,8 @@ COMMA = ","
|
||||
RETURN-ARROW = "->"
|
||||
EQUAL = "="
|
||||
BANG = "!"
|
||||
AMP = "&"
|
||||
MUT = "mut"
|
||||
|
||||
ALPHA = %x41-5A / %x61-7A ; A-Z / a-z
|
||||
DIGIT = %x30-39
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
# `exclusive_range_pattern`
|
||||
|
||||
The tracking issue for this feature is: [#37854].
|
||||
|
||||
|
||||
[#67264]: https://github.com/rust-lang/rust/issues/67264
|
||||
[#37854]: https://github.com/rust-lang/rust/issues/37854
|
||||
-----
|
||||
|
||||
The `exclusive_range_pattern` feature allows non-inclusive range
|
||||
patterns (`0..10`) to be used in appropriate pattern matching
|
||||
contexts. It also can be combined with `#![feature(half_open_range_patterns]`
|
||||
to be able to use RangeTo patterns (`..10`).
|
||||
|
||||
It also enabled RangeFrom patterns but that has since been
|
||||
stabilized.
|
||||
|
||||
```rust
|
||||
#![feature(exclusive_range_pattern)]
|
||||
let x = 5;
|
||||
match x {
|
||||
0..10 => println!("single digit"),
|
||||
10 => println!("ten isn't part of the above range"),
|
||||
_ => println!("nor is everything else.")
|
||||
}
|
||||
```
|
||||
@@ -1,7 +1,7 @@
|
||||
# `half_open_range_patterns_in_slices`
|
||||
|
||||
The tracking issue for this feature is: [#67264]
|
||||
It is part of the `exclusive_range_pattern` feature,
|
||||
It is a future part of the `exclusive_range_pattern` feature,
|
||||
tracked at [#37854].
|
||||
|
||||
[#67264]: https://github.com/rust-lang/rust/issues/67264
|
||||
@@ -12,7 +12,6 @@ This feature allow using top-level half-open range patterns in slices.
|
||||
|
||||
```rust
|
||||
#![feature(half_open_range_patterns_in_slices)]
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {
|
||||
let xs = [13, 1, 5, 2, 3, 1, 21, 8];
|
||||
|
||||
@@ -182,6 +182,7 @@ pub(crate) enum RenderTypeId {
|
||||
Primitive(clean::PrimitiveType),
|
||||
AssociatedType(Symbol),
|
||||
Index(isize),
|
||||
Mut,
|
||||
}
|
||||
|
||||
impl RenderTypeId {
|
||||
|
||||
@@ -7,7 +7,7 @@ use rustc_data_structures::fx::{FxHashMap, FxIndexMap};
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
use rustc_span::def_id::DefId;
|
||||
use rustc_span::sym;
|
||||
use rustc_span::symbol::Symbol;
|
||||
use rustc_span::symbol::{kw, Symbol};
|
||||
use serde::ser::{Serialize, SerializeSeq, SerializeStruct, Serializer};
|
||||
use thin_vec::ThinVec;
|
||||
|
||||
@@ -163,6 +163,15 @@ pub(crate) fn build_index<'tcx>(
|
||||
) -> Option<RenderTypeId> {
|
||||
let Cache { ref paths, ref external_paths, ref exact_paths, .. } = *cache;
|
||||
match id {
|
||||
RenderTypeId::Mut => Some(insert_into_map(
|
||||
primitives,
|
||||
kw::Mut,
|
||||
lastpathid,
|
||||
crate_paths,
|
||||
ItemType::Keyword,
|
||||
&[kw::Mut],
|
||||
None,
|
||||
)),
|
||||
RenderTypeId::DefId(defid) => {
|
||||
if let Some(&(ref fqp, item_type)) =
|
||||
paths.get(&defid).or_else(|| external_paths.get(&defid))
|
||||
@@ -765,9 +774,8 @@ fn get_index_type_id(
|
||||
bounds.get(0).map(|b| RenderTypeId::DefId(b.trait_.def_id()))
|
||||
}
|
||||
clean::Primitive(p) => Some(RenderTypeId::Primitive(p)),
|
||||
clean::BorrowedRef { ref type_, .. } | clean::RawPointer(_, ref type_) => {
|
||||
get_index_type_id(type_, rgen)
|
||||
}
|
||||
clean::BorrowedRef { .. } => Some(RenderTypeId::Primitive(clean::PrimitiveType::Reference)),
|
||||
clean::RawPointer(_, ref type_) => get_index_type_id(type_, rgen),
|
||||
// The type parameters are converted to generics in `simplify_fn_type`
|
||||
clean::Slice(_) => Some(RenderTypeId::Primitive(clean::PrimitiveType::Slice)),
|
||||
clean::Array(_, _) => Some(RenderTypeId::Primitive(clean::PrimitiveType::Array)),
|
||||
@@ -833,28 +841,14 @@ fn simplify_fn_type<'tcx, 'a>(
|
||||
}
|
||||
|
||||
// First, check if it's "Self".
|
||||
let mut is_self = false;
|
||||
let mut arg = if let Some(self_) = self_ {
|
||||
match &*arg {
|
||||
Type::BorrowedRef { type_, .. } if type_.is_self_type() => {
|
||||
is_self = true;
|
||||
self_
|
||||
}
|
||||
type_ if type_.is_self_type() => {
|
||||
is_self = true;
|
||||
self_
|
||||
}
|
||||
arg => arg,
|
||||
}
|
||||
let (is_self, arg) = if let Some(self_) = self_
|
||||
&& arg.is_self_type()
|
||||
{
|
||||
(true, self_)
|
||||
} else {
|
||||
arg
|
||||
(false, arg)
|
||||
};
|
||||
|
||||
// strip references from the argument type
|
||||
while let Type::BorrowedRef { type_, .. } = &*arg {
|
||||
arg = &*type_;
|
||||
}
|
||||
|
||||
// If this argument is a type parameter and not a trait bound or a type, we need to look
|
||||
// for its bounds.
|
||||
if let Type::Generic(arg_s) = *arg {
|
||||
@@ -1027,6 +1021,27 @@ fn simplify_fn_type<'tcx, 'a>(
|
||||
bindings: Some(ty_bindings),
|
||||
generics: Some(ty_generics),
|
||||
});
|
||||
} else if let Type::BorrowedRef { lifetime: _, mutability, ref type_ } = *arg {
|
||||
let mut ty_generics = Vec::new();
|
||||
if mutability.is_mut() {
|
||||
ty_generics.push(RenderType {
|
||||
id: Some(RenderTypeId::Mut),
|
||||
generics: None,
|
||||
bindings: None,
|
||||
});
|
||||
}
|
||||
simplify_fn_type(
|
||||
self_,
|
||||
generics,
|
||||
&type_,
|
||||
tcx,
|
||||
recurse + 1,
|
||||
&mut ty_generics,
|
||||
rgen,
|
||||
is_return,
|
||||
cache,
|
||||
);
|
||||
res.push(get_index_type(arg, ty_generics, rgen));
|
||||
} else {
|
||||
// This is not a type parameter. So for example if we have `T, U: Option<T>`, and we're
|
||||
// looking at `Option`, we enter this "else" condition, otherwise if it's `T`, we don't.
|
||||
|
||||
@@ -786,6 +786,37 @@ function initSearch(rawSearchIndex) {
|
||||
}
|
||||
elems.push(makePrimitiveElement(name, { bindingName, generics }));
|
||||
}
|
||||
} else if (parserState.userQuery[parserState.pos] === "&") {
|
||||
if (parserState.typeFilter !== null && parserState.typeFilter !== "primitive") {
|
||||
throw [
|
||||
"Invalid search type: primitive ",
|
||||
"&",
|
||||
" and ",
|
||||
parserState.typeFilter,
|
||||
" both specified",
|
||||
];
|
||||
}
|
||||
parserState.typeFilter = null;
|
||||
parserState.pos += 1;
|
||||
let c = parserState.userQuery[parserState.pos];
|
||||
while (c === " " && parserState.pos < parserState.length) {
|
||||
parserState.pos += 1;
|
||||
c = parserState.userQuery[parserState.pos];
|
||||
}
|
||||
const generics = [];
|
||||
if (parserState.userQuery.slice(parserState.pos, parserState.pos + 3) === "mut") {
|
||||
generics.push(makePrimitiveElement("mut", { typeFilter: "keyword"}));
|
||||
parserState.pos += 3;
|
||||
c = parserState.userQuery[parserState.pos];
|
||||
}
|
||||
while (c === " " && parserState.pos < parserState.length) {
|
||||
parserState.pos += 1;
|
||||
c = parserState.userQuery[parserState.pos];
|
||||
}
|
||||
if (!isEndCharacter(c) && parserState.pos < parserState.length) {
|
||||
getFilteredNextElem(query, parserState, generics, isInGenerics);
|
||||
}
|
||||
elems.push(makePrimitiveElement("reference", { generics }));
|
||||
} else {
|
||||
const isStringElem = parserState.userQuery[start] === "\"";
|
||||
// We handle the strings on their own mostly to make code easier to follow.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
//@edition:2018
|
||||
//@aux-build:proc_macros.rs
|
||||
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![feature(stmt_expr_attributes)]
|
||||
#![warn(clippy::almost_complete_range)]
|
||||
#![allow(ellipsis_inclusive_range_patterns)]
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
//@edition:2018
|
||||
//@aux-build:proc_macros.rs
|
||||
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![feature(stmt_expr_attributes)]
|
||||
#![warn(clippy::almost_complete_range)]
|
||||
#![allow(ellipsis_inclusive_range_patterns)]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:18:17
|
||||
--> tests/ui/almost_complete_range.rs:17:17
|
||||
|
|
||||
LL | let _ = ('a') ..'z';
|
||||
| ^^^^^^--^^^
|
||||
@@ -10,7 +10,7 @@ LL | let _ = ('a') ..'z';
|
||||
= help: to override `-D warnings` add `#[allow(clippy::almost_complete_range)]`
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:19:17
|
||||
--> tests/ui/almost_complete_range.rs:18:17
|
||||
|
|
||||
LL | let _ = 'A' .. ('Z');
|
||||
| ^^^^--^^^^^^
|
||||
@@ -18,7 +18,7 @@ LL | let _ = 'A' .. ('Z');
|
||||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:20:17
|
||||
--> tests/ui/almost_complete_range.rs:19:17
|
||||
|
|
||||
LL | let _ = ((('0'))) .. ('9');
|
||||
| ^^^^^^^^^^--^^^^^^
|
||||
@@ -26,7 +26,7 @@ LL | let _ = ((('0'))) .. ('9');
|
||||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:27:13
|
||||
--> tests/ui/almost_complete_range.rs:26:13
|
||||
|
|
||||
LL | let _ = (b'a')..(b'z');
|
||||
| ^^^^^^--^^^^^^
|
||||
@@ -34,7 +34,7 @@ LL | let _ = (b'a')..(b'z');
|
||||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:28:13
|
||||
--> tests/ui/almost_complete_range.rs:27:13
|
||||
|
|
||||
LL | let _ = b'A'..b'Z';
|
||||
| ^^^^--^^^^
|
||||
@@ -42,7 +42,7 @@ LL | let _ = b'A'..b'Z';
|
||||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:29:13
|
||||
--> tests/ui/almost_complete_range.rs:28:13
|
||||
|
|
||||
LL | let _ = b'0'..b'9';
|
||||
| ^^^^--^^^^
|
||||
@@ -50,7 +50,7 @@ LL | let _ = b'0'..b'9';
|
||||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:35:13
|
||||
--> tests/ui/almost_complete_range.rs:34:13
|
||||
|
|
||||
LL | let _ = inline!('a')..'z';
|
||||
| ^^^^^^^^^^^^--^^^
|
||||
@@ -58,7 +58,7 @@ LL | let _ = inline!('a')..'z';
|
||||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:36:13
|
||||
--> tests/ui/almost_complete_range.rs:35:13
|
||||
|
|
||||
LL | let _ = inline!('A')..'Z';
|
||||
| ^^^^^^^^^^^^--^^^
|
||||
@@ -66,7 +66,7 @@ LL | let _ = inline!('A')..'Z';
|
||||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:37:13
|
||||
--> tests/ui/almost_complete_range.rs:36:13
|
||||
|
|
||||
LL | let _ = inline!('0')..'9';
|
||||
| ^^^^^^^^^^^^--^^^
|
||||
@@ -74,7 +74,7 @@ LL | let _ = inline!('0')..'9';
|
||||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:40:9
|
||||
--> tests/ui/almost_complete_range.rs:39:9
|
||||
|
|
||||
LL | b'a'..b'z' if true => 1,
|
||||
| ^^^^--^^^^
|
||||
@@ -82,7 +82,7 @@ LL | b'a'..b'z' if true => 1,
|
||||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:41:9
|
||||
--> tests/ui/almost_complete_range.rs:40:9
|
||||
|
|
||||
LL | b'A'..b'Z' if true => 2,
|
||||
| ^^^^--^^^^
|
||||
@@ -90,7 +90,7 @@ LL | b'A'..b'Z' if true => 2,
|
||||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:42:9
|
||||
--> tests/ui/almost_complete_range.rs:41:9
|
||||
|
|
||||
LL | b'0'..b'9' if true => 3,
|
||||
| ^^^^--^^^^
|
||||
@@ -98,7 +98,7 @@ LL | b'0'..b'9' if true => 3,
|
||||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:50:9
|
||||
--> tests/ui/almost_complete_range.rs:49:9
|
||||
|
|
||||
LL | 'a'..'z' if true => 1,
|
||||
| ^^^--^^^
|
||||
@@ -106,7 +106,7 @@ LL | 'a'..'z' if true => 1,
|
||||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:51:9
|
||||
--> tests/ui/almost_complete_range.rs:50:9
|
||||
|
|
||||
LL | 'A'..'Z' if true => 2,
|
||||
| ^^^--^^^
|
||||
@@ -114,7 +114,7 @@ LL | 'A'..'Z' if true => 2,
|
||||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:52:9
|
||||
--> tests/ui/almost_complete_range.rs:51:9
|
||||
|
|
||||
LL | '0'..'9' if true => 3,
|
||||
| ^^^--^^^
|
||||
@@ -122,7 +122,7 @@ LL | '0'..'9' if true => 3,
|
||||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:65:17
|
||||
--> tests/ui/almost_complete_range.rs:64:17
|
||||
|
|
||||
LL | let _ = 'a'..'z';
|
||||
| ^^^--^^^
|
||||
@@ -132,7 +132,7 @@ LL | let _ = 'a'..'z';
|
||||
= note: this error originates in the macro `__inline_mac_fn_main` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:66:17
|
||||
--> tests/ui/almost_complete_range.rs:65:17
|
||||
|
|
||||
LL | let _ = 'A'..'Z';
|
||||
| ^^^--^^^
|
||||
@@ -142,7 +142,7 @@ LL | let _ = 'A'..'Z';
|
||||
= note: this error originates in the macro `__inline_mac_fn_main` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:67:17
|
||||
--> tests/ui/almost_complete_range.rs:66:17
|
||||
|
|
||||
LL | let _ = '0'..'9';
|
||||
| ^^^--^^^
|
||||
@@ -152,7 +152,7 @@ LL | let _ = '0'..'9';
|
||||
= note: this error originates in the macro `__inline_mac_fn_main` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:74:9
|
||||
--> tests/ui/almost_complete_range.rs:73:9
|
||||
|
|
||||
LL | 'a'..'z' => 1,
|
||||
| ^^^--^^^
|
||||
@@ -160,7 +160,7 @@ LL | 'a'..'z' => 1,
|
||||
| help: use an inclusive range: `...`
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:75:9
|
||||
--> tests/ui/almost_complete_range.rs:74:9
|
||||
|
|
||||
LL | 'A'..'Z' => 2,
|
||||
| ^^^--^^^
|
||||
@@ -168,7 +168,7 @@ LL | 'A'..'Z' => 2,
|
||||
| help: use an inclusive range: `...`
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:76:9
|
||||
--> tests/ui/almost_complete_range.rs:75:9
|
||||
|
|
||||
LL | '0'..'9' => 3,
|
||||
| ^^^--^^^
|
||||
@@ -176,7 +176,7 @@ LL | '0'..'9' => 3,
|
||||
| help: use an inclusive range: `...`
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:83:13
|
||||
--> tests/ui/almost_complete_range.rs:82:13
|
||||
|
|
||||
LL | let _ = 'a'..'z';
|
||||
| ^^^--^^^
|
||||
@@ -184,7 +184,7 @@ LL | let _ = 'a'..'z';
|
||||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:84:13
|
||||
--> tests/ui/almost_complete_range.rs:83:13
|
||||
|
|
||||
LL | let _ = 'A'..'Z';
|
||||
| ^^^--^^^
|
||||
@@ -192,7 +192,7 @@ LL | let _ = 'A'..'Z';
|
||||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:85:13
|
||||
--> tests/ui/almost_complete_range.rs:84:13
|
||||
|
|
||||
LL | let _ = '0'..'9';
|
||||
| ^^^--^^^
|
||||
@@ -200,7 +200,7 @@ LL | let _ = '0'..'9';
|
||||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:87:9
|
||||
--> tests/ui/almost_complete_range.rs:86:9
|
||||
|
|
||||
LL | 'a'..'z' => 1,
|
||||
| ^^^--^^^
|
||||
@@ -208,7 +208,7 @@ LL | 'a'..'z' => 1,
|
||||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:88:9
|
||||
--> tests/ui/almost_complete_range.rs:87:9
|
||||
|
|
||||
LL | 'A'..'Z' => 1,
|
||||
| ^^^--^^^
|
||||
@@ -216,7 +216,7 @@ LL | 'A'..'Z' => 1,
|
||||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii range
|
||||
--> tests/ui/almost_complete_range.rs:89:9
|
||||
--> tests/ui/almost_complete_range.rs:88:9
|
||||
|
|
||||
LL | '0'..'9' => 3,
|
||||
| ^^^--^^^
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#![allow(unused)]
|
||||
#![allow(non_contiguous_range_endpoints)]
|
||||
#![warn(clippy::manual_range_patterns)]
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {
|
||||
let f = 6;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#![allow(unused)]
|
||||
#![allow(non_contiguous_range_endpoints)]
|
||||
#![warn(clippy::manual_range_patterns)]
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {
|
||||
let f = 6;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error: this OR pattern can be rewritten using a range
|
||||
--> tests/ui/manual_range_patterns.rs:9:25
|
||||
--> tests/ui/manual_range_patterns.rs:8:25
|
||||
|
|
||||
LL | let _ = matches!(f, 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `1..=10`
|
||||
@@ -8,109 +8,109 @@ LL | let _ = matches!(f, 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10);
|
||||
= help: to override `-D warnings` add `#[allow(clippy::manual_range_patterns)]`
|
||||
|
||||
error: this OR pattern can be rewritten using a range
|
||||
--> tests/ui/manual_range_patterns.rs:10:25
|
||||
--> tests/ui/manual_range_patterns.rs:9:25
|
||||
|
|
||||
LL | let _ = matches!(f, 4 | 2 | 3 | 1 | 5 | 6 | 9 | 7 | 8 | 10);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `1..=10`
|
||||
|
||||
error: this OR pattern can be rewritten using a range
|
||||
--> tests/ui/manual_range_patterns.rs:17:25
|
||||
--> tests/ui/manual_range_patterns.rs:16:25
|
||||
|
|
||||
LL | let _ = matches!(f, 1 | (2..=4));
|
||||
| ^^^^^^^^^^^ help: try: `1..=4`
|
||||
|
||||
error: this OR pattern can be rewritten using a range
|
||||
--> tests/ui/manual_range_patterns.rs:18:25
|
||||
--> tests/ui/manual_range_patterns.rs:17:25
|
||||
|
|
||||
LL | let _ = matches!(f, 1 | (2..4));
|
||||
| ^^^^^^^^^^ help: try: `1..4`
|
||||
|
||||
error: this OR pattern can be rewritten using a range
|
||||
--> tests/ui/manual_range_patterns.rs:19:25
|
||||
--> tests/ui/manual_range_patterns.rs:18:25
|
||||
|
|
||||
LL | let _ = matches!(f, (1..=10) | (2..=13) | (14..=48324728) | 48324729);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `1..=48324729`
|
||||
|
||||
error: this OR pattern can be rewritten using a range
|
||||
--> tests/ui/manual_range_patterns.rs:20:25
|
||||
--> tests/ui/manual_range_patterns.rs:19:25
|
||||
|
|
||||
LL | let _ = matches!(f, 0 | (1..=10) | 48324730 | (2..=13) | (14..=48324728) | 48324729);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `0..=48324730`
|
||||
|
||||
error: this OR pattern can be rewritten using a range
|
||||
--> tests/ui/manual_range_patterns.rs:21:25
|
||||
--> tests/ui/manual_range_patterns.rs:20:25
|
||||
|
|
||||
LL | let _ = matches!(f, 0..=1 | 0..=2 | 0..=3);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `0..=3`
|
||||
|
||||
error: this OR pattern can be rewritten using a range
|
||||
--> tests/ui/manual_range_patterns.rs:24:9
|
||||
--> tests/ui/manual_range_patterns.rs:23:9
|
||||
|
|
||||
LL | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 => true,
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `1..=10`
|
||||
|
||||
error: this OR pattern can be rewritten using a range
|
||||
--> tests/ui/manual_range_patterns.rs:27:25
|
||||
--> tests/ui/manual_range_patterns.rs:26:25
|
||||
|
|
||||
LL | let _ = matches!(f, -1 | -5 | 3 | -2 | -4 | -3 | 0 | 1 | 2);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-5..=3`
|
||||
|
||||
error: this OR pattern can be rewritten using a range
|
||||
--> tests/ui/manual_range_patterns.rs:29:25
|
||||
--> tests/ui/manual_range_patterns.rs:28:25
|
||||
|
|
||||
LL | let _ = matches!(f, -1_000_000..=1_000_000 | -1_000_001 | 1_000_001);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-1_000_001..=1_000_001`
|
||||
|
||||
error: this OR pattern can be rewritten using a range
|
||||
--> tests/ui/manual_range_patterns.rs:32:17
|
||||
--> tests/ui/manual_range_patterns.rs:31:17
|
||||
|
|
||||
LL | matches!(f, 0x00 | 0x01 | 0x02 | 0x03);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x00..=0x03`
|
||||
|
||||
error: this OR pattern can be rewritten using a range
|
||||
--> tests/ui/manual_range_patterns.rs:33:17
|
||||
--> tests/ui/manual_range_patterns.rs:32:17
|
||||
|
|
||||
LL | matches!(f, 0x00..=0x05 | 0x06 | 0x07);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x00..=0x07`
|
||||
|
||||
error: this OR pattern can be rewritten using a range
|
||||
--> tests/ui/manual_range_patterns.rs:34:17
|
||||
--> tests/ui/manual_range_patterns.rs:33:17
|
||||
|
|
||||
LL | matches!(f, -0x09 | -0x08 | -0x07..=0x00);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-0x09..=0x00`
|
||||
|
||||
error: this OR pattern can be rewritten using a range
|
||||
--> tests/ui/manual_range_patterns.rs:36:17
|
||||
--> tests/ui/manual_range_patterns.rs:35:17
|
||||
|
|
||||
LL | matches!(f, 0..5 | 5);
|
||||
| ^^^^^^^^ help: try: `0..=5`
|
||||
|
||||
error: this OR pattern can be rewritten using a range
|
||||
--> tests/ui/manual_range_patterns.rs:37:17
|
||||
--> tests/ui/manual_range_patterns.rs:36:17
|
||||
|
|
||||
LL | matches!(f, 0 | 1..5);
|
||||
| ^^^^^^^^ help: try: `0..5`
|
||||
|
||||
error: this OR pattern can be rewritten using a range
|
||||
--> tests/ui/manual_range_patterns.rs:39:17
|
||||
--> tests/ui/manual_range_patterns.rs:38:17
|
||||
|
|
||||
LL | matches!(f, 0..=5 | 6..10);
|
||||
| ^^^^^^^^^^^^^ help: try: `0..10`
|
||||
|
||||
error: this OR pattern can be rewritten using a range
|
||||
--> tests/ui/manual_range_patterns.rs:40:17
|
||||
--> tests/ui/manual_range_patterns.rs:39:17
|
||||
|
|
||||
LL | matches!(f, 0..5 | 5..=10);
|
||||
| ^^^^^^^^^^^^^ help: try: `0..=10`
|
||||
|
||||
error: this OR pattern can be rewritten using a range
|
||||
--> tests/ui/manual_range_patterns.rs:41:17
|
||||
--> tests/ui/manual_range_patterns.rs:40:17
|
||||
|
|
||||
LL | matches!(f, 5..=10 | 0..5);
|
||||
| ^^^^^^^^^^^^^ help: try: `0..=10`
|
||||
|
||||
error: this OR pattern can be rewritten using a range
|
||||
--> tests/ui/manual_range_patterns.rs:45:26
|
||||
--> tests/ui/manual_range_patterns.rs:44:26
|
||||
|
|
||||
LL | matches!($e, 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `1..=10`
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![warn(clippy::match_overlapping_arm)]
|
||||
#![allow(clippy::redundant_pattern_matching)]
|
||||
#![allow(clippy::if_same_then_else, clippy::equatable_if_let, clippy::needless_if)]
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
error: some ranges overlap
|
||||
--> tests/ui/match_overlapping_arm.rs:12:9
|
||||
--> tests/ui/match_overlapping_arm.rs:11:9
|
||||
|
|
||||
LL | 0..=10 => println!("0..=10"),
|
||||
| ^^^^^^
|
||||
|
|
||||
note: overlaps with this
|
||||
--> tests/ui/match_overlapping_arm.rs:14:9
|
||||
--> tests/ui/match_overlapping_arm.rs:13:9
|
||||
|
|
||||
LL | 0..=11 => println!("0..=11"),
|
||||
| ^^^^^^
|
||||
@@ -13,85 +13,85 @@ LL | 0..=11 => println!("0..=11"),
|
||||
= help: to override `-D warnings` add `#[allow(clippy::match_overlapping_arm)]`
|
||||
|
||||
error: some ranges overlap
|
||||
--> tests/ui/match_overlapping_arm.rs:19:9
|
||||
--> tests/ui/match_overlapping_arm.rs:18:9
|
||||
|
|
||||
LL | 0..=5 => println!("0..=5"),
|
||||
| ^^^^^
|
||||
|
|
||||
note: overlaps with this
|
||||
--> tests/ui/match_overlapping_arm.rs:22:9
|
||||
--> tests/ui/match_overlapping_arm.rs:21:9
|
||||
|
|
||||
LL | FOO..=11 => println!("FOO..=11"),
|
||||
| ^^^^^^^^
|
||||
|
||||
error: some ranges overlap
|
||||
--> tests/ui/match_overlapping_arm.rs:57:9
|
||||
--> tests/ui/match_overlapping_arm.rs:56:9
|
||||
|
|
||||
LL | 0..11 => println!("0..11"),
|
||||
| ^^^^^
|
||||
|
|
||||
note: overlaps with this
|
||||
--> tests/ui/match_overlapping_arm.rs:59:9
|
||||
--> tests/ui/match_overlapping_arm.rs:58:9
|
||||
|
|
||||
LL | 0..=11 => println!("0..=11"),
|
||||
| ^^^^^^
|
||||
|
||||
error: some ranges overlap
|
||||
--> tests/ui/match_overlapping_arm.rs:83:9
|
||||
--> tests/ui/match_overlapping_arm.rs:82:9
|
||||
|
|
||||
LL | 0..=10 => println!("0..=10"),
|
||||
| ^^^^^^
|
||||
|
|
||||
note: overlaps with this
|
||||
--> tests/ui/match_overlapping_arm.rs:82:9
|
||||
--> tests/ui/match_overlapping_arm.rs:81:9
|
||||
|
|
||||
LL | 5..14 => println!("5..14"),
|
||||
| ^^^^^
|
||||
|
||||
error: some ranges overlap
|
||||
--> tests/ui/match_overlapping_arm.rs:89:9
|
||||
--> tests/ui/match_overlapping_arm.rs:88:9
|
||||
|
|
||||
LL | 0..7 => println!("0..7"),
|
||||
| ^^^^
|
||||
|
|
||||
note: overlaps with this
|
||||
--> tests/ui/match_overlapping_arm.rs:91:9
|
||||
--> tests/ui/match_overlapping_arm.rs:90:9
|
||||
|
|
||||
LL | 0..=10 => println!("0..=10"),
|
||||
| ^^^^^^
|
||||
|
||||
error: some ranges overlap
|
||||
--> tests/ui/match_overlapping_arm.rs:102:9
|
||||
--> tests/ui/match_overlapping_arm.rs:101:9
|
||||
|
|
||||
LL | ..=23 => println!("..=23"),
|
||||
| ^^^^^
|
||||
|
|
||||
note: overlaps with this
|
||||
--> tests/ui/match_overlapping_arm.rs:104:9
|
||||
--> tests/ui/match_overlapping_arm.rs:103:9
|
||||
|
|
||||
LL | ..26 => println!("..26"),
|
||||
| ^^^^
|
||||
|
||||
error: some ranges overlap
|
||||
--> tests/ui/match_overlapping_arm.rs:112:9
|
||||
--> tests/ui/match_overlapping_arm.rs:111:9
|
||||
|
|
||||
LL | 21..=30 => (),
|
||||
| ^^^^^^^
|
||||
|
|
||||
note: overlaps with this
|
||||
--> tests/ui/match_overlapping_arm.rs:114:9
|
||||
--> tests/ui/match_overlapping_arm.rs:113:9
|
||||
|
|
||||
LL | 21..=40 => (),
|
||||
| ^^^^^^^
|
||||
|
||||
error: some ranges overlap
|
||||
--> tests/ui/match_overlapping_arm.rs:127:9
|
||||
--> tests/ui/match_overlapping_arm.rs:126:9
|
||||
|
|
||||
LL | 0..=0x0000_0000_0000_00ff => (),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: overlaps with this
|
||||
--> tests/ui/match_overlapping_arm.rs:129:9
|
||||
--> tests/ui/match_overlapping_arm.rs:128:9
|
||||
|
|
||||
LL | 0..=0x0000_0000_0000_ffff => (),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![allow(clippy::match_same_arms, dead_code)]
|
||||
#![warn(clippy::match_wild_err_arm)]
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error: `Err(_)` matches all errors
|
||||
--> tests/ui/match_wild_err_arm.rs:24:9
|
||||
--> tests/ui/match_wild_err_arm.rs:23:9
|
||||
|
|
||||
LL | Err(_) => panic!("err"),
|
||||
| ^^^^^^
|
||||
@@ -9,7 +9,7 @@ LL | Err(_) => panic!("err"),
|
||||
= help: to override `-D warnings` add `#[allow(clippy::match_wild_err_arm)]`
|
||||
|
||||
error: `Err(_)` matches all errors
|
||||
--> tests/ui/match_wild_err_arm.rs:32:9
|
||||
--> tests/ui/match_wild_err_arm.rs:31:9
|
||||
|
|
||||
LL | Err(_) => panic!(),
|
||||
| ^^^^^^
|
||||
@@ -17,7 +17,7 @@ LL | Err(_) => panic!(),
|
||||
= note: match each error separately or use the error output, or use `.expect(msg)` if the error case is unreachable
|
||||
|
||||
error: `Err(_)` matches all errors
|
||||
--> tests/ui/match_wild_err_arm.rs:40:9
|
||||
--> tests/ui/match_wild_err_arm.rs:39:9
|
||||
|
|
||||
LL | Err(_) => {
|
||||
| ^^^^^^
|
||||
@@ -25,7 +25,7 @@ LL | Err(_) => {
|
||||
= note: match each error separately or use the error output, or use `.expect(msg)` if the error case is unreachable
|
||||
|
||||
error: `Err(_e)` matches all errors
|
||||
--> tests/ui/match_wild_err_arm.rs:50:9
|
||||
--> tests/ui/match_wild_err_arm.rs:49:9
|
||||
|
|
||||
LL | Err(_e) => panic!(),
|
||||
| ^^^^^^^
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// Check specific cases of sorting candidates in match lowering.
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
// EMIT_MIR sort_candidates.constant_eq.SimplifyCfg-initial.after.mir
|
||||
fn constant_eq(s: &str, b: bool) -> u32 {
|
||||
|
||||
527
tests/rustdoc-js-std/parser-reference.js
Normal file
527
tests/rustdoc-js-std/parser-reference.js
Normal file
@@ -0,0 +1,527 @@
|
||||
const PARSED = [
|
||||
{
|
||||
query: '&[',
|
||||
elems: [],
|
||||
foundElems: 0,
|
||||
original: '&[',
|
||||
returned: [],
|
||||
userQuery: '&[',
|
||||
error: 'Unclosed `[`',
|
||||
},
|
||||
{
|
||||
query: '[&',
|
||||
elems: [],
|
||||
foundElems: 0,
|
||||
original: '[&',
|
||||
returned: [],
|
||||
userQuery: '[&',
|
||||
error: 'Unclosed `[`',
|
||||
},
|
||||
{
|
||||
query: '&&&D, []',
|
||||
elems: [
|
||||
{
|
||||
name: "reference",
|
||||
fullPath: ["reference"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "reference",
|
||||
generics: [
|
||||
{
|
||||
name: "reference",
|
||||
fullPath: ["reference"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "reference",
|
||||
generics: [
|
||||
{
|
||||
name: "reference",
|
||||
fullPath: ["reference"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "reference",
|
||||
generics: [
|
||||
{
|
||||
name: "d",
|
||||
fullPath: ["d"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "d",
|
||||
generics: [],
|
||||
typeFilter: -1,
|
||||
},
|
||||
],
|
||||
typeFilter: 1,
|
||||
},
|
||||
],
|
||||
typeFilter: 1,
|
||||
},
|
||||
],
|
||||
typeFilter: 1,
|
||||
},
|
||||
{
|
||||
name: "[]",
|
||||
fullPath: ["[]"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "[]",
|
||||
generics: [],
|
||||
typeFilter: 1,
|
||||
},
|
||||
],
|
||||
foundElems: 2,
|
||||
original: '&&&D, []',
|
||||
returned: [],
|
||||
userQuery: '&&&d, []',
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
query: '&&&[D]',
|
||||
elems: [
|
||||
{
|
||||
name: "reference",
|
||||
fullPath: ["reference"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "reference",
|
||||
generics: [
|
||||
{
|
||||
name: "reference",
|
||||
fullPath: ["reference"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "reference",
|
||||
generics: [
|
||||
{
|
||||
name: "reference",
|
||||
fullPath: ["reference"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "reference",
|
||||
generics: [
|
||||
{
|
||||
name: "[]",
|
||||
fullPath: ["[]"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "[]",
|
||||
generics: [
|
||||
{
|
||||
name: "d",
|
||||
fullPath: ["d"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "d",
|
||||
generics: [],
|
||||
typeFilter: -1,
|
||||
},
|
||||
],
|
||||
typeFilter: 1,
|
||||
},
|
||||
],
|
||||
typeFilter: 1,
|
||||
},
|
||||
],
|
||||
typeFilter: 1,
|
||||
},
|
||||
],
|
||||
typeFilter: 1,
|
||||
},
|
||||
],
|
||||
foundElems: 1,
|
||||
original: '&&&[D]',
|
||||
returned: [],
|
||||
userQuery: '&&&[d]',
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
query: '&',
|
||||
elems: [
|
||||
{
|
||||
name: "reference",
|
||||
fullPath: ["reference"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "reference",
|
||||
generics: [],
|
||||
typeFilter: 1,
|
||||
},
|
||||
],
|
||||
foundElems: 1,
|
||||
original: '&',
|
||||
returned: [],
|
||||
userQuery: '&',
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
query: '&mut',
|
||||
elems: [
|
||||
{
|
||||
name: "reference",
|
||||
fullPath: ["reference"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "reference",
|
||||
generics: [
|
||||
{
|
||||
name: "mut",
|
||||
fullPath: ["mut"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "mut",
|
||||
generics: [],
|
||||
typeFilter: 0,
|
||||
},
|
||||
],
|
||||
typeFilter: 1,
|
||||
},
|
||||
],
|
||||
foundElems: 1,
|
||||
original: '&mut',
|
||||
returned: [],
|
||||
userQuery: '&mut',
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
query: '&,u8',
|
||||
elems: [
|
||||
{
|
||||
name: "reference",
|
||||
fullPath: ["reference"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "reference",
|
||||
generics: [],
|
||||
typeFilter: 1,
|
||||
},
|
||||
{
|
||||
name: "u8",
|
||||
fullPath: ["u8"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "u8",
|
||||
generics: [],
|
||||
typeFilter: -1,
|
||||
},
|
||||
],
|
||||
foundElems: 2,
|
||||
original: "&,u8",
|
||||
returned: [],
|
||||
userQuery: "&,u8",
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
query: '&mut,u8',
|
||||
elems: [
|
||||
{
|
||||
name: "reference",
|
||||
fullPath: ["reference"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "reference",
|
||||
generics: [
|
||||
{
|
||||
name: "mut",
|
||||
fullPath: ["mut"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "mut",
|
||||
generics: [],
|
||||
typeFilter: 0,
|
||||
},
|
||||
],
|
||||
typeFilter: 1,
|
||||
},
|
||||
{
|
||||
name: "u8",
|
||||
fullPath: ["u8"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "u8",
|
||||
generics: [],
|
||||
typeFilter: -1,
|
||||
},
|
||||
],
|
||||
foundElems: 2,
|
||||
original: "&mut,u8",
|
||||
returned: [],
|
||||
userQuery: "&mut,u8",
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
query: '&u8',
|
||||
elems: [
|
||||
{
|
||||
name: "reference",
|
||||
fullPath: ["reference"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "reference",
|
||||
generics: [
|
||||
{
|
||||
name: "u8",
|
||||
fullPath: ["u8"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "u8",
|
||||
generics: [],
|
||||
typeFilter: -1,
|
||||
},
|
||||
],
|
||||
typeFilter: 1,
|
||||
},
|
||||
],
|
||||
foundElems: 1,
|
||||
original: "&u8",
|
||||
returned: [],
|
||||
userQuery: "&u8",
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
query: '&u8<u8>',
|
||||
elems: [
|
||||
{
|
||||
name: "reference",
|
||||
fullPath: ["reference"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "reference",
|
||||
generics: [
|
||||
{
|
||||
name: "u8",
|
||||
fullPath: ["u8"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "u8",
|
||||
generics: [
|
||||
{
|
||||
name: "u8",
|
||||
fullPath: ["u8"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "u8",
|
||||
generics: [],
|
||||
typeFilter: -1,
|
||||
},
|
||||
],
|
||||
typeFilter: -1,
|
||||
},
|
||||
],
|
||||
typeFilter: 1,
|
||||
},
|
||||
],
|
||||
foundElems: 1,
|
||||
original: "&u8<u8>",
|
||||
returned: [],
|
||||
userQuery: "&u8<u8>",
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
query: 'u8<&u8>',
|
||||
elems: [
|
||||
{
|
||||
name: "u8",
|
||||
fullPath: ["u8"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "u8",
|
||||
generics: [
|
||||
{
|
||||
name: "reference",
|
||||
fullPath: ["reference"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "reference",
|
||||
generics: [
|
||||
{
|
||||
name: "u8",
|
||||
fullPath: ["u8"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "u8",
|
||||
generics: [],
|
||||
typeFilter: -1,
|
||||
},
|
||||
],
|
||||
typeFilter: 1,
|
||||
},
|
||||
],
|
||||
typeFilter: -1,
|
||||
},
|
||||
],
|
||||
foundElems: 1,
|
||||
original: "u8<&u8>",
|
||||
returned: [],
|
||||
userQuery: "u8<&u8>",
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
query: 'u8<&u8, u8>',
|
||||
elems: [
|
||||
{
|
||||
name: "u8",
|
||||
fullPath: ["u8"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "u8",
|
||||
generics: [
|
||||
{
|
||||
name: "reference",
|
||||
fullPath: ["reference"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "reference",
|
||||
generics: [
|
||||
{
|
||||
name: "u8",
|
||||
fullPath: ["u8"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "u8",
|
||||
generics: [],
|
||||
typeFilter: -1,
|
||||
},
|
||||
],
|
||||
typeFilter: 1,
|
||||
},
|
||||
{
|
||||
name: "u8",
|
||||
fullPath: ["u8"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "u8",
|
||||
generics: [],
|
||||
typeFilter: -1,
|
||||
},
|
||||
],
|
||||
typeFilter: -1,
|
||||
},
|
||||
],
|
||||
foundElems: 1,
|
||||
original: "u8<&u8, u8>",
|
||||
returned: [],
|
||||
userQuery: "u8<&u8, u8>",
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
query: 'u8<&u8>',
|
||||
elems: [
|
||||
{
|
||||
name: "u8",
|
||||
fullPath: ["u8"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "u8",
|
||||
generics: [
|
||||
{
|
||||
name: "reference",
|
||||
fullPath: ["reference"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "reference",
|
||||
generics: [
|
||||
{
|
||||
name: "u8",
|
||||
fullPath: ["u8"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "u8",
|
||||
generics: [],
|
||||
typeFilter: -1,
|
||||
},
|
||||
],
|
||||
typeFilter: 1,
|
||||
},
|
||||
],
|
||||
typeFilter: -1,
|
||||
},
|
||||
],
|
||||
foundElems: 1,
|
||||
original: "u8<&u8>",
|
||||
returned: [],
|
||||
userQuery: "u8<&u8>",
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
query: 'u8<&mut u8, u8>',
|
||||
elems: [
|
||||
{
|
||||
name: "u8",
|
||||
fullPath: ["u8"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "u8",
|
||||
generics: [
|
||||
{
|
||||
name: "reference",
|
||||
fullPath: ["reference"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "reference",
|
||||
generics: [
|
||||
{
|
||||
name: "mut",
|
||||
fullPath: ["mut"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "mut",
|
||||
generics: [],
|
||||
typeFilter: 0,
|
||||
},
|
||||
{
|
||||
name: "u8",
|
||||
fullPath: ["u8"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "u8",
|
||||
generics: [],
|
||||
typeFilter: -1,
|
||||
},
|
||||
],
|
||||
typeFilter: 1,
|
||||
},
|
||||
{
|
||||
name: "u8",
|
||||
fullPath: ["u8"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "u8",
|
||||
generics: [],
|
||||
typeFilter: -1,
|
||||
},
|
||||
],
|
||||
typeFilter: -1,
|
||||
},
|
||||
],
|
||||
foundElems: 1,
|
||||
original: "u8<&mut u8, u8>",
|
||||
returned: [],
|
||||
userQuery: "u8<&mut u8, u8>",
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
query: 'primitive:&u8',
|
||||
elems: [
|
||||
{
|
||||
name: "reference",
|
||||
fullPath: ["reference"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "reference",
|
||||
generics: [
|
||||
{
|
||||
name: "u8",
|
||||
fullPath: ["u8"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "u8",
|
||||
generics: [],
|
||||
typeFilter: -1,
|
||||
},
|
||||
],
|
||||
typeFilter: 1,
|
||||
},
|
||||
],
|
||||
foundElems: 1,
|
||||
original: "primitive:&u8",
|
||||
returned: [],
|
||||
userQuery: "primitive:&u8",
|
||||
error: null,
|
||||
},
|
||||
{
|
||||
query: 'macro:&u8',
|
||||
elems: [],
|
||||
foundElems: 0,
|
||||
original: "macro:&u8",
|
||||
returned: [],
|
||||
userQuery: "macro:&u8",
|
||||
error: "Invalid search type: primitive `&` and `macro` both specified",
|
||||
},
|
||||
{
|
||||
query: '¯o:u8',
|
||||
elems: [
|
||||
{
|
||||
name: "reference",
|
||||
fullPath: ["reference"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "reference",
|
||||
generics: [
|
||||
{
|
||||
name: "u8",
|
||||
fullPath: ["u8"],
|
||||
pathWithoutLast: [],
|
||||
pathLast: "u8",
|
||||
generics: [],
|
||||
typeFilter: 16,
|
||||
},
|
||||
],
|
||||
typeFilter: 1,
|
||||
},
|
||||
],
|
||||
foundElems: 1,
|
||||
original: "¯o:u8",
|
||||
returned: [],
|
||||
userQuery: "¯o:u8",
|
||||
error: null,
|
||||
},
|
||||
];
|
||||
236
tests/rustdoc-js/reference.js
Normal file
236
tests/rustdoc-js/reference.js
Normal file
@@ -0,0 +1,236 @@
|
||||
// exact-check
|
||||
|
||||
const EXPECTED = [
|
||||
// pinkie with explicit names
|
||||
{
|
||||
'query': 'usize, usize -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference', 'name': 'pinky' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'reference<usize>, usize -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference', 'name': 'pinky' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'reference<usize>, reference<usize> -> ()',
|
||||
'others': [],
|
||||
},
|
||||
{
|
||||
'query': 'reference<mut, usize>, usize -> ()',
|
||||
'others': [],
|
||||
},
|
||||
// thumb with explicit names
|
||||
{
|
||||
'query': 'thumb, thumb -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference::Thumb', 'name': 'up' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'reference<thumb>, thumb -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference::Thumb', 'name': 'up' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'reference<thumb>, reference<thumb> -> ()',
|
||||
'others': [],
|
||||
},
|
||||
{
|
||||
'query': 'reference<mut, thumb>, thumb -> ()',
|
||||
'others': [],
|
||||
},
|
||||
// index with explicit names
|
||||
{
|
||||
'query': 'index, index -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference::Index', 'name': 'point' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'reference<index>, index -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference::Index', 'name': 'point' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'reference<index>, reference<index> -> ()',
|
||||
'others': [],
|
||||
},
|
||||
{
|
||||
'query': 'reference<mut, index>, index -> ()',
|
||||
'others': [],
|
||||
},
|
||||
// ring with explicit names
|
||||
{
|
||||
'query': 'ring, ring -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference::Ring', 'name': 'wear' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'reference<ring>, ring -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference::Ring', 'name': 'wear' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'reference<ring>, reference<ring> -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference::Ring', 'name': 'wear' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'reference<mut, ring>, reference<ring> -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference::Ring', 'name': 'wear' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'reference<mut, ring>, reference<mut, ring> -> ()',
|
||||
'others': [],
|
||||
},
|
||||
// middle with explicit names
|
||||
{
|
||||
'query': 'middle, middle -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference', 'name': 'show' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'reference<middle>, reference<middle> -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference', 'name': 'show' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'reference<mut, middle>, reference<mut, middle> -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference', 'name': 'show' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'reference<reference<mut, middle>>, reference<mut, reference<middle>> -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference', 'name': 'show' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'reference<mut, reference<middle>>, reference<reference<mut, middle>> -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference', 'name': 'show' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'reference<reference<mut, middle>>, reference<reference<mut, middle>> -> ()',
|
||||
'others': [],
|
||||
},
|
||||
{
|
||||
'query': 'reference<mut, reference<middle>>, reference<mut, reference<middle>> -> ()',
|
||||
'others': [],
|
||||
},
|
||||
// pinkie with shorthand
|
||||
{
|
||||
'query': '&usize, usize -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference', 'name': 'pinky' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': '&usize, &usize -> ()',
|
||||
'others': [],
|
||||
},
|
||||
{
|
||||
'query': '&mut usize, usize -> ()',
|
||||
'others': [],
|
||||
},
|
||||
// thumb with shorthand
|
||||
{
|
||||
'query': '&thumb, thumb -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference::Thumb', 'name': 'up' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': '&thumb, &thumb -> ()',
|
||||
'others': [],
|
||||
},
|
||||
{
|
||||
'query': '&mut thumb, thumb -> ()',
|
||||
'others': [],
|
||||
},
|
||||
// index with explicit names
|
||||
{
|
||||
'query': '&index, index -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference::Index', 'name': 'point' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': '&index, &index -> ()',
|
||||
'others': [],
|
||||
},
|
||||
{
|
||||
'query': '&mut index, index -> ()',
|
||||
'others': [],
|
||||
},
|
||||
// ring with shorthand
|
||||
{
|
||||
'query': '&ring, ring -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference::Ring', 'name': 'wear' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': '&ring, ring -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference::Ring', 'name': 'wear' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': '&mut ring, &ring -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference::Ring', 'name': 'wear' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': '&mut ring, &mut ring -> ()',
|
||||
'others': [],
|
||||
},
|
||||
// middle with shorthand
|
||||
{
|
||||
'query': '&middle, &middle -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference', 'name': 'show' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': '&mut middle, &mut middle -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference', 'name': 'show' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': '&&mut middle, &mut &middle -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference', 'name': 'show' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': '&mut &middle, &&mut middle -> ()',
|
||||
'others': [
|
||||
{ 'path': 'reference', 'name': 'show' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': '&&mut middle, &&mut middle -> ()',
|
||||
'others': [],
|
||||
},
|
||||
{
|
||||
'query': '&mut &middle, &mut &middle -> ()',
|
||||
'others': [],
|
||||
},
|
||||
];
|
||||
32
tests/rustdoc-js/reference.rs
Normal file
32
tests/rustdoc-js/reference.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
#![feature(extern_types)]
|
||||
|
||||
pub fn pinky(input: &usize, manage: usize) {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
pub struct Thumb;
|
||||
|
||||
impl Thumb {
|
||||
pub fn up(&self, finger: Thumb) { unimplemented!() }
|
||||
}
|
||||
|
||||
pub enum Index {}
|
||||
|
||||
impl Index {
|
||||
pub fn point(self, data: &Index) { unimplemented!() }
|
||||
}
|
||||
|
||||
pub union Ring {
|
||||
magic: u32,
|
||||
marriage: f32,
|
||||
}
|
||||
|
||||
impl Ring {
|
||||
pub fn wear(&mut self, extra: &Ring) { unimplemented!() }
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub type Middle;
|
||||
}
|
||||
|
||||
pub fn show(left: &&mut Middle, right: &mut &Middle) { unimplemented!() }
|
||||
@@ -1,5 +1,4 @@
|
||||
//@ run-pass
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
pub fn main() {
|
||||
match 5_usize {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//@ aux-build:static_cross_crate.rs
|
||||
//@ normalize-stderr-test "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
|
||||
//@ normalize-stderr-test "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
|
||||
#![feature(exclusive_range_pattern, half_open_range_patterns_in_slices)]
|
||||
#![feature(half_open_range_patterns_in_slices)]
|
||||
#![allow(static_mut_refs)]
|
||||
|
||||
extern crate static_cross_crate;
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
pub fn main() {
|
||||
match 22 {
|
||||
0 .. 3 => {} //~ ERROR exclusive range pattern syntax is experimental
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/feature-gate-exclusive-range-pattern.rs:3:9
|
||||
|
|
||||
LL | 0 .. 3 => {}
|
||||
| ^^^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
@@ -1,5 +1,4 @@
|
||||
#![feature(half_open_range_patterns_in_slices)]
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {
|
||||
match [5..4, 99..105, 43..44] {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/exclusive_range_pattern_syntax_collision.rs:6:13
|
||||
--> $DIR/exclusive_range_pattern_syntax_collision.rs:5:13
|
||||
|
|
||||
LL | match [5..4, 99..105, 43..44] {
|
||||
| ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#![feature(half_open_range_patterns_in_slices)]
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {
|
||||
match [5..4, 99..105, 43..44] {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
error[E0527]: pattern requires 2 elements but array has 3
|
||||
--> $DIR/exclusive_range_pattern_syntax_collision2.rs:6:9
|
||||
--> $DIR/exclusive_range_pattern_syntax_collision2.rs:5:9
|
||||
|
|
||||
LL | [_, 99..] => {},
|
||||
| ^^^^^^^^^ expected 3 elements
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/exclusive_range_pattern_syntax_collision2.rs:6:13
|
||||
--> $DIR/exclusive_range_pattern_syntax_collision2.rs:5:13
|
||||
|
|
||||
LL | match [5..4, 99..105, 43..44] {
|
||||
| ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {
|
||||
match [5..4, 99..105, 43..44] {
|
||||
[..9, 99..100, _] => {},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/exclusive_range_pattern_syntax_collision3.rs:5:12
|
||||
--> $DIR/exclusive_range_pattern_syntax_collision3.rs:3:12
|
||||
|
|
||||
LL | match [5..4, 99..105, 43..44] {
|
||||
| ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
|
||||
@@ -10,7 +10,7 @@ LL | [..9, 99..100, _] => {},
|
||||
found type `{integer}`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/exclusive_range_pattern_syntax_collision3.rs:5:15
|
||||
--> $DIR/exclusive_range_pattern_syntax_collision3.rs:3:15
|
||||
|
|
||||
LL | match [5..4, 99..105, 43..44] {
|
||||
| ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
|
||||
@@ -23,7 +23,7 @@ LL | [..9, 99..100, _] => {},
|
||||
found type `{integer}`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/exclusive_range_pattern_syntax_collision3.rs:5:19
|
||||
--> $DIR/exclusive_range_pattern_syntax_collision3.rs:3:19
|
||||
|
|
||||
LL | match [5..4, 99..105, 43..44] {
|
||||
| ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {
|
||||
let xs = [13, 1, 5, 2, 3, 1, 21, 8];
|
||||
let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error[E0658]: `X..` patterns in slices are experimental
|
||||
--> $DIR/feature-gate-half-open-range-patterns-in-slices.rs:5:10
|
||||
--> $DIR/feature-gate-half-open-range-patterns-in-slices.rs:3:10
|
||||
|
|
||||
LL | let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs;
|
||||
| ^^^^^^^
|
||||
@@ -9,7 +9,7 @@ LL | let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs;
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/feature-gate-half-open-range-patterns-in-slices.rs:5:9
|
||||
--> $DIR/feature-gate-half-open-range-patterns-in-slices.rs:3:9
|
||||
|
|
||||
LL | let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `[i32::MIN..=2_i32, ..]` not covered
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {
|
||||
let "a".. = "a"; //~ ERROR only `char` and numeric types are allowed in range patterns
|
||||
let .."a" = "a"; //~ ERROR only `char` and numeric types are allowed in range patterns
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/half-open-range-pats-bad-types.rs:4:9
|
||||
--> $DIR/half-open-range-pats-bad-types.rs:2:9
|
||||
|
|
||||
LL | let "a".. = "a";
|
||||
| ^^^ this is of type `&'static str` but it should be `char` or numeric
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/half-open-range-pats-bad-types.rs:5:11
|
||||
--> $DIR/half-open-range-pats-bad-types.rs:3:11
|
||||
|
|
||||
LL | let .."a" = "a";
|
||||
| ^^^ this is of type `&'static str` but it should be `char` or numeric
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/half-open-range-pats-bad-types.rs:6:12
|
||||
--> $DIR/half-open-range-pats-bad-types.rs:4:12
|
||||
|
|
||||
LL | let ..="a" = "a";
|
||||
| ^^^ this is of type `&'static str` but it should be `char` or numeric
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Test various non-exhaustive matches for `X..`, `..=X` and `..X` ranges.
|
||||
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![allow(non_contiguous_range_endpoints)]
|
||||
|
||||
fn main() {}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error[E0004]: non-exhaustive patterns: `_` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:15:8
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:14:8
|
||||
|
|
||||
LL | m!(0f32, f32::NEG_INFINITY..);
|
||||
| ^^^^ pattern `_` not covered
|
||||
@@ -11,7 +11,7 @@ LL | match $s { $($t)+ => {}, _ => todo!() }
|
||||
| ++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `_` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:16:8
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:15:8
|
||||
|
|
||||
LL | m!(0f32, ..f32::INFINITY);
|
||||
| ^^^^ pattern `_` not covered
|
||||
@@ -23,7 +23,7 @@ LL | match $s { $($t)+ => {}, _ => todo!() }
|
||||
| ++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `'\u{10ffff}'` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:25:8
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:24:8
|
||||
|
|
||||
LL | m!('a', ..core::char::MAX);
|
||||
| ^^^ pattern `'\u{10ffff}'` not covered
|
||||
@@ -35,7 +35,7 @@ LL | match $s { $($t)+ => {}, '\u{10ffff}' => todo!() }
|
||||
| +++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `'\u{10fffe}'..='\u{10ffff}'` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:26:8
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:25:8
|
||||
|
|
||||
LL | m!('a', ..ALMOST_MAX);
|
||||
| ^^^ pattern `'\u{10fffe}'..='\u{10ffff}'` not covered
|
||||
@@ -47,7 +47,7 @@ LL | match $s { $($t)+ => {}, '\u{10fffe}'..='\u{10ffff}' => todo!() }
|
||||
| ++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `'\0'` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:27:8
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:26:8
|
||||
|
|
||||
LL | m!('a', ALMOST_MIN..);
|
||||
| ^^^ pattern `'\0'` not covered
|
||||
@@ -59,7 +59,7 @@ LL | match $s { $($t)+ => {}, '\0' => todo!() }
|
||||
| +++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `'\u{10ffff}'` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:28:8
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:27:8
|
||||
|
|
||||
LL | m!('a', ..=ALMOST_MAX);
|
||||
| ^^^ pattern `'\u{10ffff}'` not covered
|
||||
@@ -71,7 +71,7 @@ LL | match $s { $($t)+ => {}, '\u{10ffff}' => todo!() }
|
||||
| +++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `'b'` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:29:8
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:28:8
|
||||
|
|
||||
LL | m!('a', ..=VAL | VAL_2..);
|
||||
| ^^^ pattern `'b'` not covered
|
||||
@@ -83,7 +83,7 @@ LL | match $s { $($t)+ => {}, 'b' => todo!() }
|
||||
| ++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `'b'` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:30:8
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:29:8
|
||||
|
|
||||
LL | m!('a', ..VAL_1 | VAL_2..);
|
||||
| ^^^ pattern `'b'` not covered
|
||||
@@ -95,7 +95,7 @@ LL | match $s { $($t)+ => {}, 'b' => todo!() }
|
||||
| ++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `u8::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:40:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:39:12
|
||||
|
|
||||
LL | m!(0, ..u8::MAX);
|
||||
| ^ pattern `u8::MAX` not covered
|
||||
@@ -107,7 +107,7 @@ LL | match $s { $($t)+ => {}, u8::MAX => todo!() }
|
||||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `254_u8..=u8::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:41:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:40:12
|
||||
|
|
||||
LL | m!(0, ..ALMOST_MAX);
|
||||
| ^ pattern `254_u8..=u8::MAX` not covered
|
||||
@@ -119,7 +119,7 @@ LL | match $s { $($t)+ => {}, 254_u8..=u8::MAX => todo!() }
|
||||
| +++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `0_u8` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:42:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:41:12
|
||||
|
|
||||
LL | m!(0, ALMOST_MIN..);
|
||||
| ^ pattern `0_u8` not covered
|
||||
@@ -131,7 +131,7 @@ LL | match $s { $($t)+ => {}, 0_u8 => todo!() }
|
||||
| +++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `u8::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:43:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:42:12
|
||||
|
|
||||
LL | m!(0, ..=ALMOST_MAX);
|
||||
| ^ pattern `u8::MAX` not covered
|
||||
@@ -143,7 +143,7 @@ LL | match $s { $($t)+ => {}, u8::MAX => todo!() }
|
||||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_u8` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:44:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:43:12
|
||||
|
|
||||
LL | m!(0, ..=VAL | VAL_2..);
|
||||
| ^ pattern `43_u8` not covered
|
||||
@@ -155,7 +155,7 @@ LL | match $s { $($t)+ => {}, 43_u8 => todo!() }
|
||||
| ++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_u8` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:45:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:44:12
|
||||
|
|
||||
LL | m!(0, ..VAL_1 | VAL_2..);
|
||||
| ^ pattern `43_u8` not covered
|
||||
@@ -167,7 +167,7 @@ LL | match $s { $($t)+ => {}, 43_u8 => todo!() }
|
||||
| ++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `u16::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:53:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:52:12
|
||||
|
|
||||
LL | m!(0, ..u16::MAX);
|
||||
| ^ pattern `u16::MAX` not covered
|
||||
@@ -179,7 +179,7 @@ LL | match $s { $($t)+ => {}, u16::MAX => todo!() }
|
||||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `65534_u16..=u16::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:54:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:53:12
|
||||
|
|
||||
LL | m!(0, ..ALMOST_MAX);
|
||||
| ^ pattern `65534_u16..=u16::MAX` not covered
|
||||
@@ -191,7 +191,7 @@ LL | match $s { $($t)+ => {}, 65534_u16..=u16::MAX => todo!() }
|
||||
| +++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `0_u16` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:55:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:54:12
|
||||
|
|
||||
LL | m!(0, ALMOST_MIN..);
|
||||
| ^ pattern `0_u16` not covered
|
||||
@@ -203,7 +203,7 @@ LL | match $s { $($t)+ => {}, 0_u16 => todo!() }
|
||||
| ++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `u16::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:56:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:55:12
|
||||
|
|
||||
LL | m!(0, ..=ALMOST_MAX);
|
||||
| ^ pattern `u16::MAX` not covered
|
||||
@@ -215,7 +215,7 @@ LL | match $s { $($t)+ => {}, u16::MAX => todo!() }
|
||||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_u16` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:57:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:56:12
|
||||
|
|
||||
LL | m!(0, ..=VAL | VAL_2..);
|
||||
| ^ pattern `43_u16` not covered
|
||||
@@ -227,7 +227,7 @@ LL | match $s { $($t)+ => {}, 43_u16 => todo!() }
|
||||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_u16` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:58:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:57:12
|
||||
|
|
||||
LL | m!(0, ..VAL_1 | VAL_2..);
|
||||
| ^ pattern `43_u16` not covered
|
||||
@@ -239,7 +239,7 @@ LL | match $s { $($t)+ => {}, 43_u16 => todo!() }
|
||||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `u32::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:66:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:65:12
|
||||
|
|
||||
LL | m!(0, ..u32::MAX);
|
||||
| ^ pattern `u32::MAX` not covered
|
||||
@@ -251,7 +251,7 @@ LL | match $s { $($t)+ => {}, u32::MAX => todo!() }
|
||||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `4294967294_u32..=u32::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:67:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:66:12
|
||||
|
|
||||
LL | m!(0, ..ALMOST_MAX);
|
||||
| ^ pattern `4294967294_u32..=u32::MAX` not covered
|
||||
@@ -263,7 +263,7 @@ LL | match $s { $($t)+ => {}, 4294967294_u32..=u32::MAX => todo!() }
|
||||
| ++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `0_u32` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:68:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:67:12
|
||||
|
|
||||
LL | m!(0, ALMOST_MIN..);
|
||||
| ^ pattern `0_u32` not covered
|
||||
@@ -275,7 +275,7 @@ LL | match $s { $($t)+ => {}, 0_u32 => todo!() }
|
||||
| ++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `u32::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:69:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:68:12
|
||||
|
|
||||
LL | m!(0, ..=ALMOST_MAX);
|
||||
| ^ pattern `u32::MAX` not covered
|
||||
@@ -287,7 +287,7 @@ LL | match $s { $($t)+ => {}, u32::MAX => todo!() }
|
||||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_u32` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:70:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:69:12
|
||||
|
|
||||
LL | m!(0, ..=VAL | VAL_2..);
|
||||
| ^ pattern `43_u32` not covered
|
||||
@@ -299,7 +299,7 @@ LL | match $s { $($t)+ => {}, 43_u32 => todo!() }
|
||||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_u32` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:71:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:70:12
|
||||
|
|
||||
LL | m!(0, ..VAL_1 | VAL_2..);
|
||||
| ^ pattern `43_u32` not covered
|
||||
@@ -311,7 +311,7 @@ LL | match $s { $($t)+ => {}, 43_u32 => todo!() }
|
||||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `u64::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:79:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:78:12
|
||||
|
|
||||
LL | m!(0, ..u64::MAX);
|
||||
| ^ pattern `u64::MAX` not covered
|
||||
@@ -323,7 +323,7 @@ LL | match $s { $($t)+ => {}, u64::MAX => todo!() }
|
||||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `18446744073709551614_u64..=u64::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:80:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:79:12
|
||||
|
|
||||
LL | m!(0, ..ALMOST_MAX);
|
||||
| ^ pattern `18446744073709551614_u64..=u64::MAX` not covered
|
||||
@@ -335,7 +335,7 @@ LL | match $s { $($t)+ => {}, 18446744073709551614_u64..=u64::MAX => tod
|
||||
| ++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `0_u64` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:81:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:80:12
|
||||
|
|
||||
LL | m!(0, ALMOST_MIN..);
|
||||
| ^ pattern `0_u64` not covered
|
||||
@@ -347,7 +347,7 @@ LL | match $s { $($t)+ => {}, 0_u64 => todo!() }
|
||||
| ++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `u64::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:82:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:81:12
|
||||
|
|
||||
LL | m!(0, ..=ALMOST_MAX);
|
||||
| ^ pattern `u64::MAX` not covered
|
||||
@@ -359,7 +359,7 @@ LL | match $s { $($t)+ => {}, u64::MAX => todo!() }
|
||||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_u64` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:83:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:82:12
|
||||
|
|
||||
LL | m!(0, ..=VAL | VAL_2..);
|
||||
| ^ pattern `43_u64` not covered
|
||||
@@ -371,7 +371,7 @@ LL | match $s { $($t)+ => {}, 43_u64 => todo!() }
|
||||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_u64` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:84:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:83:12
|
||||
|
|
||||
LL | m!(0, ..VAL_1 | VAL_2..);
|
||||
| ^ pattern `43_u64` not covered
|
||||
@@ -383,7 +383,7 @@ LL | match $s { $($t)+ => {}, 43_u64 => todo!() }
|
||||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `u128::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:92:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:91:12
|
||||
|
|
||||
LL | m!(0, ..u128::MAX);
|
||||
| ^ pattern `u128::MAX` not covered
|
||||
@@ -395,7 +395,7 @@ LL | match $s { $($t)+ => {}, u128::MAX => todo!() }
|
||||
| ++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `340282366920938463463374607431768211454_u128..` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:93:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:92:12
|
||||
|
|
||||
LL | m!(0, ..ALMOST_MAX);
|
||||
| ^ pattern `340282366920938463463374607431768211454_u128..` not covered
|
||||
@@ -407,7 +407,7 @@ LL | match $s { $($t)+ => {}, 340282366920938463463374607431768211454_u1
|
||||
| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `0_u128` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:94:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:93:12
|
||||
|
|
||||
LL | m!(0, ALMOST_MIN..);
|
||||
| ^ pattern `0_u128` not covered
|
||||
@@ -419,7 +419,7 @@ LL | match $s { $($t)+ => {}, 0_u128 => todo!() }
|
||||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `u128::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:95:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:94:12
|
||||
|
|
||||
LL | m!(0, ..=ALMOST_MAX);
|
||||
| ^ pattern `u128::MAX` not covered
|
||||
@@ -431,7 +431,7 @@ LL | match $s { $($t)+ => {}, u128::MAX => todo!() }
|
||||
| ++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_u128` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:96:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:95:12
|
||||
|
|
||||
LL | m!(0, ..=VAL | VAL_2..);
|
||||
| ^ pattern `43_u128` not covered
|
||||
@@ -443,7 +443,7 @@ LL | match $s { $($t)+ => {}, 43_u128 => todo!() }
|
||||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_u128` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:97:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:96:12
|
||||
|
|
||||
LL | m!(0, ..VAL_1 | VAL_2..);
|
||||
| ^ pattern `43_u128` not covered
|
||||
@@ -455,7 +455,7 @@ LL | match $s { $($t)+ => {}, 43_u128 => todo!() }
|
||||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i8::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:108:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:107:12
|
||||
|
|
||||
LL | m!(0, ..i8::MAX);
|
||||
| ^ pattern `i8::MAX` not covered
|
||||
@@ -467,7 +467,7 @@ LL | match $s { $($t)+ => {}, i8::MAX => todo!() }
|
||||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `126_i8..=i8::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:109:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:108:12
|
||||
|
|
||||
LL | m!(0, ..ALMOST_MAX);
|
||||
| ^ pattern `126_i8..=i8::MAX` not covered
|
||||
@@ -479,7 +479,7 @@ LL | match $s { $($t)+ => {}, 126_i8..=i8::MAX => todo!() }
|
||||
| +++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i8::MIN` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:110:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:109:12
|
||||
|
|
||||
LL | m!(0, ALMOST_MIN..);
|
||||
| ^ pattern `i8::MIN` not covered
|
||||
@@ -491,7 +491,7 @@ LL | match $s { $($t)+ => {}, i8::MIN => todo!() }
|
||||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i8::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:111:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:110:12
|
||||
|
|
||||
LL | m!(0, ..=ALMOST_MAX);
|
||||
| ^ pattern `i8::MAX` not covered
|
||||
@@ -503,7 +503,7 @@ LL | match $s { $($t)+ => {}, i8::MAX => todo!() }
|
||||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_i8` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:112:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:111:12
|
||||
|
|
||||
LL | m!(0, ..=VAL | VAL_2..);
|
||||
| ^ pattern `43_i8` not covered
|
||||
@@ -515,7 +515,7 @@ LL | match $s { $($t)+ => {}, 43_i8 => todo!() }
|
||||
| ++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_i8` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:113:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:112:12
|
||||
|
|
||||
LL | m!(0, ..VAL_1 | VAL_2..);
|
||||
| ^ pattern `43_i8` not covered
|
||||
@@ -527,7 +527,7 @@ LL | match $s { $($t)+ => {}, 43_i8 => todo!() }
|
||||
| ++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i16::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:121:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:120:12
|
||||
|
|
||||
LL | m!(0, ..i16::MAX);
|
||||
| ^ pattern `i16::MAX` not covered
|
||||
@@ -539,7 +539,7 @@ LL | match $s { $($t)+ => {}, i16::MAX => todo!() }
|
||||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `32766_i16..=i16::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:122:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:121:12
|
||||
|
|
||||
LL | m!(0, ..ALMOST_MAX);
|
||||
| ^ pattern `32766_i16..=i16::MAX` not covered
|
||||
@@ -551,7 +551,7 @@ LL | match $s { $($t)+ => {}, 32766_i16..=i16::MAX => todo!() }
|
||||
| +++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i16::MIN` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:123:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:122:12
|
||||
|
|
||||
LL | m!(0, ALMOST_MIN..);
|
||||
| ^ pattern `i16::MIN` not covered
|
||||
@@ -563,7 +563,7 @@ LL | match $s { $($t)+ => {}, i16::MIN => todo!() }
|
||||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i16::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:124:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:123:12
|
||||
|
|
||||
LL | m!(0, ..=ALMOST_MAX);
|
||||
| ^ pattern `i16::MAX` not covered
|
||||
@@ -575,7 +575,7 @@ LL | match $s { $($t)+ => {}, i16::MAX => todo!() }
|
||||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_i16` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:125:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:124:12
|
||||
|
|
||||
LL | m!(0, ..=VAL | VAL_2..);
|
||||
| ^ pattern `43_i16` not covered
|
||||
@@ -587,7 +587,7 @@ LL | match $s { $($t)+ => {}, 43_i16 => todo!() }
|
||||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_i16` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:126:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:125:12
|
||||
|
|
||||
LL | m!(0, ..VAL_1 | VAL_2..);
|
||||
| ^ pattern `43_i16` not covered
|
||||
@@ -599,7 +599,7 @@ LL | match $s { $($t)+ => {}, 43_i16 => todo!() }
|
||||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i32::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:134:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:133:12
|
||||
|
|
||||
LL | m!(0, ..i32::MAX);
|
||||
| ^ pattern `i32::MAX` not covered
|
||||
@@ -611,7 +611,7 @@ LL | match $s { $($t)+ => {}, i32::MAX => todo!() }
|
||||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `2147483646_i32..=i32::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:135:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:134:12
|
||||
|
|
||||
LL | m!(0, ..ALMOST_MAX);
|
||||
| ^ pattern `2147483646_i32..=i32::MAX` not covered
|
||||
@@ -623,7 +623,7 @@ LL | match $s { $($t)+ => {}, 2147483646_i32..=i32::MAX => todo!() }
|
||||
| ++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i32::MIN` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:136:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:135:12
|
||||
|
|
||||
LL | m!(0, ALMOST_MIN..);
|
||||
| ^ pattern `i32::MIN` not covered
|
||||
@@ -635,7 +635,7 @@ LL | match $s { $($t)+ => {}, i32::MIN => todo!() }
|
||||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i32::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:137:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:136:12
|
||||
|
|
||||
LL | m!(0, ..=ALMOST_MAX);
|
||||
| ^ pattern `i32::MAX` not covered
|
||||
@@ -647,7 +647,7 @@ LL | match $s { $($t)+ => {}, i32::MAX => todo!() }
|
||||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_i32` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:138:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:137:12
|
||||
|
|
||||
LL | m!(0, ..=VAL | VAL_2..);
|
||||
| ^ pattern `43_i32` not covered
|
||||
@@ -659,7 +659,7 @@ LL | match $s { $($t)+ => {}, 43_i32 => todo!() }
|
||||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_i32` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:139:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:138:12
|
||||
|
|
||||
LL | m!(0, ..VAL_1 | VAL_2..);
|
||||
| ^ pattern `43_i32` not covered
|
||||
@@ -671,7 +671,7 @@ LL | match $s { $($t)+ => {}, 43_i32 => todo!() }
|
||||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i64::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:147:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:146:12
|
||||
|
|
||||
LL | m!(0, ..i64::MAX);
|
||||
| ^ pattern `i64::MAX` not covered
|
||||
@@ -683,7 +683,7 @@ LL | match $s { $($t)+ => {}, i64::MAX => todo!() }
|
||||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `9223372036854775806_i64..=i64::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:148:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:147:12
|
||||
|
|
||||
LL | m!(0, ..ALMOST_MAX);
|
||||
| ^ pattern `9223372036854775806_i64..=i64::MAX` not covered
|
||||
@@ -695,7 +695,7 @@ LL | match $s { $($t)+ => {}, 9223372036854775806_i64..=i64::MAX => todo
|
||||
| +++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i64::MIN` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:149:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:148:12
|
||||
|
|
||||
LL | m!(0, ALMOST_MIN..);
|
||||
| ^ pattern `i64::MIN` not covered
|
||||
@@ -707,7 +707,7 @@ LL | match $s { $($t)+ => {}, i64::MIN => todo!() }
|
||||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i64::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:150:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:149:12
|
||||
|
|
||||
LL | m!(0, ..=ALMOST_MAX);
|
||||
| ^ pattern `i64::MAX` not covered
|
||||
@@ -719,7 +719,7 @@ LL | match $s { $($t)+ => {}, i64::MAX => todo!() }
|
||||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_i64` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:151:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:150:12
|
||||
|
|
||||
LL | m!(0, ..=VAL | VAL_2..);
|
||||
| ^ pattern `43_i64` not covered
|
||||
@@ -731,7 +731,7 @@ LL | match $s { $($t)+ => {}, 43_i64 => todo!() }
|
||||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_i64` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:152:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:151:12
|
||||
|
|
||||
LL | m!(0, ..VAL_1 | VAL_2..);
|
||||
| ^ pattern `43_i64` not covered
|
||||
@@ -743,7 +743,7 @@ LL | match $s { $($t)+ => {}, 43_i64 => todo!() }
|
||||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i128::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:160:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:159:12
|
||||
|
|
||||
LL | m!(0, ..i128::MAX);
|
||||
| ^ pattern `i128::MAX` not covered
|
||||
@@ -755,7 +755,7 @@ LL | match $s { $($t)+ => {}, i128::MAX => todo!() }
|
||||
| ++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `170141183460469231731687303715884105726_i128..` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:161:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:160:12
|
||||
|
|
||||
LL | m!(0, ..ALMOST_MAX);
|
||||
| ^ pattern `170141183460469231731687303715884105726_i128..` not covered
|
||||
@@ -767,7 +767,7 @@ LL | match $s { $($t)+ => {}, 170141183460469231731687303715884105726_i1
|
||||
| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i128::MIN` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:162:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:161:12
|
||||
|
|
||||
LL | m!(0, ALMOST_MIN..);
|
||||
| ^ pattern `i128::MIN` not covered
|
||||
@@ -779,7 +779,7 @@ LL | match $s { $($t)+ => {}, i128::MIN => todo!() }
|
||||
| ++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i128::MAX` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:163:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:162:12
|
||||
|
|
||||
LL | m!(0, ..=ALMOST_MAX);
|
||||
| ^ pattern `i128::MAX` not covered
|
||||
@@ -791,7 +791,7 @@ LL | match $s { $($t)+ => {}, i128::MAX => todo!() }
|
||||
| ++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_i128` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:164:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:163:12
|
||||
|
|
||||
LL | m!(0, ..=VAL | VAL_2..);
|
||||
| ^ pattern `43_i128` not covered
|
||||
@@ -803,7 +803,7 @@ LL | match $s { $($t)+ => {}, 43_i128 => todo!() }
|
||||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `43_i128` not covered
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:165:12
|
||||
--> $DIR/half-open-range-pats-exhaustive-fail.rs:164:12
|
||||
|
|
||||
LL | m!(0, ..VAL_1 | VAL_2..);
|
||||
| ^ pattern `43_i128` not covered
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
// Test various exhaustive matches for `X..`, `..=X` and `..X` ranges.
|
||||
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {}
|
||||
|
||||
macro_rules! m {
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
// Test half-open range patterns against their expression equivalents
|
||||
// via `.contains(...)` and make sure the dynamic semantics match.
|
||||
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![allow(unreachable_patterns)]
|
||||
|
||||
macro_rules! yes {
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
// Test the parsing of half-open ranges.
|
||||
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {}
|
||||
|
||||
#[cfg(FALSE)]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
macro_rules! m {
|
||||
($s:expr, $($t:tt)+) => {
|
||||
match $s { $($t)+ => {} }
|
||||
|
||||
@@ -1,77 +1,77 @@
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:10:11
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:8:11
|
||||
|
|
||||
LL | m!(0, ..u8::MIN);
|
||||
| ^^^^^^^^^
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:12:11
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:10:11
|
||||
|
|
||||
LL | m!(0, ..u16::MIN);
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:14:11
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:12:11
|
||||
|
|
||||
LL | m!(0, ..u32::MIN);
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:16:11
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:14:11
|
||||
|
|
||||
LL | m!(0, ..u64::MIN);
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:18:11
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:16:11
|
||||
|
|
||||
LL | m!(0, ..u128::MIN);
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:21:11
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:19:11
|
||||
|
|
||||
LL | m!(0, ..i8::MIN);
|
||||
| ^^^^^^^^^
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:23:11
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:21:11
|
||||
|
|
||||
LL | m!(0, ..i16::MIN);
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:25:11
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:23:11
|
||||
|
|
||||
LL | m!(0, ..i32::MIN);
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:27:11
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:25:11
|
||||
|
|
||||
LL | m!(0, ..i64::MIN);
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:29:11
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:27:11
|
||||
|
|
||||
LL | m!(0, ..i128::MIN);
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:32:14
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:30:14
|
||||
|
|
||||
LL | m!(0f32, ..f32::NEG_INFINITY);
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:34:14
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:32:14
|
||||
|
|
||||
LL | m!(0f64, ..f64::NEG_INFINITY);
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:37:13
|
||||
--> $DIR/half-open-range-pats-thir-lower-empty.rs:35:13
|
||||
|
|
||||
LL | m!('a', ..'\u{0}');
|
||||
| ^^^^^^^^^
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
//@ check-pass
|
||||
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {
|
||||
const PAT: u8 = 1;
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {
|
||||
const PAT: u8 = 1;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/pat-tuple-5.rs:7:10
|
||||
--> $DIR/pat-tuple-5.rs:5:10
|
||||
|
|
||||
LL | match (0, 1) {
|
||||
| ------ this expression has type `({integer}, {integer})`
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
//@ run-pass
|
||||
#![allow(non_contiguous_range_endpoints)]
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![feature(inline_const_pat)]
|
||||
|
||||
fn main() {
|
||||
|
||||
@@ -9,26 +9,19 @@ fn main() {
|
||||
for x in -9 + 1..=(9 - 2) {
|
||||
if let n @ 2..3|4 = x {
|
||||
//~^ error: variable `n` is not bound in all patterns
|
||||
//~| exclusive range pattern syntax is experimental
|
||||
errors_only.push(x);
|
||||
} else if let 2..3 | 4 = x {
|
||||
//~^ exclusive range pattern syntax is experimental
|
||||
if_lettable.push(x);
|
||||
}
|
||||
match x as i32 {
|
||||
0..5+1 => errors_only.push(x),
|
||||
//~^ error: expected a pattern range bound, found an expression
|
||||
//~| error: exclusive range pattern syntax is experimental
|
||||
1 | -3..0 => first_or.push(x),
|
||||
//~^ error: exclusive range pattern syntax is experimental
|
||||
y @ (0..5 | 6) => or_two.push(y),
|
||||
//~^ error: exclusive range pattern syntax is experimental
|
||||
y @ 0..const { 5 + 1 } => assert_eq!(y, 5),
|
||||
//~^ error: exclusive range pattern syntax is experimental
|
||||
//~| error: inline-const in pattern position is experimental
|
||||
//~^ error: inline-const in pattern position is experimental [E0658]
|
||||
y @ -5.. => range_from.push(y),
|
||||
y @ ..-7 => assert_eq!(y, -8),
|
||||
//~^ error: exclusive range pattern syntax is experimental
|
||||
y => bottom.push(y),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error: expected a pattern range bound, found an expression
|
||||
--> $DIR/range_pat_interactions1.rs:19:16
|
||||
--> $DIR/range_pat_interactions1.rs:17:16
|
||||
|
|
||||
LL | 0..5+1 => errors_only.push(x),
|
||||
| ^^^ arbitrary expressions are not allowed in patterns
|
||||
@@ -13,7 +13,7 @@ LL | if let n @ 2..3|4 = x {
|
||||
| variable not in all patterns
|
||||
|
||||
error[E0658]: inline-const in pattern position is experimental
|
||||
--> $DIR/range_pat_interactions1.rs:26:20
|
||||
--> $DIR/range_pat_interactions1.rs:21:20
|
||||
|
|
||||
LL | y @ 0..const { 5 + 1 } => assert_eq!(y, 5),
|
||||
| ^^^^^
|
||||
@@ -22,84 +22,7 @@ LL | y @ 0..const { 5 + 1 } => assert_eq!(y, 5),
|
||||
= help: add `#![feature(inline_const_pat)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions1.rs:10:20
|
||||
|
|
||||
LL | if let n @ 2..3|4 = x {
|
||||
| ^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions1.rs:14:23
|
||||
|
|
||||
LL | } else if let 2..3 | 4 = x {
|
||||
| ^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions1.rs:19:13
|
||||
|
|
||||
LL | 0..5+1 => errors_only.push(x),
|
||||
| ^^^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions1.rs:22:17
|
||||
|
|
||||
LL | 1 | -3..0 => first_or.push(x),
|
||||
| ^^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions1.rs:24:18
|
||||
|
|
||||
LL | y @ (0..5 | 6) => or_two.push(y),
|
||||
| ^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions1.rs:26:17
|
||||
|
|
||||
LL | y @ 0..const { 5 + 1 } => assert_eq!(y, 5),
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions1.rs:30:17
|
||||
|
|
||||
LL | y @ ..-7 => assert_eq!(y, -8),
|
||||
| ^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error: aborting due to 10 previous errors
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0408, E0658.
|
||||
For more information about an error, try `rustc --explain E0408`.
|
||||
|
||||
@@ -11,15 +11,11 @@ fn main() {
|
||||
//~^ error: expected a pattern range bound, found an expression
|
||||
//~| error: range pattern bounds cannot have parentheses
|
||||
1 | -3..0 => first_or.push(x),
|
||||
//~^ error: exclusive range pattern syntax is experimental
|
||||
y @ (0..5 | 6) => or_two.push(y),
|
||||
//~^ error: exclusive range pattern syntax is experimental
|
||||
y @ 0..const { 5 + 1 } => assert_eq!(y, 5),
|
||||
//~^ error: inline-const in pattern position is experimental
|
||||
//~| error: exclusive range pattern syntax is experimental
|
||||
y @ -5.. => range_from.push(y),
|
||||
y @ ..-7 => assert_eq!(y, -8),
|
||||
//~^ error: exclusive range pattern syntax is experimental
|
||||
y => bottom.push(y),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ LL + 0..=5+1 => errors_only.push(x),
|
||||
|
|
||||
|
||||
error[E0658]: inline-const in pattern position is experimental
|
||||
--> $DIR/range_pat_interactions2.rs:17:20
|
||||
--> $DIR/range_pat_interactions2.rs:15:20
|
||||
|
|
||||
LL | y @ 0..const { 5 + 1 } => assert_eq!(y, 5),
|
||||
| ^^^^^
|
||||
@@ -26,50 +26,6 @@ LL | y @ 0..const { 5 + 1 } => assert_eq!(y, 5),
|
||||
= help: add `#![feature(inline_const_pat)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions2.rs:13:17
|
||||
|
|
||||
LL | 1 | -3..0 => first_or.push(x),
|
||||
| ^^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions2.rs:15:18
|
||||
|
|
||||
LL | y @ (0..5 | 6) => or_two.push(y),
|
||||
| ^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions2.rs:17:17
|
||||
|
|
||||
LL | y @ 0..const { 5 + 1 } => assert_eq!(y, 5),
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions2.rs:21:17
|
||||
|
|
||||
LL | y @ ..-7 => assert_eq!(y, -8),
|
||||
| ^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error: aborting due to 7 previous errors
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
||||
@@ -8,15 +8,11 @@ fn main() {
|
||||
match x as i32 {
|
||||
8.. => bottom.push(x),
|
||||
1 | -3..0 => first_or.push(x),
|
||||
//~^ exclusive range pattern syntax is experimental
|
||||
y @ (0..5 | 6) => or_two.push(y),
|
||||
//~^ exclusive range pattern syntax is experimental
|
||||
y @ 0..const { 5 + 1 } => assert_eq!(y, 5),
|
||||
//~^ inline-const in pattern position is experimental
|
||||
//~| exclusive range pattern syntax is experimental
|
||||
y @ -5.. => range_from.push(y),
|
||||
y @ ..-7 => assert_eq!(y, -8),
|
||||
//~^ exclusive range pattern syntax is experimental
|
||||
y => bottom.push(y),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error[E0658]: inline-const in pattern position is experimental
|
||||
--> $DIR/range_pat_interactions3.rs:14:20
|
||||
--> $DIR/range_pat_interactions3.rs:12:20
|
||||
|
|
||||
LL | y @ 0..const { 5 + 1 } => assert_eq!(y, 5),
|
||||
| ^^^^^
|
||||
@@ -8,50 +8,6 @@ LL | y @ 0..const { 5 + 1 } => assert_eq!(y, 5),
|
||||
= help: add `#![feature(inline_const_pat)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions3.rs:10:17
|
||||
|
|
||||
LL | 1 | -3..0 => first_or.push(x),
|
||||
| ^^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions3.rs:12:18
|
||||
|
|
||||
LL | y @ (0..5 | 6) => or_two.push(y),
|
||||
| ^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions3.rs:14:17
|
||||
|
|
||||
LL | y @ 0..const { 5 + 1 } => assert_eq!(y, 5),
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range_pat_interactions3.rs:18:17
|
||||
|
|
||||
LL | y @ ..-7 => assert_eq!(y, -8),
|
||||
| ^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#![feature(half_open_range_patterns_in_slices)]
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {
|
||||
let xs = [13, 1, 5, 2, 3, 1, 21, 8];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error[E0527]: pattern requires 2 elements but array has 8
|
||||
--> $DIR/slice_pattern_syntax_problem0.rs:11:9
|
||||
--> $DIR/slice_pattern_syntax_problem0.rs:10:9
|
||||
|
|
||||
LL | let [first_three @ ..3, rest @ 2..] = xs;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 8 elements
|
||||
|
||||
@@ -3,7 +3,5 @@ fn main() {
|
||||
let xs = [13, 1, 5, 2, 3, 1, 21, 8];
|
||||
let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs;
|
||||
//~^ `X..` patterns in slices are experimental
|
||||
//~| exclusive range pattern syntax is experimental
|
||||
//~| exclusive range pattern syntax is experimental
|
||||
//~| ERROR: refutable pattern
|
||||
}
|
||||
|
||||
@@ -8,28 +8,6 @@ LL | let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs;
|
||||
= help: add `#![feature(half_open_range_patterns_in_slices)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/slice_pattern_syntax_problem1.rs:4:23
|
||||
|
|
||||
LL | let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs;
|
||||
| ^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/slice_pattern_syntax_problem1.rs:4:32
|
||||
|
|
||||
LL | let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs;
|
||||
| ^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/slice_pattern_syntax_problem1.rs:4:9
|
||||
|
|
||||
@@ -44,7 +22,7 @@ help: you might want to use `let else` to handle the variant that isn't matched
|
||||
LL | let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs else { todo!() };
|
||||
| ++++++++++++++++
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0005, E0658.
|
||||
For more information about an error, try `rustc --explain E0005`.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//@ build-pass
|
||||
|
||||
#![feature(inline_const_pat, exclusive_range_pattern)]
|
||||
#![feature(inline_const_pat)]
|
||||
|
||||
fn main() {
|
||||
const N: u32 = 10;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
fn main() {
|
||||
match 5 {
|
||||
6 ..= 1 => { }
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
error[E0030]: lower range bound must be less than or equal to upper
|
||||
--> $DIR/match-range-fail-2.rs:5:9
|
||||
--> $DIR/match-range-fail-2.rs:3:9
|
||||
|
|
||||
LL | 6 ..= 1 => { }
|
||||
| ^^^^^^^ lower bound larger than upper bound
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/match-range-fail-2.rs:11:9
|
||||
--> $DIR/match-range-fail-2.rs:9:9
|
||||
|
|
||||
LL | 0 .. 0 => { }
|
||||
| ^^^^^^
|
||||
|
||||
error[E0030]: lower range bound must be less than or equal to upper
|
||||
--> $DIR/match-range-fail-2.rs:17:9
|
||||
--> $DIR/match-range-fail-2.rs:15:9
|
||||
|
|
||||
LL | 0xFFFF_FFFF_FFFF_FFFF ..= 1 => { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ lower bound larger than upper bound
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![feature(inline_const_pat)]
|
||||
#![allow(overlapping_range_endpoints)]
|
||||
|
||||
|
||||
@@ -1,59 +1,59 @@
|
||||
error: literal out of range for `u8`
|
||||
--> $DIR/validate-range-endpoints.rs:8:12
|
||||
--> $DIR/validate-range-endpoints.rs:7:12
|
||||
|
|
||||
LL | 1..257 => {}
|
||||
| ^^^ this value does not fit into the type `u8` whose range is `0..=255`
|
||||
|
||||
error: literal out of range for `u8`
|
||||
--> $DIR/validate-range-endpoints.rs:10:13
|
||||
--> $DIR/validate-range-endpoints.rs:9:13
|
||||
|
|
||||
LL | 1..=256 => {}
|
||||
| ^^^ this value does not fit into the type `u8` whose range is `0..=255`
|
||||
|
||||
error[E0030]: lower range bound must be less than or equal to upper
|
||||
--> $DIR/validate-range-endpoints.rs:19:9
|
||||
--> $DIR/validate-range-endpoints.rs:18:9
|
||||
|
|
||||
LL | 1..=TOO_BIG => {}
|
||||
| ^^^^^^^^^^^ lower bound larger than upper bound
|
||||
|
||||
error[E0030]: lower range bound must be less than or equal to upper
|
||||
--> $DIR/validate-range-endpoints.rs:21:9
|
||||
--> $DIR/validate-range-endpoints.rs:20:9
|
||||
|
|
||||
LL | 1..=const { 256 } => {}
|
||||
| ^^^^^^^^^^^^^^^^^ lower bound larger than upper bound
|
||||
|
||||
error: literal out of range for `u64`
|
||||
--> $DIR/validate-range-endpoints.rs:27:32
|
||||
--> $DIR/validate-range-endpoints.rs:26:32
|
||||
|
|
||||
LL | 10000000000000000000..=99999999999999999999 => {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^ this value does not fit into the type `u64` whose range is `0..=18446744073709551615`
|
||||
|
||||
error: literal out of range for `i8`
|
||||
--> $DIR/validate-range-endpoints.rs:33:12
|
||||
--> $DIR/validate-range-endpoints.rs:32:12
|
||||
|
|
||||
LL | 0..129 => {}
|
||||
| ^^^ this value does not fit into the type `i8` whose range is `-128..=127`
|
||||
|
||||
error: literal out of range for `i8`
|
||||
--> $DIR/validate-range-endpoints.rs:35:13
|
||||
--> $DIR/validate-range-endpoints.rs:34:13
|
||||
|
|
||||
LL | 0..=128 => {}
|
||||
| ^^^ this value does not fit into the type `i8` whose range is `-128..=127`
|
||||
|
||||
error: literal out of range for `i8`
|
||||
--> $DIR/validate-range-endpoints.rs:37:9
|
||||
--> $DIR/validate-range-endpoints.rs:36:9
|
||||
|
|
||||
LL | -129..0 => {}
|
||||
| ^^^^ this value does not fit into the type `i8` whose range is `-128..=127`
|
||||
|
||||
error: literal out of range for `i8`
|
||||
--> $DIR/validate-range-endpoints.rs:39:9
|
||||
--> $DIR/validate-range-endpoints.rs:38:9
|
||||
|
|
||||
LL | -10000..=-20 => {}
|
||||
| ^^^^^^ this value does not fit into the type `i8` whose range is `-128..=127`
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i8::MIN..=-17_i8` and `1_i8..=i8::MAX` not covered
|
||||
--> $DIR/validate-range-endpoints.rs:50:11
|
||||
--> $DIR/validate-range-endpoints.rs:49:11
|
||||
|
|
||||
LL | match 0i8 {
|
||||
| ^^^ patterns `i8::MIN..=-17_i8` and `1_i8..=i8::MAX` not covered
|
||||
@@ -66,7 +66,7 @@ LL + i8::MIN..=-17_i8 | 1_i8..=i8::MAX => todo!()
|
||||
|
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i8::MIN..=-17_i8` not covered
|
||||
--> $DIR/validate-range-endpoints.rs:54:11
|
||||
--> $DIR/validate-range-endpoints.rs:53:11
|
||||
|
|
||||
LL | match 0i8 {
|
||||
| ^^^ pattern `i8::MIN..=-17_i8` not covered
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![allow(overlapping_range_endpoints)]
|
||||
#![allow(non_contiguous_range_endpoints)]
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
//@ check-pass
|
||||
|
||||
#![feature(exclusive_range_pattern)]
|
||||
|
||||
#![allow(ellipsis_inclusive_range_patterns)]
|
||||
|
||||
fn main() {
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
// 1. Things parse as they should.
|
||||
// 2. Or at least we have parser recovery if they don't.
|
||||
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![deny(ellipsis_inclusive_range_patterns)]
|
||||
|
||||
fn main() {}
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
error: float literals must have an integer part
|
||||
--> $DIR/recover-range-pats.rs:21:12
|
||||
--> $DIR/recover-range-pats.rs:20:12
|
||||
|
|
||||
LL | if let .0..Y = 0 {}
|
||||
| ^^ help: must have an integer part: `0.0`
|
||||
|
||||
error: float literals must have an integer part
|
||||
--> $DIR/recover-range-pats.rs:23:16
|
||||
--> $DIR/recover-range-pats.rs:22:16
|
||||
|
|
||||
LL | if let X.. .0 = 0 {}
|
||||
| ^^ help: must have an integer part: `0.0`
|
||||
|
||||
error: float literals must have an integer part
|
||||
--> $DIR/recover-range-pats.rs:34:12
|
||||
--> $DIR/recover-range-pats.rs:33:12
|
||||
|
|
||||
LL | if let .0..=Y = 0 {}
|
||||
| ^^ help: must have an integer part: `0.0`
|
||||
|
||||
error: float literals must have an integer part
|
||||
--> $DIR/recover-range-pats.rs:36:16
|
||||
--> $DIR/recover-range-pats.rs:35:16
|
||||
|
|
||||
LL | if let X..=.0 = 0 {}
|
||||
| ^^ help: must have an integer part: `0.0`
|
||||
|
||||
error: float literals must have an integer part
|
||||
--> $DIR/recover-range-pats.rs:59:12
|
||||
--> $DIR/recover-range-pats.rs:58:12
|
||||
|
|
||||
LL | if let .0...Y = 0 {}
|
||||
| ^^ help: must have an integer part: `0.0`
|
||||
|
||||
error: float literals must have an integer part
|
||||
--> $DIR/recover-range-pats.rs:63:17
|
||||
--> $DIR/recover-range-pats.rs:62:17
|
||||
|
|
||||
LL | if let X... .0 = 0 {}
|
||||
| ^^ help: must have an integer part: `0.0`
|
||||
|
||||
error: float literals must have an integer part
|
||||
--> $DIR/recover-range-pats.rs:74:12
|
||||
--> $DIR/recover-range-pats.rs:73:12
|
||||
|
|
||||
LL | if let .0.. = 0 {}
|
||||
| ^^ help: must have an integer part: `0.0`
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/recover-range-pats.rs:80:13
|
||||
--> $DIR/recover-range-pats.rs:79:13
|
||||
|
|
||||
LL | if let 0..= = 0 {}
|
||||
| ^^^ help: use `..` instead
|
||||
@@ -49,7 +49,7 @@ LL | if let 0..= = 0 {}
|
||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/recover-range-pats.rs:81:13
|
||||
--> $DIR/recover-range-pats.rs:80:13
|
||||
|
|
||||
LL | if let X..= = 0 {}
|
||||
| ^^^ help: use `..` instead
|
||||
@@ -57,7 +57,7 @@ LL | if let X..= = 0 {}
|
||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/recover-range-pats.rs:82:16
|
||||
--> $DIR/recover-range-pats.rs:81:16
|
||||
|
|
||||
LL | if let true..= = 0 {}
|
||||
| ^^^ help: use `..` instead
|
||||
@@ -65,13 +65,13 @@ LL | if let true..= = 0 {}
|
||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
||||
|
||||
error: float literals must have an integer part
|
||||
--> $DIR/recover-range-pats.rs:84:12
|
||||
--> $DIR/recover-range-pats.rs:83:12
|
||||
|
|
||||
LL | if let .0..= = 0 {}
|
||||
| ^^ help: must have an integer part: `0.0`
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/recover-range-pats.rs:84:14
|
||||
--> $DIR/recover-range-pats.rs:83:14
|
||||
|
|
||||
LL | if let .0..= = 0 {}
|
||||
| ^^^ help: use `..` instead
|
||||
@@ -79,7 +79,7 @@ LL | if let .0..= = 0 {}
|
||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/recover-range-pats.rs:90:13
|
||||
--> $DIR/recover-range-pats.rs:89:13
|
||||
|
|
||||
LL | if let 0... = 0 {}
|
||||
| ^^^ help: use `..` instead
|
||||
@@ -87,7 +87,7 @@ LL | if let 0... = 0 {}
|
||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/recover-range-pats.rs:91:13
|
||||
--> $DIR/recover-range-pats.rs:90:13
|
||||
|
|
||||
LL | if let X... = 0 {}
|
||||
| ^^^ help: use `..` instead
|
||||
@@ -95,7 +95,7 @@ LL | if let X... = 0 {}
|
||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/recover-range-pats.rs:92:16
|
||||
--> $DIR/recover-range-pats.rs:91:16
|
||||
|
|
||||
LL | if let true... = 0 {}
|
||||
| ^^^ help: use `..` instead
|
||||
@@ -103,13 +103,13 @@ LL | if let true... = 0 {}
|
||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
||||
|
||||
error: float literals must have an integer part
|
||||
--> $DIR/recover-range-pats.rs:94:12
|
||||
--> $DIR/recover-range-pats.rs:93:12
|
||||
|
|
||||
LL | if let .0... = 0 {}
|
||||
| ^^ help: must have an integer part: `0.0`
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/recover-range-pats.rs:94:14
|
||||
--> $DIR/recover-range-pats.rs:93:14
|
||||
|
|
||||
LL | if let .0... = 0 {}
|
||||
| ^^^ help: use `..` instead
|
||||
@@ -117,49 +117,49 @@ LL | if let .0... = 0 {}
|
||||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
|
||||
|
||||
error: float literals must have an integer part
|
||||
--> $DIR/recover-range-pats.rs:104:15
|
||||
--> $DIR/recover-range-pats.rs:103:15
|
||||
|
|
||||
LL | if let .. .0 = 0 {}
|
||||
| ^^ help: must have an integer part: `0.0`
|
||||
|
||||
error: float literals must have an integer part
|
||||
--> $DIR/recover-range-pats.rs:114:15
|
||||
--> $DIR/recover-range-pats.rs:113:15
|
||||
|
|
||||
LL | if let ..=.0 = 0 {}
|
||||
| ^^ help: must have an integer part: `0.0`
|
||||
|
||||
error: range-to patterns with `...` are not allowed
|
||||
--> $DIR/recover-range-pats.rs:120:12
|
||||
--> $DIR/recover-range-pats.rs:119:12
|
||||
|
|
||||
LL | if let ...3 = 0 {}
|
||||
| ^^^ help: use `..=` instead
|
||||
|
||||
error: range-to patterns with `...` are not allowed
|
||||
--> $DIR/recover-range-pats.rs:122:12
|
||||
--> $DIR/recover-range-pats.rs:121:12
|
||||
|
|
||||
LL | if let ...Y = 0 {}
|
||||
| ^^^ help: use `..=` instead
|
||||
|
||||
error: range-to patterns with `...` are not allowed
|
||||
--> $DIR/recover-range-pats.rs:124:12
|
||||
--> $DIR/recover-range-pats.rs:123:12
|
||||
|
|
||||
LL | if let ...true = 0 {}
|
||||
| ^^^ help: use `..=` instead
|
||||
|
||||
error: float literals must have an integer part
|
||||
--> $DIR/recover-range-pats.rs:127:15
|
||||
--> $DIR/recover-range-pats.rs:126:15
|
||||
|
|
||||
LL | if let ....3 = 0 {}
|
||||
| ^^ help: must have an integer part: `0.3`
|
||||
|
||||
error: range-to patterns with `...` are not allowed
|
||||
--> $DIR/recover-range-pats.rs:127:12
|
||||
--> $DIR/recover-range-pats.rs:126:12
|
||||
|
|
||||
LL | if let ....3 = 0 {}
|
||||
| ^^^ help: use `..=` instead
|
||||
|
||||
error: range-to patterns with `...` are not allowed
|
||||
--> $DIR/recover-range-pats.rs:153:17
|
||||
--> $DIR/recover-range-pats.rs:152:17
|
||||
|
|
||||
LL | let ...$e;
|
||||
| ^^^ help: use `..=` instead
|
||||
@@ -170,7 +170,7 @@ LL | mac!(0);
|
||||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/recover-range-pats.rs:160:19
|
||||
--> $DIR/recover-range-pats.rs:159:19
|
||||
|
|
||||
LL | let $e...;
|
||||
| ^^^ help: use `..` instead
|
||||
@@ -182,7 +182,7 @@ LL | mac!(0);
|
||||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0586]: inclusive range with no end
|
||||
--> $DIR/recover-range-pats.rs:162:19
|
||||
--> $DIR/recover-range-pats.rs:161:19
|
||||
|
|
||||
LL | let $e..=;
|
||||
| ^^^ help: use `..` instead
|
||||
@@ -194,7 +194,7 @@ LL | mac!(0);
|
||||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: `...` range patterns are deprecated
|
||||
--> $DIR/recover-range-pats.rs:41:13
|
||||
--> $DIR/recover-range-pats.rs:40:13
|
||||
|
|
||||
LL | if let 0...3 = 0 {}
|
||||
| ^^^ help: use `..=` for an inclusive range
|
||||
@@ -202,13 +202,13 @@ LL | if let 0...3 = 0 {}
|
||||
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
|
||||
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
|
||||
note: the lint level is defined here
|
||||
--> $DIR/recover-range-pats.rs:7:9
|
||||
--> $DIR/recover-range-pats.rs:6:9
|
||||
|
|
||||
LL | #![deny(ellipsis_inclusive_range_patterns)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `...` range patterns are deprecated
|
||||
--> $DIR/recover-range-pats.rs:44:13
|
||||
--> $DIR/recover-range-pats.rs:43:13
|
||||
|
|
||||
LL | if let 0...Y = 0 {}
|
||||
| ^^^ help: use `..=` for an inclusive range
|
||||
@@ -217,7 +217,7 @@ LL | if let 0...Y = 0 {}
|
||||
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
|
||||
|
||||
error: `...` range patterns are deprecated
|
||||
--> $DIR/recover-range-pats.rs:47:13
|
||||
--> $DIR/recover-range-pats.rs:46:13
|
||||
|
|
||||
LL | if let X...3 = 0 {}
|
||||
| ^^^ help: use `..=` for an inclusive range
|
||||
@@ -226,7 +226,7 @@ LL | if let X...3 = 0 {}
|
||||
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
|
||||
|
||||
error: `...` range patterns are deprecated
|
||||
--> $DIR/recover-range-pats.rs:50:13
|
||||
--> $DIR/recover-range-pats.rs:49:13
|
||||
|
|
||||
LL | if let X...Y = 0 {}
|
||||
| ^^^ help: use `..=` for an inclusive range
|
||||
@@ -235,7 +235,7 @@ LL | if let X...Y = 0 {}
|
||||
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
|
||||
|
||||
error: `...` range patterns are deprecated
|
||||
--> $DIR/recover-range-pats.rs:53:16
|
||||
--> $DIR/recover-range-pats.rs:52:16
|
||||
|
|
||||
LL | if let true...Y = 0 {}
|
||||
| ^^^ help: use `..=` for an inclusive range
|
||||
@@ -244,7 +244,7 @@ LL | if let true...Y = 0 {}
|
||||
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
|
||||
|
||||
error: `...` range patterns are deprecated
|
||||
--> $DIR/recover-range-pats.rs:56:13
|
||||
--> $DIR/recover-range-pats.rs:55:13
|
||||
|
|
||||
LL | if let X...true = 0 {}
|
||||
| ^^^ help: use `..=` for an inclusive range
|
||||
@@ -253,7 +253,7 @@ LL | if let X...true = 0 {}
|
||||
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
|
||||
|
||||
error: `...` range patterns are deprecated
|
||||
--> $DIR/recover-range-pats.rs:59:14
|
||||
--> $DIR/recover-range-pats.rs:58:14
|
||||
|
|
||||
LL | if let .0...Y = 0 {}
|
||||
| ^^^ help: use `..=` for an inclusive range
|
||||
@@ -262,7 +262,7 @@ LL | if let .0...Y = 0 {}
|
||||
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
|
||||
|
||||
error: `...` range patterns are deprecated
|
||||
--> $DIR/recover-range-pats.rs:63:13
|
||||
--> $DIR/recover-range-pats.rs:62:13
|
||||
|
|
||||
LL | if let X... .0 = 0 {}
|
||||
| ^^^ help: use `..=` for an inclusive range
|
||||
@@ -271,7 +271,7 @@ LL | if let X... .0 = 0 {}
|
||||
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
|
||||
|
||||
error: `...` range patterns are deprecated
|
||||
--> $DIR/recover-range-pats.rs:138:20
|
||||
--> $DIR/recover-range-pats.rs:137:20
|
||||
|
|
||||
LL | let $e1...$e2;
|
||||
| ^^^ help: use `..=` for an inclusive range
|
||||
@@ -284,7 +284,7 @@ LL | mac2!(0, 1);
|
||||
= note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/recover-range-pats.rs:19:12
|
||||
--> $DIR/recover-range-pats.rs:18:12
|
||||
|
|
||||
LL | if let true..Y = 0 {}
|
||||
| ^^^^ - this is of type `u8`
|
||||
@@ -292,7 +292,7 @@ LL | if let true..Y = 0 {}
|
||||
| this is of type `bool` but it should be `char` or numeric
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/recover-range-pats.rs:20:15
|
||||
--> $DIR/recover-range-pats.rs:19:15
|
||||
|
|
||||
LL | if let X..true = 0 {}
|
||||
| - ^^^^ this is of type `bool` but it should be `char` or numeric
|
||||
@@ -300,7 +300,7 @@ LL | if let X..true = 0 {}
|
||||
| this is of type `u8`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/recover-range-pats.rs:21:12
|
||||
--> $DIR/recover-range-pats.rs:20:12
|
||||
|
|
||||
LL | if let .0..Y = 0 {}
|
||||
| ^^ - - this expression has type `{integer}`
|
||||
@@ -309,7 +309,7 @@ LL | if let .0..Y = 0 {}
|
||||
| expected integer, found floating-point number
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/recover-range-pats.rs:23:16
|
||||
--> $DIR/recover-range-pats.rs:22:16
|
||||
|
|
||||
LL | if let X.. .0 = 0 {}
|
||||
| - ^^ - this expression has type `u8`
|
||||
@@ -321,7 +321,7 @@ LL | if let X.. .0 = 0 {}
|
||||
found type `{float}`
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/recover-range-pats.rs:32:12
|
||||
--> $DIR/recover-range-pats.rs:31:12
|
||||
|
|
||||
LL | if let true..=Y = 0 {}
|
||||
| ^^^^ - this is of type `u8`
|
||||
@@ -329,7 +329,7 @@ LL | if let true..=Y = 0 {}
|
||||
| this is of type `bool` but it should be `char` or numeric
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/recover-range-pats.rs:33:16
|
||||
--> $DIR/recover-range-pats.rs:32:16
|
||||
|
|
||||
LL | if let X..=true = 0 {}
|
||||
| - ^^^^ this is of type `bool` but it should be `char` or numeric
|
||||
@@ -337,7 +337,7 @@ LL | if let X..=true = 0 {}
|
||||
| this is of type `u8`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/recover-range-pats.rs:34:12
|
||||
--> $DIR/recover-range-pats.rs:33:12
|
||||
|
|
||||
LL | if let .0..=Y = 0 {}
|
||||
| ^^ - - this expression has type `{integer}`
|
||||
@@ -346,7 +346,7 @@ LL | if let .0..=Y = 0 {}
|
||||
| expected integer, found floating-point number
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/recover-range-pats.rs:36:16
|
||||
--> $DIR/recover-range-pats.rs:35:16
|
||||
|
|
||||
LL | if let X..=.0 = 0 {}
|
||||
| - ^^ - this expression has type `u8`
|
||||
@@ -358,7 +358,7 @@ LL | if let X..=.0 = 0 {}
|
||||
found type `{float}`
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/recover-range-pats.rs:53:12
|
||||
--> $DIR/recover-range-pats.rs:52:12
|
||||
|
|
||||
LL | if let true...Y = 0 {}
|
||||
| ^^^^ - this is of type `u8`
|
||||
@@ -366,7 +366,7 @@ LL | if let true...Y = 0 {}
|
||||
| this is of type `bool` but it should be `char` or numeric
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/recover-range-pats.rs:56:16
|
||||
--> $DIR/recover-range-pats.rs:55:16
|
||||
|
|
||||
LL | if let X...true = 0 {}
|
||||
| - ^^^^ this is of type `bool` but it should be `char` or numeric
|
||||
@@ -374,7 +374,7 @@ LL | if let X...true = 0 {}
|
||||
| this is of type `u8`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/recover-range-pats.rs:59:12
|
||||
--> $DIR/recover-range-pats.rs:58:12
|
||||
|
|
||||
LL | if let .0...Y = 0 {}
|
||||
| ^^ - - this expression has type `{integer}`
|
||||
@@ -383,7 +383,7 @@ LL | if let .0...Y = 0 {}
|
||||
| expected integer, found floating-point number
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/recover-range-pats.rs:63:17
|
||||
--> $DIR/recover-range-pats.rs:62:17
|
||||
|
|
||||
LL | if let X... .0 = 0 {}
|
||||
| - ^^ - this expression has type `u8`
|
||||
@@ -395,13 +395,13 @@ LL | if let X... .0 = 0 {}
|
||||
found type `{float}`
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/recover-range-pats.rs:72:12
|
||||
--> $DIR/recover-range-pats.rs:71:12
|
||||
|
|
||||
LL | if let true.. = 0 {}
|
||||
| ^^^^ this is of type `bool` but it should be `char` or numeric
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/recover-range-pats.rs:74:12
|
||||
--> $DIR/recover-range-pats.rs:73:12
|
||||
|
|
||||
LL | if let .0.. = 0 {}
|
||||
| ^^ - this expression has type `{integer}`
|
||||
@@ -409,13 +409,13 @@ LL | if let .0.. = 0 {}
|
||||
| expected integer, found floating-point number
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/recover-range-pats.rs:82:12
|
||||
--> $DIR/recover-range-pats.rs:81:12
|
||||
|
|
||||
LL | if let true..= = 0 {}
|
||||
| ^^^^ this is of type `bool` but it should be `char` or numeric
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/recover-range-pats.rs:84:12
|
||||
--> $DIR/recover-range-pats.rs:83:12
|
||||
|
|
||||
LL | if let .0..= = 0 {}
|
||||
| ^^ - this expression has type `{integer}`
|
||||
@@ -423,13 +423,13 @@ LL | if let .0..= = 0 {}
|
||||
| expected integer, found floating-point number
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/recover-range-pats.rs:92:12
|
||||
--> $DIR/recover-range-pats.rs:91:12
|
||||
|
|
||||
LL | if let true... = 0 {}
|
||||
| ^^^^ this is of type `bool` but it should be `char` or numeric
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/recover-range-pats.rs:94:12
|
||||
--> $DIR/recover-range-pats.rs:93:12
|
||||
|
|
||||
LL | if let .0... = 0 {}
|
||||
| ^^ - this expression has type `{integer}`
|
||||
@@ -437,13 +437,13 @@ LL | if let .0... = 0 {}
|
||||
| expected integer, found floating-point number
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/recover-range-pats.rs:102:14
|
||||
--> $DIR/recover-range-pats.rs:101:14
|
||||
|
|
||||
LL | if let ..true = 0 {}
|
||||
| ^^^^ this is of type `bool` but it should be `char` or numeric
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/recover-range-pats.rs:104:15
|
||||
--> $DIR/recover-range-pats.rs:103:15
|
||||
|
|
||||
LL | if let .. .0 = 0 {}
|
||||
| ^^ - this expression has type `{integer}`
|
||||
@@ -451,13 +451,13 @@ LL | if let .. .0 = 0 {}
|
||||
| expected integer, found floating-point number
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/recover-range-pats.rs:112:15
|
||||
--> $DIR/recover-range-pats.rs:111:15
|
||||
|
|
||||
LL | if let ..=true = 0 {}
|
||||
| ^^^^ this is of type `bool` but it should be `char` or numeric
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/recover-range-pats.rs:114:15
|
||||
--> $DIR/recover-range-pats.rs:113:15
|
||||
|
|
||||
LL | if let ..=.0 = 0 {}
|
||||
| ^^ - this expression has type `{integer}`
|
||||
@@ -465,13 +465,13 @@ LL | if let ..=.0 = 0 {}
|
||||
| expected integer, found floating-point number
|
||||
|
||||
error[E0029]: only `char` and numeric types are allowed in range patterns
|
||||
--> $DIR/recover-range-pats.rs:124:15
|
||||
--> $DIR/recover-range-pats.rs:123:15
|
||||
|
|
||||
LL | if let ...true = 0 {}
|
||||
| ^^^^ this is of type `bool` but it should be `char` or numeric
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/recover-range-pats.rs:127:15
|
||||
--> $DIR/recover-range-pats.rs:126:15
|
||||
|
|
||||
LL | if let ....3 = 0 {}
|
||||
| ^^ - this expression has type `{integer}`
|
||||
@@ -479,7 +479,7 @@ LL | if let ....3 = 0 {}
|
||||
| expected integer, found floating-point number
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/recover-range-pats.rs:136:17
|
||||
--> $DIR/recover-range-pats.rs:135:17
|
||||
|
|
||||
LL | let $e1..$e2;
|
||||
| ^^^^^^^^ patterns `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
|
||||
@@ -493,7 +493,7 @@ LL | mac2!(0, 1);
|
||||
= note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/recover-range-pats.rs:138:17
|
||||
--> $DIR/recover-range-pats.rs:137:17
|
||||
|
|
||||
LL | let $e1...$e2;
|
||||
| ^^^^^^^^^ patterns `i32::MIN..=-1_i32` and `2_i32..=i32::MAX` not covered
|
||||
@@ -507,7 +507,7 @@ LL | mac2!(0, 1);
|
||||
= note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/recover-range-pats.rs:142:17
|
||||
--> $DIR/recover-range-pats.rs:141:17
|
||||
|
|
||||
LL | let $e1..=$e2;
|
||||
| ^^^^^^^^^ patterns `i32::MIN..=-1_i32` and `2_i32..=i32::MAX` not covered
|
||||
@@ -521,7 +521,7 @@ LL | mac2!(0, 1);
|
||||
= note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/recover-range-pats.rs:151:17
|
||||
--> $DIR/recover-range-pats.rs:150:17
|
||||
|
|
||||
LL | let ..$e;
|
||||
| ^^^^ pattern `0_i32..=i32::MAX` not covered
|
||||
@@ -535,7 +535,7 @@ LL | mac!(0);
|
||||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/recover-range-pats.rs:153:17
|
||||
--> $DIR/recover-range-pats.rs:152:17
|
||||
|
|
||||
LL | let ...$e;
|
||||
| ^^^^^ pattern `1_i32..=i32::MAX` not covered
|
||||
@@ -549,7 +549,7 @@ LL | mac!(0);
|
||||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/recover-range-pats.rs:156:17
|
||||
--> $DIR/recover-range-pats.rs:155:17
|
||||
|
|
||||
LL | let ..=$e;
|
||||
| ^^^^^ pattern `1_i32..=i32::MAX` not covered
|
||||
@@ -563,7 +563,7 @@ LL | mac!(0);
|
||||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/recover-range-pats.rs:158:17
|
||||
--> $DIR/recover-range-pats.rs:157:17
|
||||
|
|
||||
LL | let $e..;
|
||||
| ^^^^ pattern `i32::MIN..=-1_i32` not covered
|
||||
@@ -577,7 +577,7 @@ LL | mac!(0);
|
||||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/recover-range-pats.rs:160:17
|
||||
--> $DIR/recover-range-pats.rs:159:17
|
||||
|
|
||||
LL | let $e...;
|
||||
| ^^^^^ pattern `i32::MIN..=-1_i32` not covered
|
||||
@@ -591,7 +591,7 @@ LL | mac!(0);
|
||||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/recover-range-pats.rs:162:17
|
||||
--> $DIR/recover-range-pats.rs:161:17
|
||||
|
|
||||
LL | let $e..=;
|
||||
| ^^^^^ pattern `i32::MIN..=-1_i32` not covered
|
||||
|
||||
@@ -11,7 +11,6 @@ fn main() {
|
||||
[_, ..tail] => println!("{tail}"),
|
||||
//~^ ERROR cannot find value `tail` in this scope
|
||||
//~| ERROR cannot find value `tail` in this scope
|
||||
//~| ERROR exclusive range pattern syntax is experimental
|
||||
}
|
||||
match &[7, 8, 9][..] {
|
||||
[] => {}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error: range-to patterns with `...` are not allowed
|
||||
--> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:18:13
|
||||
--> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:17:13
|
||||
|
|
||||
LL | [_, ...tail] => println!("{tail}"),
|
||||
| ^^^ help: use `..=` instead
|
||||
@@ -39,7 +39,7 @@ LL | [_, ..tail] => println!("{tail}"),
|
||||
| ^^^^ not found in this scope
|
||||
|
||||
error[E0425]: cannot find value `tail` in this scope
|
||||
--> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:18:16
|
||||
--> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:17:16
|
||||
|
|
||||
LL | [_, ...tail] => println!("{tail}"),
|
||||
| ^^^^ not found in this scope
|
||||
@@ -50,7 +50,7 @@ LL | [_, tail @ ..] => println!("{tail}"),
|
||||
| ~~~~~~~~~
|
||||
|
||||
error[E0425]: cannot find value `tail` in this scope
|
||||
--> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:18:36
|
||||
--> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:17:36
|
||||
|
|
||||
LL | [_, ...tail] => println!("{tail}"),
|
||||
| ^^^^ not found in this scope
|
||||
@@ -65,18 +65,7 @@ LL | [1, rest..] => println!("{rest}"),
|
||||
= help: add `#![feature(half_open_range_patterns_in_slices)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0658]: exclusive range pattern syntax is experimental
|
||||
--> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:11:13
|
||||
|
|
||||
LL | [_, ..tail] => println!("{tail}"),
|
||||
| ^^^^^^
|
||||
|
|
||||
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
|
||||
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: use an inclusive range pattern, like N..=M
|
||||
|
||||
error: aborting due to 9 previous errors
|
||||
error: aborting due to 8 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0425, E0658.
|
||||
For more information about an error, try `rustc --explain E0425`.
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![deny(unreachable_patterns)]
|
||||
|
||||
fn main() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error[E0004]: non-exhaustive patterns: `_` not covered
|
||||
--> $DIR/floats.rs:10:11
|
||||
--> $DIR/floats.rs:9:11
|
||||
|
|
||||
LL | match 0.0 {
|
||||
| ^^^ pattern `_` not covered
|
||||
@@ -12,49 +12,49 @@ LL + _ => todo!()
|
||||
|
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/floats.rs:18:9
|
||||
--> $DIR/floats.rs:17:9
|
||||
|
|
||||
LL | 0.01f64 => {}
|
||||
| ^^^^^^^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/floats.rs:2:9
|
||||
--> $DIR/floats.rs:1:9
|
||||
|
|
||||
LL | #![deny(unreachable_patterns)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/floats.rs:19:9
|
||||
--> $DIR/floats.rs:18:9
|
||||
|
|
||||
LL | 0.02f64 => {}
|
||||
| ^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/floats.rs:20:9
|
||||
--> $DIR/floats.rs:19:9
|
||||
|
|
||||
LL | 6.5f64 => {}
|
||||
| ^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/floats.rs:22:9
|
||||
--> $DIR/floats.rs:21:9
|
||||
|
|
||||
LL | 1.0f64..=4.0f64 => {}
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/floats.rs:34:9
|
||||
--> $DIR/floats.rs:33:9
|
||||
|
|
||||
LL | 0.01f32 => {}
|
||||
| ^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/floats.rs:35:9
|
||||
--> $DIR/floats.rs:34:9
|
||||
|
|
||||
LL | 0.02f32 => {}
|
||||
| ^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/floats.rs:36:9
|
||||
--> $DIR/floats.rs:35:9
|
||||
|
|
||||
LL | 6.5f32 => {}
|
||||
| ^^^^^^
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![deny(unreachable_patterns)]
|
||||
|
||||
enum Q { R(Option<usize>) }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error[E0004]: non-exhaustive patterns: `128_u8..=u8::MAX` not covered
|
||||
--> $DIR/guards.rs:12:11
|
||||
--> $DIR/guards.rs:11:11
|
||||
|
|
||||
LL | match 0u8 {
|
||||
| ^^^ pattern `128_u8..=u8::MAX` not covered
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![allow(overlapping_range_endpoints)]
|
||||
#![allow(non_contiguous_range_endpoints)]
|
||||
#![deny(unreachable_patterns)]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error[E0004]: non-exhaustive patterns: `u8::MAX` not covered
|
||||
--> $DIR/exhaustiveness.rs:48:8
|
||||
--> $DIR/exhaustiveness.rs:47:8
|
||||
|
|
||||
LL | m!(0u8, 0..255);
|
||||
| ^^^ pattern `u8::MAX` not covered
|
||||
@@ -11,7 +11,7 @@ LL | match $s { $($t)+ => {}, u8::MAX => todo!() }
|
||||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `u8::MAX` not covered
|
||||
--> $DIR/exhaustiveness.rs:49:8
|
||||
--> $DIR/exhaustiveness.rs:48:8
|
||||
|
|
||||
LL | m!(0u8, 0..=254);
|
||||
| ^^^ pattern `u8::MAX` not covered
|
||||
@@ -23,7 +23,7 @@ LL | match $s { $($t)+ => {}, u8::MAX => todo!() }
|
||||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `0_u8` not covered
|
||||
--> $DIR/exhaustiveness.rs:50:8
|
||||
--> $DIR/exhaustiveness.rs:49:8
|
||||
|
|
||||
LL | m!(0u8, 1..=255);
|
||||
| ^^^ pattern `0_u8` not covered
|
||||
@@ -35,7 +35,7 @@ LL | match $s { $($t)+ => {}, 0_u8 => todo!() }
|
||||
| +++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `42_u8` not covered
|
||||
--> $DIR/exhaustiveness.rs:51:8
|
||||
--> $DIR/exhaustiveness.rs:50:8
|
||||
|
|
||||
LL | m!(0u8, 0..42 | 43..=255);
|
||||
| ^^^ pattern `42_u8` not covered
|
||||
@@ -47,7 +47,7 @@ LL | match $s { $($t)+ => {}, 42_u8 => todo!() }
|
||||
| ++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i8::MAX` not covered
|
||||
--> $DIR/exhaustiveness.rs:52:8
|
||||
--> $DIR/exhaustiveness.rs:51:8
|
||||
|
|
||||
LL | m!(0i8, -128..127);
|
||||
| ^^^ pattern `i8::MAX` not covered
|
||||
@@ -59,7 +59,7 @@ LL | match $s { $($t)+ => {}, i8::MAX => todo!() }
|
||||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i8::MAX` not covered
|
||||
--> $DIR/exhaustiveness.rs:53:8
|
||||
--> $DIR/exhaustiveness.rs:52:8
|
||||
|
|
||||
LL | m!(0i8, -128..=126);
|
||||
| ^^^ pattern `i8::MAX` not covered
|
||||
@@ -71,7 +71,7 @@ LL | match $s { $($t)+ => {}, i8::MAX => todo!() }
|
||||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `i8::MIN` not covered
|
||||
--> $DIR/exhaustiveness.rs:54:8
|
||||
--> $DIR/exhaustiveness.rs:53:8
|
||||
|
|
||||
LL | m!(0i8, -127..=127);
|
||||
| ^^^ pattern `i8::MIN` not covered
|
||||
@@ -83,7 +83,7 @@ LL | match $s { $($t)+ => {}, i8::MIN => todo!() }
|
||||
| ++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `0_i8` not covered
|
||||
--> $DIR/exhaustiveness.rs:55:11
|
||||
--> $DIR/exhaustiveness.rs:54:11
|
||||
|
|
||||
LL | match 0i8 {
|
||||
| ^^^ pattern `0_i8` not covered
|
||||
@@ -96,7 +96,7 @@ LL + 0_i8 => todo!()
|
||||
|
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `u128::MAX` not covered
|
||||
--> $DIR/exhaustiveness.rs:60:8
|
||||
--> $DIR/exhaustiveness.rs:59:8
|
||||
|
|
||||
LL | m!(0u128, 0..=ALMOST_MAX);
|
||||
| ^^^^^ pattern `u128::MAX` not covered
|
||||
@@ -108,7 +108,7 @@ LL | match $s { $($t)+ => {}, u128::MAX => todo!() }
|
||||
| ++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `5_u128..` not covered
|
||||
--> $DIR/exhaustiveness.rs:61:8
|
||||
--> $DIR/exhaustiveness.rs:60:8
|
||||
|
|
||||
LL | m!(0u128, 0..=4);
|
||||
| ^^^^^ pattern `5_u128..` not covered
|
||||
@@ -120,7 +120,7 @@ LL | match $s { $($t)+ => {}, 5_u128.. => todo!() }
|
||||
| +++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `0_u128` not covered
|
||||
--> $DIR/exhaustiveness.rs:62:8
|
||||
--> $DIR/exhaustiveness.rs:61:8
|
||||
|
|
||||
LL | m!(0u128, 1..=u128::MAX);
|
||||
| ^^^^^ pattern `0_u128` not covered
|
||||
@@ -132,7 +132,7 @@ LL | match $s { $($t)+ => {}, 0_u128 => todo!() }
|
||||
| +++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `(126_u8..=127_u8, false)` not covered
|
||||
--> $DIR/exhaustiveness.rs:70:11
|
||||
--> $DIR/exhaustiveness.rs:69:11
|
||||
|
|
||||
LL | match (0u8, true) {
|
||||
| ^^^^^^^^^^^ pattern `(126_u8..=127_u8, false)` not covered
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![deny(non_contiguous_range_endpoints)]
|
||||
|
||||
macro_rules! m {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:16:9
|
||||
--> $DIR/gap_between_ranges.rs:15:9
|
||||
|
|
||||
LL | 20..30 => {}
|
||||
| ^^^^^^
|
||||
@@ -10,13 +10,13 @@ LL | 31..=40 => {}
|
||||
| ------- this could appear to continue range `20_u8..30_u8`, but `30_u8` isn't matched by either of them
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/gap_between_ranges.rs:2:9
|
||||
--> $DIR/gap_between_ranges.rs:1:9
|
||||
|
|
||||
LL | #![deny(non_contiguous_range_endpoints)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:21:9
|
||||
--> $DIR/gap_between_ranges.rs:20:9
|
||||
|
|
||||
LL | 20..30 => {}
|
||||
| ^^^^^^
|
||||
@@ -27,7 +27,7 @@ LL | 31 => {}
|
||||
| -- this could appear to continue range `20_u8..30_u8`, but `30_u8` isn't matched by either of them
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:26:13
|
||||
--> $DIR/gap_between_ranges.rs:25:13
|
||||
|
|
||||
LL | m!(0u8, 20..30, 31..=40);
|
||||
| ^^^^^^ ------- this could appear to continue range `20_u8..30_u8`, but `30_u8` isn't matched by either of them
|
||||
@@ -36,7 +36,7 @@ LL | m!(0u8, 20..30, 31..=40);
|
||||
| help: use an inclusive range instead: `20_u8..=30_u8`
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:27:22
|
||||
--> $DIR/gap_between_ranges.rs:26:22
|
||||
|
|
||||
LL | m!(0u8, 31..=40, 20..30);
|
||||
| ------- ^^^^^^
|
||||
@@ -46,7 +46,7 @@ LL | m!(0u8, 31..=40, 20..30);
|
||||
| this could appear to continue range `20_u8..30_u8`, but `30_u8` isn't matched by either of them
|
||||
|
||||
warning: multiple patterns overlap on their endpoints
|
||||
--> $DIR/gap_between_ranges.rs:28:21
|
||||
--> $DIR/gap_between_ranges.rs:27:21
|
||||
|
|
||||
LL | m!(0u8, 20..30, 29..=40);
|
||||
| ------ ^^^^^^^ ... with this range
|
||||
@@ -57,7 +57,7 @@ LL | m!(0u8, 20..30, 29..=40);
|
||||
= note: `#[warn(overlapping_range_endpoints)]` on by default
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:30:13
|
||||
--> $DIR/gap_between_ranges.rs:29:13
|
||||
|
|
||||
LL | m!(0u8, 20..30, 31..=40);
|
||||
| ^^^^^^ ------- this could appear to continue range `20_u8..30_u8`, but `30_u8` isn't matched by either of them
|
||||
@@ -66,7 +66,7 @@ LL | m!(0u8, 20..30, 31..=40);
|
||||
| help: use an inclusive range instead: `20_u8..=30_u8`
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:32:13
|
||||
--> $DIR/gap_between_ranges.rs:31:13
|
||||
|
|
||||
LL | m!(0u8, 20..30, 31..=32);
|
||||
| ^^^^^^ ------- this could appear to continue range `20_u8..30_u8`, but `30_u8` isn't matched by either of them
|
||||
@@ -75,7 +75,7 @@ LL | m!(0u8, 20..30, 31..=32);
|
||||
| help: use an inclusive range instead: `20_u8..=30_u8`
|
||||
|
||||
error: exclusive range missing `u8::MAX`
|
||||
--> $DIR/gap_between_ranges.rs:42:9
|
||||
--> $DIR/gap_between_ranges.rs:41:9
|
||||
|
|
||||
LL | 0..255 => {}
|
||||
| ^^^^^^
|
||||
@@ -84,7 +84,7 @@ LL | 0..255 => {}
|
||||
| help: use an inclusive range instead: `0_u8..=u8::MAX`
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:71:9
|
||||
--> $DIR/gap_between_ranges.rs:70:9
|
||||
|
|
||||
LL | 0..10 => {}
|
||||
| ^^^^^
|
||||
@@ -97,7 +97,7 @@ LL | 11..30 => {}
|
||||
| ------ this could appear to continue range `0_u8..10_u8`, but `10_u8` isn't matched by either of them
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:77:9
|
||||
--> $DIR/gap_between_ranges.rs:76:9
|
||||
|
|
||||
LL | 0..10 => {}
|
||||
| ^^^^^
|
||||
@@ -108,7 +108,7 @@ LL | 11..20 => {}
|
||||
| ------ this could appear to continue range `0_u8..10_u8`, but `10_u8` isn't matched by either of them
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:78:9
|
||||
--> $DIR/gap_between_ranges.rs:77:9
|
||||
|
|
||||
LL | 11..20 => {}
|
||||
| ^^^^^^
|
||||
@@ -119,7 +119,7 @@ LL | 21..30 => {}
|
||||
| ------ this could appear to continue range `11_u8..20_u8`, but `20_u8` isn't matched by either of them
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:83:9
|
||||
--> $DIR/gap_between_ranges.rs:82:9
|
||||
|
|
||||
LL | 00..20 => {}
|
||||
| ^^^^^^
|
||||
@@ -133,7 +133,7 @@ LL | 21..40 => {}
|
||||
| ------ this could appear to continue range `0_u8..20_u8`, but `20_u8` isn't matched by either of them
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:84:9
|
||||
--> $DIR/gap_between_ranges.rs:83:9
|
||||
|
|
||||
LL | 10..20 => {}
|
||||
| ^^^^^^
|
||||
@@ -146,7 +146,7 @@ LL | 21..40 => {}
|
||||
| ------ this could appear to continue range `10_u8..20_u8`, but `20_u8` isn't matched by either of them
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:92:10
|
||||
--> $DIR/gap_between_ranges.rs:91:10
|
||||
|
|
||||
LL | (0..10, true) => {}
|
||||
| ^^^^^
|
||||
@@ -157,7 +157,7 @@ LL | (11..20, true) => {}
|
||||
| ------ this could appear to continue range `0_u8..10_u8`, but `10_u8` isn't matched by either of them
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:97:16
|
||||
--> $DIR/gap_between_ranges.rs:96:16
|
||||
|
|
||||
LL | (true, 0..10) => {}
|
||||
| ^^^^^
|
||||
@@ -168,7 +168,7 @@ LL | (true, 11..20) => {}
|
||||
| ------ this could appear to continue range `0_u8..10_u8`, but `10_u8` isn't matched by either of them
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:103:10
|
||||
--> $DIR/gap_between_ranges.rs:102:10
|
||||
|
|
||||
LL | (0..10, true) => {}
|
||||
| ^^^^^
|
||||
@@ -179,7 +179,7 @@ LL | (11..20, false) => {}
|
||||
| ------ this could appear to continue range `0_u8..10_u8`, but `10_u8` isn't matched by either of them
|
||||
|
||||
error: multiple ranges are one apart
|
||||
--> $DIR/gap_between_ranges.rs:113:14
|
||||
--> $DIR/gap_between_ranges.rs:112:14
|
||||
|
|
||||
LL | Some(0..10) => {}
|
||||
| ^^^^^
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![deny(overlapping_range_endpoints)]
|
||||
|
||||
macro_rules! m {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error: multiple patterns overlap on their endpoints
|
||||
--> $DIR/overlapping_range_endpoints.rs:15:22
|
||||
--> $DIR/overlapping_range_endpoints.rs:14:22
|
||||
|
|
||||
LL | m!(0u8, 20..=30, 30..=40);
|
||||
| ------- ^^^^^^^ ... with this range
|
||||
@@ -8,13 +8,13 @@ LL | m!(0u8, 20..=30, 30..=40);
|
||||
|
|
||||
= note: you likely meant to write mutually exclusive ranges
|
||||
note: the lint level is defined here
|
||||
--> $DIR/overlapping_range_endpoints.rs:2:9
|
||||
--> $DIR/overlapping_range_endpoints.rs:1:9
|
||||
|
|
||||
LL | #![deny(overlapping_range_endpoints)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: multiple patterns overlap on their endpoints
|
||||
--> $DIR/overlapping_range_endpoints.rs:16:22
|
||||
--> $DIR/overlapping_range_endpoints.rs:15:22
|
||||
|
|
||||
LL | m!(0u8, 30..=40, 20..=30);
|
||||
| ------- ^^^^^^^ ... with this range
|
||||
@@ -24,7 +24,7 @@ LL | m!(0u8, 30..=40, 20..=30);
|
||||
= note: you likely meant to write mutually exclusive ranges
|
||||
|
||||
error: multiple patterns overlap on their endpoints
|
||||
--> $DIR/overlapping_range_endpoints.rs:19:21
|
||||
--> $DIR/overlapping_range_endpoints.rs:18:21
|
||||
|
|
||||
LL | m!(0u8, 20..30, 29..=40);
|
||||
| ------ ^^^^^^^ ... with this range
|
||||
@@ -34,7 +34,7 @@ LL | m!(0u8, 20..30, 29..=40);
|
||||
= note: you likely meant to write mutually exclusive ranges
|
||||
|
||||
error: multiple patterns overlap on their endpoints
|
||||
--> $DIR/overlapping_range_endpoints.rs:23:22
|
||||
--> $DIR/overlapping_range_endpoints.rs:22:22
|
||||
|
|
||||
LL | m!(0u8, 20..=30, 30..=31);
|
||||
| ------- ^^^^^^^ ... with this range
|
||||
@@ -44,7 +44,7 @@ LL | m!(0u8, 20..=30, 30..=31);
|
||||
= note: you likely meant to write mutually exclusive ranges
|
||||
|
||||
error: multiple patterns overlap on their endpoints
|
||||
--> $DIR/overlapping_range_endpoints.rs:27:22
|
||||
--> $DIR/overlapping_range_endpoints.rs:26:22
|
||||
|
|
||||
LL | m!(0u8, 20..=30, 19..=20);
|
||||
| ------- ^^^^^^^ ... with this range
|
||||
@@ -54,7 +54,7 @@ LL | m!(0u8, 20..=30, 19..=20);
|
||||
= note: you likely meant to write mutually exclusive ranges
|
||||
|
||||
error: multiple patterns overlap on their endpoints
|
||||
--> $DIR/overlapping_range_endpoints.rs:39:9
|
||||
--> $DIR/overlapping_range_endpoints.rs:38:9
|
||||
|
|
||||
LL | 0..=10 => {}
|
||||
| ------ this range overlaps on `10_u8`...
|
||||
@@ -65,7 +65,7 @@ LL | 10..=20 => {}
|
||||
= note: you likely meant to write mutually exclusive ranges
|
||||
|
||||
error: multiple patterns overlap on their endpoints
|
||||
--> $DIR/overlapping_range_endpoints.rs:39:9
|
||||
--> $DIR/overlapping_range_endpoints.rs:38:9
|
||||
|
|
||||
LL | 20..=30 => {}
|
||||
| ------- this range overlaps on `20_u8`...
|
||||
@@ -75,7 +75,7 @@ LL | 10..=20 => {}
|
||||
= note: you likely meant to write mutually exclusive ranges
|
||||
|
||||
error: multiple patterns overlap on their endpoints
|
||||
--> $DIR/overlapping_range_endpoints.rs:46:10
|
||||
--> $DIR/overlapping_range_endpoints.rs:45:10
|
||||
|
|
||||
LL | (0..=10, true) => {}
|
||||
| ------ this range overlaps on `10_u8`...
|
||||
@@ -85,7 +85,7 @@ LL | (10..20, true) => {}
|
||||
= note: you likely meant to write mutually exclusive ranges
|
||||
|
||||
error: multiple patterns overlap on their endpoints
|
||||
--> $DIR/overlapping_range_endpoints.rs:52:16
|
||||
--> $DIR/overlapping_range_endpoints.rs:51:16
|
||||
|
|
||||
LL | (true, 0..=10) => {}
|
||||
| ------ this range overlaps on `10_u8`...
|
||||
@@ -95,7 +95,7 @@ LL | (true, 10..20) => {}
|
||||
= note: you likely meant to write mutually exclusive ranges
|
||||
|
||||
error: multiple patterns overlap on their endpoints
|
||||
--> $DIR/overlapping_range_endpoints.rs:58:14
|
||||
--> $DIR/overlapping_range_endpoints.rs:57:14
|
||||
|
|
||||
LL | Some(0..=10) => {}
|
||||
| ------ this range overlaps on `10_u8`...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error[E0004]: non-exhaustive patterns: `usize::MAX..` not covered
|
||||
--> $DIR/pointer-sized-int.rs:13:11
|
||||
--> $DIR/pointer-sized-int.rs:12:11
|
||||
|
|
||||
LL | match 0usize {
|
||||
| ^^^^^^ pattern `usize::MAX..` not covered
|
||||
@@ -13,7 +13,7 @@ LL + usize::MAX.. => todo!()
|
||||
|
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `..isize::MIN` and `isize::MAX..` not covered
|
||||
--> $DIR/pointer-sized-int.rs:18:11
|
||||
--> $DIR/pointer-sized-int.rs:17:11
|
||||
|
|
||||
LL | match 0isize {
|
||||
| ^^^^^^ patterns `..isize::MIN` and `isize::MAX..` not covered
|
||||
@@ -27,7 +27,7 @@ LL + ..isize::MIN | isize::MAX.. => todo!()
|
||||
|
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `usize::MAX..` not covered
|
||||
--> $DIR/pointer-sized-int.rs:23:8
|
||||
--> $DIR/pointer-sized-int.rs:22:8
|
||||
|
|
||||
LL | m!(0usize, 0..=usize::MAX);
|
||||
| ^^^^^^ pattern `usize::MAX..` not covered
|
||||
@@ -40,7 +40,7 @@ LL | match $s { $($t)+ => {}, usize::MAX.. => todo!() }
|
||||
| +++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `usize::MAX..` not covered
|
||||
--> $DIR/pointer-sized-int.rs:25:8
|
||||
--> $DIR/pointer-sized-int.rs:24:8
|
||||
|
|
||||
LL | m!(0usize, 0..5 | 5..=usize::MAX);
|
||||
| ^^^^^^ pattern `usize::MAX..` not covered
|
||||
@@ -53,7 +53,7 @@ LL | match $s { $($t)+ => {}, usize::MAX.. => todo!() }
|
||||
| +++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `usize::MAX..` not covered
|
||||
--> $DIR/pointer-sized-int.rs:27:8
|
||||
--> $DIR/pointer-sized-int.rs:26:8
|
||||
|
|
||||
LL | m!(0usize, 0..usize::MAX | usize::MAX);
|
||||
| ^^^^^^ pattern `usize::MAX..` not covered
|
||||
@@ -66,7 +66,7 @@ LL | match $s { $($t)+ => {}, usize::MAX.. => todo!() }
|
||||
| +++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `(usize::MAX.., _)` not covered
|
||||
--> $DIR/pointer-sized-int.rs:29:8
|
||||
--> $DIR/pointer-sized-int.rs:28:8
|
||||
|
|
||||
LL | m!((0usize, true), (0..5, true) | (5..=usize::MAX, true) | (0..=usize::MAX, false));
|
||||
| ^^^^^^^^^^^^^^ pattern `(usize::MAX.., _)` not covered
|
||||
@@ -79,7 +79,7 @@ LL | match $s { $($t)+ => {}, (usize::MAX.., _) => todo!() }
|
||||
| ++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `..isize::MIN` and `isize::MAX..` not covered
|
||||
--> $DIR/pointer-sized-int.rs:38:8
|
||||
--> $DIR/pointer-sized-int.rs:37:8
|
||||
|
|
||||
LL | m!(0isize, isize::MIN..=isize::MAX);
|
||||
| ^^^^^^ patterns `..isize::MIN` and `isize::MAX..` not covered
|
||||
@@ -92,7 +92,7 @@ LL | match $s { $($t)+ => {}, ..isize::MIN | isize::MAX.. => todo!() }
|
||||
| ++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `..isize::MIN` and `isize::MAX..` not covered
|
||||
--> $DIR/pointer-sized-int.rs:40:8
|
||||
--> $DIR/pointer-sized-int.rs:39:8
|
||||
|
|
||||
LL | m!(0isize, isize::MIN..5 | 5..=isize::MAX);
|
||||
| ^^^^^^ patterns `..isize::MIN` and `isize::MAX..` not covered
|
||||
@@ -105,7 +105,7 @@ LL | match $s { $($t)+ => {}, ..isize::MIN | isize::MAX.. => todo!() }
|
||||
| ++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `..isize::MIN` and `isize::MAX..` not covered
|
||||
--> $DIR/pointer-sized-int.rs:42:8
|
||||
--> $DIR/pointer-sized-int.rs:41:8
|
||||
|
|
||||
LL | m!(0isize, isize::MIN..=-1 | 0 | 1..=isize::MAX);
|
||||
| ^^^^^^ patterns `..isize::MIN` and `isize::MAX..` not covered
|
||||
@@ -118,7 +118,7 @@ LL | match $s { $($t)+ => {}, ..isize::MIN | isize::MAX.. => todo!() }
|
||||
| ++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `..isize::MIN` and `isize::MAX..` not covered
|
||||
--> $DIR/pointer-sized-int.rs:44:8
|
||||
--> $DIR/pointer-sized-int.rs:43:8
|
||||
|
|
||||
LL | m!(0isize, isize::MIN..isize::MAX | isize::MAX);
|
||||
| ^^^^^^ patterns `..isize::MIN` and `isize::MAX..` not covered
|
||||
@@ -131,7 +131,7 @@ LL | match $s { $($t)+ => {}, ..isize::MIN | isize::MAX.. => todo!() }
|
||||
| ++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `(..isize::MIN, _)` and `(isize::MAX.., _)` not covered
|
||||
--> $DIR/pointer-sized-int.rs:47:9
|
||||
--> $DIR/pointer-sized-int.rs:46:9
|
||||
|
|
||||
LL | (0isize, true),
|
||||
| ^^^^^^^^^^^^^^ patterns `(..isize::MIN, _)` and `(isize::MAX.., _)` not covered
|
||||
@@ -144,7 +144,7 @@ LL | match $s { $($t)+ => {}, (..isize::MIN, _) | (isize::MAX.., _) => t
|
||||
| ++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
error[E0004]: non-exhaustive patterns: type `usize` is non-empty
|
||||
--> $DIR/pointer-sized-int.rs:58:11
|
||||
--> $DIR/pointer-sized-int.rs:57:11
|
||||
|
|
||||
LL | match 7usize {}
|
||||
| ^^^^^^
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//@ revisions: deny
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![allow(overlapping_range_endpoints)]
|
||||
|
||||
macro_rules! m {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![allow(overlapping_range_endpoints)]
|
||||
#![allow(non_contiguous_range_endpoints)]
|
||||
#![deny(unreachable_patterns)]
|
||||
|
||||
@@ -1,137 +1,137 @@
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:19:17
|
||||
--> $DIR/reachability.rs:18:17
|
||||
|
|
||||
LL | m!(0u8, 42, 42);
|
||||
| ^^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/reachability.rs:4:9
|
||||
--> $DIR/reachability.rs:3:9
|
||||
|
|
||||
LL | #![deny(unreachable_patterns)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:23:22
|
||||
--> $DIR/reachability.rs:22:22
|
||||
|
|
||||
LL | m!(0u8, 20..=30, 20);
|
||||
| ^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:24:22
|
||||
--> $DIR/reachability.rs:23:22
|
||||
|
|
||||
LL | m!(0u8, 20..=30, 21);
|
||||
| ^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:25:22
|
||||
--> $DIR/reachability.rs:24:22
|
||||
|
|
||||
LL | m!(0u8, 20..=30, 25);
|
||||
| ^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:26:22
|
||||
--> $DIR/reachability.rs:25:22
|
||||
|
|
||||
LL | m!(0u8, 20..=30, 29);
|
||||
| ^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:27:22
|
||||
--> $DIR/reachability.rs:26:22
|
||||
|
|
||||
LL | m!(0u8, 20..=30, 30);
|
||||
| ^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:30:21
|
||||
--> $DIR/reachability.rs:29:21
|
||||
|
|
||||
LL | m!(0u8, 20..30, 20);
|
||||
| ^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:31:21
|
||||
--> $DIR/reachability.rs:30:21
|
||||
|
|
||||
LL | m!(0u8, 20..30, 21);
|
||||
| ^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:32:21
|
||||
--> $DIR/reachability.rs:31:21
|
||||
|
|
||||
LL | m!(0u8, 20..30, 25);
|
||||
| ^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:33:21
|
||||
--> $DIR/reachability.rs:32:21
|
||||
|
|
||||
LL | m!(0u8, 20..30, 29);
|
||||
| ^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:37:22
|
||||
--> $DIR/reachability.rs:36:22
|
||||
|
|
||||
LL | m!(0u8, 20..=30, 20..=30);
|
||||
| ^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:38:22
|
||||
--> $DIR/reachability.rs:37:22
|
||||
|
|
||||
LL | m!(0u8, 20.. 30, 20.. 30);
|
||||
| ^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:39:22
|
||||
--> $DIR/reachability.rs:38:22
|
||||
|
|
||||
LL | m!(0u8, 20..=30, 20.. 30);
|
||||
| ^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:41:22
|
||||
--> $DIR/reachability.rs:40:22
|
||||
|
|
||||
LL | m!(0u8, 20..=30, 21..=30);
|
||||
| ^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:42:22
|
||||
--> $DIR/reachability.rs:41:22
|
||||
|
|
||||
LL | m!(0u8, 20..=30, 20..=29);
|
||||
| ^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:44:24
|
||||
--> $DIR/reachability.rs:43:24
|
||||
|
|
||||
LL | m!('a', 'A'..='z', 'a'..='z');
|
||||
| ^^^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:51:9
|
||||
--> $DIR/reachability.rs:50:9
|
||||
|
|
||||
LL | 5..=8 => {},
|
||||
| ^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:57:9
|
||||
--> $DIR/reachability.rs:56:9
|
||||
|
|
||||
LL | 5..15 => {},
|
||||
| ^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:64:9
|
||||
--> $DIR/reachability.rs:63:9
|
||||
|
|
||||
LL | 5..25 => {},
|
||||
| ^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:72:9
|
||||
--> $DIR/reachability.rs:71:9
|
||||
|
|
||||
LL | 5..25 => {},
|
||||
| ^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:78:9
|
||||
--> $DIR/reachability.rs:77:9
|
||||
|
|
||||
LL | 5..15 => {},
|
||||
| ^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:85:9
|
||||
--> $DIR/reachability.rs:84:9
|
||||
|
|
||||
LL | _ => {},
|
||||
| - matches any value
|
||||
@@ -139,19 +139,19 @@ LL | '\u{D7FF}'..='\u{E000}' => {},
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ unreachable pattern
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:90:9
|
||||
--> $DIR/reachability.rs:89:9
|
||||
|
|
||||
LL | '\u{D7FF}'..='\u{E000}' => {},
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:106:9
|
||||
--> $DIR/reachability.rs:105:9
|
||||
|
|
||||
LL | &FOO => {}
|
||||
| ^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/reachability.rs:107:9
|
||||
--> $DIR/reachability.rs:106:9
|
||||
|
|
||||
LL | BAR => {}
|
||||
| ^^^
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![allow(unreachable_patterns)]
|
||||
fn main() {
|
||||
match 0u8 {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
error: literal out of range for `u8`
|
||||
--> $DIR/range-pattern-out-of-bounds-issue-68972.rs:5:14
|
||||
--> $DIR/range-pattern-out-of-bounds-issue-68972.rs:4:14
|
||||
|
|
||||
LL | 251..257 => {}
|
||||
| ^^^ this value does not fit into the type `u8` whose range is `0..=255`
|
||||
|
||||
error: literal out of range for `u8`
|
||||
--> $DIR/range-pattern-out-of-bounds-issue-68972.rs:7:15
|
||||
--> $DIR/range-pattern-out-of-bounds-issue-68972.rs:6:15
|
||||
|
|
||||
LL | 251..=256 => {}
|
||||
| ^^^ this value does not fit into the type `u8` whose range is `0..=255`
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// Matching against NaN should result in an error
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![allow(unused)]
|
||||
|
||||
const NAN: f64 = f64::NAN;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error: cannot use NaN in patterns
|
||||
--> $DIR/issue-6804-nan-match.rs:15:9
|
||||
--> $DIR/issue-6804-nan-match.rs:14:9
|
||||
|
|
||||
LL | NAN => {},
|
||||
| ^^^
|
||||
@@ -8,7 +8,7 @@ LL | NAN => {},
|
||||
= help: try using the `is_nan` method instead
|
||||
|
||||
error: cannot use NaN in patterns
|
||||
--> $DIR/issue-6804-nan-match.rs:20:10
|
||||
--> $DIR/issue-6804-nan-match.rs:19:10
|
||||
|
|
||||
LL | [NAN, _] => {},
|
||||
| ^^^
|
||||
@@ -17,7 +17,7 @@ LL | [NAN, _] => {},
|
||||
= help: try using the `is_nan` method instead
|
||||
|
||||
error: cannot use NaN in patterns
|
||||
--> $DIR/issue-6804-nan-match.rs:25:9
|
||||
--> $DIR/issue-6804-nan-match.rs:24:9
|
||||
|
|
||||
LL | C => {},
|
||||
| ^
|
||||
@@ -26,7 +26,7 @@ LL | C => {},
|
||||
= help: try using the `is_nan` method instead
|
||||
|
||||
error: cannot use NaN in patterns
|
||||
--> $DIR/issue-6804-nan-match.rs:31:9
|
||||
--> $DIR/issue-6804-nan-match.rs:30:9
|
||||
|
|
||||
LL | NAN..=1.0 => {},
|
||||
| ^^^
|
||||
@@ -35,13 +35,13 @@ LL | NAN..=1.0 => {},
|
||||
= help: try using the `is_nan` method instead
|
||||
|
||||
error[E0030]: lower range bound must be less than or equal to upper
|
||||
--> $DIR/issue-6804-nan-match.rs:31:9
|
||||
--> $DIR/issue-6804-nan-match.rs:30:9
|
||||
|
|
||||
LL | NAN..=1.0 => {},
|
||||
| ^^^^^^^^^ lower bound larger than upper bound
|
||||
|
||||
error: cannot use NaN in patterns
|
||||
--> $DIR/issue-6804-nan-match.rs:33:16
|
||||
--> $DIR/issue-6804-nan-match.rs:32:16
|
||||
|
|
||||
LL | -1.0..=NAN => {},
|
||||
| ^^^
|
||||
@@ -50,13 +50,13 @@ LL | -1.0..=NAN => {},
|
||||
= help: try using the `is_nan` method instead
|
||||
|
||||
error[E0030]: lower range bound must be less than or equal to upper
|
||||
--> $DIR/issue-6804-nan-match.rs:33:9
|
||||
--> $DIR/issue-6804-nan-match.rs:32:9
|
||||
|
|
||||
LL | -1.0..=NAN => {},
|
||||
| ^^^^^^^^^^ lower bound larger than upper bound
|
||||
|
||||
error: cannot use NaN in patterns
|
||||
--> $DIR/issue-6804-nan-match.rs:35:9
|
||||
--> $DIR/issue-6804-nan-match.rs:34:9
|
||||
|
|
||||
LL | NAN.. => {},
|
||||
| ^^^
|
||||
@@ -65,13 +65,13 @@ LL | NAN.. => {},
|
||||
= help: try using the `is_nan` method instead
|
||||
|
||||
error[E0030]: lower range bound must be less than or equal to upper
|
||||
--> $DIR/issue-6804-nan-match.rs:35:9
|
||||
--> $DIR/issue-6804-nan-match.rs:34:9
|
||||
|
|
||||
LL | NAN.. => {},
|
||||
| ^^^^^ lower bound larger than upper bound
|
||||
|
||||
error: cannot use NaN in patterns
|
||||
--> $DIR/issue-6804-nan-match.rs:37:11
|
||||
--> $DIR/issue-6804-nan-match.rs:36:11
|
||||
|
|
||||
LL | ..NAN => {},
|
||||
| ^^^
|
||||
@@ -80,7 +80,7 @@ LL | ..NAN => {},
|
||||
= help: try using the `is_nan` method instead
|
||||
|
||||
error[E0579]: lower range bound must be less than upper
|
||||
--> $DIR/issue-6804-nan-match.rs:37:9
|
||||
--> $DIR/issue-6804-nan-match.rs:36:9
|
||||
|
|
||||
LL | ..NAN => {},
|
||||
| ^^^^^
|
||||
|
||||
Reference in New Issue
Block a user