Skip to content
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

Rollup of 17 pull requests #49051

Merged
merged 47 commits into from
Mar 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
2bc3f5b
borrowck-asm: enable on mips
jcowgill Jan 23, 2018
1376bf8
tools/compiletest: add mips64 to ARCH_LIST
jcowgill Jan 25, 2018
6f55819
test: remove useless ignore-mips*el headers
jcowgill Jan 25, 2018
dcc438d
test: ignore mips64 in abi-main-signature-16bit-c-int.rs
jcowgill Jan 25, 2018
59199eb
test: remove duplicate ignore-aarch64 from stack-probes test
jcowgill Mar 9, 2018
bceb94e
test: ignore stack probe tests on mips*
jcowgill Mar 9, 2018
e0863c5
test: ignore mips* in x86_mmx test
jcowgill Mar 9, 2018
54467ae
test: ignore asm tests on mips* which won't work
jcowgill Mar 9, 2018
fb806fd
test: fix repr-transparent-aggregates test on mips64
jcowgill Mar 9, 2018
ff227c4
rustbuild: Remove ThinLTO-related configuration
alexcrichton Mar 9, 2018
a67e072
Dedupe rand
Eijebong Mar 12, 2018
74f5dd0
rustc: Start a custom cabi module for wasm32
alexcrichton Mar 12, 2018
0511077
rustc: Add `sha` to the x86 feature whitelist
alexcrichton Mar 12, 2018
0ca9a4c
Move librustdoc readme to rustc guide
mark-i-m Mar 13, 2018
a48224b
Add a section for using assertions into doc tests.
Songbird0 Mar 12, 2018
decbb83
Add test for issue 48941
ExpHP Mar 13, 2018
dc96467
Fix ICE on malformed plugin attributes
ExpHP Mar 13, 2018
12ac032
Implement import renaming with `_` (RFC 2166)
petrochenkov Mar 10, 2018
b4b7ccb
Add crate name to "main function not found" error message.
ehuss Mar 3, 2018
19b5113
rustc_trans: fix small aggregate returns for big-endian mips64 FFI
Mar 14, 2018
6aa4dcb
Add empty main() to tests where it is missing.
ehuss Mar 12, 2018
b08e6d3
Add suggestion where to add main function.
ehuss Mar 12, 2018
2f1b34c
Add backticks to `main` not found errors.
ehuss Mar 13, 2018
16d424f
Some tweaks to "type parameters from outer function" diagnostic
estebank Mar 14, 2018
5257275
Update E0601 test for new message format.
ehuss Mar 14, 2018
b6ec75f
Remove unnecessary "`" in error message E0307 (invalid self type).
kennytm Mar 15, 2018
6fbdaf4
unstabilize FusedIterator for Flatten since Flatten is unstable
Centril Mar 15, 2018
9e64946
setting ABORTING_MALLOC for asmjs backend
Mar 14, 2018
a45b79d
Rollup merge of #48706 - ehuss:main-not-found-in-crate, r=estebank
kennytm Mar 15, 2018
da88827
Rollup merge of #48875 - jcowgill:mips-test-fixes, r=sanxiyn
kennytm Mar 15, 2018
68a602e
Rollup merge of #48892 - alexcrichton:thinlto-again, r=Mark-Simulacrum
kennytm Mar 15, 2018
e1d19df
Rollup merge of #48922 - petrochenkov:asunder, r=nikomatsakis
kennytm Mar 15, 2018
35b008c
Rollup merge of #48957 - Eijebong:rand, r=michaelwoerister
kennytm Mar 15, 2018
292c6ca
Rollup merge of #48959 - alexcrichton:signext, r=eddyb
kennytm Mar 15, 2018
97b489e
Rollup merge of #48961 - Songbird0:rustdoc_doctests_assertions, r=Gui…
kennytm Mar 15, 2018
bf270bb
Rollup merge of #48965 - alexcrichton:add-sha-feature, r=eddyb
kennytm Mar 15, 2018
5e991e1
Improve `AddrParseError` documentation.
Songbird0 Mar 8, 2018
4d5cd21
Coherence diagnostic tweaks
estebank Mar 15, 2018
5a7aa6c
Rollup merge of #49007 - estebank:follow-up-47574, r=oli-obk
kennytm Mar 15, 2018
77cf02d
Rollup merge of #49024 - draganmladjenovic:mips64_cabi_sret, r=sanxiyn
kennytm Mar 15, 2018
55a0075
Rollup merge of #49042 - kennytm:fix-e0307-typo, r=rkruppe
kennytm Mar 15, 2018
90230ce
Rollup merge of #49050 - snf:fix_oom_asmjs, r=alexcrichton
kennytm Mar 15, 2018
6fbd033
Rollup merge of #48853 - Songbird0:addrparseerror_documentation_impro…
kennytm Mar 15, 2018
64490ff
Rollup merge of #48990 - ExpHP:dont-drop-the-bomb, r=estebank
kennytm Mar 15, 2018
a199fb2
Rollup merge of #49037 - estebank:coherence-tweaks, r=nikomatsakis
kennytm Mar 15, 2018
fb49ae0
Rollup merge of #49049 - Centril:fix/flatten-fusediterator, r=bluss
kennytm Mar 15, 2018
db2f0ae
Rollup merge of #48972 - mark-i-m:rustdoc_readme, r=QuietMisdreavus
kennytm Mar 15, 2018
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
43 changes: 16 additions & 27 deletions src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,6 @@ fn main() {
if let Ok(s) = env::var("RUSTC_CODEGEN_UNITS") {
cmd.arg("-C").arg(format!("codegen-units={}", s));
}
if env::var("RUSTC_THINLTO").is_ok() {
cmd.arg("-Ccodegen-units=16").arg("-Zthinlto");
}

// Emit save-analysis info.
if env::var("RUSTC_SAVE_ANALYSIS") == Ok("api".to_string()) {
Expand Down
11 changes: 0 additions & 11 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -778,17 +778,6 @@ impl<'a> Builder<'a> {
if cmd != "bench" {
cargo.arg("--release");
}

if self.config.rust_codegen_units.is_none() &&
self.build.is_rust_llvm(compiler.host) &&
self.config.rust_thinlto {
cargo.env("RUSTC_THINLTO", "1");
} else if self.config.rust_codegen_units.is_none() {
// Generally, if ThinLTO has been disabled for some reason, we
// want to set the codegen units to 1. However, we shouldn't do
// this if the option was specifically set by the user.
cargo.env("RUSTC_CODEGEN_UNITS", "1");
}
}

if self.config.locked_deps {
Expand Down
5 changes: 0 additions & 5 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ pub struct Config {
// rust codegen options
pub rust_optimize: bool,
pub rust_codegen_units: Option<u32>,
pub rust_thinlto: bool,
pub rust_debug_assertions: bool,
pub rust_debuginfo: bool,
pub rust_debuginfo_lines: bool,
Expand Down Expand Up @@ -270,7 +269,6 @@ impl Default for StringOrBool {
struct Rust {
optimize: Option<bool>,
codegen_units: Option<u32>,
thinlto: Option<bool>,
debug_assertions: Option<bool>,
debuginfo: Option<bool>,
debuginfo_lines: Option<bool>,
Expand Down Expand Up @@ -429,7 +427,6 @@ impl Config {

// Store off these values as options because if they're not provided
// we'll infer default values for them later
let mut thinlto = None;
let mut llvm_assertions = None;
let mut debuginfo_lines = None;
let mut debuginfo_only_std = None;
Expand Down Expand Up @@ -473,7 +470,6 @@ impl Config {
optimize = rust.optimize;
ignore_git = rust.ignore_git;
debug_jemalloc = rust.debug_jemalloc;
thinlto = rust.thinlto;
set(&mut config.rust_optimize_tests, rust.optimize_tests);
set(&mut config.rust_debuginfo_tests, rust.debuginfo_tests);
set(&mut config.codegen_tests, rust.codegen_tests);
Expand Down Expand Up @@ -561,7 +557,6 @@ impl Config {
"stable" | "beta" | "nightly" => true,
_ => false,
};
config.rust_thinlto = thinlto.unwrap_or(true);
config.rust_debuginfo_lines = debuginfo_lines.unwrap_or(default);
config.rust_debuginfo_only_std = debuginfo_only_std.unwrap_or(default);

Expand Down
1 change: 0 additions & 1 deletion src/bootstrap/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def v(*args):
# Optimization and debugging options. These may be overridden by the release
# channel, etc.
o("optimize", "rust.optimize", "build optimized rust code")
o("thinlto", "rust.thinlto", "build Rust with ThinLTO enabled")
o("optimize-llvm", "llvm.optimize", "build optimized LLVM")
o("llvm-assertions", "llvm.assertions", "build LLVM with assertions")
o("debug-assertions", "rust.debug-assertions", "build with debugging assertions")
Expand Down
1 change: 0 additions & 1 deletion src/ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export RUST_RELEASE_CHANNEL=nightly
if [ "$DEPLOY$DEPLOY_ALT" != "" ]; then
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --release-channel=$RUST_RELEASE_CHANNEL"
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-llvm-static-stdcpp"
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-thinlto"

if [ "$NO_LLVM_ASSERTIONS" = "1" ]; then
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-llvm-assertions"
Expand Down
16 changes: 16 additions & 0 deletions src/doc/rustdoc/src/documentation-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,22 @@ let x = 5;

There's some subtlety though! Read on for more details.

## Passing or failing a doctest

Like regular unit tests, regular doctests are considered to "pass"
if they compile and run without panicking.
So if you want to demonstrate that some computation gives a certain result,
the `assert!` family of macros works the same as other Rust code:

```rust
let foo = "foo";

assert_eq!(foo, "foo");
```

This way, if the computation ever returns something different,
the code panics and the doctest fails.

## Pre-processing examples

In the example above, you'll note something strange: there's no `main`
Expand Down
5 changes: 0 additions & 5 deletions src/liballoc/tests/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@
// except according to those terms.

use std::borrow::Cow;
#[cfg(not(target_arch = "asmjs"))]
use std::collections::CollectionAllocErr::*;
#[cfg(not(target_arch = "asmjs"))]
use std::mem::size_of;
#[cfg(not(target_arch = "asmjs"))]
use std::{usize, isize};

pub trait IntoCow<'a, B: ?Sized> where B: ToOwned {
Expand Down Expand Up @@ -535,7 +532,6 @@ fn test_reserve_exact() {
assert!(s.capacity() >= 33)
}

#[cfg(not(target_arch = "asmjs"))]
#[test]
fn test_try_reserve() {

Expand Down Expand Up @@ -613,7 +609,6 @@ fn test_try_reserve() {

}

#[cfg(not(target_arch = "asmjs"))]
#[test]
fn test_try_reserve_exact() {

Expand Down
7 changes: 1 addition & 6 deletions src/liballoc/tests/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@

use std::borrow::Cow;
use std::mem::size_of;
use std::{usize, panic};
#[cfg(not(target_arch = "asmjs"))]
use std::isize;
use std::{usize, isize, panic};
use std::vec::{Drain, IntoIter};
#[cfg(not(target_arch = "asmjs"))]
use std::collections::CollectionAllocErr::*;

struct DropCounter<'a> {
Expand Down Expand Up @@ -994,7 +991,6 @@ fn test_reserve_exact() {
assert!(v.capacity() >= 33)
}

#[cfg(not(target_arch = "asmjs"))]
#[test]
fn test_try_reserve() {

Expand Down Expand Up @@ -1097,7 +1093,6 @@ fn test_try_reserve() {

}

#[cfg(not(target_arch = "asmjs"))]
#[test]
fn test_try_reserve_exact() {

Expand Down
8 changes: 1 addition & 7 deletions src/liballoc/tests/vec_deque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,9 @@
use std::collections::VecDeque;
use std::fmt::Debug;
use std::collections::vec_deque::{Drain};
#[cfg(not(target_arch = "asmjs"))]
use std::collections::CollectionAllocErr::*;
#[cfg(not(target_arch = "asmjs"))]
use std::mem::size_of;
use std::isize;
#[cfg(not(target_arch = "asmjs"))]
use std::usize;
use std::{usize, isize};

use self::Taggy::*;
use self::Taggypar::*;
Expand Down Expand Up @@ -1053,7 +1049,6 @@ fn test_reserve_exact_2() {
assert!(v.capacity() >= 48)
}

#[cfg(not(target_arch = "asmjs"))]
#[test]
fn test_try_reserve() {

Expand Down Expand Up @@ -1155,7 +1150,6 @@ fn test_try_reserve() {

}

#[cfg(not(target_arch = "asmjs"))]
#[test]
fn test_try_reserve_exact() {

Expand Down
2 changes: 1 addition & 1 deletion src/libcore/iter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2605,7 +2605,7 @@ impl<I, U> DoubleEndedIterator for Flatten<I>
}
}

#[stable(feature = "fused", since = "1.26.0")]
#[unstable(feature = "iterator_flatten", issue = "48213")]
impl<I, U> FusedIterator for Flatten<I>
where I: FusedIterator, U: Iterator,
I::Item: IntoIterator<IntoIter = U, Item = U::Item> {}
Expand Down
14 changes: 10 additions & 4 deletions src/librustc/middle/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ impl<'a, 'tcx> ItemLikeVisitor<'tcx> for EntryContext<'a, 'tcx> {
}
}

pub fn find_entry_point(session: &Session, hir_map: &hir_map::Map) {
pub fn find_entry_point(session: &Session,
hir_map: &hir_map::Map,
crate_name: &str) {
let any_exe = session.crate_types.borrow().iter().any(|ty| {
*ty == config::CrateTypeExecutable
});
Expand All @@ -81,7 +83,7 @@ pub fn find_entry_point(session: &Session, hir_map: &hir_map::Map) {

hir_map.krate().visit_all_item_likes(&mut ctxt);

configure_main(&mut ctxt);
configure_main(&mut ctxt, crate_name);
}

// Beware, this is duplicated in libsyntax/entry.rs, make sure to keep
Expand Down Expand Up @@ -150,7 +152,7 @@ fn find_item(item: &Item, ctxt: &mut EntryContext, at_root: bool) {
}
}

fn configure_main(this: &mut EntryContext) {
fn configure_main(this: &mut EntryContext, crate_name: &str) {
if this.start_fn.is_some() {
*this.session.entry_fn.borrow_mut() = this.start_fn;
this.session.entry_type.set(Some(config::EntryStart));
Expand All @@ -162,7 +164,8 @@ fn configure_main(this: &mut EntryContext) {
this.session.entry_type.set(Some(config::EntryMain));
} else {
// No main function
let mut err = struct_err!(this.session, E0601, "main function not found");
let mut err = struct_err!(this.session, E0601,
"`main` function not found in crate `{}`", crate_name);
if !this.non_main_fns.is_empty() {
// There were some functions named 'main' though. Try to give the user a hint.
err.note("the main function must be defined at the crate level \
Expand All @@ -175,6 +178,9 @@ fn configure_main(this: &mut EntryContext) {
err.emit();
this.session.abort_if_errors();
} else {
if let Some(ref filename) = this.session.local_crate_source_file {
err.note(&format!("consider adding a `main` function to `{}`", filename.display()));
}
if this.session.teach(&err.get_code().unwrap()) {
err.note("If you don't know the basics of Rust, you can go look to the Rust Book \
to get started: https://doc.rust-lang.org/book/");
Expand Down
Loading