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 8 pull requests #60683

Merged
merged 27 commits into from
May 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
902904a
std: Derive `Default` for `io::Cursor`
tesaguri Apr 24, 2019
f007e6f
Identify when a stmt could have been parsed as an expr
estebank Apr 23, 2019
bff0be3
Add test case for #47287
estebank Apr 29, 2019
617ce2b
Reword ambigous parse error to fit with the current error
estebank May 1, 2019
145add7
Add test for slice drop shims
matthewjasper Mar 30, 2019
6fff547
Slightly simplify the MIR for slice drop shims
matthewjasper Apr 29, 2019
e0cef5c
fix typo
estebank May 2, 2019
f6a4b52
Deduplicate needed parentheses suggestion code
estebank May 2, 2019
6d26c5f
rustfmt
mark-i-m May 6, 2019
54430ad
review comments: fix typo and add comments
estebank May 6, 2019
606bb6f
avoid extra copy
mark-i-m May 6, 2019
5db665b
lots of comments + minor cleanup
mark-i-m May 6, 2019
eb7d47c
fix incorrect assert
mark-i-m May 8, 2019
d0ba8fe
Skip codegen for one UI test with long file path
petrochenkov May 8, 2019
b2f71fb
remove unneeded `extern crate`s from build tools
euclio May 9, 2019
e57c7b8
Add regression test for #60674.
davidtwco May 9, 2019
df41e4f
Remove the old await! macro
cramertj May 9, 2019
dcd3cf7
Do not modify mutability of simple bindings.
davidtwco May 9, 2019
d5e0406
Add FIXME about `construct_async_arguments`.
davidtwco May 9, 2019
62ab971
Rollup merge of #59348 - matthewjasper:cleanup-drop-shims, r=arielb1
Centril May 9, 2019
39edc68
Rollup merge of #60188 - estebank:recover-block, r=varkor
Centril May 9, 2019
bd17b5c
Rollup merge of #60234 - tesaguri:cursor-default, r=Amanieu
Centril May 9, 2019
903fc4b
Rollup merge of #60618 - mark-i-m:transcribe, r=petrochenkov
Centril May 9, 2019
e7b4023
Rollup merge of #60648 - petrochenkov:shorten2, r=Dylan-DPC
Centril May 9, 2019
f27f14b
Rollup merge of #60671 - euclio:extern-crate, r=Centril
Centril May 9, 2019
f6df1f6
Rollup merge of #60675 - cramertj:no-await-macro, r=nikomatsakis,Centril
Centril May 9, 2019
45b0945
Rollup merge of #60676 - davidtwco:issue-60674, r=cramertj
Centril May 9, 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
76 changes: 36 additions & 40 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions src/bootstrap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ num_cpus = "1.0"
getopts = "0.2.19"
cc = "1.0.35"
libc = "0.2"
serde = "1.0.8"
serde_derive = "1.0.8"
serde = { version = "1.0.8", features = ["derive"] }
serde_json = "1.0.2"
toml = "0.4"
lazy_static = "0.2"
lazy_static = "1.3.0"
time = "0.1"
petgraph = "0.4.13"

Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ use std::path::{Path, PathBuf};
use std::process::Command;
use std::time::{Duration, Instant};

use build_helper::t;

