Auto merge of #98440 - ehuss:update-beta-cargo, r=ehuss
[beta] Beta backports * Remove the unused-#[doc(hidden)] logic from the unused_attributes lint #98336 * debuginfo: Fix NatVis for Rc and Arc with unsized pointees. #98137 * Revert "remove num_cpus dependency" in rustc and update cargo #97911 * Update LLVM submodule #97690 * Revert #96682. #97636 * don't do Sized and other return type checks on RPIT's real type #97431 * Temporarily disable submodule archive downloads. #98423
This commit is contained in:
commit
d8ffc1fe6b
38 changed files with 337 additions and 419 deletions
|
|
@ -218,6 +218,7 @@ dependencies = [
|
|||
"getopts",
|
||||
"ignore",
|
||||
"libc",
|
||||
"num_cpus",
|
||||
"once_cell",
|
||||
"opener",
|
||||
"pretty_assertions",
|
||||
|
|
@ -247,6 +248,7 @@ dependencies = [
|
|||
"anyhow",
|
||||
"flate2",
|
||||
"hex 0.4.2",
|
||||
"num_cpus",
|
||||
"rayon",
|
||||
"serde",
|
||||
"serde_json",
|
||||
|
|
@ -346,6 +348,7 @@ dependencies = [
|
|||
"libgit2-sys",
|
||||
"log",
|
||||
"memchr",
|
||||
"num_cpus",
|
||||
"opener",
|
||||
"openssl",
|
||||
"os_info",
|
||||
|
|
@ -4338,6 +4341,7 @@ name = "rustc_session"
|
|||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"getopts",
|
||||
"num_cpus",
|
||||
"rustc_ast",
|
||||
"rustc_data_structures",
|
||||
"rustc_errors",
|
||||
|
|
|
|||
|
|
@ -50,12 +50,11 @@ pub enum Delimiter {
|
|||
Brace,
|
||||
/// `[ ... ]`
|
||||
Bracket,
|
||||
/// `/*«*/ ... /*»*/`
|
||||
/// `Ø ... Ø`
|
||||
/// An invisible delimiter, that may, for example, appear around tokens coming from a
|
||||
/// "macro variable" `$var`. It is important to preserve operator priorities in cases like
|
||||
/// `$var * 3` where `$var` is `1 + 2`.
|
||||
/// Invisible delimiters are not directly writable in normal Rust code except as comments.
|
||||
/// Therefore, they might not survive a roundtrip of a token stream through a string.
|
||||
/// Invisible delimiters might not survive roundtrip of a token stream through a string.
|
||||
Invisible,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -590,29 +590,15 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
|
|||
self.nbsp();
|
||||
}
|
||||
self.word("{");
|
||||
let empty = tts.is_empty();
|
||||
if !empty {
|
||||
if !tts.is_empty() {
|
||||
self.space();
|
||||
}
|
||||
self.ibox(0);
|
||||
self.print_tts(tts, convert_dollar_crate);
|
||||
self.end();
|
||||
let empty = tts.is_empty();
|
||||
self.bclose(span, empty);
|
||||
}
|
||||
Some(Delimiter::Invisible) => {
|
||||
self.word("/*«*/");
|
||||
let empty = tts.is_empty();
|
||||
if !empty {
|
||||
self.space();
|
||||
}
|
||||
self.ibox(0);
|
||||
self.print_tts(tts, convert_dollar_crate);
|
||||
self.end();
|
||||
if !empty {
|
||||
self.space();
|
||||
}
|
||||
self.word("/*»*/");
|
||||
}
|
||||
Some(delim) => {
|
||||
let token_str = self.token_kind_to_string(&token::OpenDelim(delim));
|
||||
self.word(token_str);
|
||||
|
|
@ -786,8 +772,9 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
|
|||
token::CloseDelim(Delimiter::Bracket) => "]".into(),
|
||||
token::OpenDelim(Delimiter::Brace) => "{".into(),
|
||||
token::CloseDelim(Delimiter::Brace) => "}".into(),
|
||||
token::OpenDelim(Delimiter::Invisible) => "/*«*/".into(),
|
||||
token::CloseDelim(Delimiter::Invisible) => "/*»*/".into(),
|
||||
token::OpenDelim(Delimiter::Invisible) | token::CloseDelim(Delimiter::Invisible) => {
|
||||
"".into()
|
||||
}
|
||||
token::Pound => "#".into(),
|
||||
token::Dollar => "$".into(),
|
||||
token::Question => "?".into(),
|
||||
|
|
|
|||
|
|
@ -4,8 +4,7 @@
|
|||
//! conflicts between multiple such attributes attached to the same
|
||||
//! item.
|
||||
|
||||
use rustc_ast::tokenstream::DelimSpan;
|
||||
use rustc_ast::{ast, AttrStyle, Attribute, Lit, LitKind, MacArgs, MetaItemKind, NestedMetaItem};
|
||||
use rustc_ast::{ast, AttrStyle, Attribute, Lit, LitKind, MetaItemKind, NestedMetaItem};
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_errors::{pluralize, struct_span_err, Applicability, MultiSpan};
|
||||
use rustc_feature::{AttributeDuplicates, AttributeType, BuiltinAttribute, BUILTIN_ATTRIBUTE_MAP};
|
||||
|
|
@ -815,68 +814,6 @@ impl CheckAttrVisitor<'_> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Checks `#[doc(hidden)]` attributes. Returns `true` if valid.
|
||||
fn check_doc_hidden(
|
||||
&self,
|
||||
attr: &Attribute,
|
||||
meta_index: usize,
|
||||
meta: &NestedMetaItem,
|
||||
hir_id: HirId,
|
||||
target: Target,
|
||||
) -> bool {
|
||||
if let Target::AssocConst
|
||||
| Target::AssocTy
|
||||
| Target::Method(MethodKind::Trait { body: true }) = target
|
||||
{
|
||||
let parent_hir_id = self.tcx.hir().get_parent_item(hir_id);
|
||||
let containing_item = self.tcx.hir().expect_item(parent_hir_id);
|
||||
|
||||
if Target::from_item(containing_item) == Target::Impl {
|
||||
let meta_items = attr.meta_item_list().unwrap();
|
||||
|
||||
let (span, replacement_span) = if meta_items.len() == 1 {
|
||||
(attr.span, attr.span)
|
||||
} else {
|
||||
let meta_span = meta.span();
|
||||
(
|
||||
meta_span,
|
||||
meta_span.until(match meta_items.get(meta_index + 1) {
|
||||
Some(next_item) => next_item.span(),
|
||||
None => match attr.get_normal_item().args {
|
||||
MacArgs::Delimited(DelimSpan { close, .. }, ..) => close,
|
||||
_ => unreachable!(),
|
||||
},
|
||||
}),
|
||||
)
|
||||
};
|
||||
|
||||
// FIXME: #[doc(hidden)] was previously erroneously allowed on trait impl items,
|
||||
// so for backward compatibility only emit a warning and do not mark it as invalid.
|
||||
self.tcx.struct_span_lint_hir(UNUSED_ATTRIBUTES, hir_id, span, |lint| {
|
||||
lint.build("`#[doc(hidden)]` is ignored on trait impl items")
|
||||
.warn(
|
||||
"this was previously accepted by the compiler but is \
|
||||
being phased out; it will become a hard error in \
|
||||
a future release!",
|
||||
)
|
||||
.note(
|
||||
"whether the impl item is `doc(hidden)` or not \
|
||||
entirely depends on the corresponding trait item",
|
||||
)
|
||||
.span_suggestion(
|
||||
replacement_span,
|
||||
"remove this attribute",
|
||||
String::new(),
|
||||
Applicability::MachineApplicable,
|
||||
)
|
||||
.emit();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
true
|
||||
}
|
||||
|
||||
/// Checks that an attribute is *not* used at the crate level. Returns `true` if valid.
|
||||
fn check_attr_not_crate_level(
|
||||
&self,
|
||||
|
|
@ -995,7 +932,7 @@ impl CheckAttrVisitor<'_> {
|
|||
let mut is_valid = true;
|
||||
|
||||
if let Some(mi) = attr.meta() && let Some(list) = mi.meta_item_list() {
|
||||
for (meta_index, meta) in list.into_iter().enumerate() {
|
||||
for meta in list {
|
||||
if let Some(i_meta) = meta.meta_item() {
|
||||
match i_meta.name_or_empty() {
|
||||
sym::alias
|
||||
|
|
@ -1036,15 +973,6 @@ impl CheckAttrVisitor<'_> {
|
|||
is_valid = false;
|
||||
}
|
||||
|
||||
sym::hidden if !self.check_doc_hidden(attr,
|
||||
meta_index,
|
||||
meta,
|
||||
hir_id,
|
||||
target,
|
||||
) => {
|
||||
is_valid = false;
|
||||
}
|
||||
|
||||
// no_default_passes: deprecated
|
||||
// passes: deprecated
|
||||
// plugins: removed, but rustdoc warns about it itself
|
||||
|
|
|
|||
|
|
@ -15,5 +15,6 @@ rustc_serialize = { path = "../rustc_serialize" }
|
|||
rustc_data_structures = { path = "../rustc_data_structures" }
|
||||
rustc_span = { path = "../rustc_span" }
|
||||
rustc_fs_util = { path = "../rustc_fs_util" }
|
||||
num_cpus = "1.0"
|
||||
rustc_ast = { path = "../rustc_ast" }
|
||||
rustc_lint_defs = { path = "../rustc_lint_defs" }
|
||||
|
|
|
|||
|
|
@ -578,7 +578,7 @@ mod parse {
|
|||
crate fn parse_threads(slot: &mut usize, v: Option<&str>) -> bool {
|
||||
match v.and_then(|s| s.parse().ok()) {
|
||||
Some(0) => {
|
||||
*slot = std::thread::available_parallelism().map_or(1, std::num::NonZeroUsize::get);
|
||||
*slot = ::num_cpus::get();
|
||||
true
|
||||
}
|
||||
Some(i) => {
|
||||
|
|
|
|||
|
|
@ -103,12 +103,6 @@ pub(super) fn check_fn<'a, 'tcx>(
|
|||
DUMMY_SP,
|
||||
param_env,
|
||||
));
|
||||
// HACK(oli-obk): we rewrite the declared return type, too, so that we don't end up inferring all
|
||||
// unconstrained RPIT to have `()` as their hidden type. This would happen because further down we
|
||||
// compare the ret_coercion with declared_ret_ty, and anything uninferred would be inferred to the
|
||||
// opaque type itself. That again would cause writeback to assume we have a recursive call site
|
||||
// and do the sadly stabilized fallback to `()`.
|
||||
let declared_ret_ty = ret_ty;
|
||||
fcx.ret_coercion = Some(RefCell::new(CoerceMany::new(ret_ty)));
|
||||
fcx.ret_type_span = Some(decl.output.span());
|
||||
|
||||
|
|
@ -252,7 +246,12 @@ pub(super) fn check_fn<'a, 'tcx>(
|
|||
fcx.next_ty_var(TypeVariableOrigin { kind: TypeVariableOriginKind::DynReturnFn, span });
|
||||
debug!("actual_return_ty replaced with {:?}", actual_return_ty);
|
||||
}
|
||||
fcx.demand_suptype(span, declared_ret_ty, actual_return_ty);
|
||||
|
||||
// HACK(oli-obk, compiler-errors): We should be comparing this against
|
||||
// `declared_ret_ty`, but then anything uninferred would be inferred to
|
||||
// the opaque type itself. That again would cause writeback to assume
|
||||
// we have a recursive call site and do the sadly stabilized fallback to `()`.
|
||||
fcx.demand_suptype(span, ret_ty, actual_return_ty);
|
||||
|
||||
// Check that a function marked as `#[panic_handler]` has signature `fn(&PanicInfo) -> !`
|
||||
if let Some(panic_impl_did) = tcx.lang_items().panic_impl()
|
||||
|
|
|
|||
|
|
@ -703,12 +703,11 @@ pub enum Delimiter {
|
|||
/// `[ ... ]`
|
||||
#[stable(feature = "proc_macro_lib2", since = "1.29.0")]
|
||||
Bracket,
|
||||
/// `/*«*/ ... /*»*/`
|
||||
/// `Ø ... Ø`
|
||||
/// An invisible delimiter, that may, for example, appear around tokens coming from a
|
||||
/// "macro variable" `$var`. It is important to preserve operator priorities in cases like
|
||||
/// `$var * 3` where `$var` is `1 + 2`.
|
||||
/// Invisible delimiters are not directly writable in normal Rust code except as comments.
|
||||
/// Therefore, they might not survive a roundtrip of a token stream through a string.
|
||||
/// Invisible delimiters might not survive roundtrip of a token stream through a string.
|
||||
#[stable(feature = "proc_macro_lib2", since = "1.29.0")]
|
||||
None,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ test = false
|
|||
[dependencies]
|
||||
cmake = "0.1.38"
|
||||
filetime = "0.2"
|
||||
num_cpus = "1.0"
|
||||
getopts = "0.2.19"
|
||||
cc = "1.0.69"
|
||||
libc = "0.2"
|
||||
|
|
|
|||
|
|
@ -1345,7 +1345,7 @@ fn set<T>(field: &mut T, val: Option<T>) {
|
|||
|
||||
fn threads_from_config(v: u32) -> u32 {
|
||||
match v {
|
||||
0 => std::thread::available_parallelism().map_or(1, std::num::NonZeroUsize::get) as u32,
|
||||
0 => num_cpus::get() as u32,
|
||||
n => n,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`",
|
|||
let j_msg = format!(
|
||||
"number of jobs to run in parallel; \
|
||||
defaults to {} (this host's logical CPU count)",
|
||||
std::thread::available_parallelism().map_or(1, std::num::NonZeroUsize::get)
|
||||
num_cpus::get()
|
||||
);
|
||||
opts.optopt("j", "jobs", &j_msg, "JOBS");
|
||||
opts.optflag("h", "help", "print this help message");
|
||||
|
|
|
|||
|
|
@ -993,9 +993,7 @@ impl Build {
|
|||
/// Returns the number of parallel jobs that have been configured for this
|
||||
/// build.
|
||||
fn jobs(&self) -> u32 {
|
||||
self.config.jobs.unwrap_or_else(|| {
|
||||
std::thread::available_parallelism().map_or(1, std::num::NonZeroUsize::get) as u32
|
||||
})
|
||||
self.config.jobs.unwrap_or_else(|| num_cpus::get() as u32)
|
||||
}
|
||||
|
||||
fn debuginfo_map_to(&self, which: GitRepo) -> Option<String> {
|
||||
|
|
|
|||
|
|
@ -52,7 +52,10 @@ function fetch_github_commit_archive {
|
|||
rm $cached
|
||||
}
|
||||
|
||||
included="src/llvm-project src/doc/book src/doc/rust-by-example"
|
||||
# Archive downloads are temporarily disabled due to sudden 504
|
||||
# gateway timeout errors.
|
||||
# included="src/llvm-project src/doc/book src/doc/rust-by-example"
|
||||
included=""
|
||||
modules="$(git config --file .gitmodules --get-regexp '\.path$' | cut -d' ' -f2)"
|
||||
modules=($modules)
|
||||
use_git=""
|
||||
|
|
@ -75,10 +78,10 @@ for i in ${!modules[@]}; do
|
|||
done
|
||||
retry sh -c "git submodule deinit -f $use_git && \
|
||||
git submodule sync && \
|
||||
git submodule update -j 16 --init --recursive $use_git"
|
||||
STATUS=0
|
||||
for pid in ${bg_pids[*]}
|
||||
do
|
||||
wait $pid || STATUS=1
|
||||
done
|
||||
exit ${STATUS}
|
||||
git submodule update -j 16 --init --recursive --depth 1 $use_git"
|
||||
# STATUS=0
|
||||
# for pid in ${bg_pids[*]}
|
||||
# do
|
||||
# wait $pid || STATUS=1
|
||||
# done
|
||||
# exit ${STATUS}
|
||||
|
|
|
|||
|
|
@ -59,39 +59,133 @@
|
|||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!--
|
||||
The display string for Rc, Arc, etc is optional because the expression cannot be evaluated
|
||||
if the pointee is unsized (i.e. if `ptr.pointer` is a fat pointer).
|
||||
|
||||
There are also two versions for the reference count fields, one for sized and one for
|
||||
dyn pointees.
|
||||
|
||||
Rc<[T]> and Arc<[T]> are handled separately altogether so we can actually show
|
||||
the slice values.
|
||||
-->
|
||||
<!-- alloc::rc::Rc<T> -->
|
||||
<Type Name="alloc::rc::Rc<*>">
|
||||
<DisplayString>{ptr.pointer->value}</DisplayString>
|
||||
<DisplayString Optional="true">{ptr.pointer->value}</DisplayString>
|
||||
<Expand>
|
||||
<ExpandedItem>ptr.pointer->value</ExpandedItem>
|
||||
<Item Name="[Reference count]">ptr.pointer->strong</Item>
|
||||
<Item Name="[Weak reference count]">ptr.pointer->weak</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
<Type Name="alloc::rc::Weak<*>">
|
||||
<DisplayString>{ptr.pointer->value}</DisplayString>
|
||||
<Expand>
|
||||
<ExpandedItem>ptr.pointer->value</ExpandedItem>
|
||||
<Item Name="[Reference count]">ptr.pointer->strong</Item>
|
||||
<Item Name="[Weak reference count]">ptr.pointer->weak</Item>
|
||||
<!-- thin -->
|
||||
<ExpandedItem Optional="true">ptr.pointer->value</ExpandedItem>
|
||||
<Item Name="[Reference count]" Optional="true">ptr.pointer->strong</Item>
|
||||
<Item Name="[Weak reference count]" Optional="true">ptr.pointer->weak</Item>
|
||||
|
||||
<!-- dyn -->
|
||||
<Item Name="[Reference count]" Optional="true">ptr.pointer.pointer->strong</Item>
|
||||
<Item Name="[Weak reference count]" Optional="true">ptr.pointer.pointer->weak</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- alloc::rc::Rc<[T]> -->
|
||||
<Type Name="alloc::rc::Rc<slice$<*> >">
|
||||
<DisplayString>{{ len={ptr.pointer.length} }}</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[Length]" ExcludeView="simple">ptr.pointer.length</Item>
|
||||
<Item Name="[Reference count]">ptr.pointer.data_ptr->strong</Item>
|
||||
<Item Name="[Weak reference count]">ptr.pointer.data_ptr->weak</Item>
|
||||
<ArrayItems>
|
||||
<Size>ptr.pointer.length</Size>
|
||||
<!-- We add +2 to the data_ptr in order to skip the ref count fields in the RcBox -->
|
||||
<ValuePointer>($T1*)(((size_t*)ptr.pointer.data_ptr) + 2)</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- alloc::rc::Weak<T> -->
|
||||
<Type Name="alloc::rc::Weak<*>">
|
||||
<DisplayString Optional="true">{ptr.pointer->value}</DisplayString>
|
||||
<Expand>
|
||||
<!-- thin -->
|
||||
<ExpandedItem Optional="true">ptr.pointer->value</ExpandedItem>
|
||||
<Item Name="[Reference count]" Optional="true">ptr.pointer->strong</Item>
|
||||
<Item Name="[Weak reference count]" Optional="true">ptr.pointer->weak</Item>
|
||||
|
||||
<!-- dyn -->
|
||||
<Item Name="[Reference count]" Optional="true">ptr.pointer.pointer->strong</Item>
|
||||
<Item Name="[Weak reference count]" Optional="true">ptr.pointer.pointer->weak</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- alloc::rc::Weak<[T]> -->
|
||||
<Type Name="alloc::rc::Weak<slice$<*> >">
|
||||
<DisplayString>{{ len={ptr.pointer.length} }}</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[Length]" ExcludeView="simple">ptr.pointer.length</Item>
|
||||
<Item Name="[Reference count]">ptr.pointer.data_ptr->strong</Item>
|
||||
<Item Name="[Weak reference count]">ptr.pointer.data_ptr->weak</Item>
|
||||
<ArrayItems>
|
||||
<Size>ptr.pointer.length</Size>
|
||||
<ValuePointer>($T1*)(((size_t*)ptr.pointer.data_ptr) + 2)</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- alloc::sync::Arc<T> -->
|
||||
<Type Name="alloc::sync::Arc<*>">
|
||||
<DisplayString>{ptr.pointer->data}</DisplayString>
|
||||
<DisplayString Optional="true">{ptr.pointer->data}</DisplayString>
|
||||
<Expand>
|
||||
<ExpandedItem>ptr.pointer->data</ExpandedItem>
|
||||
<Item Name="[Reference count]">ptr.pointer->strong</Item>
|
||||
<Item Name="[Weak reference count]">ptr.pointer->weak</Item>
|
||||
<!-- thin -->
|
||||
<ExpandedItem Optional="true">ptr.pointer->data</ExpandedItem>
|
||||
<Item Name="[Reference count]" Optional="true">ptr.pointer->strong</Item>
|
||||
<Item Name="[Weak reference count]" Optional="true">ptr.pointer->weak</Item>
|
||||
|
||||
<!-- dyn -->
|
||||
<Item Name="[Reference count]" Optional="true">ptr.pointer.pointer->strong</Item>
|
||||
<Item Name="[Weak reference count]" Optional="true">ptr.pointer.pointer->weak</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- alloc::sync::Arc<[T]> -->
|
||||
<Type Name="alloc::sync::Arc<slice$<*> >">
|
||||
<DisplayString>{{ len={ptr.pointer.length} }}</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[Length]" ExcludeView="simple">ptr.pointer.length</Item>
|
||||
<Item Name="[Reference count]">ptr.pointer.data_ptr->strong</Item>
|
||||
<Item Name="[Weak reference count]">ptr.pointer.data_ptr->weak</Item>
|
||||
<ArrayItems>
|
||||
<Size>ptr.pointer.length</Size>
|
||||
<ValuePointer>($T1*)(((size_t*)ptr.pointer.data_ptr) + 2)</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- alloc::sync::Weak<T> -->
|
||||
<Type Name="alloc::sync::Weak<*>">
|
||||
<DisplayString>{ptr.pointer->data}</DisplayString>
|
||||
<DisplayString Optional="true">{ptr.pointer->data}</DisplayString>
|
||||
<Expand>
|
||||
<ExpandedItem>ptr.pointer->data</ExpandedItem>
|
||||
<Item Name="[Reference count]">ptr.pointer->strong</Item>
|
||||
<Item Name="[Weak reference count]">ptr.pointer->weak</Item>
|
||||
<!-- thin -->
|
||||
<ExpandedItem Optional="true">ptr.pointer->data</ExpandedItem>
|
||||
<Item Name="[Reference count]" Optional="true">ptr.pointer->strong</Item>
|
||||
<Item Name="[Weak reference count]" Optional="true">ptr.pointer->weak</Item>
|
||||
|
||||
<!-- dyn -->
|
||||
<Item Name="[Reference count]" Optional="true">ptr.pointer.pointer->strong</Item>
|
||||
<Item Name="[Weak reference count]" Optional="true">ptr.pointer.pointer->weak</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<!-- alloc::sync::Weak<[T]> -->
|
||||
<Type Name="alloc::sync::Weak<slice$<*> >">
|
||||
<DisplayString>{{ len={ptr.pointer.length} }}</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[Length]" ExcludeView="simple">ptr.pointer.length</Item>
|
||||
<Item Name="[Reference count]">ptr.pointer.data_ptr->strong</Item>
|
||||
<Item Name="[Weak reference count]">ptr.pointer.data_ptr->weak</Item>
|
||||
<ArrayItems>
|
||||
<Size>ptr.pointer.length</Size>
|
||||
<ValuePointer>($T1*)(((size_t*)ptr.pointer.data_ptr) + 2)</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="alloc::borrow::Cow<*>">
|
||||
<DisplayString Condition="RUST$ENUM$DISR == 0x0">Borrowed({__0})</DisplayString>
|
||||
<DisplayString Condition="RUST$ENUM$DISR == 0x1">Owned({__0})</DisplayString>
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 47848665966fc7393cb6f898077994f6dec2b591
|
||||
Subproject commit c9e2e89ed3aa5a3be77143aa0c86906b4138374a
|
||||
|
|
@ -8,74 +8,138 @@
|
|||
|
||||
// gdb-command:run
|
||||
|
||||
// gdb-command:print r
|
||||
// gdb-check:[...]$1 = Rc(strong=2, weak=1) = {value = 42, strong = 2, weak = 1}
|
||||
// gdb-command:print a
|
||||
// gdb-check:[...]$2 = Arc(strong=2, weak=1) = {value = 42, strong = 2, weak = 1}
|
||||
|
||||
// gdb-command:print rc
|
||||
// gdb-check:[...]$1 = Rc(strong=11, weak=1) = {value = 111, strong = 11, weak = 1}
|
||||
// gdb-command:print arc
|
||||
// gdb-check:[...]$2 = Arc(strong=21, weak=1) = {value = 222, strong = 21, weak = 1}
|
||||
|
||||
// === LLDB TESTS ==================================================================================
|
||||
|
||||
// lldb-command:run
|
||||
|
||||
// lldb-command:print r
|
||||
// lldb-check:[...]$0 = strong=2, weak=1 { value = 42 }
|
||||
// lldb-command:print a
|
||||
// lldb-check:[...]$1 = strong=2, weak=1 { data = 42 }
|
||||
// lldb-command:print rc
|
||||
// lldb-check:[...]$0 = strong=11, weak=1 { value = 111 }
|
||||
// lldb-command:print arc
|
||||
// lldb-check:[...]$1 = strong=21, weak=1 { data = 222 }
|
||||
|
||||
// === CDB TESTS ==================================================================================
|
||||
|
||||
// cdb-command:g
|
||||
|
||||
// cdb-command:dx r,d
|
||||
// cdb-check:r,d : 42 [Type: alloc::rc::Rc<i32>]
|
||||
// cdb-check: [<Raw View>] [Type: alloc::rc::Rc<i32>]
|
||||
// cdb-check: [Reference count] : 2 [Type: core::cell::Cell<usize>]
|
||||
// cdb-command:dx rc,d
|
||||
// cdb-check:rc,d : 111 [Type: alloc::rc::Rc<i32>]
|
||||
// cdb-check: [Reference count] : 11 [Type: core::cell::Cell<usize>]
|
||||
// cdb-check: [Weak reference count] : 2 [Type: core::cell::Cell<usize>]
|
||||
|
||||
// cdb-command:dx r1,d
|
||||
// cdb-check:r1,d : 42 [Type: alloc::rc::Rc<i32>]
|
||||
// cdb-check: [<Raw View>] [Type: alloc::rc::Rc<i32>]
|
||||
// cdb-check: [Reference count] : 2 [Type: core::cell::Cell<usize>]
|
||||
// cdb-command:dx weak_rc,d
|
||||
// cdb-check:weak_rc,d : 111 [Type: alloc::rc::Weak<i32>]
|
||||
// cdb-check: [Reference count] : 11 [Type: core::cell::Cell<usize>]
|
||||
// cdb-check: [Weak reference count] : 2 [Type: core::cell::Cell<usize>]
|
||||
|
||||
// cdb-command:dx w1,d
|
||||
// cdb-check:w1,d : 42 [Type: alloc::rc::Weak<i32>]
|
||||
// cdb-check: [<Raw View>] [Type: alloc::rc::Weak<i32>]
|
||||
// cdb-check: [Reference count] : 2 [Type: core::cell::Cell<usize>]
|
||||
// cdb-command:dx arc,d
|
||||
// cdb-check:arc,d : 222 [Type: alloc::sync::Arc<i32>]
|
||||
// cdb-check: [Reference count] : 21 [Type: core::sync::atomic::AtomicUsize]
|
||||
// cdb-check: [Weak reference count] : 2 [Type: core::sync::atomic::AtomicUsize]
|
||||
|
||||
// cdb-command:dx weak_arc,d
|
||||
// cdb-check:weak_arc,d : 222 [Type: alloc::sync::Weak<i32>]
|
||||
// cdb-check: [Reference count] : 21 [Type: core::sync::atomic::AtomicUsize]
|
||||
// cdb-check: [Weak reference count] : 2 [Type: core::sync::atomic::AtomicUsize]
|
||||
|
||||
// cdb-command:dx dyn_rc,d
|
||||
// cdb-check:dyn_rc,d [Type: alloc::rc::Rc<dyn$<core::fmt::Debug> >]
|
||||
// cdb-check: [Reference count] : 31 [Type: core::cell::Cell<usize>]
|
||||
// cdb-check: [Weak reference count] : 2 [Type: core::cell::Cell<usize>]
|
||||
|
||||
// cdb-command:dx a,d
|
||||
// cdb-check:a,d : 42 [Type: alloc::sync::Arc<i32>]
|
||||
// cdb-check: [<Raw View>] [Type: alloc::sync::Arc<i32>]
|
||||
// cdb-check: [Reference count] : 2 [Type: core::sync::atomic::AtomicUsize]
|
||||
// cdb-command:dx dyn_rc_weak,d
|
||||
// cdb-check:dyn_rc_weak,d [Type: alloc::rc::Weak<dyn$<core::fmt::Debug> >]
|
||||
// cdb-check: [Reference count] : 31 [Type: core::cell::Cell<usize>]
|
||||
// cdb-check: [Weak reference count] : 2 [Type: core::cell::Cell<usize>]
|
||||
|
||||
// cdb-command:dx slice_rc,d
|
||||
// cdb-check:slice_rc,d : { len=3 } [Type: alloc::rc::Rc<slice$<u32> >]
|
||||
// cdb-check: [Length] : 3 [Type: [...]]
|
||||
// cdb-check: [Reference count] : 41 [Type: core::cell::Cell<usize>]
|
||||
// cdb-check: [Weak reference count] : 2 [Type: core::cell::Cell<usize>]
|
||||
// cdb-check: [0] : 1 [Type: u32]
|
||||
// cdb-check: [1] : 2 [Type: u32]
|
||||
// cdb-check: [2] : 3 [Type: u32]
|
||||
|
||||
// cdb-command:dx slice_rc_weak,d
|
||||
// cdb-check:slice_rc_weak,d : { len=3 } [Type: alloc::rc::Weak<slice$<u32> >]
|
||||
// cdb-check: [Length] : 3 [Type: [...]]
|
||||
// cdb-check: [Reference count] : 41 [Type: core::cell::Cell<usize>]
|
||||
// cdb-check: [Weak reference count] : 2 [Type: core::cell::Cell<usize>]
|
||||
// cdb-check: [0] : 1 [Type: u32]
|
||||
// cdb-check: [1] : 2 [Type: u32]
|
||||
// cdb-check: [2] : 3 [Type: u32]
|
||||
|
||||
// cdb-command:dx dyn_arc,d
|
||||
// cdb-check:dyn_arc,d [Type: alloc::sync::Arc<dyn$<core::fmt::Debug> >]
|
||||
// cdb-check: [Reference count] : 51 [Type: core::sync::atomic::AtomicUsize]
|
||||
// cdb-check: [Weak reference count] : 2 [Type: core::sync::atomic::AtomicUsize]
|
||||
|
||||
// cdb-command:dx a1,d
|
||||
// cdb-check:a1,d : 42 [Type: alloc::sync::Arc<i32>]
|
||||
// cdb-check: [<Raw View>] [Type: alloc::sync::Arc<i32>]
|
||||
// cdb-check: [Reference count] : 2 [Type: core::sync::atomic::AtomicUsize]
|
||||
// cdb-command:dx dyn_arc_weak,d
|
||||
// cdb-check:dyn_arc_weak,d [Type: alloc::sync::Weak<dyn$<core::fmt::Debug> >]
|
||||
// cdb-check: [Reference count] : 51 [Type: core::sync::atomic::AtomicUsize]
|
||||
// cdb-check: [Weak reference count] : 2 [Type: core::sync::atomic::AtomicUsize]
|
||||
|
||||
// cdb-command:dx w2,d
|
||||
// cdb-check:w2,d : 42 [Type: alloc::sync::Weak<i32>]
|
||||
// cdb-check: [<Raw View>] [Type: alloc::sync::Weak<i32>]
|
||||
// cdb-check: [Reference count] : 2 [Type: core::sync::atomic::AtomicUsize]
|
||||
// cdb-command:dx slice_arc,d
|
||||
// cdb-check:slice_arc,d : { len=3 } [Type: alloc::sync::Arc<slice$<u32> >]
|
||||
// cdb-check: [Length] : 3 [Type: [...]]
|
||||
// cdb-check: [Reference count] : 61 [Type: core::sync::atomic::AtomicUsize]
|
||||
// cdb-check: [Weak reference count] : 2 [Type: core::sync::atomic::AtomicUsize]
|
||||
// cdb-check: [0] : 4 [Type: u32]
|
||||
// cdb-check: [1] : 5 [Type: u32]
|
||||
// cdb-check: [2] : 6 [Type: u32]
|
||||
|
||||
// cdb-command:dx slice_arc_weak,d
|
||||
// cdb-check:slice_arc_weak,d : { len=3 } [Type: alloc::sync::Weak<slice$<u32> >]
|
||||
// cdb-check: [Length] : 3 [Type: [...]]
|
||||
// cdb-check: [Reference count] : 61 [Type: core::sync::atomic::AtomicUsize]
|
||||
// cdb-check: [Weak reference count] : 2 [Type: core::sync::atomic::AtomicUsize]
|
||||
// cdb-check: [0] : 4 [Type: u32]
|
||||
// cdb-check: [1] : 5 [Type: u32]
|
||||
// cdb-check: [2] : 6 [Type: u32]
|
||||
|
||||
use std::fmt::Debug;
|
||||
use std::rc::Rc;
|
||||
use std::sync::Arc;
|
||||
|
||||
fn main() {
|
||||
let r = Rc::new(42);
|
||||
let r1 = Rc::clone(&r);
|
||||
let w1 = Rc::downgrade(&r);
|
||||
let rc = Rc::new(111);
|
||||
inc_ref_count(&rc, 10);
|
||||
let weak_rc = Rc::downgrade(&rc);
|
||||
|
||||
let a = Arc::new(42);
|
||||
let a1 = Arc::clone(&a);
|
||||
let w2 = Arc::downgrade(&a);
|
||||
let arc = Arc::new(222);
|
||||
inc_ref_count(&arc, 20);
|
||||
let weak_arc = Arc::downgrade(&arc);
|
||||
|
||||
let dyn_rc: Rc<dyn Debug> = Rc::new(333);
|
||||
inc_ref_count(&dyn_rc, 30);
|
||||
let dyn_rc_weak = Rc::downgrade(&dyn_rc);
|
||||
|
||||
let slice_rc: Rc<[u32]> = Rc::from(vec![1, 2, 3]);
|
||||
inc_ref_count(&slice_rc, 40);
|
||||
let slice_rc_weak = Rc::downgrade(&slice_rc);
|
||||
|
||||
let dyn_arc: Arc<dyn Debug> = Arc::new(444);
|
||||
inc_ref_count(&dyn_arc, 50);
|
||||
let dyn_arc_weak = Arc::downgrade(&dyn_arc);
|
||||
|
||||
let slice_arc: Arc<[u32]> = Arc::from(vec![4, 5, 6]);
|
||||
inc_ref_count(&slice_arc, 60);
|
||||
let slice_arc_weak = Arc::downgrade(&slice_arc);
|
||||
|
||||
zzz(); // #break
|
||||
}
|
||||
|
||||
fn zzz() { () }
|
||||
fn inc_ref_count<T: Clone>(rc: &T, count: usize) {
|
||||
for _ in 0..count {
|
||||
std::mem::forget(rc.clone());
|
||||
}
|
||||
}
|
||||
|
||||
fn zzz() {
|
||||
()
|
||||
}
|
||||
|
|
|
|||
6
src/test/ui/impl-trait/rpit-not-sized.rs
Normal file
6
src/test/ui/impl-trait/rpit-not-sized.rs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
fn foo() -> impl ?Sized {
|
||||
//~^ ERROR the size for values of type `impl ?Sized` cannot be known at compilation time
|
||||
()
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
12
src/test/ui/impl-trait/rpit-not-sized.stderr
Normal file
12
src/test/ui/impl-trait/rpit-not-sized.stderr
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
error[E0277]: the size for values of type `impl ?Sized` cannot be known at compilation time
|
||||
--> $DIR/rpit-not-sized.rs:1:13
|
||||
|
|
||||
LL | fn foo() -> impl ?Sized {
|
||||
| ^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: the trait `Sized` is not implemented for `impl ?Sized`
|
||||
= note: the return type of a function must have a statically known size
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
#![deny(unused_attributes)]
|
||||
#![crate_type = "lib"]
|
||||
// run-rustfix
|
||||
|
||||
pub trait Trait {
|
||||
type It;
|
||||
const IT: ();
|
||||
fn it0();
|
||||
fn it1();
|
||||
fn it2();
|
||||
}
|
||||
|
||||
pub struct Implementor;
|
||||
|
||||
impl Trait for Implementor {
|
||||
|
||||
type It = ();
|
||||
//~^^ ERROR `#[doc(hidden)]` is ignored
|
||||
//~| WARNING this was previously accepted
|
||||
|
||||
|
||||
const IT: () = ();
|
||||
//~^^ ERROR `#[doc(hidden)]` is ignored
|
||||
//~| WARNING this was previously accepted
|
||||
|
||||
#[doc(alias = "aka")]
|
||||
fn it0() {}
|
||||
//~^^ ERROR `#[doc(hidden)]` is ignored
|
||||
//~| WARNING this was previously accepted
|
||||
|
||||
#[doc(alias = "this", )]
|
||||
fn it1() {}
|
||||
//~^^ ERROR `#[doc(hidden)]` is ignored
|
||||
//~| WARNING this was previously accepted
|
||||
|
||||
#[doc()]
|
||||
fn it2() {}
|
||||
//~^^ ERROR `#[doc(hidden)]` is ignored
|
||||
//~| WARNING this was previously accepted
|
||||
//~| ERROR `#[doc(hidden)]` is ignored
|
||||
//~| WARNING this was previously accepted
|
||||
}
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
#![deny(unused_attributes)]
|
||||
#![crate_type = "lib"]
|
||||
// run-rustfix
|
||||
|
||||
pub trait Trait {
|
||||
type It;
|
||||
const IT: ();
|
||||
fn it0();
|
||||
fn it1();
|
||||
fn it2();
|
||||
}
|
||||
|
||||
pub struct Implementor;
|
||||
|
||||
impl Trait for Implementor {
|
||||
#[doc(hidden)]
|
||||
type It = ();
|
||||
//~^^ ERROR `#[doc(hidden)]` is ignored
|
||||
//~| WARNING this was previously accepted
|
||||
|
||||
#[doc(hidden)]
|
||||
const IT: () = ();
|
||||
//~^^ ERROR `#[doc(hidden)]` is ignored
|
||||
//~| WARNING this was previously accepted
|
||||
|
||||
#[doc(hidden, alias = "aka")]
|
||||
fn it0() {}
|
||||
//~^^ ERROR `#[doc(hidden)]` is ignored
|
||||
//~| WARNING this was previously accepted
|
||||
|
||||
#[doc(alias = "this", hidden,)]
|
||||
fn it1() {}
|
||||
//~^^ ERROR `#[doc(hidden)]` is ignored
|
||||
//~| WARNING this was previously accepted
|
||||
|
||||
#[doc(hidden, hidden)]
|
||||
fn it2() {}
|
||||
//~^^ ERROR `#[doc(hidden)]` is ignored
|
||||
//~| WARNING this was previously accepted
|
||||
//~| ERROR `#[doc(hidden)]` is ignored
|
||||
//~| WARNING this was previously accepted
|
||||
}
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
error: `#[doc(hidden)]` is ignored on trait impl items
|
||||
--> $DIR/unused-attr-doc-hidden.rs:16:5
|
||||
|
|
||||
LL | #[doc(hidden)]
|
||||
| ^^^^^^^^^^^^^^ help: remove this attribute
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/unused-attr-doc-hidden.rs:1:9
|
||||
|
|
||||
LL | #![deny(unused_attributes)]
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: whether the impl item is `doc(hidden)` or not entirely depends on the corresponding trait item
|
||||
|
||||
error: `#[doc(hidden)]` is ignored on trait impl items
|
||||
--> $DIR/unused-attr-doc-hidden.rs:21:5
|
||||
|
|
||||
LL | #[doc(hidden)]
|
||||
| ^^^^^^^^^^^^^^ help: remove this attribute
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: whether the impl item is `doc(hidden)` or not entirely depends on the corresponding trait item
|
||||
|
||||
error: `#[doc(hidden)]` is ignored on trait impl items
|
||||
--> $DIR/unused-attr-doc-hidden.rs:26:11
|
||||
|
|
||||
LL | #[doc(hidden, alias = "aka")]
|
||||
| ^^^^^^--
|
||||
| |
|
||||
| help: remove this attribute
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: whether the impl item is `doc(hidden)` or not entirely depends on the corresponding trait item
|
||||
|
||||
error: `#[doc(hidden)]` is ignored on trait impl items
|
||||
--> $DIR/unused-attr-doc-hidden.rs:31:27
|
||||
|
|
||||
LL | #[doc(alias = "this", hidden,)]
|
||||
| ^^^^^^-
|
||||
| |
|
||||
| help: remove this attribute
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: whether the impl item is `doc(hidden)` or not entirely depends on the corresponding trait item
|
||||
|
||||
error: `#[doc(hidden)]` is ignored on trait impl items
|
||||
--> $DIR/unused-attr-doc-hidden.rs:36:11
|
||||
|
|
||||
LL | #[doc(hidden, hidden)]
|
||||
| ^^^^^^--
|
||||
| |
|
||||
| help: remove this attribute
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: whether the impl item is `doc(hidden)` or not entirely depends on the corresponding trait item
|
||||
|
||||
error: `#[doc(hidden)]` is ignored on trait impl items
|
||||
--> $DIR/unused-attr-doc-hidden.rs:36:19
|
||||
|
|
||||
LL | #[doc(hidden, hidden)]
|
||||
| ^^^^^^ help: remove this attribute
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: whether the impl item is `doc(hidden)` or not entirely depends on the corresponding trait item
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
|
@ -12,15 +12,6 @@ use std::str::FromStr;
|
|||
|
||||
#[proc_macro]
|
||||
pub fn expand_expr_is(input: TokenStream) -> TokenStream {
|
||||
expand_expr_is_inner(input, false)
|
||||
}
|
||||
|
||||
#[proc_macro]
|
||||
pub fn expand_expr_is_trim(input: TokenStream) -> TokenStream {
|
||||
expand_expr_is_inner(input, true)
|
||||
}
|
||||
|
||||
fn expand_expr_is_inner(input: TokenStream, trim_invisible: bool) -> TokenStream {
|
||||
let mut iter = input.into_iter();
|
||||
let mut expected_tts = Vec::new();
|
||||
loop {
|
||||
|
|
@ -31,18 +22,14 @@ fn expand_expr_is_inner(input: TokenStream, trim_invisible: bool) -> TokenStream
|
|||
}
|
||||
}
|
||||
|
||||
// If requested, trim the "invisible" delimiters at the start and end.
|
||||
let expected = expected_tts.into_iter().collect::<TokenStream>().to_string();
|
||||
let expected = if trim_invisible {
|
||||
let len1 = "/*«*/ ".len();
|
||||
let len2 = " /*»*/".len();
|
||||
&expected[len1..expected.len() - len2]
|
||||
} else {
|
||||
&expected[..]
|
||||
};
|
||||
let expanded = iter.collect::<TokenStream>().expand_expr().unwrap().to_string();
|
||||
|
||||
assert_eq!(expected, expanded);
|
||||
let expected = expected_tts.into_iter().collect::<TokenStream>();
|
||||
let expanded = iter.collect::<TokenStream>().expand_expr().expect("expand_expr failed");
|
||||
assert!(
|
||||
expected.to_string() == expanded.to_string(),
|
||||
"assert failed\nexpected: `{}`\nexpanded: `{}`",
|
||||
expected.to_string(),
|
||||
expanded.to_string()
|
||||
);
|
||||
|
||||
TokenStream::new()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
PRINT-BANG INPUT (DISPLAY): self
|
||||
PRINT-BANG RE-COLLECTED (DISPLAY): /*«*/ self /*»*/
|
||||
PRINT-BANG INPUT (DEBUG): TokenStream [
|
||||
Group {
|
||||
delimiter: None,
|
||||
|
|
@ -14,10 +13,8 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
|
|||
]
|
||||
PRINT-BANG INPUT (DISPLAY): 1 + 1, { "a" }, let a = 1;, String, my_name, 'a, my_val = 30,
|
||||
std::option::Option, pub(in some::path) , [a b c], -30
|
||||
PRINT-BANG RE-COLLECTED (DISPLAY): /*«*/ 1 + 1 /*»*/, /*«*/ { "a" } /*»*/, /*«*/ let a = 1 /*»*/, /*«*/
|
||||
String /*»*/, my_name, /*«*/ 'a /*»*/, /*«*/ my_val = 30 /*»*/, /*«*/
|
||||
std :: option :: Option /*»*/, /*«*/ pub(in some :: path) /*»*/, [a b c],
|
||||
/*«*/ - 30 /*»*/
|
||||
PRINT-BANG RE-COLLECTED (DISPLAY): 1 + 1, { "a" }, let a = 1, String, my_name, 'a, my_val = 30,
|
||||
std :: option :: Option, pub(in some :: path), [a b c], - 30
|
||||
PRINT-BANG INPUT (DEBUG): TokenStream [
|
||||
Group {
|
||||
delimiter: None,
|
||||
|
|
@ -298,7 +295,6 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
|
|||
},
|
||||
]
|
||||
PRINT-BANG INPUT (DISPLAY): (a, b)
|
||||
PRINT-BANG RE-COLLECTED (DISPLAY): /*«*/ (a, b) /*»*/
|
||||
PRINT-BANG INPUT (DEBUG): TokenStream [
|
||||
Group {
|
||||
delimiter: None,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
PRINT-BANG INPUT (DISPLAY): Vec<u8>
|
||||
PRINT-BANG RE-COLLECTED (DISPLAY): /*«*/ Vec < u8 > /*»*/
|
||||
PRINT-BANG RE-COLLECTED (DISPLAY): Vec < u8 >
|
||||
PRINT-BANG INPUT (DEBUG): TokenStream [
|
||||
Group {
|
||||
delimiter: None,
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
extern crate expand_expr;
|
||||
|
||||
use expand_expr::{check_expand_expr_file, echo_pm, expand_expr_fail, expand_expr_is};
|
||||
use expand_expr::{expand_expr_is_trim, recursive_expand};
|
||||
|
||||
use expand_expr::{
|
||||
check_expand_expr_file, echo_pm, expand_expr_fail, expand_expr_is, recursive_expand,
|
||||
};
|
||||
|
||||
// Check builtin macros can be expanded.
|
||||
|
||||
|
|
@ -47,21 +47,21 @@ macro_rules! echo_expr {
|
|||
|
||||
macro_rules! simple_lit {
|
||||
($l:literal) => {
|
||||
expand_expr_is_trim!($l, $l);
|
||||
expand_expr_is_trim!($l, echo_lit!($l));
|
||||
expand_expr_is_trim!($l, echo_expr!($l));
|
||||
expand_expr_is_trim!($l, echo_tts!($l));
|
||||
expand_expr_is_trim!($l, echo_pm!($l));
|
||||
expand_expr_is!($l, $l);
|
||||
expand_expr_is!($l, echo_lit!($l));
|
||||
expand_expr_is!($l, echo_expr!($l));
|
||||
expand_expr_is!($l, echo_tts!($l));
|
||||
expand_expr_is!($l, echo_pm!($l));
|
||||
const _: () = {
|
||||
macro_rules! mac {
|
||||
() => {
|
||||
$l
|
||||
};
|
||||
}
|
||||
expand_expr_is_trim!($l, mac!());
|
||||
expand_expr_is_trim!($l, echo_expr!(mac!()));
|
||||
expand_expr_is_trim!($l, echo_tts!(mac!()));
|
||||
expand_expr_is_trim!($l, echo_pm!(mac!()));
|
||||
expand_expr_is!($l, mac!());
|
||||
expand_expr_is!($l, echo_expr!(mac!()));
|
||||
expand_expr_is!($l, echo_tts!(mac!()));
|
||||
expand_expr_is!($l, echo_pm!(mac!()));
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = #[allow(warnings)] 0 ; 0 }, }
|
||||
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E
|
||||
{ V = { let _ = /*«*/ #[allow(warnings)] #[allow(warnings)] 0 /*»*/ ; 0 }, }
|
||||
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = #[allow(warnings)] #[allow(warnings)] 0 ; 0 }, }
|
||||
PRINT-DERIVE INPUT (DEBUG): TokenStream [
|
||||
Ident {
|
||||
ident: "enum",
|
||||
|
|
@ -124,7 +123,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
|
|||
},
|
||||
]
|
||||
PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { 0; } ; 0 }, }
|
||||
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { /*«*/ 0 /*»*/ } ; 0 }, }
|
||||
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { 0 } ; 0 }, }
|
||||
PRINT-DERIVE INPUT (DEBUG): TokenStream [
|
||||
Ident {
|
||||
ident: "enum",
|
||||
|
|
@ -204,7 +203,6 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
|
|||
},
|
||||
]
|
||||
PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { {} } ; 0 }, }
|
||||
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { /*«*/ {} /*»*/ } ; 0 }, }
|
||||
PRINT-DERIVE INPUT (DEBUG): TokenStream [
|
||||
Ident {
|
||||
ident: "enum",
|
||||
|
|
@ -283,7 +281,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
|
|||
},
|
||||
]
|
||||
PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { PATH; } ; 0 }, }
|
||||
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { /*«*/ PATH /*»*/ } ; 0 }, }
|
||||
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { PATH } ; 0 }, }
|
||||
PRINT-DERIVE INPUT (DEBUG): TokenStream [
|
||||
Ident {
|
||||
ident: "enum",
|
||||
|
|
@ -361,7 +359,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
|
|||
},
|
||||
]
|
||||
PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { 0 + 1; } ; 0 }, }
|
||||
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { /*«*/ 0 + 1 /*»*/ } ; 0 }, }
|
||||
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { 0 + 1 } ; 0 }, }
|
||||
PRINT-DERIVE INPUT (DEBUG): TokenStream [
|
||||
Ident {
|
||||
ident: "enum",
|
||||
|
|
@ -452,7 +450,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
|
|||
},
|
||||
]
|
||||
PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { PATH + 1; } ; 0 }, }
|
||||
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { /*«*/ PATH + 1 /*»*/ } ; 0 }, }
|
||||
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { PATH + 1 } ; 0 }, }
|
||||
PRINT-DERIVE INPUT (DEBUG): TokenStream [
|
||||
Ident {
|
||||
ident: "enum",
|
||||
|
|
|
|||
|
|
@ -96,7 +96,6 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
|
|||
},
|
||||
]
|
||||
PRINT-BANG INPUT (DISPLAY): 1 + 1 * 2
|
||||
PRINT-BANG RE-COLLECTED (DISPLAY): /*«*/ 1 + 1 /*»*/ * 2
|
||||
PRINT-BANG INPUT (DEBUG): TokenStream [
|
||||
Group {
|
||||
delimiter: None,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
PRINT-BANG INPUT (DISPLAY): foo! { #[fake_attr] mod bar {
|
||||
#![doc = r" Foo"]
|
||||
} }
|
||||
PRINT-BANG DEEP-RE-COLLECTED (DISPLAY): foo! { #[fake_attr] /*«*/ mod bar { #! [doc = r" Foo"] } /*»*/ }
|
||||
PRINT-BANG DEEP-RE-COLLECTED (DISPLAY): foo! { #[fake_attr] mod bar { #! [doc = r" Foo"] } }
|
||||
PRINT-BANG INPUT (DEBUG): TokenStream [
|
||||
Ident {
|
||||
ident: "foo",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
PRINT-BANG INPUT (DISPLAY): ;
|
||||
PRINT-BANG RE-COLLECTED (DISPLAY): /*«*/ ; /*»*/
|
||||
PRINT-BANG INPUT (DEBUG): TokenStream [
|
||||
Group {
|
||||
delimiter: None,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
PRINT-BANG INPUT (DISPLAY): 0 + 1 + 2 + 3
|
||||
PRINT-BANG RE-COLLECTED (DISPLAY): /*«*/ 0 + 1 + 2 /*»*/ + 3
|
||||
PRINT-BANG DEEP-RE-COLLECTED (DISPLAY): /*«*/ /*«*/ /*«*/ 0 /*»*/ + 1 /*»*/ + 2 /*»*/ + 3
|
||||
PRINT-BANG INPUT (DEBUG): TokenStream [
|
||||
Group {
|
||||
delimiter: None,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
PRINT-BANG INPUT (DISPLAY): "hi" 1 + (25) + 1 (1 + 1)
|
||||
PRINT-BANG RE-COLLECTED (DISPLAY): "hi" /*«*/ 1 + (25) + 1 /*»*/ (1 + 1)
|
||||
PRINT-BANG INPUT (DEBUG): TokenStream [
|
||||
Literal {
|
||||
kind: Str,
|
||||
|
|
@ -72,9 +71,6 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
|
|||
},
|
||||
]
|
||||
PRINT-BANG INPUT (DISPLAY): "hi" "hello".len() + "world".len() (1 + 1)
|
||||
PRINT-BANG RE-COLLECTED (DISPLAY): "hi" /*«*/ "hello".len() + "world".len() /*»*/ (1 + 1)
|
||||
PRINT-BANG DEEP-RE-COLLECTED (DISPLAY): "hi" /*«*/ /*«*/ "hello".len() /*»*/ + /*«*/ "world".len() /*»*/ /*»*/
|
||||
(1 + 1)
|
||||
PRINT-BANG INPUT (DEBUG): TokenStream [
|
||||
Literal {
|
||||
kind: Str,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
PRINT-ATTR_ARGS INPUT (DISPLAY): a, line!(), b
|
||||
PRINT-ATTR_ARGS RE-COLLECTED (DISPLAY): a, /*«*/ line! () /*»*/, b
|
||||
PRINT-ATTR_ARGS RE-COLLECTED (DISPLAY): a, line! (), b
|
||||
PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
|
||||
Ident {
|
||||
ident: "a",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
PRINT-BANG INPUT (DISPLAY): struct S;
|
||||
PRINT-BANG RE-COLLECTED (DISPLAY): /*«*/ struct S ; /*»*/
|
||||
PRINT-BANG RE-COLLECTED (DISPLAY): struct S ;
|
||||
PRINT-BANG INPUT (DEBUG): TokenStream [
|
||||
Group {
|
||||
delimiter: None,
|
||||
|
|
|
|||
|
|
@ -8,16 +8,16 @@ use parent_source_spans::parent_source_spans;
|
|||
|
||||
macro one($a:expr, $b:expr) {
|
||||
two!($a, $b);
|
||||
//~^ ERROR first parent: /*«*/ "hello" /*»*/
|
||||
//~| ERROR second parent: /*«*/ "world" /*»*/
|
||||
//~^ ERROR first parent: "hello"
|
||||
//~| ERROR second parent: "world"
|
||||
}
|
||||
|
||||
macro two($a:expr, $b:expr) {
|
||||
three!($a, $b);
|
||||
//~^ ERROR first final: /*«*/ "hello" /*»*/
|
||||
//~| ERROR second final: /*«*/ "world" /*»*/
|
||||
//~| ERROR first final: /*«*/ "yay" /*»*/
|
||||
//~| ERROR second final: /*«*/ "rust" /*»*/
|
||||
//~^ ERROR first final: "hello"
|
||||
//~| ERROR second final: "world"
|
||||
//~| ERROR first final: "yay"
|
||||
//~| ERROR second final: "rust"
|
||||
}
|
||||
|
||||
// forwarding tokens directly doesn't create a new source chain
|
||||
|
|
@ -34,16 +34,16 @@ macro four($($tokens:tt)*) {
|
|||
|
||||
fn main() {
|
||||
one!("hello", "world");
|
||||
//~^ ERROR first grandparent: /*«*/ "hello" /*»*/
|
||||
//~| ERROR second grandparent: /*«*/ "world" /*»*/
|
||||
//~| ERROR first source: /*«*/ "hello" /*»*/
|
||||
//~| ERROR second source: /*«*/ "world" /*»*/
|
||||
//~^ ERROR first grandparent: "hello"
|
||||
//~| ERROR second grandparent: "world"
|
||||
//~| ERROR first source: "hello"
|
||||
//~| ERROR second source: "world"
|
||||
|
||||
two!("yay", "rust");
|
||||
//~^ ERROR first parent: /*«*/ "yay" /*»*/
|
||||
//~| ERROR second parent: /*«*/ "rust" /*»*/
|
||||
//~| ERROR first source: /*«*/ "yay" /*»*/
|
||||
//~| ERROR second source: /*«*/ "rust" /*»*/
|
||||
//~^ ERROR first parent: "yay"
|
||||
//~| ERROR second parent: "rust"
|
||||
//~| ERROR first source: "yay"
|
||||
//~| ERROR second source: "rust"
|
||||
|
||||
three!("hip", "hop");
|
||||
//~^ ERROR first final: "hip"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error: first final: /*«*/ "hello" /*»*/
|
||||
error: first final: "hello"
|
||||
--> $DIR/parent-source-spans.rs:16:12
|
||||
|
|
||||
LL | three!($a, $b);
|
||||
|
|
@ -9,7 +9,7 @@ LL | one!("hello", "world");
|
|||
|
|
||||
= note: this error originates in the macro `two` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: second final: /*«*/ "world" /*»*/
|
||||
error: second final: "world"
|
||||
--> $DIR/parent-source-spans.rs:16:16
|
||||
|
|
||||
LL | three!($a, $b);
|
||||
|
|
@ -20,7 +20,7 @@ LL | one!("hello", "world");
|
|||
|
|
||||
= note: this error originates in the macro `two` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: first parent: /*«*/ "hello" /*»*/
|
||||
error: first parent: "hello"
|
||||
--> $DIR/parent-source-spans.rs:10:5
|
||||
|
|
||||
LL | two!($a, $b);
|
||||
|
|
@ -31,7 +31,7 @@ LL | one!("hello", "world");
|
|||
|
|
||||
= note: this error originates in the macro `one` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: second parent: /*«*/ "world" /*»*/
|
||||
error: second parent: "world"
|
||||
--> $DIR/parent-source-spans.rs:10:5
|
||||
|
|
||||
LL | two!($a, $b);
|
||||
|
|
@ -42,31 +42,31 @@ LL | one!("hello", "world");
|
|||
|
|
||||
= note: this error originates in the macro `one` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: first grandparent: /*«*/ "hello" /*»*/
|
||||
error: first grandparent: "hello"
|
||||
--> $DIR/parent-source-spans.rs:36:5
|
||||
|
|
||||
LL | one!("hello", "world");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: second grandparent: /*«*/ "world" /*»*/
|
||||
error: second grandparent: "world"
|
||||
--> $DIR/parent-source-spans.rs:36:5
|
||||
|
|
||||
LL | one!("hello", "world");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: first source: /*«*/ "hello" /*»*/
|
||||
error: first source: "hello"
|
||||
--> $DIR/parent-source-spans.rs:36:5
|
||||
|
|
||||
LL | one!("hello", "world");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: second source: /*«*/ "world" /*»*/
|
||||
error: second source: "world"
|
||||
--> $DIR/parent-source-spans.rs:36:5
|
||||
|
|
||||
LL | one!("hello", "world");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: first final: /*«*/ "yay" /*»*/
|
||||
error: first final: "yay"
|
||||
--> $DIR/parent-source-spans.rs:16:12
|
||||
|
|
||||
LL | three!($a, $b);
|
||||
|
|
@ -77,7 +77,7 @@ LL | two!("yay", "rust");
|
|||
|
|
||||
= note: this error originates in the macro `two` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: second final: /*«*/ "rust" /*»*/
|
||||
error: second final: "rust"
|
||||
--> $DIR/parent-source-spans.rs:16:16
|
||||
|
|
||||
LL | three!($a, $b);
|
||||
|
|
@ -88,25 +88,25 @@ LL | two!("yay", "rust");
|
|||
|
|
||||
= note: this error originates in the macro `two` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: first parent: /*«*/ "yay" /*»*/
|
||||
error: first parent: "yay"
|
||||
--> $DIR/parent-source-spans.rs:42:5
|
||||
|
|
||||
LL | two!("yay", "rust");
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: second parent: /*«*/ "rust" /*»*/
|
||||
error: second parent: "rust"
|
||||
--> $DIR/parent-source-spans.rs:42:5
|
||||
|
|
||||
LL | two!("yay", "rust");
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: first source: /*«*/ "yay" /*»*/
|
||||
error: first source: "yay"
|
||||
--> $DIR/parent-source-spans.rs:42:5
|
||||
|
|
||||
LL | two!("yay", "rust");
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: second source: /*«*/ "rust" /*»*/
|
||||
error: second source: "rust"
|
||||
--> $DIR/parent-source-spans.rs:42:5
|
||||
|
|
||||
LL | two!("yay", "rust");
|
||||
|
|
|
|||
|
|
@ -13,3 +13,4 @@ tar = "0.4.29"
|
|||
sha2 = "0.10.1"
|
||||
rayon = "1.5.1"
|
||||
hex = "0.4.2"
|
||||
num_cpus = "1.13.0"
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ fn main() {
|
|||
let num_threads = if let Some(num) = env::var_os("BUILD_MANIFEST_NUM_THREADS") {
|
||||
num.to_str().unwrap().parse().expect("invalid number for BUILD_MANIFEST_NUM_THREADS")
|
||||
} else {
|
||||
std::thread::available_parallelism().map_or(1, std::num::NonZeroUsize::get)
|
||||
num_cpus::get()
|
||||
};
|
||||
rayon::ThreadPoolBuilder::new()
|
||||
.num_threads(num_threads)
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 4751950ccc948c07047e62c20adf423d7e5f668c
|
||||
Subproject commit a748cf5a3e666bc2dcdf54f37adef8ef22196452
|
||||
Loading…
Add table
Add a link
Reference in a new issue