Skip to content

Commit

Permalink
Auto merge of #56977 - pietroalbini:rollup, r=pietroalbini
Browse files Browse the repository at this point in the history
Rollup of 15 pull requests

Successful merges:

 - #56363 (Defactored Bytes::read)
 - #56663 (Remove lifetime from Resolver)
 - #56689 (add a lint group for lints emitted by rustdoc)
 - #56772 (fix issue 54153 by not testing issue-18804 on Windows nor OS X.)
 - #56820 (format-related tweaks)
 - #56881 (Implement Eq, PartialEq and Hash for atomic::Ordering)
 - #56907 (Fix grammar in compiler error for array iterators)
 - #56908 (rustc: Don't ICE on usage of two new target features)
 - #56910 (Do not point at delim spans for complete correct blocks)
 - #56913 (Enable stack probes for UEFI images)
 - #56918 (Profiler: simplify total_duration, improve readability)
 - #56931 (Update release notes for Rust 1.31.1)
 - #56947 (Add targets thumbv7neon-linux-androideabi and thumbv7neon-unknown-linux-gnueabihf)
 - #56948 (Update LLVM submodule)
 - #56959 (Fix mobile menu rendering collision with tooltip.)

Failed merges:

 - #56914 (Ignore ui/target-feature-gate on sparc, sparc64, powerpc, powerpc64 and powerpc64le)

r? @ghost
  • Loading branch information
bors committed Dec 19, 2018
2 parents 74ebf02 + 1ba6ec4 commit 6f839fb
Show file tree
Hide file tree
Showing 53 changed files with 471 additions and 255 deletions.
11 changes: 11 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
Version 1.31.1 (2018-12-20)
===========================

- [Fix Rust failing to build on `powerpc-unknown-netbsd`][56562]
- [Fix broken go-to-definition in RLS][rls/1171]
- [Fix infinite loop on hover in RLS][rls/1170]

[56562]: https://github.com/rust-lang/rust/pull/56562
[rls/1171]: https://github.com/rust-lang/rls/issues/1171
[rls/1170]: https://github.com/rust-lang/rls/pull/1170

Version 1.31.0 (2018-12-06)
==========================