use crate::cache::{Cache, Interned, INTERNER};
use crate::check;
use crate::compile;
Expand Down Expand Up @@ -1308,6 +1310,8 @@ mod __test {
use crate::config::Config;
use std::thread;

use pretty_assertions::assert_eq;

fn configure(host: &[&str], target: &[&str]) -> Config {
let mut config = Config::default_opts();
// don't save toolstates
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ use std::path::{Path, PathBuf};
use std::sync::Mutex;
use std::cmp::{PartialOrd, Ord, Ordering};

use lazy_static::lazy_static;

use crate::builder::Step;

pub struct Interned<T>(usize, PhantomData<*const T>);
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ use std::fs;
use std::io::{self, ErrorKind};
use std::path::Path;

use build_helper::t;

use crate::Build;

pub fn clean(build: &Build, all: bool) {
Expand Down
3 changes: 2 additions & 1 deletion src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ use std::path::{Path, PathBuf};
use std::process::{Command, Stdio, exit};
use std::str;

use build_helper::{output, mtime, up_to_date};
use build_helper::{output, mtime, t, up_to_date};
use filetime::FileTime;
use serde::Deserialize;
use serde_json;

use crate::dist;
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ use std::path::{Path, PathBuf};
use std::process;
use std::cmp;

use build_helper::t;
use num_cpus;
use toml;
use serde::Deserialize;
use crate::cache::{INTERNER, Interned};
use crate::flags::Flags;
pub use crate::flags::Subcommand;
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::io::Write;
use std::path::{PathBuf, Path};
use std::process::{Command, Stdio};

use build_helper::output;
use build_helper::{output, t};

use crate::{Compiler, Mode, LLVM_TOOLS};
use crate::channel;
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::io;
use std::path::{PathBuf, Path};

use crate::Mode;
use build_helper::up_to_date;
use build_helper::{t, up_to_date};

use crate::util::symlink_dir;
use crate::builder::{Builder, Compiler, RunConfig, ShouldRun, Step};
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ use std::fs;
use std::path::{Path, PathBuf, Component};
use std::process::Command;

use build_helper::t;

use crate::dist::{self, pkgname, sanitize_sh, tmpdir};

use crate::builder::{Builder, RunConfig, ShouldRun, Step};
Expand Down
15 changes: 3 additions & 12 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,6 @@
#![feature(core_intrinsics)]
#![feature(drain_filter)]

#[macro_use]
extern crate build_helper;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate lazy_static;

#[cfg(test)]
#[macro_use]
extern crate pretty_assertions;

use std::cell::{RefCell, Cell};
use std::collections::{HashSet, HashMap};
use std::env;
Expand All @@ -134,7 +123,9 @@ use std::os::unix::fs::symlink as symlink_file;
#[cfg(windows)]
use std::os::windows::fs::symlink_file;

use build_helper::{run_silent, run_suppressed, try_run_silent, try_run_suppressed, output, mtime};
use build_helper::{
mtime, output, run_silent, run_suppressed, t, try_run_silent, try_run_suppressed,
};
use filetime::FileTime;

use crate::util::{exe, libdir, OutputFolder, CiEnv};
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::path::PathBuf;
use std::collections::HashSet;

use build_helper::output;
use serde::Deserialize;
use serde_json;

use crate::{Build, Crate};
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::fs::{self, File};
use std::path::{Path, PathBuf};
use std::process::Command;

use build_helper::output;
use build_helper::{output, t};
use cmake;
use cc;

Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::fs;
use std::path::PathBuf;
use std::process::Command;

use build_helper::output;
use build_helper::{output, t};

use crate::Build;

Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::iter;
use std::path::{Path, PathBuf};
use std::process::Command;

use build_helper::{self, output};
use build_helper::{self, output, t};

use crate::builder::{Builder, Compiler, Kind, RunConfig, ShouldRun, Step};
use crate::cache::{Interned, INTERNER};
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use std::path::PathBuf;
use std::process::{Command, exit};
use std::collections::HashSet;

use build_helper::t;

use crate::Mode;
use crate::Compiler;
use crate::builder::{Step, RunConfig, ShouldRun, Builder};
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/toolstate.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};

#[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
/// Whether a tool can be compiled, tested or neither
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ use std::path::{Path, PathBuf};
use std::process::Command;
use std::time::{SystemTime, Instant};

use build_helper::t;

use crate::config::Config;
use crate::builder::Builder;

Expand Down
44 changes: 11 additions & 33 deletions src/librustc/hir/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ use errors::Applicability;
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::indexed_vec::IndexVec;
use rustc_data_structures::thin_vec::ThinVec;
use rustc_data_structures::sync::Lrc;

use std::collections::{BTreeSet, BTreeMap};
use std::mem;
Expand All @@ -59,10 +58,10 @@ use syntax::attr;
use syntax::ast;
use syntax::ast::*;
use syntax::errors;
use syntax::ext::hygiene::{Mark, SyntaxContext};
use syntax::ext::hygiene::Mark;
use syntax::print::pprust;
use syntax::ptr::P;
use syntax::source_map::{self, respan, CompilerDesugaringKind, Spanned};
use syntax::source_map::{respan, CompilerDesugaringKind, Spanned};
use syntax::std_inject;
use syntax::symbol::{keywords, Symbol};
use syntax::tokenstream::{TokenStream, TokenTree};
Expand Down Expand Up @@ -854,27 +853,6 @@ impl<'a> LoweringContext<'a> {
Ident::with_empty_ctxt(Symbol::gensym(s))
}

/// Reuses the span but adds information like the kind of the desugaring and features that are
/// allowed inside this span.
fn mark_span_with_reason(
&self,
reason: CompilerDesugaringKind,
span: Span,
allow_internal_unstable: Option<Lrc<[Symbol]>>,
) -> Span {
let mark = Mark::fresh(Mark::root());
mark.set_expn_info(source_map::ExpnInfo {
call_site: span,
def_site: Some(span),
format: source_map::CompilerDesugaring(reason),
allow_internal_unstable,
allow_internal_unsafe: false,
local_inner_macros: false,
edition: source_map::hygiene::default_edition(),
});
span.with_ctxt(SyntaxContext::empty().apply_mark(mark))
}

fn with_anonymous_lifetime_mode<R>(
&mut self,
anonymous_lifetime_mode: AnonymousLifetimeMode,
Expand Down Expand Up @@ -1162,7 +1140,7 @@ impl<'a> LoweringContext<'a> {
attrs: ThinVec::new(),
};

let unstable_span = self.mark_span_with_reason(
let unstable_span = self.sess.source_map().mark_span_with_reason(
CompilerDesugaringKind::Async,
span,
Some(vec![
Expand Down Expand Up @@ -1569,7 +1547,7 @@ impl<'a> LoweringContext<'a> {
// desugaring that explicitly states that we don't want to track that.
// Not tracking it makes lints in rustc and clippy very fragile as
// frequently opened issues show.
let exist_ty_span = self.mark_span_with_reason(
let exist_ty_span = self.sess.source_map().mark_span_with_reason(
CompilerDesugaringKind::ExistentialReturnType,
span,
None,
Expand Down Expand Up @@ -2443,7 +2421,7 @@ impl<'a> LoweringContext<'a> {
) -> hir::FunctionRetTy {
let span = output.span();

let exist_ty_span = self.mark_span_with_reason(
let exist_ty_span = self.sess.source_map().mark_span_with_reason(
CompilerDesugaringKind::Async,
span,
None,
Expand Down Expand Up @@ -4179,7 +4157,7 @@ impl<'a> LoweringContext<'a> {
}),
ExprKind::TryBlock(ref body) => {
self.with_catch_scope(body.id, |this| {
let unstable_span = this.mark_span_with_reason(
let unstable_span = this.sess.source_map().mark_span_with_reason(
CompilerDesugaringKind::TryBlock,
body.span,
Some(vec![
Expand Down Expand Up @@ -4612,7 +4590,7 @@ impl<'a> LoweringContext<'a> {
// expand <head>
let mut head = self.lower_expr(head);
let head_sp = head.span;
let desugared_span = self.mark_span_with_reason(
let desugared_span = self.sess.source_map().mark_span_with_reason(
CompilerDesugaringKind::ForLoop,
head_sp,
None,
Expand Down Expand Up @@ -4773,15 +4751,15 @@ impl<'a> LoweringContext<'a> {
// return Try::from_error(From::from(err)),
// }

let unstable_span = self.mark_span_with_reason(
let unstable_span = self.sess.source_map().mark_span_with_reason(
CompilerDesugaringKind::QuestionMark,
e.span,
Some(vec![
Symbol::intern("try_trait")
].into()),
);
let try_span = self.sess.source_map().end_point(e.span);
let try_span = self.mark_span_with_reason(
let try_span = self.sess.source_map().mark_span_with_reason(
CompilerDesugaringKind::QuestionMark,
try_span,
Some(vec![
Expand Down Expand Up @@ -5566,12 +5544,12 @@ impl<'a> LoweringContext<'a> {
);
self.sess.abort_if_errors();
}
let span = self.mark_span_with_reason(
let span = self.sess.source_map().mark_span_with_reason(
CompilerDesugaringKind::Await,
await_span,
None,
);
let gen_future_span = self.mark_span_with_reason(
let gen_future_span = self.sess.source_map().mark_span_with_reason(
CompilerDesugaringKind::Await,
await_span,
Some(vec![Symbol::intern("gen_future")].into()),
Expand Down
Loading