Skip to content

Rollup of 10 pull requests #45818

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 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
676b4bb
rustdoc: Fix duplicated impls with generics
ollie27 Oct 29, 2017
af1e4f6
add missing docs for MetadataExt
GuillaumeGomez Oct 23, 2017
71534c4
RwLock guards are Sync if T is
RalfJung Nov 1, 2017
5687000
Update the std::thread docs and clarify that panics can nowadays be c…
sdroege Nov 2, 2017
283b4a1
Use ` instead of ' for function names
sdroege Nov 2, 2017
a12f511
Mention that panics can't possibly be caught when compiling with pani…
sdroege Nov 2, 2017
b86bba5
Make join a link to the function's documentation
sdroege Nov 2, 2017
784528b
rustbuild: don't try to install rls if ToolState is not Testing
Keruspe Oct 28, 2017
6363b06
Update reference link in doc's 404
Havvy Nov 5, 2017
03de2c7
[xsave] whitelist xsave target features
gnzlbg Nov 4, 2017
5abc524
rustdoc: add #[allow(unused)] to every doctest
QuietMisdreavus Nov 4, 2017
ce2768a
add #![allow(unused)] to the playground link rustdoc tests
QuietMisdreavus Nov 5, 2017
94d9ff5
[intrinsics] add missing div and rem vector intrinsics
gnzlbg Nov 6, 2017
01ced6e
[intrinsics] add div and rem vector tests
gnzlbg Nov 6, 2017
c3ea358
Display all emission types in error msg if user inputs invalid option.
frewsxcv Nov 5, 2017
53d8c94
Rollup merge of #45470 - GuillaumeGomez:unix-metadata-ext, r=QuietMis…
kennytm Nov 7, 2017
100e956
Rollup merge of #45588 - Keruspe:master, r=alexcrichton
kennytm Nov 7, 2017
e957d52
Rollup merge of #45620 - ollie27:rustdoc_impl_generic_dupe, r=QuietMi…
kennytm Nov 7, 2017
d40ee40
Rollup merge of #45682 - RalfJung:rwlock-guards, r=alexcrichton
kennytm Nov 7, 2017
90c2a62
Rollup merge of #45714 - sdroege:thread-panic-docs, r=dtolnay
kennytm Nov 7, 2017
93a7fd0
Rollup merge of #45761 - gnzlbg:xsave_feature, r=alexcrichton
kennytm Nov 7, 2017
39ab57e
Rollup merge of #45764 - QuietMisdreavus:rustdoc-doctest-lints, r=Gui…
kennytm Nov 7, 2017
d053310
Rollup merge of #45778 - Havvy:patch-1, r=steveklabnik
kennytm Nov 7, 2017
e5fa9e3
Rollup merge of #45782 - frewsxcv:frewsxcv-shorthands-helpers, r=mani…
kennytm Nov 7, 2017
bb3b9ac
Rollup merge of #45804 - gnzlbg:div_intr, r=alexcrichton
kennytm Nov 7, 2017
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
7 changes: 5 additions & 2 deletions src/bootstrap/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,11 @@ install!((self, builder, _config),
install_cargo(builder, self.stage, self.target);
};
Rls, "rls", _config.extended, only_hosts: true, {
builder.ensure(dist::Rls { stage: self.stage, target: self.target });
install_rls(builder, self.stage, self.target);
if builder.ensure(dist::Rls { stage: self.stage, target: self.target }).is_some() {
install_rls(builder, self.stage, self.target);
} else {
println!("skipping Install RLS stage{} ({})", self.stage, self.target);
}
};
Analysis, "analysis", _config.extended, only_hosts: false, {
builder.ensure(dist::Analysis {
Expand Down
2 changes: 1 addition & 1 deletion src/doc/not_found.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Some things that might be helpful to you though:
# Reference

* [The Rust official site](https://www.rust-lang.org)
* [The Rust reference](https://doc.rust-lang.org/reference.html)
* [The Rust reference](https://doc.rust-lang.org/reference/index.html)

# Docs

Expand Down
48 changes: 35 additions & 13 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,34 @@ impl OutputType {
}
}

fn from_shorthand(shorthand: &str) -> Option<Self> {
Some(match shorthand {
"asm" => OutputType::Assembly,
"llvm-ir" => OutputType::LlvmAssembly,
"mir" => OutputType::Mir,
"llvm-bc" => OutputType::Bitcode,
"obj" => OutputType::Object,
"metadata" => OutputType::Metadata,
"link" => OutputType::Exe,
"dep-info" => OutputType::DepInfo,
_ => return None,
})
}

fn shorthands_display() -> String {
format!(
"`{}`, `{}`, `{}`, `{}`, `{}`, `{}`, `{}`, `{}`",
OutputType::Bitcode.shorthand(),
OutputType::Assembly.shorthand(),
OutputType::LlvmAssembly.shorthand(),
OutputType::Mir.shorthand(),
OutputType::Object.shorthand(),
OutputType::Metadata.shorthand(),
OutputType::Exe.shorthand(),
OutputType::DepInfo.shorthand(),
)
}

pub fn extension(&self) -> &'static str {
match *self {
OutputType::Bitcode => "bc",
Expand Down Expand Up @@ -1485,19 +1513,13 @@ pub fn build_session_options_and_crate_config(matches: &getopts::Matches)
for list in matches.opt_strs("emit") {
for output_type in list.split(',') {
let mut parts = output_type.splitn(2, '=');
let output_type = match parts.next().unwrap() {
"asm" => OutputType::Assembly,
"llvm-ir" => OutputType::LlvmAssembly,
"mir" => OutputType::Mir,
"llvm-bc" => OutputType::Bitcode,
"obj" => OutputType::Object,
"metadata" => OutputType::Metadata,
"link" => OutputType::Exe,
"dep-info" => OutputType::DepInfo,
part => {
early_error(error_format, &format!("unknown emission type: `{}`",
part))
}
let shorthand = parts.next().unwrap();
let output_type = match OutputType::from_shorthand(shorthand) {
Some(output_type) => output_type,
None => early_error(error_format, &format!(
"unknown emission type: `{}` - expected one of: {}",
shorthand, OutputType::shorthands_display(),
)),
};
let path = parts.next().map(PathBuf::from);
output_types.insert(output_type, path);
Expand Down
3 changes: 2 additions & 1 deletion src/librustc_trans/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,8 @@ fn generic_simd_intrinsic<'a, 'tcx>(
simd_add: TyUint, TyInt => add, TyFloat => fadd;
simd_sub: TyUint, TyInt => sub, TyFloat => fsub;
simd_mul: TyUint, TyInt => mul, TyFloat => fmul;
simd_div: TyFloat => fdiv;
simd_div: TyUint => udiv, TyInt => sdiv, TyFloat => fdiv;
simd_rem: TyUint => urem, TyInt => srem, TyFloat => frem;
simd_shl: TyUint, TyInt => shl;
simd_shr: TyUint => lshr, TyInt => ashr;
simd_and: TyUint, TyInt => and;
Expand Down
4 changes: 3 additions & 1 deletion src/librustc_trans/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ const AARCH64_WHITELIST: &'static [&'static str] = &["neon\0"];
const X86_WHITELIST: &'static [&'static str] = &["avx\0", "avx2\0", "bmi\0", "bmi2\0", "sse\0",
"sse2\0", "sse3\0", "sse4.1\0", "sse4.2\0",
"ssse3\0", "tbm\0", "lzcnt\0", "popcnt\0",
"sse4a\0", "rdrnd\0", "rdseed\0", "fma\0"];
"sse4a\0", "rdrnd\0", "rdseed\0", "fma\0",
"xsave\0", "xsaveopt\0", "xsavec\0",
"xsaves\0"];

const HEXAGON_WHITELIST: &'static [&'static str] = &["hvx\0", "hvx-double\0"];

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ pub fn check_platform_intrinsic_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
"simd_eq" | "simd_ne" | "simd_lt" | "simd_le" | "simd_gt" | "simd_ge" => {
(2, vec![param(0), param(0)], param(1))
}
"simd_add" | "simd_sub" | "simd_mul" |
"simd_add" | "simd_sub" | "simd_mul" | "simd_rem" |
"simd_div" | "simd_shl" | "simd_shr" |
"simd_and" | "simd_or" | "simd_xor" => {
(1, vec![param(0), param(0)], param(0))
Expand Down
8 changes: 4 additions & 4 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,7 @@ impl DocFolder for Cache {
// Figure out the id of this impl. This may map to a
// primitive rather than always to a struct/enum.
// Note: matching twice to restrict the lifetime of the `i` borrow.
let mut dids = vec![];
let mut dids = FxHashSet();
if let clean::Item { inner: clean::ImplItem(ref i), .. } = item {
let masked_trait = i.trait_.def_id().map_or(false,
|d| self.masked_crates.contains(&d.krate));
Expand All @@ -1336,15 +1336,15 @@ impl DocFolder for Cache {
clean::BorrowedRef {
type_: box clean::ResolvedPath { did, .. }, ..
} => {
dids.push(did);
dids.insert(did);
}
ref t => {
let did = t.primitive_type().and_then(|t| {
self.primitive_locations.get(&t).cloned()
});

if let Some(did) = did {
dids.push(did);
dids.insert(did);
}
}
}
Expand All @@ -1353,7 +1353,7 @@ impl DocFolder for Cache {
if let Some(generics) = i.trait_.as_ref().and_then(|t| t.generics()) {
for bound in generics {
if let Some(did) = bound.def_id() {
dids.push(did);
dids.insert(did);
}
}
}
Expand Down
16 changes: 12 additions & 4 deletions src/librustdoc/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,15 +337,23 @@ pub fn make_test(s: &str,

let mut prog = String::new();

// First push any outer attributes from the example, assuming they
// are intended to be crate attributes.
prog.push_str(&crate_attrs);
if opts.attrs.is_empty() {
// If there aren't any attributes supplied by #![doc(test(attr(...)))], then allow some
// lints that are commonly triggered in doctests. The crate-level test attributes are
// commonly used to make tests fail in case they trigger warnings, so having this there in
// that case may cause some tests to pass when they shouldn't have.
prog.push_str("#![allow(unused)]\n");
}

// Next, any attributes for other aspects such as lints.
// Next, any attributes that came from the crate root via #![doc(test(attr(...)))].
for attr in &opts.attrs {
prog.push_str(&format!("#![{}]\n", attr));
}

// Now push any outer attributes from the example, assuming they
// are intended to be crate attributes.
prog.push_str(&crate_attrs);

// Don't inject `extern crate std` because it's already injected by the
// compiler.
if !s.contains("extern crate") && !opts.no_crate_inject && cratename != Some("std") {
Expand Down
11 changes: 8 additions & 3 deletions src/libstd/sync/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

use cell::UnsafeCell;
use fmt;
use marker;
use mem;
use ops::{Deref, DerefMut};
use ptr;
Expand Down Expand Up @@ -102,7 +101,10 @@ pub struct RwLockReadGuard<'a, T: ?Sized + 'a> {
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized> !marker::Send for RwLockReadGuard<'a, T> {}
impl<'a, T: ?Sized> !Send for RwLockReadGuard<'a, T> {}

#[stable(feature = "rwlock_guard_sync", since = "1.23.0")]
unsafe impl<'a, T: ?Sized + Sync> Sync for RwLockReadGuard<'a, T> {}

/// RAII structure used to release the exclusive write access of a lock when
/// dropped.
Expand All @@ -121,7 +123,10 @@ pub struct RwLockWriteGuard<'a, T: ?Sized + 'a> {
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized> !marker::Send for RwLockWriteGuard<'a, T> {}
impl<'a, T: ?Sized> !Send for RwLockWriteGuard<'a, T> {}

#[stable(feature = "rwlock_guard_sync", since = "1.23.0")]
unsafe impl<'a, T: ?Sized + Sync> Sync for RwLockWriteGuard<'a, T> {}

impl<T> RwLock<T> {
/// Creates a new instance of an `RwLock<T>` which is unlocked.
Expand Down
Loading