mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Merge pull request #4930 from rust-lang/rustup-2026-03-30
Automatic Rustup
This commit is contained in:
@@ -588,8 +588,6 @@ fn visit_pat(&mut self, p: &'hir hir::Pat<'hir>) {
|
||||
}
|
||||
|
||||
// for dbg!(x) which may take ownership, suggest dbg!(&x) instead
|
||||
// but here we actually do not check whether the macro name is `dbg!`
|
||||
// so that we may extend the scope a bit larger to cover more cases
|
||||
fn suggest_ref_for_dbg_args(
|
||||
&self,
|
||||
body: &hir::Expr<'_>,
|
||||
@@ -603,29 +601,41 @@ fn suggest_ref_for_dbg_args(
|
||||
});
|
||||
let Some(var_info) = var_info else { return };
|
||||
let arg_name = var_info.name;
|
||||
struct MatchArgFinder {
|
||||
expr_span: Span,
|
||||
match_arg_span: Option<Span>,
|
||||
struct MatchArgFinder<'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
move_span: Span,
|
||||
arg_name: Symbol,
|
||||
match_arg_span: Option<Span> = None,
|
||||
}
|
||||
impl Visitor<'_> for MatchArgFinder {
|
||||
impl Visitor<'_> for MatchArgFinder<'_> {
|
||||
fn visit_expr(&mut self, e: &hir::Expr<'_>) {
|
||||
// dbg! is expanded into a match pattern, we need to find the right argument span
|
||||
if let hir::ExprKind::Match(expr, ..) = &e.kind
|
||||
&& let hir::ExprKind::Path(hir::QPath::Resolved(
|
||||
_,
|
||||
path @ Path { segments: [seg], .. },
|
||||
)) = &expr.kind
|
||||
&& seg.ident.name == self.arg_name
|
||||
&& self.expr_span.source_callsite().contains(expr.span)
|
||||
if let hir::ExprKind::Match(scrutinee, ..) = &e.kind
|
||||
&& let hir::ExprKind::Tup(args) = scrutinee.kind
|
||||
&& e.span.macro_backtrace().any(|expn| {
|
||||
expn.macro_def_id.is_some_and(|macro_def_id| {
|
||||
self.tcx.is_diagnostic_item(sym::dbg_macro, macro_def_id)
|
||||
})
|
||||
})
|
||||
{
|
||||
self.match_arg_span = Some(path.span);
|
||||
for arg in args {
|
||||
if let hir::ExprKind::Path(hir::QPath::Resolved(
|
||||
_,
|
||||
path @ Path { segments: [seg], .. },
|
||||
)) = &arg.kind
|
||||
&& seg.ident.name == self.arg_name
|
||||
&& self.move_span.source_equal(arg.span)
|
||||
{
|
||||
self.match_arg_span = Some(path.span);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
hir::intravisit::walk_expr(self, e);
|
||||
}
|
||||
}
|
||||
|
||||
let mut finder = MatchArgFinder { expr_span: move_span, match_arg_span: None, arg_name };
|
||||
let mut finder = MatchArgFinder { tcx: self.infcx.tcx, move_span, arg_name, .. };
|
||||
finder.visit_expr(body);
|
||||
if let Some(macro_arg_span) = finder.match_arg_span {
|
||||
err.span_suggestion_verbose(
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
use rustc_hir::def_id::{DefId, LocalDefId};
|
||||
use rustc_hir::intravisit::VisitorExt;
|
||||
use rustc_hir::{self as hir, AmbigArg, HirId};
|
||||
use rustc_middle::ty::print::with_forced_trimmed_paths;
|
||||
use rustc_middle::ty::print::{with_forced_trimmed_paths, with_types_for_suggestion};
|
||||
use rustc_middle::ty::util::IntTypeExt;
|
||||
use rustc_middle::ty::{self, DefiningScopeKind, IsSuggestable, Ty, TyCtxt, TypeVisitableExt};
|
||||
use rustc_middle::{bug, span_bug};
|
||||
@@ -451,7 +451,7 @@ fn infer_placeholder_type<'tcx>(
|
||||
err.span_suggestion(
|
||||
ty_span,
|
||||
format!("provide a type for the {kind}"),
|
||||
format!("{colon} {ty}"),
|
||||
with_types_for_suggestion!(format!("{colon} {ty}")),
|
||||
Applicability::MachineApplicable,
|
||||
);
|
||||
} else {
|
||||
|
||||
@@ -82,7 +82,7 @@ fn used_trait_imports(tcx: TyCtxt<'_>, def_id: LocalDefId) -> &UnordSet<LocalDef
|
||||
&tcx.typeck(def_id).used_trait_imports
|
||||
}
|
||||
|
||||
fn typeck<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &'tcx ty::TypeckResults<'tcx> {
|
||||
fn typeck_root<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &'tcx ty::TypeckResults<'tcx> {
|
||||
typeck_with_inspect(tcx, def_id, None)
|
||||
}
|
||||
|
||||
@@ -95,6 +95,13 @@ pub fn inspect_typeck<'tcx>(
|
||||
def_id: LocalDefId,
|
||||
inspect: ObligationInspector<'tcx>,
|
||||
) -> &'tcx ty::TypeckResults<'tcx> {
|
||||
// Closures' typeck results come from their outermost function,
|
||||
// as they are part of the same "inference environment".
|
||||
let typeck_root_def_id = tcx.typeck_root_def_id_local(def_id);
|
||||
if typeck_root_def_id != def_id {
|
||||
return tcx.typeck(typeck_root_def_id);
|
||||
}
|
||||
|
||||
typeck_with_inspect(tcx, def_id, Some(inspect))
|
||||
}
|
||||
|
||||
@@ -104,12 +111,7 @@ fn typeck_with_inspect<'tcx>(
|
||||
def_id: LocalDefId,
|
||||
inspector: Option<ObligationInspector<'tcx>>,
|
||||
) -> &'tcx ty::TypeckResults<'tcx> {
|
||||
// Closures' typeck results come from their outermost function,
|
||||
// as they are part of the same "inference environment".
|
||||
let typeck_root_def_id = tcx.typeck_root_def_id_local(def_id);
|
||||
if typeck_root_def_id != def_id {
|
||||
return tcx.typeck(typeck_root_def_id);
|
||||
}
|
||||
assert!(!tcx.is_typeck_child(def_id.to_def_id()));
|
||||
|
||||
let id = tcx.local_def_id_to_hir_id(def_id);
|
||||
let node = tcx.hir_node(id);
|
||||
@@ -660,7 +662,7 @@ fn fatally_break_rust(tcx: TyCtxt<'_>, span: Span) -> ! {
|
||||
pub fn provide(providers: &mut Providers) {
|
||||
*providers = Providers {
|
||||
method_autoderef_steps: method::probe::method_autoderef_steps,
|
||||
typeck,
|
||||
typeck_root,
|
||||
used_trait_imports,
|
||||
check_transmutes: intrinsicck::check_transmutes,
|
||||
..*providers
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
label_strs::type_of,
|
||||
// And a big part of compilation (that we eventually want to cache) is type inference
|
||||
// information:
|
||||
label_strs::typeck,
|
||||
label_strs::typeck_root,
|
||||
];
|
||||
|
||||
/// DepNodes for Hir, which is pretty much everything
|
||||
|
||||
@@ -1222,9 +1222,9 @@
|
||||
separate_provide_extern
|
||||
}
|
||||
|
||||
query typeck(key: LocalDefId) -> &'tcx ty::TypeckResults<'tcx> {
|
||||
query typeck_root(key: LocalDefId) -> &'tcx ty::TypeckResults<'tcx> {
|
||||
desc { "type-checking `{}`", tcx.def_path_str(key) }
|
||||
cache_on_disk_if { !tcx.is_typeck_child(key.to_def_id()) }
|
||||
cache_on_disk_if { true }
|
||||
}
|
||||
|
||||
query used_trait_imports(key: LocalDefId) -> &'tcx UnordSet<LocalDefId> {
|
||||
|
||||
@@ -7,14 +7,15 @@
|
||||
use rustc_data_structures::sharded::Sharded;
|
||||
use rustc_data_structures::sync::{AtomicU64, Lock, WorkerLocal};
|
||||
use rustc_errors::Diag;
|
||||
use rustc_hir::def_id::LocalDefId;
|
||||
use rustc_span::Span;
|
||||
|
||||
use crate::dep_graph::{DepKind, DepNodeIndex, QuerySideEffect, SerializedDepNodeIndex};
|
||||
use crate::ich::StableHashingContext;
|
||||
use crate::queries::{ExternProviders, Providers, QueryArenas, QueryVTables, TaggedQueryKey};
|
||||
use crate::query::on_disk_cache::OnDiskCache;
|
||||
use crate::query::{QueryCache, QueryJob, QueryStackFrame};
|
||||
use crate::ty::TyCtxt;
|
||||
use crate::query::{IntoQueryKey, QueryCache, QueryJob, QueryStackFrame};
|
||||
use crate::ty::{self, TyCtxt};
|
||||
|
||||
/// For a particular query, keeps track of "active" keys, i.e. keys whose
|
||||
/// evaluation has started but has not yet finished successfully.
|
||||
@@ -200,7 +201,21 @@ pub struct TyCtxtEnsureDone<'tcx> {
|
||||
pub tcx: TyCtxt<'tcx>,
|
||||
}
|
||||
|
||||
impl<'tcx> TyCtxtEnsureOk<'tcx> {
|
||||
pub fn typeck(self, def_id: impl IntoQueryKey<LocalDefId>) {
|
||||
self.typeck_root(
|
||||
self.tcx.typeck_root_def_id(def_id.into_query_key().to_def_id()).expect_local(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> TyCtxt<'tcx> {
|
||||
pub fn typeck(self, def_id: impl IntoQueryKey<LocalDefId>) -> &'tcx ty::TypeckResults<'tcx> {
|
||||
self.typeck_root(
|
||||
self.typeck_root_def_id(def_id.into_query_key().to_def_id()).expect_local(),
|
||||
)
|
||||
}
|
||||
|
||||
/// Returns a transparent wrapper for `TyCtxt` which uses
|
||||
/// `span` as the location of queries performed through it.
|
||||
#[inline(always)]
|
||||
|
||||
@@ -133,8 +133,15 @@ fn print_coroutine_with_kind(
|
||||
self.print_path_with_generic_args(|p| p.print_def_path(def_id, parent_args), &[kind.into()])
|
||||
}
|
||||
|
||||
// Defaults (should not be overridden):
|
||||
fn reset_path(&mut self) -> Result<(), PrintError> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn should_omit_parent_def_path(&self, _parent_def_id: DefId) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
// Defaults (should not be overridden):
|
||||
#[instrument(skip(self), level = "debug")]
|
||||
fn default_print_def_path(
|
||||
&mut self,
|
||||
@@ -210,9 +217,15 @@ fn default_print_def_path(
|
||||
&& self.tcx().generics_of(parent_def_id).parent_count == 0;
|
||||
}
|
||||
|
||||
let omit_parent = matches!(key.disambiguated_data.data, DefPathData::TypeNs(..))
|
||||
&& self.should_omit_parent_def_path(parent_def_id);
|
||||
|
||||
self.print_path_with_simple(
|
||||
|p: &mut Self| {
|
||||
if trait_qualify_parent {
|
||||
if omit_parent {
|
||||
p.reset_path()?;
|
||||
Ok(())
|
||||
} else if trait_qualify_parent {
|
||||
let trait_ref = ty::TraitRef::new(
|
||||
p.tcx(),
|
||||
parent_def_id,
|
||||
|
||||
@@ -2224,6 +2224,19 @@ fn tcx<'a>(&'a self) -> TyCtxt<'tcx> {
|
||||
self.tcx
|
||||
}
|
||||
|
||||
fn reset_path(&mut self) -> Result<(), PrintError> {
|
||||
self.empty_path = true;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn should_omit_parent_def_path(&self, parent_def_id: DefId) -> bool {
|
||||
RTN_MODE.with(|mode| mode.get()) == RtnMode::ForSuggestion
|
||||
&& matches!(
|
||||
self.tcx().def_key(parent_def_id).disambiguated_data.data,
|
||||
DefPathData::ValueNs(..) | DefPathData::Closure | DefPathData::AnonConst
|
||||
)
|
||||
}
|
||||
|
||||
fn print_def_path(
|
||||
&mut self,
|
||||
def_id: DefId,
|
||||
|
||||
@@ -746,6 +746,7 @@
|
||||
custom_mir,
|
||||
custom_test_frameworks,
|
||||
d32,
|
||||
dbg_macro,
|
||||
dead_code,
|
||||
dealloc,
|
||||
debug,
|
||||
|
||||
@@ -3348,6 +3348,7 @@ fn upper_bound(&self) -> Option<usize> {
|
||||
/// [`split`]: BufRead::split
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[derive(Debug)]
|
||||
#[cfg_attr(not(test), rustc_diagnostic_item = "IoSplit")]
|
||||
pub struct Split<B> {
|
||||
buf: B,
|
||||
delim: u8,
|
||||
|
||||
@@ -94,8 +94,8 @@
|
||||
//! pull-requests for your suggested changes.
|
||||
//!
|
||||
//! Contributions are appreciated! If you see a part of the docs that can be
|
||||
//! improved, submit a PR, or chat with us first on [Zulip][rust-zulip]
|
||||
//! #docs.
|
||||
//! improved, submit a PR, or chat with us first on [Zulip][t-libs-zulip]
|
||||
//! #t-libs.
|
||||
//!
|
||||
//! # A Tour of The Rust Standard Library
|
||||
//!
|
||||
@@ -209,7 +209,7 @@
|
||||
//! [multithreading]: thread
|
||||
//! [other]: #what-is-in-the-standard-library-documentation
|
||||
//! [primitive types]: ../book/ch03-02-data-types.html
|
||||
//! [rust-zulip]: https://rust-lang.zulipchat.com/
|
||||
//! [t-libs-zulip]: https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/
|
||||
//! [array]: prim@array
|
||||
//! [slice]: prim@slice
|
||||
|
||||
@@ -337,6 +337,8 @@
|
||||
#![feature(formatting_options)]
|
||||
#![feature(funnel_shifts)]
|
||||
#![feature(generic_atomic)]
|
||||
#![feature(hash_map_internals)]
|
||||
#![feature(hash_map_macro)]
|
||||
#![feature(hasher_prefixfree_extras)]
|
||||
#![feature(hashmap_internals)]
|
||||
#![feature(hint_must_use)]
|
||||
|
||||
+119
-39
@@ -5,6 +5,9 @@
|
||||
//! library.
|
||||
// ignore-tidy-dbg
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
#[doc = include_str!("../../core/src/macros/panic.md")]
|
||||
#[macro_export]
|
||||
#[rustc_builtin_macro(std_panic)]
|
||||
@@ -359,19 +362,16 @@ macro_rules! dbg {
|
||||
};
|
||||
}
|
||||
|
||||
/// Internal macro that processes a list of expressions and produces a chain of
|
||||
/// nested `match`es, one for each expression, before finally calling `eprint!`
|
||||
/// with the collected information and returning all the evaluated expressions
|
||||
/// in a tuple.
|
||||
/// Internal macro that processes a list of expressions, binds their results
|
||||
/// with `match`, calls `eprint!` with the collected information, and returns
|
||||
/// all the evaluated expressions in a tuple.
|
||||
///
|
||||
/// E.g. `dbg_internal!(() () (1, 2))` expands into
|
||||
/// ```rust, ignore
|
||||
/// match 1 {
|
||||
/// tmp_1 => match 2 {
|
||||
/// tmp_2 => {
|
||||
/// eprint!("...", &tmp_1, &tmp_2, /* some other arguments */);
|
||||
/// (tmp_1, tmp_2)
|
||||
/// }
|
||||
/// match (1, 2) {
|
||||
/// (tmp_1, tmp_2) => {
|
||||
/// eprint!("...", &tmp_1, &tmp_2, /* some other arguments */);
|
||||
/// (tmp_1, tmp_2)
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
@@ -380,37 +380,117 @@ macro_rules! dbg {
|
||||
#[doc(hidden)]
|
||||
#[rustc_macro_transparency = "semiopaque"]
|
||||
pub macro dbg_internal {
|
||||
(($($piece:literal),+) ($($processed:expr => $bound:expr),+) ()) => {{
|
||||
$crate::eprint!(
|
||||
$crate::concat!($($piece),+),
|
||||
$(
|
||||
$crate::stringify!($processed),
|
||||
// The `&T: Debug` check happens here (not in the format literal desugaring)
|
||||
// to avoid format literal related messages and suggestions.
|
||||
&&$bound as &dyn $crate::fmt::Debug
|
||||
),+,
|
||||
// The location returned here is that of the macro invocation, so
|
||||
// it will be the same for all expressions. Thus, label these
|
||||
// arguments so that they can be reused in every piece of the
|
||||
// formatting template.
|
||||
file=$crate::file!(),
|
||||
line=$crate::line!(),
|
||||
column=$crate::column!()
|
||||
);
|
||||
// Comma separate the variables only when necessary so that this will
|
||||
// not yield a tuple for a single expression, but rather just parenthesize
|
||||
// the expression.
|
||||
($($bound),+)
|
||||
}},
|
||||
(($($piece:literal),*) ($($processed:expr => $bound:expr),*) ($val:expr $(,$rest:expr)*)) => {
|
||||
(($($piece:literal),+) ($($processed:expr => $bound:ident),+) ()) => {
|
||||
// Use of `match` here is intentional because it affects the lifetimes
|
||||
// of temporaries - https://stackoverflow.com/a/48732525/1063961
|
||||
match $val {
|
||||
tmp => $crate::macros::dbg_internal!(
|
||||
($($piece,)* "[{file}:{line}:{column}] {} = {:#?}\n")
|
||||
($($processed => $bound,)* $val => tmp)
|
||||
($($rest),*)
|
||||
),
|
||||
// Always put the arguments in a tuple to avoid an unused parens lint on the pattern.
|
||||
match ($($processed,)+) {
|
||||
($($bound,)+) => {
|
||||
$crate::eprint!(
|
||||
$crate::concat!($($piece),+),
|
||||
$(
|
||||
$crate::stringify!($processed),
|
||||
// The `&T: Debug` check happens here (not in the format literal desugaring)
|
||||
// to avoid format literal related messages and suggestions.
|
||||
&&$bound as &dyn $crate::fmt::Debug
|
||||
),+,
|
||||
// The location returned here is that of the macro invocation, so
|
||||
// it will be the same for all expressions. Thus, label these
|
||||
// arguments so that they can be reused in every piece of the
|
||||
// formatting template.
|
||||
file=$crate::file!(),
|
||||
line=$crate::line!(),
|
||||
column=$crate::column!()
|
||||
);
|
||||
// Comma separate the variables only when necessary so that this will
|
||||
// not yield a tuple for a single expression, but rather just parenthesize
|
||||
// the expression.
|
||||
($($bound),+)
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
(($($piece:literal),*) ($($processed:expr => $bound:ident),*) ($val:expr $(,$rest:expr)*)) => {
|
||||
$crate::macros::dbg_internal!(
|
||||
($($piece,)* "[{file}:{line}:{column}] {} = {:#?}\n")
|
||||
($($processed => $bound,)* $val => tmp)
|
||||
($($rest),*)
|
||||
)
|
||||
},
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
#[macro_export]
|
||||
#[allow_internal_unstable(hash_map_internals)]
|
||||
#[unstable(feature = "hash_map_internals", issue = "none")]
|
||||
macro_rules! repetition_utils {
|
||||
(@count $($tokens:tt),*) => {{
|
||||
[$($crate::repetition_utils!(@replace $tokens => ())),*].len()
|
||||
}};
|
||||
|
||||
(@replace $x:tt => $y:tt) => { $y }
|
||||
}
|
||||
|
||||
/// Creates a [`HashMap`] containing the arguments.
|
||||
///
|
||||
/// `hash_map!` allows specifying the entries that make
|
||||
/// up the [`HashMap`] where the key and value are separated by a `=>`.
|
||||
///
|
||||
/// The entries are separated by commas with a trailing comma being allowed.
|
||||
///
|
||||
/// It is semantically equivalent to using repeated [`HashMap::insert`]
|
||||
/// on a newly created hashmap.
|
||||
///
|
||||
/// `hash_map!` will attempt to avoid repeated reallocations by
|
||||
/// using [`HashMap::with_capacity`].
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// #![feature(hash_map_macro)]
|
||||
/// use std::hash_map;
|
||||
///
|
||||
/// let map = hash_map! {
|
||||
/// "key" => "value",
|
||||
/// "key1" => "value1"
|
||||
/// };
|
||||
///
|
||||
/// assert_eq!(map.get("key"), Some(&"value"));
|
||||
/// assert_eq!(map.get("key1"), Some(&"value1"));
|
||||
/// assert!(map.get("brrrrrrooooommm").is_none());
|
||||
/// ```
|
||||
///
|
||||
/// And with a trailing comma
|
||||
///
|
||||
///```rust
|
||||
/// #![feature(hash_map_macro)]
|
||||
/// use std::hash_map;
|
||||
///
|
||||
/// let map = hash_map! {
|
||||
/// "key" => "value", // notice the ,
|
||||
/// };
|
||||
///
|
||||
/// assert_eq!(map.get("key"), Some(&"value"));
|
||||
/// ```
|
||||
///
|
||||
/// The key and value are moved into the HashMap.
|
||||
///
|
||||
/// [`HashMap`]: crate::collections::HashMap
|
||||
/// [`HashMap::insert`]: crate::collections::HashMap::insert
|
||||
/// [`HashMap::with_capacity`]: crate::collections::HashMap::with_capacity
|
||||
#[macro_export]
|
||||
#[allow_internal_unstable(hash_map_internals)]
|
||||
#[unstable(feature = "hash_map_macro", issue = "144032")]
|
||||
macro_rules! hash_map {
|
||||
() => {{
|
||||
$crate::collections::HashMap::new()
|
||||
}};
|
||||
|
||||
( $( $key:expr => $value:expr ),* $(,)? ) => {{
|
||||
let mut map = $crate::collections::HashMap::with_capacity(
|
||||
const { $crate::repetition_utils!(@count $($key),*) }
|
||||
);
|
||||
$( map.insert($key, $value); )*
|
||||
map
|
||||
}}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
// ignore-tidy-dbg
|
||||
|
||||
/// Test for <https://github.com/rust-lang/rust/issues/153850>:
|
||||
/// `dbg!` shouldn't drop arguments' temporaries.
|
||||
#[test]
|
||||
fn no_dropping_temps() {
|
||||
fn temp() {}
|
||||
|
||||
*dbg!(&temp());
|
||||
*dbg!(&temp(), 1).0;
|
||||
*dbg!(0, &temp()).1;
|
||||
*dbg!(0, &temp(), 2).1;
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
fn clock_gettime(clock: hermit_abi::clockid_t) -> Timespec {
|
||||
let mut t = hermit_abi::timespec { tv_sec: 0, tv_nsec: 0 };
|
||||
let _ = unsafe { hermit_abi::clock_gettime(clock, &raw mut t) };
|
||||
unsafe { hermit_abi::clock_gettime(clock, &raw mut t) }.unwrap();
|
||||
Timespec::new(t.tv_sec, t.tv_nsec.into()).unwrap()
|
||||
}
|
||||
|
||||
|
||||
@@ -81,6 +81,7 @@ pub(crate) fn detect_features() -> cache::Initializer {
|
||||
let sme_f64f64 = _sysctlbyname(c"hw.optional.arm.FEAT_SME_F64F64");
|
||||
let sme_i16i64 = _sysctlbyname(c"hw.optional.arm.FEAT_SME_I16I64");
|
||||
let ssbs = _sysctlbyname(c"hw.optional.arm.FEAT_SSBS");
|
||||
let sve_b16b16 = _sysctlbyname(c"hw.optional.arm.FEAT_SVE_B16B16");
|
||||
let wfxt = _sysctlbyname(c"hw.optional.arm.FEAT_WFxT");
|
||||
|
||||
// The following features are not exposed by `is_aarch64_feature_detected`,
|
||||
@@ -160,6 +161,7 @@ pub(crate) fn detect_features() -> cache::Initializer {
|
||||
enable_feature(Feature::sme_f64f64, sme_f64f64);
|
||||
enable_feature(Feature::sme_i16i64, sme_i16i64);
|
||||
enable_feature(Feature::ssbs, ssbs);
|
||||
enable_feature(Feature::sve_b16b16, sve_b16b16);
|
||||
enable_feature(Feature::wfxt, wfxt);
|
||||
|
||||
value
|
||||
|
||||
@@ -1259,7 +1259,12 @@ class RustBuild(object):
|
||||
|
||||
def parse_args(args):
|
||||
"""Parse the command line arguments that the python script needs."""
|
||||
parser = argparse.ArgumentParser(add_help=False)
|
||||
|
||||
# Pass allow_abbrev=False to remove support for inexact matches (e.g.,
|
||||
# `--json` turning on `--json-output`). The argument list here is partial,
|
||||
# most flags are matched in the Rust bootstrap code. This prevents the the
|
||||
# default ambiguity checks in argparse from functioning correctly.
|
||||
parser = argparse.ArgumentParser(add_help=False, allow_abbrev=False)
|
||||
parser.add_argument("-h", "--help", action="store_true")
|
||||
parser.add_argument("--config")
|
||||
parser.add_argument("--build-dir")
|
||||
|
||||
@@ -616,4 +616,9 @@ pub fn human_readable_changes(changes: &[ChangeInfo]) -> String {
|
||||
severity: ChangeSeverity::Warning,
|
||||
summary: "`x.py test --no-doc` is renamed to `--all-targets`. Additionally `--tests` is added which only executes unit and integration tests.",
|
||||
},
|
||||
ChangeInfo {
|
||||
change_id: 154508,
|
||||
severity: ChangeSeverity::Info,
|
||||
summary: "`x.py` stopped accepting partial argument names. Use full names to avoid errors.",
|
||||
},
|
||||
];
|
||||
|
||||
@@ -26,5 +26,5 @@ ENV \
|
||||
|
||||
ENV HOSTS=powerpc-unknown-linux-gnu
|
||||
|
||||
ENV RUST_CONFIGURE_ARGS --enable-extended --enable-profiler --disable-docs
|
||||
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
|
||||
ENV RUST_CONFIGURE_ARGS="--enable-extended --enable-profiler --disable-docs"
|
||||
ENV SCRIPT="python3 ../x.py dist --host $HOSTS --target $HOSTS"
|
||||
|
||||
@@ -26,5 +26,5 @@ ENV \
|
||||
|
||||
ENV HOSTS=powerpc64-unknown-linux-gnu
|
||||
|
||||
ENV RUST_CONFIGURE_ARGS --enable-extended --enable-profiler --disable-docs
|
||||
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
|
||||
ENV RUST_CONFIGURE_ARGS="--enable-extended --enable-profiler --disable-docs"
|
||||
ENV SCRIPT="python3 ../x.py dist --host $HOSTS --target $HOSTS"
|
||||
|
||||
@@ -27,13 +27,12 @@ ENV \
|
||||
|
||||
ENV HOSTS=powerpc64-unknown-linux-musl
|
||||
|
||||
ENV RUST_CONFIGURE_ARGS \
|
||||
--enable-extended \
|
||||
ENV RUST_CONFIGURE_ARGS="--enable-extended \
|
||||
--enable-full-tools \
|
||||
--enable-profiler \
|
||||
--enable-sanitizers \
|
||||
--disable-docs \
|
||||
--set target.powerpc64-unknown-linux-musl.crt-static=false \
|
||||
--musl-root-powerpc64=/x-tools/powerpc64-unknown-linux-musl/powerpc64-unknown-linux-musl/sysroot/usr
|
||||
--musl-root-powerpc64=/x-tools/powerpc64-unknown-linux-musl/powerpc64-unknown-linux-musl/sysroot/usr"
|
||||
|
||||
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
|
||||
ENV SCRIPT="python3 ../x.py dist --host $HOSTS --target $HOSTS"
|
||||
|
||||
@@ -27,11 +27,10 @@ ENV \
|
||||
|
||||
ENV HOSTS=powerpc64le-unknown-linux-gnu
|
||||
|
||||
ENV RUST_CONFIGURE_ARGS \
|
||||
--enable-extended \
|
||||
ENV RUST_CONFIGURE_ARGS="--enable-extended \
|
||||
--enable-full-tools \
|
||||
--enable-profiler \
|
||||
--enable-sanitizers \
|
||||
--disable-docs
|
||||
--disable-docs"
|
||||
|
||||
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
|
||||
ENV SCRIPT="python3 ../x.py dist --host $HOSTS --target $HOSTS"
|
||||
|
||||
@@ -27,13 +27,12 @@ ENV \
|
||||
|
||||
ENV HOSTS=powerpc64le-unknown-linux-musl
|
||||
|
||||
ENV RUST_CONFIGURE_ARGS \
|
||||
--enable-extended \
|
||||
ENV RUST_CONFIGURE_ARGS="--enable-extended \
|
||||
--enable-full-tools \
|
||||
--enable-profiler \
|
||||
--enable-sanitizers \
|
||||
--disable-docs \
|
||||
--set target.powerpc64le-unknown-linux-musl.crt-static=false \
|
||||
--musl-root-powerpc64le=/x-tools/powerpc64le-unknown-linux-musl/powerpc64le-unknown-linux-musl/sysroot/usr
|
||||
--musl-root-powerpc64le=/x-tools/powerpc64le-unknown-linux-musl/powerpc64le-unknown-linux-musl/sysroot/usr"
|
||||
|
||||
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
|
||||
ENV SCRIPT="python3 ../x.py dist --host $HOSTS --target $HOSTS"
|
||||
|
||||
+138
-57
@@ -3,6 +3,7 @@
|
||||
// FIXME: Once the portability lint RFC is implemented (see tracking issue #41619),
|
||||
// switch to use those structures instead.
|
||||
|
||||
use std::str::FromStr;
|
||||
use std::sync::Arc;
|
||||
use std::{fmt, mem, ops};
|
||||
|
||||
@@ -15,6 +16,7 @@
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
use rustc_span::symbol::{Symbol, sym};
|
||||
use rustc_span::{DUMMY_SP, Span};
|
||||
use rustc_target::spec;
|
||||
|
||||
use crate::display::{Joined as _, MaybeDisplay, Wrapped};
|
||||
use crate::html::escape::Escape;
|
||||
@@ -421,54 +423,10 @@ fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
(sym::unix, None) => "Unix",
|
||||
(sym::windows, None) => "Windows",
|
||||
(sym::debug_assertions, None) => "debug-assertions enabled",
|
||||
(sym::target_os, Some(os)) => match os.as_str() {
|
||||
"android" => "Android",
|
||||
"cygwin" => "Cygwin",
|
||||
"dragonfly" => "DragonFly BSD",
|
||||
"emscripten" => "Emscripten",
|
||||
"freebsd" => "FreeBSD",
|
||||
"fuchsia" => "Fuchsia",
|
||||
"haiku" => "Haiku",
|
||||
"hermit" => "Hermit",
|
||||
"illumos" => "illumos",
|
||||
"ios" => "iOS",
|
||||
"l4re" => "L4Re",
|
||||
"linux" => "Linux",
|
||||
"macos" => "macOS",
|
||||
"netbsd" => "NetBSD",
|
||||
"openbsd" => "OpenBSD",
|
||||
"redox" => "Redox",
|
||||
"solaris" => "Solaris",
|
||||
"tvos" => "tvOS",
|
||||
"wasi" => "WASI",
|
||||
"watchos" => "watchOS",
|
||||
"windows" => "Windows",
|
||||
"visionos" => "visionOS",
|
||||
_ => "",
|
||||
},
|
||||
(sym::target_arch, Some(arch)) => match arch.as_str() {
|
||||
"aarch64" => "AArch64",
|
||||
"arm" => "ARM",
|
||||
"loongarch32" => "LoongArch LA32",
|
||||
"loongarch64" => "LoongArch LA64",
|
||||
"m68k" => "M68k",
|
||||
"csky" => "CSKY",
|
||||
"mips" => "MIPS",
|
||||
"mips32r6" => "MIPS Release 6",
|
||||
"mips64" => "MIPS-64",
|
||||
"mips64r6" => "MIPS-64 Release 6",
|
||||
"msp430" => "MSP430",
|
||||
"powerpc" => "PowerPC",
|
||||
"powerpc64" => "PowerPC-64",
|
||||
"riscv32" => "RISC-V RV32",
|
||||
"riscv64" => "RISC-V RV64",
|
||||
"s390x" => "s390x",
|
||||
"sparc64" => "SPARC64",
|
||||
"wasm32" | "wasm64" => "WebAssembly",
|
||||
"x86" => "x86",
|
||||
"x86_64" => "x86-64",
|
||||
_ => "",
|
||||
},
|
||||
(sym::target_os, Some(os)) => human_readable_target_os(*os).unwrap_or_default(),
|
||||
(sym::target_arch, Some(arch)) => {
|
||||
human_readable_target_arch(*arch).unwrap_or_default()
|
||||
}
|
||||
(sym::target_vendor, Some(vendor)) => match vendor.as_str() {
|
||||
"apple" => "Apple",
|
||||
"pc" => "PC",
|
||||
@@ -476,15 +434,9 @@ fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
"fortanix" => "Fortanix",
|
||||
_ => "",
|
||||
},
|
||||
(sym::target_env, Some(env)) => match env.as_str() {
|
||||
"gnu" => "GNU",
|
||||
"msvc" => "MSVC",
|
||||
"musl" => "musl",
|
||||
"newlib" => "Newlib",
|
||||
"uclibc" => "uClibc",
|
||||
"sgx" => "SGX",
|
||||
_ => "",
|
||||
},
|
||||
(sym::target_env, Some(env)) => {
|
||||
human_readable_target_env(*env).unwrap_or_default()
|
||||
}
|
||||
(sym::target_endian, Some(endian)) => {
|
||||
return write!(fmt, "{endian}-endian");
|
||||
}
|
||||
@@ -527,6 +479,135 @@ fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
}
|
||||
}
|
||||
|
||||
fn human_readable_target_os(os: Symbol) -> Option<&'static str> {
|
||||
let os = spec::Os::from_str(os.as_str()).ok()?;
|
||||
|
||||
use spec::Os::*;
|
||||
Some(match os {
|
||||
// tidy-alphabetical-start
|
||||
Aix => "AIX",
|
||||
AmdHsa => "AMD HSA",
|
||||
Android => "Android",
|
||||
Cuda => "CUDA",
|
||||
Cygwin => "Cygwin",
|
||||
Dragonfly => "DragonFly BSD",
|
||||
Emscripten => "Emscripten",
|
||||
EspIdf => "ESP-IDF",
|
||||
FreeBsd => "FreeBSD",
|
||||
Fuchsia => "Fuchsia",
|
||||
Haiku => "Haiku",
|
||||
HelenOs => "HelenOS",
|
||||
Hermit => "Hermit",
|
||||
Horizon => "Horizon",
|
||||
Hurd => "GNU/Hurd",
|
||||
IOs => "iOS",
|
||||
Illumos => "illumos",
|
||||
L4Re => "L4Re",
|
||||
Linux => "Linux",
|
||||
LynxOs178 => "LynxOS-178",
|
||||
MacOs => "macOS",
|
||||
Managarm => "Managarm",
|
||||
Motor => "Motor OS",
|
||||
NetBsd => "NetBSD",
|
||||
None => "bare-metal", // FIXME(scrabsha): is this appropriate?
|
||||
Nto => "QNX Neutrino",
|
||||
NuttX => "NuttX",
|
||||
OpenBsd => "OpenBSD",
|
||||
Psp => "Play Station Portable",
|
||||
Psx => "Play Station 1",
|
||||
Qurt => "QuRT",
|
||||
Redox => "Redox OS",
|
||||
Rtems => "RTEMS OS",
|
||||
Solaris => "Solaris",
|
||||
SolidAsp3 => "SOLID ASP3",
|
||||
TeeOs => "TEEOS",
|
||||
Trusty => "Trusty",
|
||||
TvOs => "tvOS",
|
||||
Uefi => "UEFI",
|
||||
VexOs => "VEXos",
|
||||
VisionOs => "visionOS",
|
||||
Vita => "Play Station Vita",
|
||||
VxWorks => "VxWorks",
|
||||
Wasi => "WASI",
|
||||
WatchOs => "watchOS",
|
||||
Windows => "Windows",
|
||||
Xous => "Xous",
|
||||
Zkvm => "zero knowledge Virtual Machine",
|
||||
// tidy-alphabetical-end
|
||||
Unknown | Other(_) => return Option::None,
|
||||
})
|
||||
}
|
||||
|
||||
fn human_readable_target_arch(os: Symbol) -> Option<&'static str> {
|
||||
let arch = spec::Arch::from_str(os.as_str()).ok()?;
|
||||
|
||||
use spec::Arch::*;
|
||||
Some(match arch {
|
||||
// tidy-alphabetical-start
|
||||
AArch64 => "AArch64",
|
||||
AmdGpu => "AMG GPU",
|
||||
Arm => "ARM",
|
||||
Arm64EC => "ARM64EC",
|
||||
Avr => "AVR",
|
||||
Bpf => "BPF",
|
||||
CSky => "C-SKY",
|
||||
Hexagon => "Hexagon",
|
||||
LoongArch32 => "LoongArch64",
|
||||
LoongArch64 => "LoongArch32",
|
||||
M68k => "Motorola 680x0",
|
||||
Mips => "MIPS",
|
||||
Mips32r6 => "MIPS release 6",
|
||||
Mips64 => "MIPS-64",
|
||||
Mips64r6 => "MIPS-64 release 6",
|
||||
Msp430 => "MSP430",
|
||||
Nvptx64 => "NVidia GPU",
|
||||
PowerPC => "PowerPC",
|
||||
PowerPC64 => "PowerPC64",
|
||||
RiscV32 => "RISC-V RV32",
|
||||
RiscV64 => "RISC-V RV64",
|
||||
S390x => "s390x",
|
||||
Sparc => "SPARC",
|
||||
Sparc64 => "SPARC-64",
|
||||
SpirV => "SPIR-V",
|
||||
Wasm32 | Wasm64 => "WebAssembly",
|
||||
X86 => "x86",
|
||||
X86_64 => "x86-64",
|
||||
Xtensa => "Xtensa",
|
||||
// tidy-alphabetical-end
|
||||
Other(_) => return None,
|
||||
})
|
||||
}
|
||||
|
||||
fn human_readable_target_env(env: Symbol) -> Option<&'static str> {
|
||||
let env = spec::Env::from_str(env.as_str()).ok()?;
|
||||
|
||||
use spec::Env::*;
|
||||
Some(match env {
|
||||
// tidy-alphabetical-start
|
||||
Gnu => "GNU",
|
||||
MacAbi => "Catalyst",
|
||||
Mlibc => "mac ABI",
|
||||
Msvc => "MSVC",
|
||||
Musl => "musl",
|
||||
Newlib => "Newlib",
|
||||
Nto70 => "Neutrino 7.0",
|
||||
Nto71 => "Neutrino 7.1",
|
||||
Nto71IoSock => "Neutrino 7.1 with io-sock",
|
||||
Nto80 => "Neutrino 8.0",
|
||||
Ohos => "OpenHarmony",
|
||||
P1 => "WASIp1",
|
||||
P2 => "WASIp2",
|
||||
P3 => "WASIp3",
|
||||
Relibc => "relibc",
|
||||
Sgx => "SGX",
|
||||
Sim => "Simulator",
|
||||
Uclibc => "uClibc",
|
||||
V5 => "V5",
|
||||
// tidy-alphabetical-end
|
||||
Unspecified | Other(_) => return None,
|
||||
})
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
struct NameValueCfg {
|
||||
name: Symbol,
|
||||
|
||||
@@ -309,19 +309,14 @@ pub(crate) fn create_config(
|
||||
&EMPTY_SET
|
||||
};
|
||||
// In case typeck does end up being called, don't ICE in case there were name resolution errors
|
||||
providers.queries.typeck = move |tcx, def_id| {
|
||||
// Closures' tables come from their outermost function,
|
||||
// as they are part of the same "inference environment".
|
||||
// This avoids emitting errors for the parent twice (see similar code in `typeck_with_fallback`)
|
||||
let typeck_root_def_id = tcx.typeck_root_def_id(def_id.to_def_id()).expect_local();
|
||||
if typeck_root_def_id != def_id {
|
||||
return tcx.typeck(typeck_root_def_id);
|
||||
}
|
||||
providers.queries.typeck_root = move |tcx, def_id| {
|
||||
// Panic before code below breaks in case of someone calls typeck_root directly
|
||||
assert!(!tcx.is_typeck_child(def_id.to_def_id()));
|
||||
|
||||
let body = tcx.hir_body_owned_by(def_id);
|
||||
debug!("visiting body for {def_id:?}");
|
||||
EmitIgnoredResolutionErrors::new(tcx).visit_body(body);
|
||||
(rustc_interface::DEFAULT_QUERY_PROVIDERS.queries.typeck)(tcx, def_id)
|
||||
(rustc_interface::DEFAULT_QUERY_PROVIDERS.queries.typeck_root)(tcx, def_id)
|
||||
};
|
||||
}),
|
||||
extra_symbols: Vec::new(),
|
||||
|
||||
+1
-1
Submodule src/llvm-project updated: 0591836336...1cb4e3833c
@@ -5,7 +5,7 @@
|
||||
use clippy_utils::{is_in_test, sym};
|
||||
use rustc_data_structures::fx::FxHashSet;
|
||||
use rustc_errors::Applicability;
|
||||
use rustc_hir::{Arm, Closure, ClosureKind, CoroutineKind, Expr, ExprKind, LetStmt, LocalSource, Node, Stmt, StmtKind};
|
||||
use rustc_hir::{Closure, ClosureKind, CoroutineKind, Expr, ExprKind, LetStmt, LocalSource, Node, Stmt, StmtKind};
|
||||
use rustc_lint::{LateContext, LateLintPass, LintContext};
|
||||
use rustc_session::impl_lint_pass;
|
||||
use rustc_span::{Span, SyntaxContext};
|
||||
@@ -92,16 +92,15 @@ fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) {
|
||||
(macro_call.span, String::from("()"))
|
||||
}
|
||||
},
|
||||
ExprKind::Match(first, arms, _) => {
|
||||
let vals = collect_vals(first, arms);
|
||||
let suggestion = match *vals.as_slice() {
|
||||
ExprKind::Match(args, _, _) => {
|
||||
let suggestion = match args.kind {
|
||||
// dbg!(1) => 1
|
||||
[val] => {
|
||||
ExprKind::Tup([val]) => {
|
||||
snippet_with_applicability(cx, val.span.source_callsite(), "..", &mut applicability)
|
||||
.to_string()
|
||||
},
|
||||
// dbg!(2, 3) => (2, 3)
|
||||
[first, .., last] => {
|
||||
ExprKind::Tup([first, .., last]) => {
|
||||
let snippet = snippet_with_applicability(
|
||||
cx,
|
||||
first.span.source_callsite().to(last.span.source_callsite()),
|
||||
@@ -165,39 +164,3 @@ fn is_async_move_desugar<'tcx>(expr: &'tcx Expr<'tcx>) -> Option<&'tcx Expr<'tcx
|
||||
fn first_dbg_macro_in_expansion(cx: &LateContext<'_>, span: Span) -> Option<MacroCall> {
|
||||
macro_backtrace(span).find(|mc| cx.tcx.is_diagnostic_item(sym::dbg_macro, mc.def_id))
|
||||
}
|
||||
|
||||
/// Extracts all value expressions from the `match`-tree generated by `dbg!`.
|
||||
///
|
||||
/// E.g. from
|
||||
/// ```rust, ignore
|
||||
/// match 1 {
|
||||
/// tmp_1 => match 2 {
|
||||
/// tmp_2 => {
|
||||
/// /* printing */
|
||||
/// (tmp_1, tmp_2)
|
||||
/// }
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
/// this extracts `1` and `2`.
|
||||
fn collect_vals<'hir>(first: &'hir Expr<'hir>, mut arms: &'hir [Arm<'hir>]) -> Vec<&'hir Expr<'hir>> {
|
||||
let mut vals = vec![first];
|
||||
loop {
|
||||
let [arm] = arms else {
|
||||
unreachable!("dbg! macro expansion only has single-arm matches")
|
||||
};
|
||||
|
||||
match is_async_move_desugar(arm.body)
|
||||
.unwrap_or(arm.body)
|
||||
.peel_drop_temps()
|
||||
.kind
|
||||
{
|
||||
ExprKind::Block(..) => return vals,
|
||||
ExprKind::Match(val, a, _) => {
|
||||
vals.push(val);
|
||||
arms = a;
|
||||
},
|
||||
_ => unreachable!("dbg! macro expansion only results in block or match expressions"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,7 +200,6 @@ macro_rules! generate {
|
||||
cx,
|
||||
cycle,
|
||||
cyclomatic_complexity,
|
||||
dbg_macro,
|
||||
de,
|
||||
debug_struct,
|
||||
deprecated_in_future,
|
||||
|
||||
@@ -1 +1 @@
|
||||
148adf223edb0444eb1f99753919dd2080c2a534
|
||||
116458d0a5ae01cd517cabd2d1aee7f5457018ab
|
||||
|
||||
@@ -2,7 +2,7 @@ error: Undefined Behavior: memory access failed: ALLOC has been freed, so this p
|
||||
--> tests/fail/dangling_pointers/dangling_primitive.rs:LL:CC
|
||||
|
|
||||
LL | dbg!(*ptr);
|
||||
| ^^^^^^^^^^ Undefined Behavior occurred here
|
||||
| ^^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
@@ -7,7 +7,7 @@ error: Undefined Behavior: reading memory at ALLOC[0x0..0x4], but memory is unin
|
||||
--> tests/fail/function_calls/return_pointer_on_unwind.rs:LL:CC
|
||||
|
|
||||
LL | dbg!(x.0);
|
||||
| ^^^^^^^^^ Undefined Behavior occurred here
|
||||
| ^^^ Undefined Behavior occurred here
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
extern crate a;
|
||||
|
||||
#[rustc_clean(except="typeck", cfg="rpass2")]
|
||||
#[rustc_clean(except="typeck_root", cfg="rpass2")]
|
||||
pub fn call_function0() {
|
||||
a::function0(77);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ pub fn x(&self) -> f32 {
|
||||
pub mod fn_with_type_in_sig {
|
||||
use point::Point;
|
||||
|
||||
#[rustc_clean(except="typeck,fn_sig,optimized_mir", cfg="cfail2")]
|
||||
#[rustc_clean(except="typeck_root,fn_sig,optimized_mir", cfg="cfail2")]
|
||||
pub fn boop(p: Option<&Point>) -> f32 {
|
||||
p.map(|p| p.total()).unwrap_or(0.0)
|
||||
}
|
||||
@@ -86,7 +86,7 @@ pub fn boop(p: Option<&Point>) -> f32 {
|
||||
pub mod call_fn_with_type_in_sig {
|
||||
use fn_with_type_in_sig;
|
||||
|
||||
#[rustc_clean(except="typeck,optimized_mir", cfg="cfail2")]
|
||||
#[rustc_clean(except="typeck_root,optimized_mir", cfg="cfail2")]
|
||||
pub fn bip() -> f32 {
|
||||
fn_with_type_in_sig::boop(None)
|
||||
}
|
||||
@@ -102,7 +102,7 @@ pub fn bip() -> f32 {
|
||||
pub mod fn_with_type_in_body {
|
||||
use point::Point;
|
||||
|
||||
#[rustc_clean(except="typeck,optimized_mir", cfg="cfail2")]
|
||||
#[rustc_clean(except="typeck_root,optimized_mir", cfg="cfail2")]
|
||||
pub fn boop() -> f32 {
|
||||
Point::origin().total()
|
||||
}
|
||||
@@ -125,7 +125,7 @@ pub fn bip() -> f32 {
|
||||
pub mod fn_make_struct {
|
||||
use point::Point;
|
||||
|
||||
#[rustc_clean(except="typeck,fn_sig,optimized_mir", cfg="cfail2")]
|
||||
#[rustc_clean(except="typeck_root,fn_sig,optimized_mir", cfg="cfail2")]
|
||||
pub fn make_origin(p: Point) -> Point {
|
||||
Point { ..p }
|
||||
}
|
||||
@@ -135,7 +135,7 @@ pub fn make_origin(p: Point) -> Point {
|
||||
pub mod fn_read_field {
|
||||
use point::Point;
|
||||
|
||||
#[rustc_clean(except="typeck,fn_sig,optimized_mir", cfg="cfail2")]
|
||||
#[rustc_clean(except="typeck_root,fn_sig,optimized_mir", cfg="cfail2")]
|
||||
pub fn get_x(p: Point) -> f32 {
|
||||
p.x
|
||||
}
|
||||
@@ -145,7 +145,7 @@ pub fn get_x(p: Point) -> f32 {
|
||||
pub mod fn_write_field {
|
||||
use point::Point;
|
||||
|
||||
#[rustc_clean(except="typeck,fn_sig,optimized_mir", cfg="cfail2")]
|
||||
#[rustc_clean(except="typeck_root,fn_sig,optimized_mir", cfg="cfail2")]
|
||||
pub fn inc_x(p: &mut Point) {
|
||||
p.x += 1.0;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
use a::A;
|
||||
use b::B;
|
||||
|
||||
//? #[rustc_clean(label="typeck", cfg="rpass2")]
|
||||
//? #[rustc_clean(label="typeck_root", cfg="rpass2")]
|
||||
pub fn main() {
|
||||
A + B;
|
||||
}
|
||||
|
||||
@@ -54,8 +54,8 @@ pub mod fn_calls_methods_in_same_impl {
|
||||
// The cached result should actually be loaded from disk
|
||||
// (not just marked green) - for example, `DeadVisitor`
|
||||
// always runs during compilation as a "pass", and loads
|
||||
// the typeck results for bodies.
|
||||
#[rustc_clean(cfg="cfail2", loaded_from_disk="typeck")]
|
||||
// the typeck_root results for bodies.
|
||||
#[rustc_clean(cfg="cfail2", loaded_from_disk="typeck_root")]
|
||||
pub fn check() {
|
||||
let x = Point { x: 2.0, y: 2.0 };
|
||||
x.distance_from_origin();
|
||||
|
||||
@@ -52,7 +52,7 @@ pub fn x(&self) -> f32 {
|
||||
pub mod fn_calls_changed_method {
|
||||
use point::Point;
|
||||
|
||||
#[rustc_clean(except="typeck,optimized_mir", cfg="cfail2")]
|
||||
#[rustc_clean(except="typeck_root,optimized_mir", cfg="cfail2")]
|
||||
pub fn check() {
|
||||
let p = Point { x: 2.0, y: 2.0 };
|
||||
p.distance_from_point(None);
|
||||
|
||||
@@ -36,14 +36,14 @@ pub fn y() {
|
||||
//[cfail2]~| ERROR `predicates_of(y)` should be dirty but is not
|
||||
//[cfail2]~| ERROR `type_of(y)` should be dirty but is not
|
||||
//[cfail2]~| ERROR `fn_sig(y)` should be dirty but is not
|
||||
//[cfail2]~| ERROR `typeck(y)` should be clean but is not
|
||||
//[cfail2]~| ERROR `typeck_root(y)` should be clean but is not
|
||||
x::x();
|
||||
}
|
||||
}
|
||||
|
||||
mod z {
|
||||
#[rustc_clean(except="typeck", cfg="cfail2")]
|
||||
#[rustc_clean(except="typeck_root", cfg="cfail2")]
|
||||
pub fn z() {
|
||||
//[cfail2]~^ ERROR `typeck(z)` should be dirty but is not
|
||||
//[cfail2]~^ ERROR `typeck_root(z)` should be dirty but is not
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,9 +29,9 @@ pub fn change_callee_function() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_callee_function() {
|
||||
callee2(1, 2)
|
||||
@@ -63,9 +63,9 @@ mod change_callee_indirectly_function {
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
use super::callee2 as callee;
|
||||
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail2")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_callee_indirectly_function() {
|
||||
callee(1, 2)
|
||||
@@ -87,9 +87,9 @@ pub fn change_callee_method() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_callee_method() {
|
||||
let s = Struct;
|
||||
@@ -125,9 +125,9 @@ pub fn change_ufcs_callee_method() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_ufcs_callee_method() {
|
||||
let s = Struct;
|
||||
@@ -163,9 +163,9 @@ pub fn change_to_ufcs() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
// One might think this would be expanded in the opt_hir_owner_nodes/Mir, but it actually
|
||||
// results in slightly different hir_owner/Mir.
|
||||
@@ -187,9 +187,9 @@ pub mod change_ufcs_callee_indirectly {
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
use super::Struct2 as Struct;
|
||||
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_ufcs_callee_indirectly() {
|
||||
let s = Struct;
|
||||
|
||||
@@ -43,9 +43,9 @@ pub fn add_parameter() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn add_parameter() {
|
||||
let x = 0u32;
|
||||
@@ -61,9 +61,9 @@ pub fn change_parameter_pattern() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_parameter_pattern() {
|
||||
let _ = |(x,): (u32,)| x;
|
||||
@@ -96,9 +96,9 @@ pub fn add_type_ascription_to_parameter() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg = "cfail2", except = "opt_hir_owner_nodes, typeck")]
|
||||
#[rustc_clean(cfg = "cfail2", except = "opt_hir_owner_nodes, typeck_root")]
|
||||
#[rustc_clean(cfg = "cfail3")]
|
||||
#[rustc_clean(cfg = "cfail5", except = "opt_hir_owner_nodes, typeck")]
|
||||
#[rustc_clean(cfg = "cfail5", except = "opt_hir_owner_nodes, typeck_root")]
|
||||
#[rustc_clean(cfg = "cfail6")]
|
||||
pub fn add_type_ascription_to_parameter() {
|
||||
let closure = |x: u32| x + 1u32;
|
||||
@@ -115,9 +115,9 @@ pub fn change_parameter_type() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, optimized_mir, typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, optimized_mir, typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, optimized_mir, typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, optimized_mir, typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_parameter_type() {
|
||||
let closure = |x: u16| (x as u64) + 1;
|
||||
|
||||
@@ -63,9 +63,9 @@ pub fn change_field_order_struct_like() -> Enum {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
// FIXME(michaelwoerister):Interesting. I would have thought that that changes the MIR. And it
|
||||
// would if it were not all constants
|
||||
@@ -104,9 +104,9 @@ pub fn change_constructor_path_struct_like() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_constructor_path_struct_like() {
|
||||
let _ = Enum2::Struct {
|
||||
@@ -149,9 +149,9 @@ pub mod change_constructor_path_indirectly_struct_like {
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
use super::Enum2 as TheEnum;
|
||||
|
||||
#[rustc_clean(cfg="cfail2", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn function() -> TheEnum {
|
||||
TheEnum::Struct {
|
||||
@@ -211,12 +211,12 @@ pub fn change_constructor_path_tuple_like() {
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(
|
||||
cfg="cfail2",
|
||||
except="opt_hir_owner_nodes,typeck"
|
||||
except="opt_hir_owner_nodes,typeck_root"
|
||||
)]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(
|
||||
cfg="cfail5",
|
||||
except="opt_hir_owner_nodes,typeck"
|
||||
except="opt_hir_owner_nodes,typeck_root"
|
||||
)]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_constructor_path_tuple_like() {
|
||||
@@ -234,12 +234,12 @@ pub fn change_constructor_variant_tuple_like() {
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(
|
||||
cfg="cfail2",
|
||||
except="opt_hir_owner_nodes,typeck"
|
||||
except="opt_hir_owner_nodes,typeck_root"
|
||||
)]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(
|
||||
cfg="cfail5",
|
||||
except="opt_hir_owner_nodes,typeck"
|
||||
except="opt_hir_owner_nodes,typeck_root"
|
||||
)]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_constructor_variant_tuple_like() {
|
||||
@@ -254,9 +254,9 @@ pub mod change_constructor_path_indirectly_tuple_like {
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
use super::Enum2 as TheEnum;
|
||||
|
||||
#[rustc_clean(cfg="cfail2", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn function() -> TheEnum {
|
||||
TheEnum::Tuple(0, 1, 2)
|
||||
@@ -273,9 +273,9 @@ pub mod change_constructor_variant_indirectly_tuple_like {
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
use super::Enum2::Tuple2 as Variant;
|
||||
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn function() -> Enum2 {
|
||||
Variant(0, 1, 2)
|
||||
@@ -302,9 +302,9 @@ pub fn change_constructor_path_c_like() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_constructor_path_c_like() {
|
||||
let _x = Clike2::B;
|
||||
@@ -335,9 +335,9 @@ pub mod change_constructor_path_indirectly_c_like {
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
use super::Clike2 as TheEnum;
|
||||
|
||||
#[rustc_clean(cfg="cfail2", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn function() -> TheEnum {
|
||||
TheEnum::B
|
||||
|
||||
@@ -79,9 +79,9 @@ pub fn change_iteration_variable_pattern() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, optimized_mir, typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, optimized_mir, typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, optimized_mir, typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, optimized_mir, typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_iteration_variable_pattern() {
|
||||
let mut _x = 0;
|
||||
@@ -129,9 +129,9 @@ pub fn add_break() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, optimized_mir, typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, optimized_mir, typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, optimized_mir, typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, optimized_mir, typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn add_break() {
|
||||
let mut _x = 0;
|
||||
|
||||
@@ -26,12 +26,12 @@ pub fn add_parameter() {}
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(
|
||||
cfg = "cfail2",
|
||||
except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
||||
except = "opt_hir_owner_nodes, optimized_mir, typeck_root, fn_sig"
|
||||
)]
|
||||
#[rustc_clean(cfg = "cfail3")]
|
||||
#[rustc_clean(
|
||||
cfg = "cfail5",
|
||||
except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
||||
except = "opt_hir_owner_nodes, optimized_mir, typeck_root, fn_sig"
|
||||
)]
|
||||
#[rustc_clean(cfg = "cfail6")]
|
||||
pub fn add_parameter(p: i32) {}
|
||||
@@ -56,12 +56,12 @@ pub fn type_of_parameter(p: i32) {}
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(
|
||||
cfg = "cfail2",
|
||||
except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
||||
except = "opt_hir_owner_nodes, optimized_mir, typeck_root, fn_sig"
|
||||
)]
|
||||
#[rustc_clean(cfg = "cfail3")]
|
||||
#[rustc_clean(
|
||||
cfg = "cfail5",
|
||||
except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
||||
except = "opt_hir_owner_nodes, optimized_mir, typeck_root, fn_sig"
|
||||
)]
|
||||
#[rustc_clean(cfg = "cfail6")]
|
||||
pub fn type_of_parameter(p: i64) {}
|
||||
@@ -74,12 +74,12 @@ pub fn type_of_parameter_ref(p: &i32) {}
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(
|
||||
cfg = "cfail2",
|
||||
except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
||||
except = "opt_hir_owner_nodes, optimized_mir, typeck_root, fn_sig"
|
||||
)]
|
||||
#[rustc_clean(cfg = "cfail3")]
|
||||
#[rustc_clean(
|
||||
cfg = "cfail5",
|
||||
except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
||||
except = "opt_hir_owner_nodes, optimized_mir, typeck_root, fn_sig"
|
||||
)]
|
||||
#[rustc_clean(cfg = "cfail6")]
|
||||
pub fn type_of_parameter_ref(p: &mut i32) {}
|
||||
@@ -92,12 +92,12 @@ pub fn order_of_parameters(p1: i32, p2: i64) {}
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(
|
||||
cfg = "cfail2",
|
||||
except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
||||
except = "opt_hir_owner_nodes, optimized_mir, typeck_root, fn_sig"
|
||||
)]
|
||||
#[rustc_clean(cfg = "cfail3")]
|
||||
#[rustc_clean(
|
||||
cfg = "cfail5",
|
||||
except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
||||
except = "opt_hir_owner_nodes, optimized_mir, typeck_root, fn_sig"
|
||||
)]
|
||||
#[rustc_clean(cfg = "cfail6")]
|
||||
pub fn order_of_parameters(p2: i64, p1: i32) {}
|
||||
@@ -110,12 +110,12 @@ pub fn make_unsafe() {}
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(
|
||||
cfg = "cfail2",
|
||||
except = "opt_hir_owner_nodes, typeck, fn_sig"
|
||||
except = "opt_hir_owner_nodes, typeck_root, fn_sig"
|
||||
)]
|
||||
#[rustc_clean(cfg = "cfail3")]
|
||||
#[rustc_clean(
|
||||
cfg = "cfail5",
|
||||
except = "opt_hir_owner_nodes, typeck, fn_sig"
|
||||
except = "opt_hir_owner_nodes, typeck_root, fn_sig"
|
||||
)]
|
||||
#[rustc_clean(cfg = "cfail6")]
|
||||
pub unsafe fn make_unsafe() {}
|
||||
@@ -126,9 +126,9 @@ pub unsafe fn make_unsafe() {}
|
||||
pub fn make_extern() {}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg = "cfail2", except = "opt_hir_owner_nodes, typeck, fn_sig")]
|
||||
#[rustc_clean(cfg = "cfail2", except = "opt_hir_owner_nodes, typeck_root, fn_sig")]
|
||||
#[rustc_clean(cfg = "cfail3")]
|
||||
#[rustc_clean(cfg = "cfail5", except = "opt_hir_owner_nodes, typeck, fn_sig")]
|
||||
#[rustc_clean(cfg = "cfail5", except = "opt_hir_owner_nodes, typeck_root, fn_sig")]
|
||||
#[rustc_clean(cfg = "cfail6")]
|
||||
pub extern "C" fn make_extern() {}
|
||||
|
||||
@@ -303,9 +303,9 @@ pub fn return_impl_trait() -> i32 {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg = "cfail2", except = "opt_hir_owner_nodes, typeck, fn_sig")]
|
||||
#[rustc_clean(cfg = "cfail2", except = "opt_hir_owner_nodes, typeck_root, fn_sig")]
|
||||
#[rustc_clean(cfg = "cfail3")]
|
||||
#[rustc_clean(cfg = "cfail5", except = "opt_hir_owner_nodes, typeck, fn_sig, optimized_mir")]
|
||||
#[rustc_clean(cfg = "cfail5", except = "opt_hir_owner_nodes, typeck_root, fn_sig, optimized_mir")]
|
||||
#[rustc_clean(cfg = "cfail6")]
|
||||
pub fn return_impl_trait() -> impl Clone {
|
||||
0
|
||||
@@ -321,7 +321,7 @@ pub fn change_return_impl_trait() -> impl Clone {
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg = "cfail2", except = "opt_hir_owner_nodes")]
|
||||
#[rustc_clean(cfg = "cfail3")]
|
||||
#[rustc_clean(cfg = "cfail5", except = "opt_hir_owner_nodes, typeck")]
|
||||
#[rustc_clean(cfg = "cfail5", except = "opt_hir_owner_nodes, typeck_root")]
|
||||
#[rustc_clean(cfg = "cfail6")]
|
||||
pub fn change_return_impl_trait() -> impl Copy {
|
||||
0u32
|
||||
@@ -340,12 +340,12 @@ pub mod change_return_type_indirectly {
|
||||
|
||||
#[rustc_clean(
|
||||
cfg = "cfail2",
|
||||
except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
||||
except = "opt_hir_owner_nodes, optimized_mir, typeck_root, fn_sig"
|
||||
)]
|
||||
#[rustc_clean(cfg = "cfail3")]
|
||||
#[rustc_clean(
|
||||
cfg = "cfail5",
|
||||
except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
||||
except = "opt_hir_owner_nodes, optimized_mir, typeck_root, fn_sig"
|
||||
)]
|
||||
#[rustc_clean(cfg = "cfail6")]
|
||||
pub fn indirect_return_type() -> ReturnType {
|
||||
@@ -363,12 +363,12 @@ pub mod change_parameter_type_indirectly {
|
||||
|
||||
#[rustc_clean(
|
||||
cfg = "cfail2",
|
||||
except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
||||
except = "opt_hir_owner_nodes, optimized_mir, typeck_root, fn_sig"
|
||||
)]
|
||||
#[rustc_clean(cfg = "cfail3")]
|
||||
#[rustc_clean(
|
||||
cfg = "cfail5",
|
||||
except = "opt_hir_owner_nodes, optimized_mir, typeck, fn_sig"
|
||||
except = "opt_hir_owner_nodes, optimized_mir, typeck_root, fn_sig"
|
||||
)]
|
||||
#[rustc_clean(cfg = "cfail6")]
|
||||
pub fn indirect_parameter_type(p: ParameterType) {}
|
||||
|
||||
@@ -28,9 +28,9 @@ pub fn change_condition(x: bool) -> u32 {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_condition(x: bool) -> u32 {
|
||||
if !x {
|
||||
@@ -104,9 +104,9 @@ pub fn add_else_branch(x: bool) -> u32 {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn add_else_branch(x: bool) -> u32 {
|
||||
let mut ret = 1;
|
||||
@@ -132,9 +132,9 @@ pub fn change_condition_if_let(x: Option<u32>) -> u32 {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_condition_if_let(x: Option<u32>) -> u32 {
|
||||
if let Some(_ ) = x {
|
||||
@@ -157,9 +157,9 @@ pub fn change_then_branch_if_let(x: Option<u32>) -> u32 {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_then_branch_if_let(x: Option<u32>) -> u32 {
|
||||
if let Some(x) = x {
|
||||
@@ -210,9 +210,9 @@ pub fn add_else_branch_if_let(x: Option<u32>) -> u32 {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn add_else_branch_if_let(x: Option<u32>) -> u32 {
|
||||
let mut ret = 1;
|
||||
|
||||
@@ -75,9 +75,9 @@ fn add_lower_bound(slice: &[u32]) -> &[u32] {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail2")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
fn add_lower_bound(slice: &[u32]) -> &[u32] {
|
||||
&slice[3..4]
|
||||
@@ -92,9 +92,9 @@ fn add_upper_bound(slice: &[u32]) -> &[u32] {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail2")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
fn add_upper_bound(slice: &[u32]) -> &[u32] {
|
||||
&slice[3..7]
|
||||
@@ -109,9 +109,9 @@ fn change_mutability(slice: &mut [u32]) -> u32 {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail2")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
fn change_mutability(slice: &mut [u32]) -> u32 {
|
||||
(& slice[3..5])[0]
|
||||
@@ -126,9 +126,9 @@ fn exclusive_to_inclusive_range(slice: &[u32]) -> &[u32] {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail2")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
fn exclusive_to_inclusive_range(slice: &[u32]) -> &[u32] {
|
||||
&slice[3..=7]
|
||||
|
||||
@@ -55,12 +55,12 @@ pub fn method_body() {
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
impl Foo {
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,promoted_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2",except="opt_hir_owner_nodes,optimized_mir,promoted_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,promoted_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5",except="opt_hir_owner_nodes,optimized_mir,promoted_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn method_body() {
|
||||
println!("Hello, world!");
|
||||
@@ -86,12 +86,12 @@ pub fn method_body_inlined() {
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
impl Foo {
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
#[inline]
|
||||
pub fn method_body_inlined() {
|
||||
@@ -147,12 +147,12 @@ pub fn method_selfness() { }
|
||||
impl Foo {
|
||||
#[rustc_clean(
|
||||
cfg="cfail2",
|
||||
except="opt_hir_owner_nodes,fn_sig,generics_of,typeck,associated_item,optimized_mir",
|
||||
except="opt_hir_owner_nodes,fn_sig,generics_of,typeck_root,associated_item,optimized_mir",
|
||||
)]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(
|
||||
cfg="cfail5",
|
||||
except="opt_hir_owner_nodes,fn_sig,generics_of,typeck,associated_item,optimized_mir",
|
||||
except="opt_hir_owner_nodes,fn_sig,generics_of,typeck_root,associated_item,optimized_mir",
|
||||
)]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn method_selfness(&self) { }
|
||||
@@ -171,12 +171,12 @@ pub fn method_selfmutness(& self) { }
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
impl Foo {
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn method_selfmutness(&mut self) { }
|
||||
}
|
||||
@@ -221,12 +221,12 @@ pub fn add_method_parameter(&self ) { }
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
impl Foo {
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn add_method_parameter(&self, _: i32) { }
|
||||
}
|
||||
@@ -271,12 +271,12 @@ pub fn change_method_return_type(&self) -> u16 { 0 }
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
impl Foo {
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_method_return_type(&self) -> u32 { 0 }
|
||||
}
|
||||
@@ -348,12 +348,12 @@ pub fn make_method_unsafe(&self) { }
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
impl Foo {
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub unsafe fn make_method_unsafe(&self) { }
|
||||
}
|
||||
@@ -373,12 +373,12 @@ pub fn make_method_extern(&self) { }
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
impl Foo {
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub extern "C" fn make_method_extern(&self) { }
|
||||
}
|
||||
@@ -398,12 +398,12 @@ pub extern "C" fn change_method_calling_convention(&self) { }
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
impl Foo {
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub extern "system" fn change_method_calling_convention(&self) { }
|
||||
}
|
||||
@@ -432,18 +432,18 @@ pub fn add_lifetime_parameter_to_method (&self) { }
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
impl Foo {
|
||||
// Warning: Note that `typeck` are coming up clean here.
|
||||
// Warning: Note that `typeck_root` are coming up clean here.
|
||||
// The addition or removal of lifetime parameters that don't
|
||||
// appear in the arguments or fn body in any way does not, in
|
||||
// fact, affect the `typeck` in any semantic way (at least
|
||||
// fact, affect the `typeck_root` in any semantic way (at least
|
||||
// as of this writing). **However,** altering the order of
|
||||
// lowering **can** cause it appear to affect the `typeck`:
|
||||
// lowering **can** cause it appear to affect the `typeck_root`:
|
||||
// if we lower generics before the body, then the `HirId` for
|
||||
// things in the body will be affected. So if you start to see
|
||||
// `typeck` appear dirty, that might be the cause. -nmatsakis
|
||||
// `typeck_root` appear dirty, that might be the cause. -nmatsakis
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,fn_sig")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,fn_sig,generics_of")]
|
||||
@@ -481,17 +481,17 @@ pub fn add_type_parameter_to_method (&self) { }
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
impl Foo {
|
||||
// Warning: Note that `typeck` are coming up clean here.
|
||||
// Warning: Note that `typeck_root` are coming up clean here.
|
||||
// The addition or removal of type parameters that don't appear in
|
||||
// the arguments or fn body in any way does not, in fact, affect
|
||||
// the `typeck` in any semantic way (at least as of this
|
||||
// the `typeck_root` in any semantic way (at least as of this
|
||||
// writing). **However,** altering the order of lowering **can**
|
||||
// cause it appear to affect the `typeck`: if we lower
|
||||
// cause it appear to affect the `typeck_root`: if we lower
|
||||
// generics before the body, then the `HirId` for things in the
|
||||
// body will be affected. So if you start to see `typeck`
|
||||
// body will be affected. So if you start to see `typeck_root`
|
||||
// appear dirty, that might be the cause. -nmatsakis
|
||||
#[rustc_clean(
|
||||
cfg="cfail2",
|
||||
@@ -573,17 +573,17 @@ pub fn add_lifetime_bound_to_type_param_of_method<'a, T >(&self) { }
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
impl Foo {
|
||||
// Warning: Note that `typeck` are coming up clean here.
|
||||
// Warning: Note that `typeck_root` are coming up clean here.
|
||||
// The addition or removal of bounds that don't appear in the
|
||||
// arguments or fn body in any way does not, in fact, affect the
|
||||
// `typeck` in any semantic way (at least as of this
|
||||
// `typeck_root` in any semantic way (at least as of this
|
||||
// writing). **However,** altering the order of lowering **can**
|
||||
// cause it appear to affect the `typeck`: if we lower
|
||||
// cause it appear to affect the `typeck_root`: if we lower
|
||||
// generics before the body, then the `HirId` for things in the
|
||||
// body will be affected. So if you start to see `typeck`
|
||||
// body will be affected. So if you start to see `typeck_root`
|
||||
// appear dirty, that might be the cause. -nmatsakis
|
||||
#[rustc_clean(
|
||||
cfg="cfail2",
|
||||
@@ -622,17 +622,17 @@ pub fn add_trait_bound_to_type_param_of_method<T >(&self) { }
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
impl Foo {
|
||||
// Warning: Note that `typeck` are coming up clean here.
|
||||
// Warning: Note that `typeck_root` are coming up clean here.
|
||||
// The addition or removal of bounds that don't appear in the
|
||||
// arguments or fn body in any way does not, in fact, affect the
|
||||
// `typeck` in any semantic way (at least as of this
|
||||
// `typeck_root` in any semantic way (at least as of this
|
||||
// writing). **However,** altering the order of lowering **can**
|
||||
// cause it appear to affect the `typeck`: if we lower
|
||||
// cause it appear to affect the `typeck_root`: if we lower
|
||||
// generics before the body, then the `HirId` for things in the
|
||||
// body will be affected. So if you start to see `typeck`
|
||||
// body will be affected. So if you start to see `typeck_root`
|
||||
// appear dirty, that might be the cause. -nmatsakis
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,predicates_of")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
@@ -686,12 +686,12 @@ pub fn add_type_parameter_to_impl(&self) { }
|
||||
impl<T> Bar<T> {
|
||||
#[rustc_clean(
|
||||
cfg="cfail2",
|
||||
except="generics_of,fn_sig,typeck,type_of,optimized_mir"
|
||||
except="generics_of,fn_sig,typeck_root,type_of,optimized_mir"
|
||||
)]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(
|
||||
cfg="cfail5",
|
||||
except="generics_of,fn_sig,typeck,type_of,optimized_mir"
|
||||
except="generics_of,fn_sig,typeck_root,type_of,optimized_mir"
|
||||
)]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn add_type_parameter_to_impl(&self) { }
|
||||
@@ -711,9 +711,9 @@ pub fn change_impl_self_type(&self) { }
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
impl Bar<u64> {
|
||||
#[rustc_clean(cfg="cfail2", except="fn_sig,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="fn_sig,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="fn_sig,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="fn_sig,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_impl_self_type(&self) { }
|
||||
}
|
||||
|
||||
@@ -41,9 +41,9 @@ pub fn add_type() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn add_type() {
|
||||
let _x: u32 = 2u32;
|
||||
@@ -58,9 +58,9 @@ pub fn change_type() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_type() {
|
||||
let _x: u8 = 2;
|
||||
@@ -75,9 +75,9 @@ pub fn change_mutability_of_reference_type() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_mutability_of_reference_type() {
|
||||
let _x: &mut u64;
|
||||
@@ -92,9 +92,9 @@ pub fn change_mutability_of_slot() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_mutability_of_slot() {
|
||||
let _x: u64 = 0;
|
||||
@@ -109,9 +109,9 @@ pub fn change_simple_binding_to_pattern() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_simple_binding_to_pattern() {
|
||||
let (_a, _b) = (0u8, 'x');
|
||||
@@ -143,9 +143,9 @@ pub fn add_ref_in_pattern() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn add_ref_in_pattern() {
|
||||
let (ref _a, _b) = (1u8, 'y');
|
||||
@@ -160,9 +160,9 @@ pub fn add_amp_in_pattern() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn add_amp_in_pattern() {
|
||||
let (&_a, _b) = (&1u8, 'y');
|
||||
@@ -177,9 +177,9 @@ pub fn change_mutability_of_binding_in_pattern() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_mutability_of_binding_in_pattern() {
|
||||
let (mut _a, _b) = (99u8, 'q');
|
||||
@@ -194,9 +194,9 @@ pub fn add_initializer() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root,optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn add_initializer() {
|
||||
let _x: i16 = 3i16;
|
||||
|
||||
@@ -54,9 +54,9 @@ pub fn add_break() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, optimized_mir, typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, optimized_mir, typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, optimized_mir, typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, optimized_mir, typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn add_break() {
|
||||
let mut _x = 0;
|
||||
@@ -131,9 +131,9 @@ pub fn change_break_label() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, optimized_mir, typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, optimized_mir, typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, optimized_mir, typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, optimized_mir, typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_break_label() {
|
||||
let mut _x = 0;
|
||||
@@ -212,9 +212,9 @@ pub fn change_continue_to_break() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, typeck, optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, typeck_root, optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, typeck, optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, typeck_root, optimized_mir")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_continue_to_break() {
|
||||
let mut _x = 0;
|
||||
|
||||
@@ -29,9 +29,9 @@ pub fn add_arm(x: u32) -> u32 {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn add_arm(x: u32) -> u32 {
|
||||
match x {
|
||||
@@ -80,9 +80,9 @@ pub fn add_guard_clause(x: u32, y: bool) -> u32 {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn add_guard_clause(x: u32, y: bool) -> u32 {
|
||||
match x {
|
||||
@@ -105,9 +105,9 @@ pub fn change_guard_clause(x: u32, y: bool) -> u32 {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_guard_clause(x: u32, y: bool) -> u32 {
|
||||
match x {
|
||||
@@ -130,9 +130,9 @@ pub fn add_at_binding(x: u32) -> u32 {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn add_at_binding(x: u32) -> u32 {
|
||||
match x {
|
||||
@@ -179,9 +179,9 @@ pub fn change_simple_name_to_pattern(x: u32) -> u32 {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_simple_name_to_pattern(x: u32) -> u32 {
|
||||
match (x, x & 1) {
|
||||
@@ -228,9 +228,9 @@ pub fn change_mutability_of_binding_in_pattern(x: u32) -> u32 {
|
||||
|
||||
// Ignore optimized_mir in cfail2, the only change to optimized MIR is a span.
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_mutability_of_binding_in_pattern(x: u32) -> u32 {
|
||||
match (x, x & 1) {
|
||||
@@ -251,9 +251,9 @@ pub fn add_ref_to_binding_in_pattern(x: u32) -> u32 {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn add_ref_to_binding_in_pattern(x: u32) -> u32 {
|
||||
match (x, x & 1) {
|
||||
@@ -274,9 +274,9 @@ pub fn add_amp_to_binding_in_pattern(x: u32) -> u32 {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn add_amp_to_binding_in_pattern(x: u32) -> u32 {
|
||||
match (&x, x & 1) {
|
||||
@@ -323,9 +323,9 @@ pub fn add_alternative_to_arm(x: u32) -> u32 {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn add_alternative_to_arm(x: u32) -> u32 {
|
||||
match x {
|
||||
|
||||
@@ -60,9 +60,9 @@ pub fn change_field_order_regular_struct() -> RegularStruct {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_field_order_regular_struct() -> RegularStruct {
|
||||
RegularStruct {
|
||||
@@ -91,9 +91,9 @@ pub fn add_field_regular_struct() -> RegularStruct {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn add_field_regular_struct() -> RegularStruct {
|
||||
let struct1 = RegularStruct {
|
||||
@@ -128,9 +128,9 @@ pub fn change_field_label_regular_struct() -> RegularStruct {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_field_label_regular_struct() -> RegularStruct {
|
||||
let struct1 = RegularStruct {
|
||||
@@ -165,9 +165,9 @@ pub fn change_constructor_path_regular_struct() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_constructor_path_regular_struct() {
|
||||
let _ = RegularStruct2 {
|
||||
@@ -186,9 +186,9 @@ pub mod change_constructor_path_indirectly_regular_struct {
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
use super::RegularStruct2 as Struct;
|
||||
|
||||
#[rustc_clean(cfg="cfail2", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn function() -> Struct {
|
||||
Struct {
|
||||
@@ -229,9 +229,9 @@ pub fn change_constructor_path_tuple_struct() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn change_constructor_path_tuple_struct() {
|
||||
let _ = TupleStruct2(0, 1, 2);
|
||||
@@ -246,9 +246,9 @@ pub mod change_constructor_path_indirectly_tuple_struct {
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
use super::TupleStruct2 as Struct;
|
||||
|
||||
#[rustc_clean(cfg="cfail5", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
#[rustc_clean(cfg="cfail2", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="fn_sig,opt_hir_owner_nodes,optimized_mir,typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
pub fn function() -> Struct {
|
||||
Struct(0, 1, 2)
|
||||
|
||||
@@ -353,12 +353,12 @@ fn method( self) {}
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
trait TraitChangeModeSelfOwnToMut: Sized {
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck,optimized_mir", cfg="cfail2")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck_root,optimized_mir", cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck,optimized_mir", cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck_root,optimized_mir", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
fn method(mut self) {}
|
||||
}
|
||||
|
||||
@@ -76,12 +76,12 @@ fn method_name() {
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
impl ChangeMethodBodyTrait for Foo {
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail2")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
fn method_name() {
|
||||
()
|
||||
@@ -111,12 +111,12 @@ fn method_name() {
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
impl ChangeMethodBodyTraitInlined for Foo {
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck,optimized_mir", cfg="cfail2")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck_root,optimized_mir", cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck,optimized_mir", cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck_root,optimized_mir", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
#[inline]
|
||||
fn method_name() {
|
||||
@@ -148,12 +148,12 @@ pub trait ChangeMethodSelfnessTrait {
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
impl ChangeMethodSelfnessTrait for Foo {
|
||||
#[rustc_clean(
|
||||
except="opt_hir_owner_nodes,associated_item,generics_of,fn_sig,typeck,optimized_mir",
|
||||
except="opt_hir_owner_nodes,associated_item,generics_of,fn_sig,typeck_root,optimized_mir",
|
||||
cfg="cfail2",
|
||||
)]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(
|
||||
except="opt_hir_owner_nodes,associated_item,generics_of,fn_sig,typeck,optimized_mir",
|
||||
except="opt_hir_owner_nodes,associated_item,generics_of,fn_sig,typeck_root,optimized_mir",
|
||||
cfg="cfail5",
|
||||
)]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
@@ -186,12 +186,12 @@ pub trait RemoveMethodSelfnessTrait {
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
impl RemoveMethodSelfnessTrait for Foo {
|
||||
#[rustc_clean(
|
||||
except="opt_hir_owner_nodes,associated_item,generics_of,fn_sig,typeck,optimized_mir",
|
||||
except="opt_hir_owner_nodes,associated_item,generics_of,fn_sig,typeck_root,optimized_mir",
|
||||
cfg="cfail2",
|
||||
)]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(
|
||||
except="opt_hir_owner_nodes,associated_item,generics_of,fn_sig,typeck,optimized_mir",
|
||||
except="opt_hir_owner_nodes,associated_item,generics_of,fn_sig,typeck_root,optimized_mir",
|
||||
cfg="cfail5",
|
||||
)]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
@@ -222,12 +222,12 @@ pub trait ChangeMethodSelfmutnessTrait {
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
impl ChangeMethodSelfmutnessTrait for Foo {
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir", cfg="cfail2")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir", cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir", cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
fn method_name(&mut self) {}
|
||||
}
|
||||
@@ -404,12 +404,12 @@ pub trait AddArgumentTrait {
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
impl AddArgumentTrait for Foo {
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir", cfg="cfail2")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir", cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir", cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
fn method_name(&self, _x: u32) { }
|
||||
}
|
||||
@@ -438,12 +438,12 @@ pub trait ChangeArgumentTypeTrait {
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
impl ChangeArgumentTypeTrait for Foo {
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir", cfg="cfail2")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir", cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck,optimized_mir", cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,fn_sig,typeck_root,optimized_mir", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
fn method_name(&self, _x: char) { }
|
||||
}
|
||||
@@ -469,12 +469,12 @@ fn id(t: u32) -> u32 { t }
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
impl<TTT> AddTypeParameterToImpl<TTT> for Bar<TTT> {
|
||||
#[rustc_clean(
|
||||
except="opt_hir_owner_nodes,generics_of,fn_sig,type_of,typeck,optimized_mir",
|
||||
except="opt_hir_owner_nodes,generics_of,fn_sig,type_of,typeck_root,optimized_mir",
|
||||
cfg="cfail2",
|
||||
)]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(
|
||||
except="opt_hir_owner_nodes,generics_of,fn_sig,type_of,typeck,optimized_mir",
|
||||
except="opt_hir_owner_nodes,generics_of,fn_sig,type_of,typeck_root,optimized_mir",
|
||||
cfg="cfail5",
|
||||
)]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
@@ -499,9 +499,9 @@ fn id(self) -> Self { self }
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,impl_trait_header", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
impl ChangeSelfTypeOfImpl for u64 {
|
||||
#[rustc_clean(except="fn_sig,typeck,optimized_mir", cfg="cfail2")]
|
||||
#[rustc_clean(except="fn_sig,typeck_root,optimized_mir", cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(except="fn_sig,typeck,optimized_mir", cfg="cfail5")]
|
||||
#[rustc_clean(except="fn_sig,typeck_root,optimized_mir", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
fn id(self) -> Self { self }
|
||||
}
|
||||
|
||||
@@ -418,9 +418,9 @@ pub fn type_cast(a: u8) -> u64 {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,optimized_mir,typeck", cfg="cfail2")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,optimized_mir,typeck_root", cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,optimized_mir,typeck", cfg="cfail5")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,optimized_mir,typeck_root", cfg="cfail5")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn type_cast(a: u8) -> u64 {
|
||||
let b = a as u32;
|
||||
|
||||
@@ -79,9 +79,9 @@ pub fn add_break() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn add_break() {
|
||||
let mut _x = 0;
|
||||
|
||||
@@ -79,9 +79,9 @@ pub fn add_break() {
|
||||
}
|
||||
|
||||
#[cfg(not(any(cfail1,cfail4)))]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, optimized_mir, typeck")]
|
||||
#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, optimized_mir, typeck_root")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, optimized_mir, typeck")]
|
||||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, optimized_mir, typeck_root")]
|
||||
#[rustc_clean(cfg="cfail6")]
|
||||
pub fn add_break() {
|
||||
let mut _x = 0;
|
||||
|
||||
@@ -13,7 +13,7 @@ macro_rules! first_macro {
|
||||
}
|
||||
}
|
||||
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck,optimized_mir", cfg="rpass2")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck_root,optimized_mir", cfg="rpass2")]
|
||||
#[inline(always)]
|
||||
pub fn changed_fn() {
|
||||
// This will cause additional hygiene to be generate,
|
||||
|
||||
@@ -27,7 +27,7 @@ mod mod3 {
|
||||
#[cfg(rpass2)]
|
||||
use Trait2;
|
||||
|
||||
#[rustc_clean(except="typeck", cfg="rpass2")]
|
||||
#[rustc_clean(except="typeck_root", cfg="rpass2")]
|
||||
fn bar() {
|
||||
().method();
|
||||
}
|
||||
|
||||
@@ -31,13 +31,13 @@ mod mod3 {
|
||||
use mod2::Foo;
|
||||
|
||||
#[rustc_clean(cfg="rpass2")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="rpass3")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="rpass3")]
|
||||
fn in_expr() {
|
||||
Foo(0);
|
||||
}
|
||||
|
||||
#[rustc_clean(cfg="rpass2")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck", cfg="rpass3")]
|
||||
#[rustc_clean(except="opt_hir_owner_nodes,typeck_root", cfg="rpass3")]
|
||||
fn in_type() {
|
||||
test::<Foo>();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Regression test for #42602. It used to be that we had
|
||||
// a dep-graph like
|
||||
//
|
||||
// typeck(foo) -> FnOnce -> typeck(bar)
|
||||
// typeck_root(foo) -> FnOnce -> typeck_root(bar)
|
||||
//
|
||||
// This was fixed by improving the resolution of the `FnOnce` trait
|
||||
// selection node.
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
extern crate a;
|
||||
|
||||
#[rustc_clean(except="typeck,optimized_mir", cfg="rpass2")]
|
||||
#[rustc_clean(except="typeck_root,optimized_mir", cfg="rpass2")]
|
||||
#[rustc_clean(cfg="rpass3")]
|
||||
pub fn use_X() -> u32 {
|
||||
let x: a::X = 22;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#![crate_type = "rlib"]
|
||||
|
||||
// Here the only thing which changes is the string constant in `x`.
|
||||
// Therefore, the compiler deduces (correctly) that typeck is not
|
||||
// Therefore, the compiler deduces (correctly) that typeck_root is not
|
||||
// needed even for callers of `x`.
|
||||
|
||||
pub mod x {
|
||||
|
||||
@@ -22,12 +22,12 @@ pub struct Y {
|
||||
pub y: char
|
||||
}
|
||||
|
||||
#[rustc_clean(except="fn_sig,typeck", cfg="rpass2")]
|
||||
#[rustc_clean(except="fn_sig,typeck_root", cfg="rpass2")]
|
||||
pub fn use_X(x: X) -> u32 {
|
||||
x.x as u32
|
||||
}
|
||||
|
||||
#[rustc_clean(except="typeck", cfg="rpass2")]
|
||||
#[rustc_clean(except="typeck_root", cfg="rpass2")]
|
||||
pub fn use_EmbedX(embed: EmbedX) -> u32 {
|
||||
embed.x.x as u32
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ pub struct Y {
|
||||
pub y: char
|
||||
}
|
||||
|
||||
#[rustc_clean(except="typeck", cfg="cfail2")]
|
||||
#[rustc_clean(except="typeck_root", cfg="cfail2")]
|
||||
pub fn use_X() -> u32 {
|
||||
let x: X = X { x: 22 };
|
||||
//[cfail2]~^ ERROR struct `X` has no field named `x`
|
||||
@@ -34,7 +34,7 @@ pub fn use_X() -> u32 {
|
||||
//[cfail2]~^ ERROR no field `x` on type `X`
|
||||
}
|
||||
|
||||
#[rustc_clean(except="typeck", cfg="cfail2")]
|
||||
#[rustc_clean(except="typeck_root", cfg="cfail2")]
|
||||
pub fn use_EmbedX(embed: EmbedX) -> u32 {
|
||||
embed.x.x as u32
|
||||
//[cfail2]~^ ERROR no field `x` on type `X`
|
||||
|
||||
@@ -25,13 +25,13 @@ pub struct Y {
|
||||
pub y: char
|
||||
}
|
||||
|
||||
#[rustc_clean(except="typeck", cfg="rpass2")]
|
||||
#[rustc_clean(except="typeck_root", cfg="rpass2")]
|
||||
pub fn use_X() -> u32 {
|
||||
let x: X = X { x: 22 };
|
||||
x.x as u32
|
||||
}
|
||||
|
||||
#[rustc_clean(except="typeck", cfg="rpass2")]
|
||||
#[rustc_clean(except="typeck_root", cfg="rpass2")]
|
||||
pub fn use_EmbedX(x: EmbedX) -> u32 {
|
||||
let x: X = X { x: 22 };
|
||||
x.x as u32
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
use a::*;
|
||||
|
||||
#[rustc_clean(except="typeck", cfg="rpass2")]
|
||||
#[rustc_clean(except="typeck_root", cfg="rpass2")]
|
||||
pub fn use_X() -> u32 {
|
||||
let x: X = X { x: 22 };
|
||||
x.x as u32
|
||||
}
|
||||
|
||||
#[rustc_clean(except="typeck", cfg="rpass2")]
|
||||
#[rustc_clean(except="typeck_root", cfg="rpass2")]
|
||||
pub fn use_EmbedX(embed: EmbedX) -> u32 {
|
||||
embed.x.x as u32
|
||||
}
|
||||
|
||||
@@ -26,12 +26,12 @@ pub struct Y {
|
||||
pub y: char
|
||||
}
|
||||
|
||||
#[rustc_clean(except="typeck,fn_sig", cfg="rpass2")]
|
||||
#[rustc_clean(except="typeck_root,fn_sig", cfg="rpass2")]
|
||||
pub fn use_X(x: X) -> u32 {
|
||||
x.x as u32
|
||||
}
|
||||
|
||||
#[rustc_clean(except="typeck", cfg="rpass2")]
|
||||
#[rustc_clean(except="typeck_root", cfg="rpass2")]
|
||||
pub fn use_EmbedX(embed: EmbedX) -> u32 {
|
||||
embed.x.x as u32
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
extern crate a;
|
||||
|
||||
#[rustc_clean(except="typeck", cfg="rpass2")]
|
||||
#[rustc_clean(except="typeck_root", cfg="rpass2")]
|
||||
#[rustc_clean(cfg="rpass3")]
|
||||
pub fn use_X() -> u32 {
|
||||
let x: a::X = 22;
|
||||
|
||||
@@ -8,7 +8,7 @@ assert-property: (".item-info", {"scrollWidth": "940"})
|
||||
// Just to be sure we're comparing the correct "item-info":
|
||||
assert-text: (
|
||||
".item-info",
|
||||
"Available on Android or Linux or Emscripten or DragonFly BSD",
|
||||
"Available on Android or Linux or Emscripten or DragonFly BSD or FreeBSD or NetBSD or OpenBSD",
|
||||
STARTS_WITH,
|
||||
)
|
||||
|
||||
@@ -26,6 +26,6 @@ assert-property: (
|
||||
// Just to be sure we're comparing the correct "item-info":
|
||||
assert-text: (
|
||||
"#impl-SimpleTrait-for-LongItemInfo2 .item-info",
|
||||
"Available on Android or Linux or Emscripten or DragonFly BSD",
|
||||
"Available on Android or Linux or Emscripten or DragonFly BSD or FreeBSD or NetBSD or OpenBSD",
|
||||
STARTS_WITH,
|
||||
)
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
#![feature(doc_cfg)]
|
||||
|
||||
//@ has all_targets/fn.foo.html \
|
||||
// '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
|
||||
// 'Available on GNU or Catalyst or mac ABI or MSVC or musl or Newlib or \
|
||||
// Neutrino 7.0 or Neutrino 7.1 or Neutrino 7.1 with io-sock or Neutrino 8.0 or \
|
||||
// OpenHarmony or relibc or SGX or Simulator or WASIp1 or WASIp2 or WASIp3 or \
|
||||
// uClibc or V5 or target_env=fake_env only.'
|
||||
#[doc(cfg(any(
|
||||
target_env = "gnu",
|
||||
target_env = "macabi",
|
||||
target_env = "mlibc",
|
||||
target_env = "msvc",
|
||||
target_env = "musl",
|
||||
target_env = "newlib",
|
||||
target_env = "nto70",
|
||||
target_env = "nto71",
|
||||
target_env = "nto71_iosock",
|
||||
target_env = "nto80",
|
||||
target_env = "ohos",
|
||||
target_env = "relibc",
|
||||
target_env = "sgx",
|
||||
target_env = "sim",
|
||||
target_env = "p1",
|
||||
target_env = "p2",
|
||||
target_env = "p3",
|
||||
target_env = "uclibc",
|
||||
target_env = "v5",
|
||||
target_env = "fake_env",
|
||||
)))]
|
||||
pub fn foo() {}
|
||||
|
||||
//@ has all_targets/fn.bar.html \
|
||||
// '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
|
||||
// 'Available on AArch64 or AMG GPU or ARM or ARM64EC or AVR or BPF or C-SKY or \
|
||||
// Hexagon or LoongArch64 or LoongArch32 or Motorola 680x0 or MIPS or MIPS release \
|
||||
// 6 or MIPS-64 or MIPS-64 release 6 or MSP430 or NVidia GPU or PowerPC or \
|
||||
// PowerPC64 or RISC-V RV32 or RISC-V RV64 or s390x or SPARC or SPARC-64 or SPIR-V \
|
||||
// or WebAssembly or WebAssembly or x86 or x86-64 or Xtensa or \
|
||||
// target_arch=fake_arch only.'
|
||||
#[doc(cfg(any(
|
||||
target_arch = "aarch64",
|
||||
target_arch = "amdgpu",
|
||||
target_arch = "arm",
|
||||
target_arch = "arm64ec",
|
||||
target_arch = "avr",
|
||||
target_arch = "bpf",
|
||||
target_arch = "csky",
|
||||
target_arch = "hexagon",
|
||||
target_arch = "loongarch32",
|
||||
target_arch = "loongarch64",
|
||||
target_arch = "m68k",
|
||||
target_arch = "mips",
|
||||
target_arch = "mips32r6",
|
||||
target_arch = "mips64",
|
||||
target_arch = "mips64r6",
|
||||
target_arch = "msp430",
|
||||
target_arch = "nvptx64",
|
||||
target_arch = "powerpc",
|
||||
target_arch = "powerpc64",
|
||||
target_arch = "riscv32",
|
||||
target_arch = "riscv64",
|
||||
target_arch = "s390x",
|
||||
target_arch = "sparc",
|
||||
target_arch = "sparc64",
|
||||
target_arch = "spirv",
|
||||
target_arch = "wasm32",
|
||||
target_arch = "wasm64",
|
||||
target_arch = "x86",
|
||||
target_arch = "x86_64",
|
||||
target_arch = "xtensa",
|
||||
target_arch = "fake_arch",
|
||||
)))]
|
||||
pub fn bar() {}
|
||||
|
||||
//@ has all_targets/fn.baz.html \
|
||||
// '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
|
||||
// 'Available on AIX and AMD HSA and Android and CUDA and Cygwin and DragonFly \
|
||||
// BSD and Emscripten and ESP-IDF and FreeBSD and Fuchsia and Haiku and HelenOS \
|
||||
// and Hermit and Horizon and GNU/Hurd and illumos and iOS and L4Re and Linux \
|
||||
// and LynxOS-178 and macOS and Managarm and Motor OS and NetBSD and bare-metal \
|
||||
// and QNX Neutrino and NuttX and OpenBSD and Play Station Portable and Play \
|
||||
// Station 1 and QuRT and Redox OS and RTEMS OS and Solaris and SOLID ASP3 and \
|
||||
// TEEOS and Trusty and tvOS and UEFI and VEXos and visionOS and Play Station \
|
||||
// Vita and VxWorks and WASI and watchOS and Windows and Xous and zero knowledge \
|
||||
// Virtual Machine and target_os=unknown and target_os=fake_os only.'
|
||||
#[doc(cfg(all(
|
||||
target_os = "aix",
|
||||
target_os = "amdhsa",
|
||||
target_os = "android",
|
||||
target_os = "cuda",
|
||||
target_os = "cygwin",
|
||||
target_os = "dragonfly",
|
||||
target_os = "emscripten",
|
||||
target_os = "espidf",
|
||||
target_os = "freebsd",
|
||||
target_os = "fuchsia",
|
||||
target_os = "haiku",
|
||||
target_os = "helenos",
|
||||
target_os = "hermit",
|
||||
target_os = "horizon",
|
||||
target_os = "hurd",
|
||||
target_os = "illumos",
|
||||
target_os = "ios",
|
||||
target_os = "l4re",
|
||||
target_os = "linux",
|
||||
target_os = "lynxos178",
|
||||
target_os = "macos",
|
||||
target_os = "managarm",
|
||||
target_os = "motor",
|
||||
target_os = "netbsd",
|
||||
target_os = "none",
|
||||
target_os = "nto",
|
||||
target_os = "nuttx",
|
||||
target_os = "openbsd",
|
||||
target_os = "psp",
|
||||
target_os = "psx",
|
||||
target_os = "qurt",
|
||||
target_os = "redox",
|
||||
target_os = "rtems",
|
||||
target_os = "solaris",
|
||||
target_os = "solid_asp3",
|
||||
target_os = "teeos",
|
||||
target_os = "trusty",
|
||||
target_os = "tvos",
|
||||
target_os = "uefi",
|
||||
target_os = "vexos",
|
||||
target_os = "visionos",
|
||||
target_os = "vita",
|
||||
target_os = "vxworks",
|
||||
target_os = "wasi",
|
||||
target_os = "watchos",
|
||||
target_os = "windows",
|
||||
target_os = "xous",
|
||||
target_os = "zkvm",
|
||||
target_os = "unknown",
|
||||
target_os = "fake_os",
|
||||
)))]
|
||||
pub fn baz() {}
|
||||
@@ -1,67 +1,44 @@
|
||||
//! Diagnostic test for <https://github.com/rust-lang/rust/issues/120327>: suggest borrowing
|
||||
//! variables passed to `dbg!` that are later used.
|
||||
//@ dont-require-annotations: HELP
|
||||
|
||||
fn s() -> String {
|
||||
let a = String::new();
|
||||
dbg!(a);
|
||||
dbg!(a); //~ HELP consider borrowing instead of transferring ownership
|
||||
return a; //~ ERROR use of moved value:
|
||||
}
|
||||
|
||||
fn m() -> String {
|
||||
let a = String::new();
|
||||
dbg!(1, 2, a, 1, 2);
|
||||
dbg!(1, 2, a, 1, 2); //~ HELP consider borrowing instead of transferring ownership
|
||||
return a; //~ ERROR use of moved value:
|
||||
}
|
||||
|
||||
fn t(a: String) -> String {
|
||||
let b: String = "".to_string();
|
||||
dbg!(a, b);
|
||||
dbg!(a, b); //~ HELP consider borrowing instead of transferring ownership
|
||||
return b; //~ ERROR use of moved value:
|
||||
}
|
||||
|
||||
fn x(a: String) -> String {
|
||||
let b: String = "".to_string();
|
||||
dbg!(a, b);
|
||||
dbg!(a, b); //~ HELP consider borrowing instead of transferring ownership
|
||||
return a; //~ ERROR use of moved value:
|
||||
}
|
||||
|
||||
macro_rules! my_dbg {
|
||||
() => {
|
||||
eprintln!("[{}:{}:{}]", file!(), line!(), column!())
|
||||
};
|
||||
($val:expr $(,)?) => {
|
||||
match $val {
|
||||
tmp => {
|
||||
eprintln!("[{}:{}:{}] {} = {:#?}",
|
||||
file!(), line!(), column!(), stringify!($val), &tmp);
|
||||
tmp
|
||||
}
|
||||
}
|
||||
};
|
||||
($($val:expr),+ $(,)?) => {
|
||||
($(my_dbg!($val)),+,)
|
||||
};
|
||||
}
|
||||
|
||||
fn test_my_dbg() -> String {
|
||||
let b: String = "".to_string();
|
||||
my_dbg!(b, 1);
|
||||
return b; //~ ERROR use of moved value:
|
||||
}
|
||||
|
||||
fn test_not_macro() -> String {
|
||||
let a = String::new();
|
||||
let _b = match a {
|
||||
tmp => {
|
||||
eprintln!("dbg: {}", tmp);
|
||||
tmp
|
||||
}
|
||||
};
|
||||
return a; //~ ERROR use of moved value:
|
||||
fn two_of_them(a: String) -> String {
|
||||
dbg!(a, a); //~ ERROR use of moved value
|
||||
//~| HELP consider borrowing instead of transferring ownership
|
||||
//~| HELP consider borrowing instead of transferring ownership
|
||||
return a; //~ ERROR use of moved value
|
||||
}
|
||||
|
||||
fn get_expr(_s: String) {}
|
||||
|
||||
// The suggestion is purely syntactic; applying it here will result in a type error.
|
||||
fn test() {
|
||||
let a: String = "".to_string();
|
||||
let _res = get_expr(dbg!(a));
|
||||
let _res = get_expr(dbg!(a)); //~ HELP consider borrowing instead of transferring ownership
|
||||
let _l = a.len(); //~ ERROR borrow of moved value
|
||||
}
|
||||
|
||||
|
||||
@@ -1,112 +1,133 @@
|
||||
error[E0382]: use of moved value: `a`
|
||||
--> $DIR/dbg-issue-120327.rs:4:12
|
||||
--> $DIR/dbg-issue-120327.rs:8:12
|
||||
|
|
||||
LL | let a = String::new();
|
||||
| - move occurs because `a` has type `String`, which does not implement the `Copy` trait
|
||||
LL | dbg!(a);
|
||||
| ------- value moved here
|
||||
| - value moved here
|
||||
LL | return a;
|
||||
| ^ value used here after move
|
||||
|
|
||||
help: consider cloning the value if the performance cost is acceptable
|
||||
|
|
||||
LL | dbg!(a.clone());
|
||||
| ++++++++
|
||||
help: consider borrowing instead of transferring ownership
|
||||
|
|
||||
LL | dbg!(&a);
|
||||
| +
|
||||
|
||||
error[E0382]: use of moved value: `a`
|
||||
--> $DIR/dbg-issue-120327.rs:10:12
|
||||
--> $DIR/dbg-issue-120327.rs:14:12
|
||||
|
|
||||
LL | let a = String::new();
|
||||
| - move occurs because `a` has type `String`, which does not implement the `Copy` trait
|
||||
LL | dbg!(1, 2, a, 1, 2);
|
||||
| ------------------- value moved here
|
||||
| - value moved here
|
||||
LL | return a;
|
||||
| ^ value used here after move
|
||||
|
|
||||
help: consider cloning the value if the performance cost is acceptable
|
||||
|
|
||||
LL | dbg!(1, 2, a.clone(), 1, 2);
|
||||
| ++++++++
|
||||
help: consider borrowing instead of transferring ownership
|
||||
|
|
||||
LL | dbg!(1, 2, &a, 1, 2);
|
||||
| +
|
||||
|
||||
error[E0382]: use of moved value: `b`
|
||||
--> $DIR/dbg-issue-120327.rs:16:12
|
||||
--> $DIR/dbg-issue-120327.rs:20:12
|
||||
|
|
||||
LL | let b: String = "".to_string();
|
||||
| - move occurs because `b` has type `String`, which does not implement the `Copy` trait
|
||||
LL | dbg!(a, b);
|
||||
| ---------- value moved here
|
||||
| - value moved here
|
||||
LL | return b;
|
||||
| ^ value used here after move
|
||||
|
|
||||
help: consider cloning the value if the performance cost is acceptable
|
||||
|
|
||||
LL | dbg!(a, b.clone());
|
||||
| ++++++++
|
||||
help: consider borrowing instead of transferring ownership
|
||||
|
|
||||
LL | dbg!(a, &b);
|
||||
| +
|
||||
|
||||
error[E0382]: use of moved value: `a`
|
||||
--> $DIR/dbg-issue-120327.rs:22:12
|
||||
--> $DIR/dbg-issue-120327.rs:26:12
|
||||
|
|
||||
LL | fn x(a: String) -> String {
|
||||
| - move occurs because `a` has type `String`, which does not implement the `Copy` trait
|
||||
LL | let b: String = "".to_string();
|
||||
LL | dbg!(a, b);
|
||||
| ---------- value moved here
|
||||
| - value moved here
|
||||
LL | return a;
|
||||
| ^ value used here after move
|
||||
|
|
||||
help: consider cloning the value if the performance cost is acceptable
|
||||
|
|
||||
LL | dbg!(a.clone(), b);
|
||||
| ++++++++
|
||||
help: consider borrowing instead of transferring ownership
|
||||
|
|
||||
LL | dbg!(&a, b);
|
||||
| +
|
||||
|
||||
error[E0382]: use of moved value: `b`
|
||||
--> $DIR/dbg-issue-120327.rs:46:12
|
||||
error[E0382]: use of moved value: `a`
|
||||
--> $DIR/dbg-issue-120327.rs:30:13
|
||||
|
|
||||
LL | tmp => {
|
||||
| --- value moved here
|
||||
...
|
||||
LL | let b: String = "".to_string();
|
||||
| - move occurs because `b` has type `String`, which does not implement the `Copy` trait
|
||||
LL | my_dbg!(b, 1);
|
||||
LL | return b;
|
||||
| ^ value used here after move
|
||||
LL | fn two_of_them(a: String) -> String {
|
||||
| - move occurs because `a` has type `String`, which does not implement the `Copy` trait
|
||||
LL | dbg!(a, a);
|
||||
| - ^ value used here after move
|
||||
| |
|
||||
| value moved here
|
||||
|
|
||||
help: consider cloning the value if the performance cost is acceptable
|
||||
|
|
||||
LL | dbg!(a.clone(), a);
|
||||
| ++++++++
|
||||
help: consider borrowing instead of transferring ownership
|
||||
|
|
||||
LL | my_dbg!(&b, 1);
|
||||
| +
|
||||
help: borrow this binding in the pattern to avoid moving the value
|
||||
|
|
||||
LL | ref tmp => {
|
||||
| +++
|
||||
LL | dbg!(&a, a);
|
||||
| +
|
||||
|
||||
error[E0382]: use of moved value: `a`
|
||||
--> $DIR/dbg-issue-120327.rs:57:12
|
||||
--> $DIR/dbg-issue-120327.rs:33:12
|
||||
|
|
||||
LL | let a = String::new();
|
||||
| - move occurs because `a` has type `String`, which does not implement the `Copy` trait
|
||||
LL | let _b = match a {
|
||||
LL | tmp => {
|
||||
| --- value moved here
|
||||
LL | fn two_of_them(a: String) -> String {
|
||||
| - move occurs because `a` has type `String`, which does not implement the `Copy` trait
|
||||
LL | dbg!(a, a);
|
||||
| - value moved here
|
||||
...
|
||||
LL | return a;
|
||||
| ^ value used here after move
|
||||
|
|
||||
help: borrow this binding in the pattern to avoid moving the value
|
||||
help: consider cloning the value if the performance cost is acceptable
|
||||
|
|
||||
LL | ref tmp => {
|
||||
| +++
|
||||
LL | dbg!(a, a.clone());
|
||||
| ++++++++
|
||||
help: consider borrowing instead of transferring ownership
|
||||
|
|
||||
LL | dbg!(a, &a);
|
||||
| +
|
||||
|
||||
error[E0382]: borrow of moved value: `a`
|
||||
--> $DIR/dbg-issue-120327.rs:65:14
|
||||
--> $DIR/dbg-issue-120327.rs:42:14
|
||||
|
|
||||
LL | let a: String = "".to_string();
|
||||
| - move occurs because `a` has type `String`, which does not implement the `Copy` trait
|
||||
LL | let _res = get_expr(dbg!(a));
|
||||
| ------- value moved here
|
||||
| - value moved here
|
||||
LL | let _l = a.len();
|
||||
| ^ value borrowed here after move
|
||||
|
|
||||
help: consider cloning the value if the performance cost is acceptable
|
||||
|
|
||||
LL | let _res = get_expr(dbg!(a.clone()));
|
||||
| ++++++++
|
||||
help: consider borrowing instead of transferring ownership
|
||||
|
|
||||
LL | let _res = get_expr(dbg!(&a));
|
||||
|
||||
@@ -26,7 +26,7 @@ mod x {
|
||||
mod y {
|
||||
use crate::Foo;
|
||||
|
||||
#[rustc_then_this_would_need(typeck)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(typeck_root)] //~ ERROR OK
|
||||
pub fn use_char_assoc() {
|
||||
// Careful here: in the representation, <char as Foo>::T gets
|
||||
// normalized away, so at a certain point we had no edge to
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
error: OK
|
||||
--> $DIR/dep-graph-assoc-type-codegen.rs:29:34
|
||||
|
|
||||
LL | #[rustc_then_this_would_need(typeck)]
|
||||
| ^^^^^^
|
||||
LL | #[rustc_then_this_would_need(typeck_root)]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ mod y {
|
||||
use crate::x;
|
||||
|
||||
// These dependencies SHOULD exist:
|
||||
#[rustc_then_this_would_need(typeck)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(typeck_root)] //~ ERROR OK
|
||||
pub fn y() {
|
||||
x::x();
|
||||
}
|
||||
@@ -29,7 +29,7 @@ mod z {
|
||||
|
||||
// These are expected to yield errors, because changes to `x`
|
||||
// affect the BODY of `y`, but not its signature.
|
||||
#[rustc_then_this_would_need(typeck)] //~ ERROR no path
|
||||
#[rustc_then_this_would_need(typeck_root)] //~ ERROR no path
|
||||
pub fn z() {
|
||||
y::y();
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
error: OK
|
||||
--> $DIR/dep-graph-caller-callee.rs:21:34
|
||||
|
|
||||
LL | #[rustc_then_this_would_need(typeck)]
|
||||
| ^^^^^^
|
||||
LL | #[rustc_then_this_would_need(typeck_root)]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: no path from `x` to `typeck`
|
||||
error: no path from `x` to `typeck_root`
|
||||
--> $DIR/dep-graph-caller-callee.rs:32:34
|
||||
|
|
||||
LL | #[rustc_then_this_would_need(typeck)]
|
||||
| ^^^^^^
|
||||
LL | #[rustc_then_this_would_need(typeck_root)]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
||||
@@ -34,11 +34,11 @@ trait Bar {
|
||||
}
|
||||
|
||||
#[rustc_then_this_would_need(fn_sig)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(typeck)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(typeck_root)] //~ ERROR OK
|
||||
fn some_fn(x: WillChange) { }
|
||||
|
||||
#[rustc_then_this_would_need(fn_sig)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(typeck)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(typeck_root)] //~ ERROR OK
|
||||
fn new_foo(x: u32, y: u32) -> WillChange {
|
||||
WillChange { x: x, y: y }
|
||||
}
|
||||
@@ -46,14 +46,14 @@ fn new_foo(x: u32, y: u32) -> WillChange {
|
||||
#[rustc_then_this_would_need(type_of)] //~ ERROR OK
|
||||
impl WillChange {
|
||||
#[rustc_then_this_would_need(fn_sig)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(typeck)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(typeck_root)] //~ ERROR OK
|
||||
fn new(x: u32, y: u32) -> WillChange { loop { } }
|
||||
}
|
||||
|
||||
#[rustc_then_this_would_need(type_of)] //~ ERROR OK
|
||||
impl WillChange {
|
||||
#[rustc_then_this_would_need(fn_sig)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(typeck)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(typeck_root)] //~ ERROR OK
|
||||
fn method(&self, x: u32) { }
|
||||
}
|
||||
|
||||
@@ -82,6 +82,6 @@ trait A {
|
||||
fn b(x: WontChange) { }
|
||||
|
||||
#[rustc_then_this_would_need(fn_sig)] //~ ERROR no path from `WillChange`
|
||||
#[rustc_then_this_would_need(typeck)] //~ ERROR no path from `WillChange`
|
||||
#[rustc_then_this_would_need(typeck_root)] //~ ERROR no path from `WillChange`
|
||||
fn c(x: u32) { }
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ LL | #[rustc_then_this_would_need(fn_sig)]
|
||||
error: OK
|
||||
--> $DIR/dep-graph-struct-signature.rs:37:34
|
||||
|
|
||||
LL | #[rustc_then_this_would_need(typeck)]
|
||||
| ^^^^^^
|
||||
LL | #[rustc_then_this_would_need(typeck_root)]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: OK
|
||||
--> $DIR/dep-graph-struct-signature.rs:40:34
|
||||
@@ -37,8 +37,8 @@ LL | #[rustc_then_this_would_need(fn_sig)]
|
||||
error: OK
|
||||
--> $DIR/dep-graph-struct-signature.rs:41:34
|
||||
|
|
||||
LL | #[rustc_then_this_would_need(typeck)]
|
||||
| ^^^^^^
|
||||
LL | #[rustc_then_this_would_need(typeck_root)]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: OK
|
||||
--> $DIR/dep-graph-struct-signature.rs:46:34
|
||||
@@ -88,11 +88,11 @@ error: no path from `WillChange` to `fn_sig`
|
||||
LL | #[rustc_then_this_would_need(fn_sig)]
|
||||
| ^^^^^^
|
||||
|
||||
error: no path from `WillChange` to `typeck`
|
||||
error: no path from `WillChange` to `typeck_root`
|
||||
--> $DIR/dep-graph-struct-signature.rs:85:34
|
||||
|
|
||||
LL | #[rustc_then_this_would_need(typeck)]
|
||||
| ^^^^^^
|
||||
LL | #[rustc_then_this_would_need(typeck_root)]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: OK
|
||||
--> $DIR/dep-graph-struct-signature.rs:32:38
|
||||
@@ -115,8 +115,8 @@ LL | #[rustc_then_this_would_need(fn_sig)]
|
||||
error: OK
|
||||
--> $DIR/dep-graph-struct-signature.rs:49:38
|
||||
|
|
||||
LL | #[rustc_then_this_would_need(typeck)]
|
||||
| ^^^^^^
|
||||
LL | #[rustc_then_this_would_need(typeck_root)]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: OK
|
||||
--> $DIR/dep-graph-struct-signature.rs:55:38
|
||||
@@ -127,8 +127,8 @@ LL | #[rustc_then_this_would_need(fn_sig)]
|
||||
error: OK
|
||||
--> $DIR/dep-graph-struct-signature.rs:56:38
|
||||
|
|
||||
LL | #[rustc_then_this_would_need(typeck)]
|
||||
| ^^^^^^
|
||||
LL | #[rustc_then_this_would_need(typeck_root)]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 22 previous errors
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ impl Bar for char { }
|
||||
mod y {
|
||||
use crate::{Foo, Bar};
|
||||
|
||||
#[rustc_then_this_would_need(typeck)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(typeck_root)] //~ ERROR OK
|
||||
pub fn with_char() {
|
||||
char::method('a');
|
||||
}
|
||||
@@ -39,7 +39,7 @@ pub fn with_char() {
|
||||
mod z {
|
||||
use crate::y;
|
||||
|
||||
#[rustc_then_this_would_need(typeck)] //~ ERROR no path
|
||||
#[rustc_then_this_would_need(typeck_root)] //~ ERROR no path
|
||||
pub fn z() {
|
||||
y::with_char();
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
error: OK
|
||||
--> $DIR/dep-graph-trait-impl-two-traits-same-method.rs:33:34
|
||||
|
|
||||
LL | #[rustc_then_this_would_need(typeck)]
|
||||
| ^^^^^^
|
||||
LL | #[rustc_then_this_would_need(typeck_root)]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: no path from `x::<impl Foo for u32>` to `typeck`
|
||||
error: no path from `x::<impl Foo for u32>` to `typeck_root`
|
||||
--> $DIR/dep-graph-trait-impl-two-traits-same-method.rs:42:34
|
||||
|
|
||||
LL | #[rustc_then_this_would_need(typeck)]
|
||||
| ^^^^^^
|
||||
LL | #[rustc_then_this_would_need(typeck_root)]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ impl Bar for char { }
|
||||
mod y {
|
||||
use crate::{Foo, Bar};
|
||||
|
||||
#[rustc_then_this_would_need(typeck)] //~ ERROR no path
|
||||
#[rustc_then_this_would_need(typeck_root)] //~ ERROR no path
|
||||
pub fn call_bar() {
|
||||
char::bar('a');
|
||||
}
|
||||
@@ -38,7 +38,7 @@ pub fn call_bar() {
|
||||
mod z {
|
||||
use crate::y;
|
||||
|
||||
#[rustc_then_this_would_need(typeck)] //~ ERROR no path
|
||||
#[rustc_then_this_would_need(typeck_root)] //~ ERROR no path
|
||||
pub fn z() {
|
||||
y::call_bar();
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
error: no path from `x::<impl Foo for char>` to `typeck`
|
||||
error: no path from `x::<impl Foo for char>` to `typeck_root`
|
||||
--> $DIR/dep-graph-trait-impl-two-traits.rs:32:34
|
||||
|
|
||||
LL | #[rustc_then_this_would_need(typeck)]
|
||||
| ^^^^^^
|
||||
LL | #[rustc_then_this_would_need(typeck_root)]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: no path from `x::<impl Foo for char>` to `typeck`
|
||||
error: no path from `x::<impl Foo for char>` to `typeck_root`
|
||||
--> $DIR/dep-graph-trait-impl-two-traits.rs:41:34
|
||||
|
|
||||
LL | #[rustc_then_this_would_need(typeck)]
|
||||
| ^^^^^^
|
||||
LL | #[rustc_then_this_would_need(typeck_root)]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
||||
@@ -25,22 +25,22 @@ impl Foo for u32 { }
|
||||
mod y {
|
||||
use crate::Foo;
|
||||
|
||||
#[rustc_then_this_would_need(typeck)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(typeck_root)] //~ ERROR OK
|
||||
pub fn with_char() {
|
||||
char::method('a');
|
||||
}
|
||||
|
||||
#[rustc_then_this_would_need(typeck)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(typeck_root)] //~ ERROR OK
|
||||
pub fn take_foo_with_char() {
|
||||
take_foo::<char>('a');
|
||||
}
|
||||
|
||||
#[rustc_then_this_would_need(typeck)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(typeck_root)] //~ ERROR OK
|
||||
pub fn with_u32() {
|
||||
u32::method(22);
|
||||
}
|
||||
|
||||
#[rustc_then_this_would_need(typeck)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(typeck_root)] //~ ERROR OK
|
||||
pub fn take_foo_with_u32() {
|
||||
take_foo::<u32>(22);
|
||||
}
|
||||
@@ -53,7 +53,7 @@ mod z {
|
||||
|
||||
// These are expected to yield errors, because changes to `x`
|
||||
// affect the BODY of `y`, but not its signature.
|
||||
#[rustc_then_this_would_need(typeck)] //~ ERROR no path
|
||||
#[rustc_then_this_would_need(typeck_root)] //~ ERROR no path
|
||||
pub fn z() {
|
||||
y::with_char();
|
||||
y::with_u32();
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
error: OK
|
||||
--> $DIR/dep-graph-trait-impl.rs:28:34
|
||||
|
|
||||
LL | #[rustc_then_this_would_need(typeck)]
|
||||
| ^^^^^^
|
||||
LL | #[rustc_then_this_would_need(typeck_root)]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: OK
|
||||
--> $DIR/dep-graph-trait-impl.rs:33:34
|
||||
|
|
||||
LL | #[rustc_then_this_would_need(typeck)]
|
||||
| ^^^^^^
|
||||
LL | #[rustc_then_this_would_need(typeck_root)]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: OK
|
||||
--> $DIR/dep-graph-trait-impl.rs:38:34
|
||||
|
|
||||
LL | #[rustc_then_this_would_need(typeck)]
|
||||
| ^^^^^^
|
||||
LL | #[rustc_then_this_would_need(typeck_root)]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: OK
|
||||
--> $DIR/dep-graph-trait-impl.rs:43:34
|
||||
|
|
||||
LL | #[rustc_then_this_would_need(typeck)]
|
||||
| ^^^^^^
|
||||
LL | #[rustc_then_this_would_need(typeck_root)]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: no path from `x::<impl Foo for char>` to `typeck`
|
||||
error: no path from `x::<impl Foo for char>` to `typeck_root`
|
||||
--> $DIR/dep-graph-trait-impl.rs:56:34
|
||||
|
|
||||
LL | #[rustc_then_this_would_need(typeck)]
|
||||
| ^^^^^^
|
||||
LL | #[rustc_then_this_would_need(typeck_root)]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ trait Trait {
|
||||
#[rustc_then_this_would_need(type_of)] //~ ERROR no path
|
||||
impl SomeType {
|
||||
#[rustc_then_this_would_need(fn_sig)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(typeck)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(typeck_root)] //~ ERROR OK
|
||||
fn method(&self, _: TypeAlias) {}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ fn method(&self, _: TypeAlias) {}
|
||||
type TypeAlias2 = TypeAlias;
|
||||
|
||||
#[rustc_then_this_would_need(fn_sig)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(typeck)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(typeck_root)] //~ ERROR OK
|
||||
fn function(_: TypeAlias) {
|
||||
|
||||
}
|
||||
|
||||
@@ -49,8 +49,8 @@ LL | #[rustc_then_this_would_need(fn_sig)]
|
||||
error: OK
|
||||
--> $DIR/dep-graph-type-alias.rs:53:30
|
||||
|
|
||||
LL | #[rustc_then_this_would_need(typeck)]
|
||||
| ^^^^^^
|
||||
LL | #[rustc_then_this_would_need(typeck_root)]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: OK
|
||||
--> $DIR/dep-graph-type-alias.rs:36:34
|
||||
@@ -67,8 +67,8 @@ LL | #[rustc_then_this_would_need(fn_sig)]
|
||||
error: OK
|
||||
--> $DIR/dep-graph-type-alias.rs:45:34
|
||||
|
|
||||
LL | #[rustc_then_this_would_need(typeck)]
|
||||
| ^^^^^^
|
||||
LL | #[rustc_then_this_would_need(typeck_root)]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 12 previous errors
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ pub fn g<T: Default>(mut v: T) {
|
||||
}
|
||||
|
||||
pub fn h<T: Copy + Default + std::fmt::Debug>() {
|
||||
let mut z = T::default();
|
||||
let mut z = T::default(); //~ WARN unused variable: `z`
|
||||
let _ = move |b| {
|
||||
loop {
|
||||
if b {
|
||||
|
||||
@@ -156,6 +156,14 @@ LL | z = T::default();
|
||||
|
|
||||
= help: maybe it is overwritten before being read?
|
||||
|
||||
warning: unused variable: `z`
|
||||
--> $DIR/liveness-upvars.rs:101:9
|
||||
|
|
||||
LL | let mut z = T::default();
|
||||
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_z`
|
||||
|
|
||||
= note: `#[warn(unused_variables)]` implied by `#[warn(unused)]`
|
||||
|
||||
warning: value captured by `state` is never read
|
||||
--> $DIR/liveness-upvars.rs:131:9
|
||||
|
|
||||
@@ -196,5 +204,5 @@ LL | s = yield ();
|
||||
|
|
||||
= help: maybe it is overwritten before being read?
|
||||
|
||||
warning: 24 warnings emitted
|
||||
warning: 25 warnings emitted
|
||||
|
||||
|
||||
@@ -1,13 +1,21 @@
|
||||
error[E0382]: use of moved value: `a`
|
||||
--> $DIR/dbg-macro-move-semantics.rs:9:13
|
||||
--> $DIR/dbg-macro-move-semantics.rs:9:18
|
||||
|
|
||||
LL | let a = NoCopy(0);
|
||||
| - move occurs because `a` has type `NoCopy`, which does not implement the `Copy` trait
|
||||
LL | let _ = dbg!(a);
|
||||
| ------- value moved here
|
||||
| - value moved here
|
||||
LL | let _ = dbg!(a);
|
||||
| ^^^^^^^ value used here after move
|
||||
| ^ value used here after move
|
||||
|
|
||||
note: if `NoCopy` implemented `Clone`, you could clone the value
|
||||
--> $DIR/dbg-macro-move-semantics.rs:4:1
|
||||
|
|
||||
LL | struct NoCopy(usize);
|
||||
| ^^^^^^^^^^^^^ consider implementing `Clone` for this type
|
||||
...
|
||||
LL | let _ = dbg!(a);
|
||||
| - you could clone this value
|
||||
help: consider borrowing instead of transferring ownership
|
||||
|
|
||||
LL | let _ = dbg!(&a);
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
//@ run-rustfix
|
||||
#![allow(dead_code)]
|
||||
|
||||
fn main() {
|
||||
struct Error;
|
||||
|
||||
const ERROR: Error = Error;
|
||||
//~^ ERROR missing type for `const` item
|
||||
//~| HELP provide a type for the constant
|
||||
//~| SUGGESTION : Error
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
//@ run-rustfix
|
||||
#![allow(dead_code)]
|
||||
|
||||
fn main() {
|
||||
struct Error;
|
||||
|
||||
const ERROR = Error;
|
||||
//~^ ERROR missing type for `const` item
|
||||
//~| HELP provide a type for the constant
|
||||
//~| SUGGESTION : Error
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
error: missing type for `const` item
|
||||
--> $DIR/function-local-item-type-suggestion-issue-146786.rs:7:16
|
||||
|
|
||||
LL | const ERROR = Error;
|
||||
| ^ help: provide a type for the constant: `: Error`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
@@ -40,7 +40,7 @@ note: rustc $VERSION running on $TARGET
|
||||
note: compiler flags: ... -Z ui-testing ... -Z track-diagnostics
|
||||
|
||||
query stack during panic:
|
||||
#0 [typeck] type-checking `main`
|
||||
#0 [typeck_root] type-checking `main`
|
||||
#1 [analysis] running analysis passes on crate `track`
|
||||
end of query stack
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
//! Ensure a self-referencing lazy type alias with `min_generic_const_args`
|
||||
//! doesn't ICE during normalization.
|
||||
//!
|
||||
//! Regression test for <https://github.com/rust-lang/rust/issues/152633>.
|
||||
|
||||
#![feature(lazy_type_alias)]
|
||||
#![feature(min_generic_const_args)]
|
||||
|
||||
trait Trait {
|
||||
type const ASSOC: ();
|
||||
}
|
||||
type Arr2 = [usize; <Arr2 as Trait>::ASSOC]; //~ ERROR E0275
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,11 @@
|
||||
error[E0275]: overflow normalizing the type alias `Arr2`
|
||||
--> $DIR/recursive-lazy-type-alias-ice-152633.rs:12:1
|
||||
|
|
||||
LL | type Arr2 = [usize; <Arr2 as Trait>::ASSOC];
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: in case this is a recursive type alias, consider using a struct, enum, or union instead
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0275`.
|
||||
Reference in New Issue
Block a user