Expand Down
5 changes: 4 additions & 1 deletion src/bootstrap/cc_detect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ fn set_compiler(cfg: &mut cc::Build,
// compiler already takes into account the triple in question.
t if t.contains("android") => {
if let Some(ndk) = config.and_then(|c| c.ndk.as_ref()) {
let target = target.replace("armv7", "arm");
let target = target.replace("armv7neon", "arm")
.replace("armv7", "arm")
.replace("thumbv7neon", "arm")
.replace("thumbv7", "arm");
let compiler = format!("{}-{}", target, compiler.clang());
cfg.compiler(ndk.join("bin").join(compiler));
}
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ def v(*args):
"arm-linux-androideabi NDK standalone path")
v("armv7-linux-androideabi-ndk", "target.armv7-linux-androideabi.android-ndk",
"armv7-linux-androideabi NDK standalone path")
v("thumbv7neon-linux-androideabi-ndk", "target.thumbv7neon-linux-androideabi.android-ndk",
"thumbv7neon-linux-androideabi NDK standalone path")
v("aarch64-linux-android-ndk", "target.aarch64-linux-android.android-ndk",
"aarch64-linux-android NDK standalone path")
v("x86_64-linux-android-ndk", "target.x86_64-linux-android.android-ndk",
Expand Down
2 changes: 2 additions & 0 deletions src/ci/docker/dist-android/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ RUN . /scripts/android-ndk.sh && \
# env
ENV TARGETS=arm-linux-androideabi
ENV TARGETS=$TARGETS,armv7-linux-androideabi
ENV TARGETS=$TARGETS,thumbv7neon-linux-androideabi
ENV TARGETS=$TARGETS,i686-linux-android
ENV TARGETS=$TARGETS,aarch64-linux-android
ENV TARGETS=$TARGETS,x86_64-linux-android
Expand All @@ -24,6 +25,7 @@ ENV RUST_CONFIGURE_ARGS \
--enable-extended \
--arm-linux-androideabi-ndk=/android/ndk/arm-14 \
--armv7-linux-androideabi-ndk=/android/ndk/arm-14 \
--thumbv7neon-linux-androideabi-ndk=/android/ndk/arm-14 \
--i686-linux-android-ndk=/android/ndk/x86-14 \
--aarch64-linux-android-ndk=/android/ndk/arm64-21 \
--x86_64-linux-android-ndk=/android/ndk/x86_64-21 \
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/iter/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ fn _assert_is_object_safe(_: &dyn Iterator<Item=()>) {}
on(
_Self="[]",
label="borrow the array with `&` or call `.iter()` on it to iterate over it",
note="arrays are not an iterators, but slices like the following are: `&[1, 2, 3]`"
note="arrays are not iterators, but slices like the following are: `&[1, 2, 3]`"
),
on(
_Self="{integral}",
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/sync/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ unsafe impl<T> Sync for AtomicPtr<T> {}
/// [Ordering::Relaxed]: #variant.Relaxed
/// [Ordering::SeqCst]: #variant.SeqCst
#[stable(feature = "rust1", since = "1.0.0")]
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
#[non_exhaustive]
pub enum Ordering {
/// No ordering constraints, only atomic operations.
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,19 +315,19 @@ declare_lint! {
declare_lint! {
pub INTRA_DOC_LINK_RESOLUTION_FAILURE,
Warn,
"warn about documentation intra links resolution failure"
"failures in resolving intra-doc link targets"
}

declare_lint! {
pub MISSING_DOC_CODE_EXAMPLES,
Allow,
"warn about missing code example in an item's documentation"
"detects publicly-exported items without code samples in their documentation"
}

declare_lint! {
pub PRIVATE_DOC_TESTS,
Allow,
"warn about doc test in private item"
"detects code samples in docs of private items not documented by rustdoc"
}

declare_lint! {
Expand Down
10 changes: 5 additions & 5 deletions src/librustc_driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -730,9 +730,9 @@ pub struct ExpansionResult {
pub hir_forest: hir_map::Forest,
}

pub struct InnerExpansionResult<'a, 'b: 'a> {
pub struct InnerExpansionResult<'a> {
pub expanded_crate: ast::Crate,
pub resolver: Resolver<'a, 'b>,
pub resolver: Resolver<'a>,
pub hir_forest: hir_map::Forest,
}

Expand Down Expand Up @@ -811,7 +811,7 @@ where

/// Same as phase_2_configure_and_expand, but doesn't let you keep the resolver
/// around
pub fn phase_2_configure_and_expand_inner<'a, 'b: 'a, F>(
pub fn phase_2_configure_and_expand_inner<'a, F>(
sess: &'a Session,
cstore: &'a CStore,
mut krate: ast::Crate,
Expand All @@ -820,9 +820,9 @@ pub fn phase_2_configure_and_expand_inner<'a, 'b: 'a, F>(
addl_plugins: Option<Vec<String>>,
make_glob_map: MakeGlobMap,
resolver_arenas: &'a ResolverArenas<'a>,
crate_loader: &'a mut CrateLoader<'b>,
crate_loader: &'a mut CrateLoader<'a>,
after_expand: F,
) -> Result<InnerExpansionResult<'a, 'b>, CompileIncomplete>
) -> Result<InnerExpansionResult<'a>, CompileIncomplete>
where
F: FnOnce(&ast::Crate) -> CompileResult,
{
Expand Down
119 changes: 57 additions & 62 deletions src/librustc_driver/profile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ struct StackFrame {
}

fn total_duration(traces: &[trace::Rec]) -> Duration {
let mut sum : Duration = Duration::new(0, 0);
for t in traces.iter() { sum += t.dur_total; }
return sum
Duration::new(0, 0) + traces.iter().map(|t| t.dur_total).sum()
}

// profiling thread; retains state (in local variables) and dump traces, upon request.
Expand All @@ -93,50 +91,48 @@ fn profile_queries_thread(r: Receiver<ProfileQueriesMsg>) {
ProfileQueriesMsg::Dump(params) => {
assert!(stack.is_empty());
assert!(frame.parse_st == ParseState::Clear);
{
// write log of all messages
if params.dump_profq_msg_log {
let mut log_file =
File::create(format!("{}.log.txt", params.path)).unwrap();
for m in profq_msgs.iter() {
writeln!(&mut log_file, "{:?}", m).unwrap()
};
}

// write HTML file, and counts file
let html_path = format!("{}.html", params.path);
let mut html_file = File::create(&html_path).unwrap();
// write log of all messages
if params.dump_profq_msg_log {
let mut log_file =
File::create(format!("{}.log.txt", params.path)).unwrap();
for m in profq_msgs.iter() {
writeln!(&mut log_file, "{:?}", m).unwrap()
};
}

let counts_path = format!("{}.counts.txt", params.path);
let mut counts_file = File::create(&counts_path).unwrap();
// write HTML file, and counts file
let html_path = format!("{}.html", params.path);
let mut html_file = File::create(&html_path).unwrap();

writeln!(html_file,
"<html>\n<head>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"{}\">",
"profile_queries.css").unwrap();
writeln!(html_file, "<style>").unwrap();
trace::write_style(&mut html_file);
writeln!(html_file, "</style>\n</head>\n<body>").unwrap();
trace::write_traces(&mut html_file, &mut counts_file, &frame.traces);
writeln!(html_file, "</body>\n</html>").unwrap();
let counts_path = format!("{}.counts.txt", params.path);
let mut counts_file = File::create(&counts_path).unwrap();

let ack_path = format!("{}.ack", params.path);
let ack_file = File::create(&ack_path).unwrap();
drop(ack_file);
writeln!(html_file,
"<html>\n<head>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"{}\">",
"profile_queries.css").unwrap();
writeln!(html_file, "<style>").unwrap();
trace::write_style(&mut html_file);
writeln!(html_file, "</style>\n</head>\n<body>").unwrap();
trace::write_traces(&mut html_file, &mut counts_file, &frame.traces);
writeln!(html_file, "</body>\n</html>").unwrap();

// Tell main thread that we are done, e.g., so it can exit
params.ack.send(()).unwrap();
}
continue
let ack_path = format!("{}.ack", params.path);
let ack_file = File::create(&ack_path).unwrap();
drop(ack_file);

// Tell main thread that we are done, e.g., so it can exit
params.ack.send(()).unwrap();
}
// Actual query message:
msg => {
// Record msg in our log
profq_msgs.push(msg.clone());
// Respond to the message, knowing that we've already handled Halt and Dump, above.
match (frame.parse_st.clone(), msg) {
(_,ProfileQueriesMsg::Halt) => unreachable!(),
(_,ProfileQueriesMsg::Dump(_)) => unreachable!(),

(_, ProfileQueriesMsg::Halt) | (_, ProfileQueriesMsg::Dump(_)) => {
unreachable!();
},
// Parse State: Clear
(ParseState::Clear,
ProfileQueriesMsg::QueryBegin(span, querymsg)) => {
Expand All @@ -163,8 +159,8 @@ fn profile_queries_thread(r: Receiver<ProfileQueriesMsg>) {
ParseState::HaveQuery(q, start) => {
let duration = start.elapsed();
frame = StackFrame{
parse_st:ParseState::Clear,
traces:old_frame.traces
parse_st: ParseState::Clear,
traces: old_frame.traces
};
let dur_extent = total_duration(&provider_extent);
let trace = Rec {
Expand All @@ -181,18 +177,16 @@ fn profile_queries_thread(r: Receiver<ProfileQueriesMsg>) {
}
}
},


(ParseState::Clear,
ProfileQueriesMsg::TimeBegin(msg)) => {
let start = Instant::now();
frame.parse_st = ParseState::HaveTimeBegin(msg, start);
stack.push(frame);
frame = StackFrame{parse_st:ParseState::Clear, traces:vec![]};
frame = StackFrame{parse_st: ParseState::Clear, traces: vec![]};
},
(_, ProfileQueriesMsg::TimeBegin(_)) => {
panic!("parse error; did not expect time begin here");
},
(_, ProfileQueriesMsg::TimeBegin(_)) =>
panic!("parse error; did not expect time begin here"),

(ParseState::Clear,
ProfileQueriesMsg::TimeEnd) => {
let provider_extent = frame.traces;
Expand All @@ -204,8 +198,8 @@ fn profile_queries_thread(r: Receiver<ProfileQueriesMsg>) {
ParseState::HaveTimeBegin(msg, start) => {
let duration = start.elapsed();
frame = StackFrame{
parse_st:ParseState::Clear,
traces:old_frame.traces
parse_st: ParseState::Clear,
traces: old_frame.traces
};
let dur_extent = total_duration(&provider_extent);
let trace = Rec {
Expand All @@ -222,18 +216,19 @@ fn profile_queries_thread(r: Receiver<ProfileQueriesMsg>) {
}
}
},
(_, ProfileQueriesMsg::TimeEnd) => { panic!("parse error") }

(_, ProfileQueriesMsg::TimeEnd) => {
panic!("parse error")
},
(ParseState::Clear,
ProfileQueriesMsg::TaskBegin(key)) => {
let start = Instant::now();
frame.parse_st = ParseState::HaveTaskBegin(key, start);
stack.push(frame);
frame = StackFrame{parse_st:ParseState::Clear, traces:vec![]};
frame = StackFrame{ parse_st: ParseState::Clear, traces: vec![] };
},
(_, ProfileQueriesMsg::TaskBegin(_)) => {
panic!("parse error; did not expect time begin here");
},
(_, ProfileQueriesMsg::TaskBegin(_)) =>
panic!("parse error; did not expect time begin here"),

(ParseState::Clear,
ProfileQueriesMsg::TaskEnd) => {
let provider_extent = frame.traces;
Expand All @@ -245,8 +240,8 @@ fn profile_queries_thread(r: Receiver<ProfileQueriesMsg>) {
ParseState::HaveTaskBegin(key, start) => {
let duration = start.elapsed();
frame = StackFrame{
parse_st:ParseState::Clear,
traces:old_frame.traces
parse_st: ParseState::Clear,
traces: old_frame.traces
};
let dur_extent = total_duration(&provider_extent);
let trace = Rec {
Expand All @@ -263,8 +258,9 @@ fn profile_queries_thread(r: Receiver<ProfileQueriesMsg>) {
}
}
},
(_, ProfileQueriesMsg::TaskEnd) => { panic!("parse error") }

(_, ProfileQueriesMsg::TaskEnd) => {
panic!("parse error")
},
// Parse State: HaveQuery
(ParseState::HaveQuery(q,start),
ProfileQueriesMsg::CacheHit) => {
Expand All @@ -279,26 +275,25 @@ fn profile_queries_thread(r: Receiver<ProfileQueriesMsg>) {
frame.traces.push( trace );
frame.parse_st = ParseState::Clear;
},
(ParseState::HaveQuery(_,_),
(ParseState::HaveQuery(_, _),
ProfileQueriesMsg::ProviderBegin) => {
stack.push(frame);
frame = StackFrame{parse_st:ParseState::Clear, traces:vec![]};
frame = StackFrame{ parse_st: ParseState::Clear, traces: vec![] };
},

// Parse errors:

(ParseState::HaveQuery(q,_),
(ParseState::HaveQuery(q, _),
ProfileQueriesMsg::ProviderEnd) => {
panic!("parse error: unexpected ProviderEnd; \
expected something else to follow BeginQuery for {:?}", q)
},
(ParseState::HaveQuery(q1,_),
ProfileQueriesMsg::QueryBegin(span2,querymsg2)) => {
(ParseState::HaveQuery(q1, _),
ProfileQueriesMsg::QueryBegin(span2, querymsg2)) => {
panic!("parse error: unexpected QueryBegin; \
earlier query is unfinished: {:?} and now {:?}",
q1, Query{span:span2, msg:querymsg2})
q1, Query{span:span2, msg: querymsg2})
},

(ParseState::HaveTimeBegin(_, _), _) => {
unreachable!()
},
Expand Down
9 changes: 9 additions & 0 deletions src/librustc_lint/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ use rustc::lint::builtin::{
ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE,
ELIDED_LIFETIMES_IN_PATHS,
EXPLICIT_OUTLIVES_REQUIREMENTS,
INTRA_DOC_LINK_RESOLUTION_FAILURE,
MISSING_DOC_CODE_EXAMPLES,
PRIVATE_DOC_TESTS,
parser::QUESTION_MARK_MACRO_SEP
};
use rustc::session;
Expand Down Expand Up @@ -204,6 +207,12 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
// MACRO_USE_EXTERN_CRATE,
);

add_lint_group!(sess,
"rustdoc",
INTRA_DOC_LINK_RESOLUTION_FAILURE,
MISSING_DOC_CODE_EXAMPLES,
PRIVATE_DOC_TESTS);

// Guidelines for creating a future incompatibility lint:
//
// - Create a lint defaulting to warn as normal, with ideally the same error
Expand Down
Loading

0 comments on commit 6f839fb

Please sign in to comment.