Skip to content

Rollup of 10 pull requests #60091

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 32 commits into from
Closed
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
cc2689a
implement nth_back for Bytes
koalatux Apr 16, 2019
fae2a68
implement nth_back for Fuse
koalatux Apr 16, 2019
2605537
implement nth_back for Enumerate
koalatux Apr 16, 2019
ca19ffe
Update rustfmt to 1.2.1
topecongiro Apr 17, 2019
365a48a
whitelist rtm x86 cpu feature
mtak- Apr 17, 2019
007b40b
Point at try `?` on errors affecting the err match arm of the desugar…
estebank Apr 18, 2019
1e99b2e
Give custom error for E0277 on `?` error case
estebank Apr 18, 2019
379c541
Simplify the returning of a Result a bit
janhohenheim Apr 17, 2019
553ec5d
Update run-make PGO test to new commandline syntax.
michaelwoerister Apr 17, 2019
4269be3
Prefix PROFILER_SUPPORT and SANITIZER_SUPPORT test env vars with RUST…
michaelwoerister Apr 18, 2019
227be65
compiletest: Allow for tests requiring profiler-rt or sanitizer-rt su…
michaelwoerister Apr 18, 2019
e2acaee
Add codegen test that makes sure PGO instrumentation is emitted as ex…
michaelwoerister Apr 16, 2019
d98afc5
Fix small errors in docs for `rchunks_exact` and `rchunks_exact_mut`.
nathankleyn Apr 18, 2019
cc77087
Use new `needs-(profiler|sanitizer)-support` compiletest directive to…
michaelwoerister Apr 18, 2019
08efbac
Implement event filtering for self-profiler.
michaelwoerister Apr 12, 2019
ae1f2b5
Update miri
TimDiekmann Apr 18, 2019
faaab52
Add a `header` method to `FnKind`
varkor Apr 18, 2019
b13562a
Refactor some existing methods
varkor Apr 18, 2019
db13fe6
Feature gate async fn methods
varkor Apr 18, 2019
b6888db
Add test for async fn methods feature gating
varkor Apr 18, 2019
edce367
Fix typo in variadic C function warning
varkor Apr 18, 2019
3dbe05f
Fix additional variadic typos
varkor Apr 18, 2019
3c4e592
Rollup merge of #59915 - michaelwoerister:sp-event-filters-1, r=wesle…
Centril Apr 18, 2019
7e17c91
Rollup merge of #60023 - koalatux:nth-back, r=scottmcm
Centril Apr 18, 2019
19ae5d0
Rollup merge of #60038 - michaelwoerister:pgo-updates-2, r=alexcrichton
Centril Apr 18, 2019
55078fc
Rollup merge of #60041 - jnferner:patch-1, r=shepmaster
Centril Apr 18, 2019
b9f8430
Rollup merge of #60056 - topecongiro:rustfmt-1.2.1, r=alexcrichton
Centril Apr 18, 2019
e334288
Rollup merge of #60060 - mtak-:rtm-x86-feature, r=petrochenkov
Centril Apr 18, 2019
f77b9da
Rollup merge of #60064 - estebank:issue-59980, r=varkor
Centril Apr 18, 2019
4e6efa3
Rollup merge of #60080 - nathankleyn:fix-issue-60068, r=Centril
Centril Apr 18, 2019
15f22b4
Rollup merge of #60082 - TimDiekmann:master, r=RalfJung
Centril Apr 18, 2019
e3264bb
Rollup merge of #60088 - varkor:async_await-method-feature-gate, r=cr…
Centril Apr 18, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions Cargo.lock
Original file line number Diff line number Diff line change
@@ -36,6 +36,14 @@ dependencies = [
"url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "annotate-snippets"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "ansi_term"
version = "0.11.0"
@@ -2246,7 +2254,7 @@ dependencies = [
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-workspace-hack 1.0.0",
"rustc_tools_util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustfmt-nightly 1.2.0",
"rustfmt-nightly 1.2.1",
"serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_ignored 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3038,8 +3046,9 @@ dependencies = [

[[package]]
name = "rustfmt-nightly"
version = "1.2.0"
version = "1.2.1"
dependencies = [
"annotate-snippets 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"bytecount 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cargo_metadata 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3049,6 +3058,7 @@ dependencies = [
"env_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
"ignore 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3061,7 +3071,7 @@ dependencies = [
"serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)",
"term 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode_categories 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3987,6 +3997,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e522997b529f05601e05166c07ed17789691f562762c7f3b987263d2dedee5c"
"checksum aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1e9a933f4e58658d7b12defcf96dc5c720f20832deebe3e0a19efd3b6aaeeb9e"
"checksum ammonia 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fd4c682378117e4186a492b2252b9537990e1617f44aed9788b9a1149de45477"
"checksum annotate-snippets 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e8bcdcd5b291ce85a78f2b9d082a8de9676c12b1840d386d67bc5eea6f9d2b4e"
"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
"checksum arc-swap 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1025aeae2b664ca0ea726a89d574fe8f4e77dd712d443236ad1de00379450cf6"
"checksum argon2rs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3f67b0b6a86dae6e67ff4ca2b6201396074996379fba2b92ff649126f37cb392"
4 changes: 2 additions & 2 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
@@ -1268,11 +1268,11 @@ impl Step for Compiletest {
builder.add_rust_test_threads(&mut cmd);

if builder.config.sanitizers {
cmd.env("SANITIZER_SUPPORT", "1");
cmd.env("RUSTC_SANITIZER_SUPPORT", "1");
}

if builder.config.profiler {
cmd.env("PROFILER_SUPPORT", "1");
cmd.env("RUSTC_PROFILER_SUPPORT", "1");
}

cmd.env("RUST_TEST_TMPDIR", builder.out.join("tmp"));
26 changes: 26 additions & 0 deletions src/libcore/iter/adapters/mod.rs
Original file line number Diff line number Diff line change
@@ -980,6 +980,16 @@ impl<I> DoubleEndedIterator for Enumerate<I> where
})
}

#[inline]
fn nth_back(&mut self, n: usize) -> Option<(usize, <I as Iterator>::Item)> {
self.iter.nth_back(n).map(|a| {
let len = self.iter.len();
// Can safely add, `ExactSizeIterator` promises that the number of
// elements fits into a `usize`.
(self.count + len, a)
})
}

#[inline]
fn try_rfold<Acc, Fold, R>(&mut self, init: Acc, mut fold: Fold) -> R where
Self: Sized, Fold: FnMut(Acc, Self::Item) -> R, R: Try<Ok=Acc>
@@ -1789,6 +1799,17 @@ impl<I> DoubleEndedIterator for Fuse<I> where I: DoubleEndedIterator {
}
}

#[inline]
default fn nth_back(&mut self, n: usize) -> Option<<I as Iterator>::Item> {
if self.done {
None
} else {
let nth = self.iter.nth_back(n);
self.done = nth.is_none();
nth
}
}

#[inline]
default fn try_rfold<Acc, Fold, R>(&mut self, init: Acc, fold: Fold) -> R where
Self: Sized, Fold: FnMut(Acc, Self::Item) -> R, R: Try<Ok=Acc>
@@ -1877,6 +1898,11 @@ impl<I> DoubleEndedIterator for Fuse<I>
self.iter.next_back()
}

#[inline]
fn nth_back(&mut self, n: usize) -> Option<<I as Iterator>::Item> {
self.iter.nth_back(n)
}

#[inline]
fn try_rfold<Acc, Fold, R>(&mut self, init: Acc, fold: Fold) -> R where
Self: Sized, Fold: FnMut(Acc, Self::Item) -> R, R: Try<Ok=Acc>
6 changes: 3 additions & 3 deletions src/libcore/slice/mod.rs
Original file line number Diff line number Diff line change
@@ -838,7 +838,7 @@ impl<T> [T] {
}

/// Returns an iterator over `chunk_size` elements of the slice at a time, starting at the
/// beginning of the slice.
/// end of the slice.
///
/// The chunks are slices and do not overlap. If `chunk_size` does not divide the length of the
/// slice, then the last up to `chunk_size-1` elements will be omitted and can be retrieved
@@ -849,7 +849,7 @@ impl<T> [T] {
///
/// See [`rchunks`] for a variant of this iterator that also returns the remainder as a smaller
/// chunk, and [`chunks_exact`] for the same iterator but starting at the beginning of the
/// slice of the slice.
/// slice.
///
/// # Panics
///
@@ -890,7 +890,7 @@ impl<T> [T] {
///
/// See [`rchunks_mut`] for a variant of this iterator that also returns the remainder as a
/// smaller chunk, and [`chunks_exact_mut`] for the same iterator but starting at the beginning
/// of the slice of the slice.
/// of the slice.
///
/// # Panics
///
5 changes: 5 additions & 0 deletions src/libcore/str/mod.rs
Original file line number Diff line number Diff line change
@@ -795,6 +795,11 @@ impl DoubleEndedIterator for Bytes<'_> {
self.0.next_back()
}

#[inline]
fn nth_back(&mut self, n: usize) -> Option<Self::Item> {
self.0.nth_back(n)
}

#[inline]
fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item> where
P: FnMut(&Self::Item) -> bool
18 changes: 18 additions & 0 deletions src/libcore/tests/iter.rs
Original file line number Diff line number Diff line change
@@ -389,6 +389,24 @@ fn test_iterator_enumerate_nth() {
assert_eq!(i, 3);
}

#[test]
fn test_iterator_enumerate_nth_back() {
let xs = [0, 1, 2, 3, 4, 5];
let mut it = xs.iter().enumerate();
while let Some((i, &x)) = it.nth_back(0) {
assert_eq!(i, x);
}

let mut it = xs.iter().enumerate();
while let Some((i, &x)) = it.nth_back(1) {
assert_eq!(i, x);
}

let (i, &x) = xs.iter().enumerate().nth_back(3).unwrap();
assert_eq!(i, x);
assert_eq!(i, 2);
}

#[test]
fn test_iterator_enumerate_count() {
let xs = [0, 1, 2, 3, 4, 5];
8 changes: 8 additions & 0 deletions src/librustc/hir/intravisit.rs
Original file line number Diff line number Diff line change
@@ -57,6 +57,14 @@ impl<'a> FnKind<'a> {
FnKind::Closure(attrs) => attrs,
}
}

pub fn header(&self) -> Option<FnHeader> {
match *self {
FnKind::ItemFn(_, _, header, _, _) => Some(header),
FnKind::Method(_, sig, _, _) => Some(sig.header),
FnKind::Closure(_) => None,
}
}
}

/// Specifies what nested things a visitor wants to visit. The most
22 changes: 15 additions & 7 deletions src/librustc/hir/lowering.rs
Original file line number Diff line number Diff line change
@@ -4685,6 +4685,14 @@ impl<'a> LoweringContext<'a> {
Symbol::intern("try_trait")
].into()),
);
let try_span = self.sess.source_map().end_point(e.span);
let try_span = self.mark_span_with_reason(
CompilerDesugaringKind::QuestionMark,
try_span,
Some(vec![
Symbol::intern("try_trait")
].into()),
);

// `Try::into_result(<expr>)`
let discr = {
@@ -4729,14 +4737,14 @@ impl<'a> LoweringContext<'a> {
// return Try::from_error(From::from(err)),`
let err_arm = {
let err_ident = self.str_to_ident("err");
let (err_local, err_local_nid) = self.pat_ident(e.span, err_ident);
let (err_local, err_local_nid) = self.pat_ident(try_span, err_ident);
let from_expr = {
let path = &["convert", "From", "from"];
let from = P(self.expr_std_path(
e.span, path, None, ThinVec::new()));
let err_expr = self.expr_ident(e.span, err_ident, err_local_nid);
try_span, path, None, ThinVec::new()));
let err_expr = self.expr_ident(try_span, err_ident, err_local_nid);

self.expr_call(e.span, from, hir_vec![err_expr])
self.expr_call(try_span, from, hir_vec![err_expr])
};
let from_err_expr =
self.wrap_in_try_constructor("from_error", from_expr, unstable_span);
@@ -4745,7 +4753,7 @@ impl<'a> LoweringContext<'a> {
let ret_expr = if let Some(catch_node) = catch_scope {
let target_id = Ok(self.lower_node_id(catch_node).hir_id);
P(self.expr(
e.span,
try_span,
hir::ExprKind::Break(
hir::Destination {
label: None,
@@ -4756,10 +4764,10 @@ impl<'a> LoweringContext<'a> {
thin_attrs,
))
} else {
P(self.expr(e.span, hir::ExprKind::Ret(Some(from_err_expr)), thin_attrs))
P(self.expr(try_span, hir::ExprKind::Ret(Some(from_err_expr)), thin_attrs))
};

let err_pat = self.pat_err(e.span, err_local);
let err_pat = self.pat_err(try_span, err_local);
self.arm(hir_vec![err_pat], ret_expr)
};

18 changes: 3 additions & 15 deletions src/librustc/hir/map/blocks.rs
Original file line number Diff line number Diff line change
@@ -175,27 +175,15 @@ impl<'a> FnLikeNode<'a> {
}

pub fn constness(self) -> ast::Constness {
match self.kind() {
FnKind::ItemFn(_, _, header, ..) => header.constness,
FnKind::Method(_, m, ..) => m.header.constness,
_ => ast::Constness::NotConst
}
self.kind().header().map_or(ast::Constness::NotConst, |header| header.constness)
}

pub fn asyncness(self) -> ast::IsAsync {
match self.kind() {
FnKind::ItemFn(_, _, header, ..) => header.asyncness,
FnKind::Method(_, m, ..) => m.header.asyncness,
_ => ast::IsAsync::NotAsync
}
self.kind().header().map_or(ast::IsAsync::NotAsync, |header| header.asyncness)
}

pub fn unsafety(self) -> ast::Unsafety {
match self.kind() {
FnKind::ItemFn(_, _, header, ..) => header.unsafety,
FnKind::Method(_, m, ..) => m.header.unsafety,
_ => ast::Unsafety::Normal
}
self.kind().header().map_or(ast::Unsafety::Normal, |header| header.unsafety)
}

pub fn kind(self) -> FnKind<'a> {
2 changes: 2 additions & 0 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
@@ -1467,6 +1467,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
"inject the given attribute in the crate"),
self_profile: bool = (false, parse_bool, [UNTRACKED],
"run the self profiler and output the raw event data"),
self_profile_events: Option<Vec<String>> = (None, parse_opt_comma_list, [UNTRACKED],
"specifies which kinds of events get recorded by the self profiler"),
emit_stack_sizes: bool = (false, parse_bool, [UNTRACKED],
"emits a section containing stack size metadata"),
plt: Option<bool> = (None, parse_opt_bool, [TRACKED],
2 changes: 1 addition & 1 deletion src/librustc/session/mod.rs
Original file line number Diff line number Diff line change
@@ -1138,7 +1138,7 @@ fn build_session_(
) -> Session {
let self_profiler =
if sopts.debugging_opts.self_profile {
let profiler = SelfProfiler::new();
let profiler = SelfProfiler::new(&sopts.debugging_opts.self_profile_events);
match profiler {
Ok(profiler) => {
crate::ty::query::QueryName::register_with_profiler(&profiler);
12 changes: 12 additions & 0 deletions src/librustc/traits/error_reporting.rs
Original file line number Diff line number Diff line change
@@ -638,6 +638,18 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
let OnUnimplementedNote { message, label, note }
= self.on_unimplemented_note(trait_ref, obligation);
let have_alt_message = message.is_some() || label.is_some();
let is_try = self.tcx.sess.source_map().span_to_snippet(span)
.map(|s| &s == "?")
.unwrap_or(false);
let is_from = format!("{}", trait_ref).starts_with("std::convert::From<");
let message = if is_try && is_from {
Some(format!(
"`?` couldn't convert the error to `{}`",
trait_ref.self_ty(),
))
} else {
message
};

let mut err = struct_span_err!(
self.tcx.sess,
121 changes: 94 additions & 27 deletions src/librustc/util/profiling.rs
Original file line number Diff line number Diff line change
@@ -27,26 +27,42 @@ pub enum ProfileCategory {
Other,
}

#[derive(Clone, Debug, Eq, PartialEq)]
pub enum ProfilerEvent {
QueryStart { query_name: &'static str, category: ProfileCategory, time: u64 },
QueryEnd { query_name: &'static str, category: ProfileCategory, time: u64 },
GenericActivityStart { category: ProfileCategory, label: Cow<'static, str>, time: u64 },
GenericActivityEnd { category: ProfileCategory, label: Cow<'static, str>, time: u64 },
IncrementalLoadResultStart { query_name: &'static str, time: u64 },
IncrementalLoadResultEnd { query_name: &'static str, time: u64 },
QueryCacheHit { query_name: &'static str, category: ProfileCategory, time: u64 },
QueryCount { query_name: &'static str, category: ProfileCategory, count: usize, time: u64 },
QueryBlockedStart { query_name: &'static str, category: ProfileCategory, time: u64 },
QueryBlockedEnd { query_name: &'static str, category: ProfileCategory, time: u64 },
bitflags! {
struct EventFilter: u32 {
const GENERIC_ACTIVITIES = 1 << 0;
const QUERY_PROVIDERS = 1 << 1;
const QUERY_CACHE_HITS = 1 << 2;
const QUERY_BLOCKED = 1 << 3;
const INCR_CACHE_LOADS = 1 << 4;

const DEFAULT = Self::GENERIC_ACTIVITIES.bits |
Self::QUERY_PROVIDERS.bits |
Self::QUERY_BLOCKED.bits |
Self::INCR_CACHE_LOADS.bits;

// empty() and none() aren't const-fns unfortunately
const NONE = 0;
const ALL = !Self::NONE.bits;
}
}

const EVENT_FILTERS_BY_NAME: &[(&str, EventFilter)] = &[
("none", EventFilter::NONE),
("all", EventFilter::ALL),
("generic-activity", EventFilter::GENERIC_ACTIVITIES),
("query-provider", EventFilter::QUERY_PROVIDERS),
("query-cache-hit", EventFilter::QUERY_CACHE_HITS),
("query-blocked" , EventFilter::QUERY_BLOCKED),
("incr-cache-load", EventFilter::INCR_CACHE_LOADS),
];

fn thread_id_to_u64(tid: ThreadId) -> u64 {
unsafe { mem::transmute::<ThreadId, u64>(tid) }
}

pub struct SelfProfiler {
profiler: Profiler,
event_filter_mask: EventFilter,
query_event_kind: StringId,
generic_activity_event_kind: StringId,
incremental_load_result_event_kind: StringId,
@@ -55,7 +71,7 @@ pub struct SelfProfiler {
}

impl SelfProfiler {
pub fn new() -> Result<SelfProfiler, Box<dyn Error>> {
pub fn new(event_filters: &Option<Vec<String>>) -> Result<SelfProfiler, Box<dyn Error>> {
let filename = format!("pid-{}.rustc_profile", process::id());
let path = std::path::Path::new(&filename);
let profiler = Profiler::new(path)?;
@@ -66,8 +82,38 @@ impl SelfProfiler {
let query_blocked_event_kind = profiler.alloc_string("QueryBlocked");
let query_cache_hit_event_kind = profiler.alloc_string("QueryCacheHit");

let mut event_filter_mask = EventFilter::empty();

if let Some(ref event_filters) = *event_filters {
let mut unknown_events = vec![];
for item in event_filters {
if let Some(&(_, mask)) = EVENT_FILTERS_BY_NAME.iter()
.find(|&(name, _)| name == item) {
event_filter_mask |= mask;
} else {
unknown_events.push(item.clone());
}
}

// Warn about any unknown event names
if unknown_events.len() > 0 {
unknown_events.sort();
unknown_events.dedup();

warn!("Unknown self-profiler events specified: {}. Available options are: {}.",
unknown_events.join(", "),
EVENT_FILTERS_BY_NAME.iter()
.map(|&(name, _)| name.to_string())
.collect::<Vec<_>>()
.join(", "));
}
} else {
event_filter_mask = EventFilter::DEFAULT;
}

Ok(SelfProfiler {
profiler,
event_filter_mask,
query_event_kind,
generic_activity_event_kind,
incremental_load_result_event_kind,
@@ -86,7 +132,6 @@ impl SelfProfiler {

pub fn register_query_name(&self, query_name: QueryName) {
let id = SelfProfiler::get_query_name_string_id(query_name);

self.profiler.alloc_string_with_reserved_id(id, query_name.as_str());
}

@@ -95,54 +140,76 @@ impl SelfProfiler {
&self,
label: impl Into<Cow<'static, str>>,
) {
self.record(&label.into(), self.generic_activity_event_kind, TimestampKind::Start);
if self.event_filter_mask.contains(EventFilter::GENERIC_ACTIVITIES) {
self.record(&label.into(), self.generic_activity_event_kind, TimestampKind::Start);
}
}

#[inline]
pub fn end_activity(
&self,
label: impl Into<Cow<'static, str>>,
) {
self.record(&label.into(), self.generic_activity_event_kind, TimestampKind::End);
if self.event_filter_mask.contains(EventFilter::GENERIC_ACTIVITIES) {
self.record(&label.into(), self.generic_activity_event_kind, TimestampKind::End);
}
}

#[inline]
pub fn record_query_hit(&self, query_name: QueryName) {
self.record_query(query_name, self.query_cache_hit_event_kind, TimestampKind::Instant);
if self.event_filter_mask.contains(EventFilter::QUERY_CACHE_HITS) {
self.record_query(query_name, self.query_cache_hit_event_kind, TimestampKind::Instant);
}
}

#[inline]
pub fn start_query(&self, query_name: QueryName) {
self.record_query(query_name, self.query_event_kind, TimestampKind::Start);
if self.event_filter_mask.contains(EventFilter::QUERY_PROVIDERS) {
self.record_query(query_name, self.query_event_kind, TimestampKind::Start);
}
}

#[inline]
pub fn end_query(&self, query_name: QueryName) {
self.record_query(query_name, self.query_event_kind, TimestampKind::End);
if self.event_filter_mask.contains(EventFilter::QUERY_PROVIDERS) {
self.record_query(query_name, self.query_event_kind, TimestampKind::End);
}
}

#[inline]
pub fn incremental_load_result_start(&self, query_name: QueryName) {
self.record_query(
query_name,
self.incremental_load_result_event_kind,
TimestampKind::Start
);
if self.event_filter_mask.contains(EventFilter::INCR_CACHE_LOADS) {
self.record_query(
query_name,
self.incremental_load_result_event_kind,
TimestampKind::Start
);
}
}

#[inline]
pub fn incremental_load_result_end(&self, query_name: QueryName) {
self.record_query(query_name, self.incremental_load_result_event_kind, TimestampKind::End);
if self.event_filter_mask.contains(EventFilter::INCR_CACHE_LOADS) {
self.record_query(
query_name,
self.incremental_load_result_event_kind,
TimestampKind::End
);
}
}

#[inline]
pub fn query_blocked_start(&self, query_name: QueryName) {
self.record_query(query_name, self.query_blocked_event_kind, TimestampKind::Start);
if self.event_filter_mask.contains(EventFilter::QUERY_BLOCKED) {
self.record_query(query_name, self.query_blocked_event_kind, TimestampKind::Start);
}
}

#[inline]
pub fn query_blocked_end(&self, query_name: QueryName) {
self.record_query(query_name, self.query_blocked_event_kind, TimestampKind::End);
if self.event_filter_mask.contains(EventFilter::QUERY_BLOCKED) {
self.record_query(query_name, self.query_blocked_event_kind, TimestampKind::End);
}
}

#[inline]
1 change: 1 addition & 0 deletions src/librustc_codegen_llvm/llvm_util.rs
Original file line number Diff line number Diff line change
@@ -154,6 +154,7 @@ const X86_WHITELIST: &[(&str, Option<&str>)] = &[
("popcnt", None),
("rdrand", None),
("rdseed", None),
("rtm", Some("rtm_target_feature")),
("sha", None),
("sse", None),
("sse2", None),
1 change: 1 addition & 0 deletions src/librustc_typeck/collect.rs
Original file line number Diff line number Diff line change
@@ -2432,6 +2432,7 @@ fn from_target_feature(
Some("cmpxchg16b_target_feature") => rust_features.cmpxchg16b_target_feature,
Some("adx_target_feature") => rust_features.adx_target_feature,
Some("movbe_target_feature") => rust_features.movbe_target_feature,
Some("rtm_target_feature") => rust_features.rtm_target_feature,
Some(name) => bug!("unknown target feature gate {}", name),
None => true,
};
3 changes: 1 addition & 2 deletions src/libstd/fs.rs
Original file line number Diff line number Diff line change
@@ -901,8 +901,7 @@ impl OpenOptions {
}

fn _open(&self, path: &Path) -> io::Result<File> {
let inner = fs_imp::File::open(path, &self.0)?;
Ok(File { inner })
fs_imp::File::open(path, &self.0).map(|inner| File { inner })
}
}

35 changes: 15 additions & 20 deletions src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
@@ -402,6 +402,7 @@ declare_features! (
(active, adx_target_feature, "1.32.0", Some(44839), None),
(active, cmpxchg16b_target_feature, "1.32.0", Some(44839), None),
(active, movbe_target_feature, "1.34.0", Some(44839), None),
(active, rtm_target_feature, "1.35.0", Some(44839), None),

// Allows macro invocations on modules expressions and statements and
// procedural macros to expand to non-items.
@@ -2034,28 +2035,22 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
fn_decl: &'a ast::FnDecl,
span: Span,
_node_id: NodeId) {
match fn_kind {
FnKind::ItemFn(_, header, _, _) => {
// Check for const fn and async fn declarations.
if header.asyncness.node.is_async() {
gate_feature_post!(&self, async_await, span, "async fn is unstable");
}
if let Some(header) = fn_kind.header() {
// Check for const fn and async fn declarations.
if header.asyncness.node.is_async() {
gate_feature_post!(&self, async_await, span, "async fn is unstable");
}

if fn_decl.c_variadic {
gate_feature_post!(&self, c_variadic, span,
"C-varaidic functions are unstable");
}
// Stability of const fn methods are covered in
// `visit_trait_item` and `visit_impl_item` below; this is
// because default methods don't pass through this point.
// Stability of const fn methods are covered in
// `visit_trait_item` and `visit_impl_item` below; this is
// because default methods don't pass through this point.
self.check_abi(header.abi, span);
}

self.check_abi(header.abi, span);
}
FnKind::Method(_, sig, _, _) => {
self.check_abi(sig.header.abi, span);
}
_ => {}
if fn_decl.c_variadic {
gate_feature_post!(&self, c_variadic, span, "C-variadic functions are unstable");
}

visit::walk_fn(self, fn_kind, fn_decl, span);
}

@@ -2075,7 +2070,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
}
if sig.decl.c_variadic {
gate_feature_post!(&self, c_variadic, ti.span,
"C-varaidic functions are unstable");
"C-variadic functions are unstable");
}
if sig.header.constness.node == ast::Constness::Const {
gate_feature_post!(&self, const_fn, ti.span, "const fn is unstable");
10 changes: 10 additions & 0 deletions src/libsyntax/visit.rs
Original file line number Diff line number Diff line change
@@ -31,6 +31,16 @@ pub enum FnKind<'a> {
Closure(&'a Expr),
}

impl<'a> FnKind<'a> {
pub fn header(&self) -> Option<&'a FnHeader> {
match *self {
FnKind::ItemFn(_, header, _, _) => Some(header),
FnKind::Method(_, sig, _, _) => Some(&sig.header),
FnKind::Closure(_) => None,
}
}
}

/// Each method of the Visitor trait is a hook to be potentially
/// overridden. Each method's default implementation recursively visits
/// the substructure of the input via the corresponding `walk` method;
20 changes: 20 additions & 0 deletions src/test/codegen/pgo-instrumentation.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Test that `-Zpgo-gen` creates expected instrumentation artifacts in LLVM IR.

// needs-profiler-support
// compile-flags: -Z pgo-gen -Ccodegen-units=1

// CHECK: @__llvm_profile_raw_version =
// CHECK: @__profc_{{.*}}pgo_instrumentation{{.*}}some_function{{.*}} = private global
// CHECK: @__profd_{{.*}}pgo_instrumentation{{.*}}some_function{{.*}} = private global
// CHECK: @__profc_{{.*}}pgo_instrumentation{{.*}}main{{.*}} = private global
// CHECK: @__profd_{{.*}}pgo_instrumentation{{.*}}main{{.*}} = private global
// CHECK: @__llvm_profile_filename = {{.*}}"default_%m.profraw\00"{{.*}}

#[inline(never)]
fn some_function() {

}

fn main() {
some_function();
}
4 changes: 2 additions & 2 deletions src/test/run-make-fulldeps/pgo-gen-lto/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# needs-profiler-support

-include ../tools.mk

all:
ifeq ($(PROFILER_SUPPORT),1)
$(RUSTC) -Copt-level=3 -Clto=fat -Z pgo-gen="$(TMPDIR)" test.rs
$(call RUN,test) || exit 1
[ -e "$(TMPDIR)"/default_*.profraw ] || (echo "No .profraw file"; exit 1)
endif
6 changes: 3 additions & 3 deletions src/test/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# needs-profiler-support

-include ../tools.mk

all:
ifeq ($(PROFILER_SUPPORT),1)
$(RUSTC) -O -Ccodegen-units=1 -Z pgo-gen="$(TMPDIR)/test.profraw" --emit=llvm-ir test.rs
$(RUSTC) -O -Ccodegen-units=1 -Z pgo-gen="$(TMPDIR)" --emit=llvm-ir test.rs
# We expect symbols starting with "__llvm_profile_".
$(CGREP) "__llvm_profile_" < $(TMPDIR)/test.ll
# We do NOT expect the "__imp_" version of these symbols.
$(CGREP) -v "__imp___llvm_profile_" < $(TMPDIR)/test.ll # 64 bit
$(CGREP) -v "__imp____llvm_profile_" < $(TMPDIR)/test.ll # 32 bit
endif
4 changes: 2 additions & 2 deletions src/test/run-make-fulldeps/pgo-gen/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# needs-profiler-support

-include ../tools.mk

all:
ifeq ($(PROFILER_SUPPORT),1)
$(RUSTC) -g -Z pgo-gen="$(TMPDIR)" test.rs
$(call RUN,test) || exit 1
[ -e "$(TMPDIR)"/default_*.profraw ] || (echo "No .profraw file"; exit 1)
endif
4 changes: 2 additions & 2 deletions src/test/run-make-fulldeps/profile/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# needs-profiler-support

-include ../tools.mk

all:
ifeq ($(PROFILER_SUPPORT),1)
$(RUSTC) -g -Z profile test.rs
$(call RUN,test) || exit 1
[ -e "$(TMPDIR)/test.gcno" ] || (echo "No .gcno file"; exit 1)
[ -e "$(TMPDIR)/test.gcda" ] || (echo "No .gcda file"; exit 1)
endif
6 changes: 2 additions & 4 deletions src/test/run-make-fulldeps/sanitizer-address/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# needs-sanitizer-support

-include ../tools.mk

LOG := $(TMPDIR)/log.txt

# NOTE the address sanitizer only supports x86_64 linux and macOS

ifeq ($(TARGET),x86_64-apple-darwin)
ASAN_SUPPORT=$(SANITIZER_SUPPORT)
EXTRA_RUSTFLAG=-C rpath
else
ifeq ($(TARGET),x86_64-unknown-linux-gnu)
ASAN_SUPPORT=$(SANITIZER_SUPPORT)

# Apparently there are very specific Linux kernels, notably the one that's
# currently on Travis CI, which contain a buggy commit that triggers failures in
@@ -23,7 +23,5 @@ endif
endif

all:
ifeq ($(ASAN_SUPPORT),1)
$(RUSTC) -g -Z sanitizer=address -Z print-link-args $(EXTRA_RUSTFLAG) overflow.rs | $(CGREP) librustc_asan
$(TMPDIR)/overflow 2>&1 | $(CGREP) stack-buffer-overflow
endif
5 changes: 2 additions & 3 deletions src/test/run-make-fulldeps/sanitizer-cdylib-link/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# needs-sanitizer-support

-include ../tools.mk

LOG := $(TMPDIR)/log.txt
@@ -8,15 +10,12 @@ LOG := $(TMPDIR)/log.txt
# is correctly detected.

ifeq ($(TARGET),x86_64-unknown-linux-gnu)
ASAN_SUPPORT=$(SANITIZER_SUPPORT)

# See comment in sanitizer-address/Makefile for why this is here
EXTRA_RUSTFLAG=-C relocation-model=dynamic-no-pic
endif

all:
ifeq ($(ASAN_SUPPORT),1)
$(RUSTC) -g -Z sanitizer=address --crate-type cdylib --target $(TARGET) $(EXTRA_RUSTFLAG) library.rs
$(RUSTC) -g -Z sanitizer=address --crate-type bin --target $(TARGET) $(EXTRA_RUSTFLAG) -llibrary program.rs
LD_LIBRARY_PATH=$(TMPDIR) $(TMPDIR)/program 2>&1 | $(CGREP) stack-buffer-overflow
endif
6 changes: 2 additions & 4 deletions src/test/run-make-fulldeps/sanitizer-dylib-link/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# needs-sanitizer-support

-include ../tools.mk

LOG := $(TMPDIR)/log.txt
@@ -8,15 +10,11 @@ LOG := $(TMPDIR)/log.txt
# is correctly detected.

ifeq ($(TARGET),x86_64-unknown-linux-gnu)
ASAN_SUPPORT=$(SANITIZER_SUPPORT)

# See comment in sanitizer-address/Makefile for why this is here
EXTRA_RUSTFLAG=-C relocation-model=dynamic-no-pic
endif

all:
ifeq ($(ASAN_SUPPORT),1)
$(RUSTC) -g -Z sanitizer=address --crate-type dylib --target $(TARGET) $(EXTRA_RUSTFLAG) library.rs
$(RUSTC) -g -Z sanitizer=address --crate-type bin --target $(TARGET) $(EXTRA_RUSTFLAG) -llibrary program.rs
LD_LIBRARY_PATH=$(TMPDIR) $(TMPDIR)/program 2>&1 | $(CGREP) stack-buffer-overflow
endif
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# needs-sanitizer-support

-include ../tools.mk

# NOTE the address sanitizer only supports x86_64 linux and macOS

ifeq ($(TARGET),x86_64-apple-darwin)
ASAN_SUPPORT=$(SANITIZER_SUPPORT)
EXTRA_RUSTFLAG=-C rpath
else
ifeq ($(TARGET),x86_64-unknown-linux-gnu)
ASAN_SUPPORT=$(SANITIZER_SUPPORT)
EXTRA_RUSTFLAG=
endif
endif

all:
ifeq ($(ASAN_SUPPORT),1)
$(RUSTC) -Z sanitizer=address --crate-type proc-macro --target $(TARGET) hello.rs 2>&1 | $(CGREP) '-Z sanitizer'
endif
3 changes: 1 addition & 2 deletions src/test/run-make-fulldeps/sanitizer-leak/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
-include ../tools.mk

# needs-sanitizer-support
# only-linux
# only-x86_64
# ignore-test
# FIXME(#46126) ThinLTO for libstd broke this test

all:
ifdef SANITIZER_SUPPORT
$(RUSTC) -C opt-level=1 -g -Z sanitizer=leak -Z print-link-args leak.rs | $(CGREP) librustc_lsan
$(TMPDIR)/leak 2>&1 | $(CGREP) 'detected memory leaks'
endif
3 changes: 1 addition & 2 deletions src/test/run-make-fulldeps/sanitizer-memory/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
-include ../tools.mk

# needs-sanitizer-support
# only-linux
# only-x86_64

all:
ifdef SANITIZER_SUPPORT
$(RUSTC) -g -Z sanitizer=memory -Z print-link-args uninit.rs | $(CGREP) librustc_msan
$(TMPDIR)/uninit 2>&1 | $(CGREP) use-of-uninitialized-value
endif
7 changes: 3 additions & 4 deletions src/test/run-make-fulldeps/sanitizer-staticlib-link/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# needs-sanitizer-support

-include ../tools.mk

# This test builds a staticlib, then an executable that links to it.
# The staticlib and executable both are compiled with address sanitizer,
# The staticlib and executable both are compiled with address sanitizer,
# and we assert that a fault in the staticlib is correctly detected.

ifeq ($(TARGET),x86_64-unknown-linux-gnu)
ASAN_SUPPORT=$(SANITIZER_SUPPORT)
EXTRA_RUSTFLAG=
endif

all:
ifeq ($(ASAN_SUPPORT),1)
$(RUSTC) -g -Z sanitizer=address --crate-type staticlib --target $(TARGET) library.rs
$(CC) program.c $(call STATICLIB,library) $(call OUT_EXE,program) $(EXTRACFLAGS) $(EXTRACXXFLAGS)
LD_LIBRARY_PATH=$(TMPDIR) $(TMPDIR)/program 2>&1 | $(CGREP) stack-buffer-overflow
endif

2 changes: 1 addition & 1 deletion src/test/ui/feature-gate/feature-gate-c_variadic.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![crate_type="lib"]

pub unsafe extern "C" fn test(_: i32, ap: ...) { }
//~^ C-varaidic functions are unstable
//~^ C-variadic functions are unstable
2 changes: 1 addition & 1 deletion src/test/ui/feature-gate/feature-gate-c_variadic.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0658]: C-varaidic functions are unstable
error[E0658]: C-variadic functions are unstable
--> $DIR/feature-gate-c_variadic.rs:3:1
|
LL | pub unsafe extern "C" fn test(_: i32, ap: ...) { }
6 changes: 6 additions & 0 deletions src/test/ui/feature-gates/feature-gate-async-await.rs
Original file line number Diff line number Diff line change
@@ -2,6 +2,12 @@

#![feature(futures_api)]

struct S;

impl S {
async fn foo() {} //~ ERROR async fn is unstable
}

async fn foo() {} //~ ERROR async fn is unstable

fn main() {
17 changes: 13 additions & 4 deletions src/test/ui/feature-gates/feature-gate-async-await.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
error[E0658]: async fn is unstable
--> $DIR/feature-gate-async-await.rs:5:1
--> $DIR/feature-gate-async-await.rs:8:5
|
LL | async fn foo() {}
| ^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/50547
= help: add #![feature(async_await)] to the crate attributes to enable

error[E0658]: async fn is unstable
--> $DIR/feature-gate-async-await.rs:11:1
|
LL | async fn foo() {}
| ^^^^^^^^^^^^^^^^^
@@ -8,7 +17,7 @@ LL | async fn foo() {}
= help: add #![feature(async_await)] to the crate attributes to enable

error[E0658]: async blocks are unstable
--> $DIR/feature-gate-async-await.rs:8:13
--> $DIR/feature-gate-async-await.rs:14:13
|
LL | let _ = async {};
| ^^^^^^^^
@@ -17,14 +26,14 @@ LL | let _ = async {};
= help: add #![feature(async_await)] to the crate attributes to enable

error[E0658]: async closures are unstable
--> $DIR/feature-gate-async-await.rs:9:13
--> $DIR/feature-gate-async-await.rs:15:13
|
LL | let _ = async || {};
| ^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/50547
= help: add #![feature(async_await)] to the crate attributes to enable

error: aborting due to 3 previous errors
error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0658`.
6 changes: 3 additions & 3 deletions src/test/ui/issues/issue-32709.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `(): std::convert::From<{integer}>` is not satisfied
--> $DIR/issue-32709.rs:4:5
error[E0277]: `?` couldn't convert the error to `()`
--> $DIR/issue-32709.rs:4:11
|
LL | Err(5)?;
| ^^^^^^^ the trait `std::convert::From<{integer}>` is not implemented for `()`
| ^ the trait `std::convert::From<{integer}>` is not implemented for `()`
|
= note: required by `std::convert::From::from`

1 change: 1 addition & 0 deletions src/test/ui/target-feature-gate.rs
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@
// gate-test-adx_target_feature
// gate-test-cmpxchg16b_target_feature
// gate-test-movbe_target_feature
// gate-test-rtm_target_feature
// min-llvm-version 6.0

#[target_feature(enable = "avx512bw")]
2 changes: 1 addition & 1 deletion src/test/ui/target-feature-gate.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0658]: the target feature `avx512bw` is currently unstable
--> $DIR/target-feature-gate.rs:28:18
--> $DIR/target-feature-gate.rs:29:18
|
LL | #[target_feature(enable = "avx512bw")]
| ^^^^^^^^^^^^^^^^^^^
2 changes: 1 addition & 1 deletion src/test/ui/try-block/try-block-bad-type.rs
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@

pub fn main() {
let res: Result<u32, i32> = try {
Err("")?; //~ ERROR the trait bound `i32: std::convert::From<&str>` is not satisfied
Err("")?; //~ ERROR `?` couldn't convert the error
5
};

6 changes: 3 additions & 3 deletions src/test/ui/try-block/try-block-bad-type.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `i32: std::convert::From<&str>` is not satisfied
--> $DIR/try-block-bad-type.rs:7:9
error[E0277]: `?` couldn't convert the error to `i32`
--> $DIR/try-block-bad-type.rs:7:16
|
LL | Err("")?;
| ^^^^^^^^ the trait `std::convert::From<&str>` is not implemented for `i32`
| ^ the trait `std::convert::From<&str>` is not implemented for `i32`
|
= help: the following implementations were found:
<i32 as std::convert::From<bool>>
4 changes: 2 additions & 2 deletions src/test/ui/try-on-option.rs
Original file line number Diff line number Diff line change
@@ -4,12 +4,12 @@ fn main() {}

fn foo() -> Result<u32, ()> {
let x: Option<u32> = None;
x?; //~ the trait bound
x?; //~ ERROR `?` couldn't convert the error
Ok(22)
}

fn bar() -> u32 {
let x: Option<u32> = None;
x?; //~ the `?` operator
x?; //~ ERROR the `?` operator
22
}
6 changes: 3 additions & 3 deletions src/test/ui/try-on-option.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `(): std::convert::From<std::option::NoneError>` is not satisfied
--> $DIR/try-on-option.rs:7:5
error[E0277]: `?` couldn't convert the error to `()`
--> $DIR/try-on-option.rs:7:6
|
LL | x?;
| ^^ the trait `std::convert::From<std::option::NoneError>` is not implemented for `()`
| ^ the trait `std::convert::From<std::option::NoneError>` is not implemented for `()`
|
= note: required by `std::convert::From::from`

21 changes: 21 additions & 0 deletions src/tools/compiletest/src/header.rs
Original file line number Diff line number Diff line change
@@ -88,6 +88,9 @@ impl EarlyProps {
}
}

let rustc_has_profiler_support = env::var_os("RUSTC_PROFILER_SUPPORT").is_some();
let rustc_has_sanitizer_support = env::var_os("RUSTC_SANITIZER_SUPPORT").is_some();

iter_header(testfile, None, &mut |ln| {
// we should check if any only-<platform> exists and if it exists
// and does not matches the current platform, skip the test
@@ -116,6 +119,16 @@ impl EarlyProps {
config.parse_needs_matching_clang(ln) {
props.ignore = Ignore::Ignore;
}

if !rustc_has_profiler_support &&
config.parse_needs_profiler_support(ln) {
props.ignore = Ignore::Ignore;
}

if !rustc_has_sanitizer_support &&
config.parse_needs_sanitizer_support(ln) {
props.ignore = Ignore::Ignore;
}
}

if (config.mode == common::DebugInfoGdb || config.mode == common::DebugInfoBoth) &&
@@ -748,6 +761,14 @@ impl Config {
self.parse_name_directive(line, "needs-matching-clang")
}

fn parse_needs_profiler_support(&self, line: &str) -> bool {
self.parse_name_directive(line, "needs-profiler-support")
}

fn parse_needs_sanitizer_support(&self, line: &str) -> bool {
self.parse_name_directive(line, "needs-sanitizer-support")
}

/// Parses a name-value directive which contains config-specific information, e.g., `ignore-x86`
/// or `normalize-stderr-32bit`.
fn parse_cfg_name_directive(&self, line: &str, prefix: &str) -> ParsedNameDirective {
2 changes: 1 addition & 1 deletion src/tools/miri
2 changes: 1 addition & 1 deletion src/tools/rustfmt