Skip to content

Commit 03bd2f6

Browse files
committed
Auto merge of #60683 - Centril:rollup-p05qh5d, r=Centril
Rollup of 8 pull requests Successful merges: - #59348 (Clean up and add tests for slice drop shims) - #60188 (Identify when a stmt could have been parsed as an expr) - #60234 (std: Derive `Default` for `io::Cursor`) - #60618 (Comment ext::tt::transcribe) - #60648 (Skip codegen for one UI test with long file path) - #60671 (remove unneeded `extern crate`s from build tools) - #60675 (Remove the old await! macro) - #60676 (Fix async desugaring providing wrong input to procedural macros.) Failed merges: r? @ghost
2 parents adcd4aa + 45b0945 commit 03bd2f6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+818
-294
lines changed

Cargo.lock

+36-40
Large diffs are not rendered by default.

src/bootstrap/Cargo.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,10 @@ num_cpus = "1.0"
4242
getopts = "0.2.19"
4343
cc = "1.0.35"
4444
libc = "0.2"
45-
serde = "1.0.8"
46-
serde_derive = "1.0.8"
45+
serde = { version = "1.0.8", features = ["derive"] }
4746
serde_json = "1.0.2"
4847
toml = "0.4"
49-
lazy_static = "0.2"
48+
lazy_static = "1.3.0"
5049
time = "0.1"
5150
petgraph = "0.4.13"
5251

src/bootstrap/builder.rs

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ use std::path::{Path, PathBuf};
1111
use std::process::Command;
1212
use std::time::{Duration, Instant};
1313

14+
use build_helper::t;
15+
1416
use crate::cache::{Cache, Interned, INTERNER};
1517
use crate::check;
1618
use crate::compile;
@@ -1308,6 +1310,8 @@ mod __test {
13081310
use crate::config::Config;
13091311
use std::thread;
13101312

1313+
use pretty_assertions::assert_eq;
1314+
13111315
fn configure(host: &[&str], target: &[&str]) -> Config {
13121316
let mut config = Config::default_opts();
13131317
// don't save toolstates

src/bootstrap/cache.rs

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ use std::path::{Path, PathBuf};
1313
use std::sync::Mutex;
1414
use std::cmp::{PartialOrd, Ord, Ordering};
1515

16+
use lazy_static::lazy_static;
17+
1618
use crate::builder::Step;
1719

1820
pub struct Interned<T>(usize, PhantomData<*const T>);

src/bootstrap/clean.rs

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ use std::fs;
99
use std::io::{self, ErrorKind};
1010
use std::path::Path;
1111

12+
use build_helper::t;
13+
1214
use crate::Build;
1315

1416
pub fn clean(build: &Build, all: bool) {

src/bootstrap/compile.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ use std::path::{Path, PathBuf};
1515
use std::process::{Command, Stdio, exit};
1616
use std::str;
1717

18-
use build_helper::{output, mtime, up_to_date};
18+
use build_helper::{output, mtime, t, up_to_date};
1919
use filetime::FileTime;
20+
use serde::Deserialize;
2021
use serde_json;
2122

2223
use crate::dist;

src/bootstrap/config.rs

+2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ use std::path::{Path, PathBuf};
1010
use std::process;
1111
use std::cmp;
1212

13+
use build_helper::t;
1314
use num_cpus;
1415
use toml;
16+
use serde::Deserialize;
1517
use crate::cache::{INTERNER, Interned};
1618
use crate::flags::Flags;
1719
pub use crate::flags::Subcommand;

src/bootstrap/dist.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::io::Write;
1414
use std::path::{PathBuf, Path};
1515
use std::process::{Command, Stdio};
1616

17-
use build_helper::output;
17+
use build_helper::{output, t};
1818

1919
use crate::{Compiler, Mode, LLVM_TOOLS};
2020
use crate::channel;

src/bootstrap/doc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::io;
1313
use std::path::{PathBuf, Path};
1414

1515
use crate::Mode;
16-
use build_helper::up_to_date;
16+
use build_helper::{t, up_to_date};
1717

1818
use crate::util::symlink_dir;
1919
use crate::builder::{Builder, Compiler, RunConfig, ShouldRun, Step};

src/bootstrap/install.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ use std::fs;
88
use std::path::{Path, PathBuf, Component};
99
use std::process::Command;
1010

11+
use build_helper::t;
12+
1113
use crate::dist::{self, pkgname, sanitize_sh, tmpdir};
1214

1315
use crate::builder::{Builder, RunConfig, ShouldRun, Step};

src/bootstrap/lib.rs

+3-12
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,6 @@
108108
#![feature(core_intrinsics)]
109109
#![feature(drain_filter)]
110110

111-
#[macro_use]
112-
extern crate build_helper;
113-
#[macro_use]
114-
extern crate serde_derive;
115-
#[macro_use]
116-
extern crate lazy_static;
117-
118-
#[cfg(test)]
119-
#[macro_use]
120-
extern crate pretty_assertions;
121-
122111
use std::cell::{RefCell, Cell};
123112
use std::collections::{HashSet, HashMap};
124113
use std::env;
@@ -134,7 +123,9 @@ use std::os::unix::fs::symlink as symlink_file;
134123
#[cfg(windows)]
135124
use std::os::windows::fs::symlink_file;
136125

137-
use build_helper::{run_silent, run_suppressed, try_run_silent, try_run_suppressed, output, mtime};
126+
use build_helper::{
127+
mtime, output, run_silent, run_suppressed, t, try_run_silent, try_run_suppressed,
128+
};
138129
use filetime::FileTime;
139130

140131
use crate::util::{exe, libdir, OutputFolder, CiEnv};

src/bootstrap/metadata.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::path::PathBuf;
44
use std::collections::HashSet;
55

66
use build_helper::output;
7+
use serde::Deserialize;
78
use serde_json;
89

910
use crate::{Build, Crate};

src/bootstrap/native.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::fs::{self, File};
1414
use std::path::{Path, PathBuf};
1515
use std::process::Command;
1616

17-
use build_helper::output;
17+
use build_helper::{output, t};
1818
use cmake;
1919
use cc;
2020

src/bootstrap/sanity.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use std::fs;
1515
use std::path::PathBuf;
1616
use std::process::Command;
1717

18-
use build_helper::output;
18+
use build_helper::{output, t};
1919

2020
use crate::Build;
2121

src/bootstrap/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use std::iter;
1111
use std::path::{Path, PathBuf};
1212
use std::process::Command;
1313

14-
use build_helper::{self, output};
14+
use build_helper::{self, output, t};
1515

1616
use crate::builder::{Builder, Compiler, Kind, RunConfig, ShouldRun, Step};
1717
use crate::cache::{Interned, INTERNER};

src/bootstrap/tool.rs

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ use std::path::PathBuf;
44
use std::process::{Command, exit};
55
use std::collections::HashSet;
66

7+
use build_helper::t;
8+
79
use crate::Mode;
810
use crate::Compiler;
911
use crate::builder::{Step, RunConfig, ShouldRun, Builder};

src/bootstrap/toolstate.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use serde::{Deserialize, Serialize};
2+
13
#[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
24
#[serde(rename_all = "kebab-case")]
35
/// Whether a tool can be compiled, tested or neither

src/bootstrap/util.rs

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ use std::path::{Path, PathBuf};
1111
use std::process::Command;
1212
use std::time::{SystemTime, Instant};
1313

14+
use build_helper::t;
15+
1416
use crate::config::Config;
1517
use crate::builder::Builder;
1618

src/librustc/hir/lowering.rs

+11-33
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ use errors::Applicability;
5050
use rustc_data_structures::fx::FxHashSet;
5151
use rustc_data_structures::indexed_vec::IndexVec;
5252
use rustc_data_structures::thin_vec::ThinVec;
53-
use rustc_data_structures::sync::Lrc;
5453

5554
use std::collections::{BTreeSet, BTreeMap};
5655
use std::mem;
@@ -59,10 +58,10 @@ use syntax::attr;
5958
use syntax::ast;
6059
use syntax::ast::*;
6160
use syntax::errors;
62-
use syntax::ext::hygiene::{Mark, SyntaxContext};
61+
use syntax::ext::hygiene::Mark;
6362
use syntax::print::pprust;
6463
use syntax::ptr::P;
65-
use syntax::source_map::{self, respan, CompilerDesugaringKind, Spanned};
64+
use syntax::source_map::{respan, CompilerDesugaringKind, Spanned};
6665
use syntax::std_inject;
6766
use syntax::symbol::{keywords, Symbol};
6867
use syntax::tokenstream::{TokenStream, TokenTree};
@@ -854,27 +853,6 @@ impl<'a> LoweringContext<'a> {
854853
Ident::with_empty_ctxt(Symbol::gensym(s))
855854
}
856855

857-
/// Reuses the span but adds information like the kind of the desugaring and features that are
858-
/// allowed inside this span.
859-
fn mark_span_with_reason(
860-
&self,
861-
reason: CompilerDesugaringKind,
862-
span: Span,
863-
allow_internal_unstable: Option<Lrc<[Symbol]>>,
864-
) -> Span {
865-
let mark = Mark::fresh(Mark::root());
866-
mark.set_expn_info(source_map::ExpnInfo {
867-
call_site: span,
868-
def_site: Some(span),
869-
format: source_map::CompilerDesugaring(reason),
870-
allow_internal_unstable,
871-
allow_internal_unsafe: false,
872-
local_inner_macros: false,
873-
edition: source_map::hygiene::default_edition(),
874-
});
875-
span.with_ctxt(SyntaxContext::empty().apply_mark(mark))
876-
}
877-
878856
fn with_anonymous_lifetime_mode<R>(
879857
&mut self,
880858
anonymous_lifetime_mode: AnonymousLifetimeMode,
@@ -1162,7 +1140,7 @@ impl<'a> LoweringContext<'a> {
11621140
attrs: ThinVec::new(),
11631141
};
11641142

1165-
let unstable_span = self.mark_span_with_reason(
1143+
let unstable_span = self.sess.source_map().mark_span_with_reason(
11661144
CompilerDesugaringKind::Async,
11671145
span,
11681146
Some(vec![
@@ -1569,7 +1547,7 @@ impl<'a> LoweringContext<'a> {
15691547
// desugaring that explicitly states that we don't want to track that.
15701548
// Not tracking it makes lints in rustc and clippy very fragile as
15711549
// frequently opened issues show.
1572-
let exist_ty_span = self.mark_span_with_reason(
1550+
let exist_ty_span = self.sess.source_map().mark_span_with_reason(
15731551
CompilerDesugaringKind::ExistentialReturnType,
15741552
span,
15751553
None,
@@ -2443,7 +2421,7 @@ impl<'a> LoweringContext<'a> {
24432421
) -> hir::FunctionRetTy {
24442422
let span = output.span();
24452423

2446-
let exist_ty_span = self.mark_span_with_reason(
2424+
let exist_ty_span = self.sess.source_map().mark_span_with_reason(
24472425
CompilerDesugaringKind::Async,
24482426
span,
24492427
None,
@@ -4179,7 +4157,7 @@ impl<'a> LoweringContext<'a> {
41794157
}),
41804158
ExprKind::TryBlock(ref body) => {
41814159
self.with_catch_scope(body.id, |this| {
4182-
let unstable_span = this.mark_span_with_reason(
4160+
let unstable_span = this.sess.source_map().mark_span_with_reason(
41834161
CompilerDesugaringKind::TryBlock,
41844162
body.span,
41854163
Some(vec![
@@ -4612,7 +4590,7 @@ impl<'a> LoweringContext<'a> {
46124590
// expand <head>
46134591
let mut head = self.lower_expr(head);
46144592
let head_sp = head.span;
4615-
let desugared_span = self.mark_span_with_reason(
4593+
let desugared_span = self.sess.source_map().mark_span_with_reason(
46164594
CompilerDesugaringKind::ForLoop,
46174595
head_sp,
46184596
None,
@@ -4773,15 +4751,15 @@ impl<'a> LoweringContext<'a> {
47734751
// return Try::from_error(From::from(err)),
47744752
// }
47754753

4776-
let unstable_span = self.mark_span_with_reason(
4754+
let unstable_span = self.sess.source_map().mark_span_with_reason(
47774755
CompilerDesugaringKind::QuestionMark,
47784756
e.span,
47794757
Some(vec![
47804758
Symbol::intern("try_trait")
47814759
].into()),
47824760
);
47834761
let try_span = self.sess.source_map().end_point(e.span);
4784-
let try_span = self.mark_span_with_reason(
4762+
let try_span = self.sess.source_map().mark_span_with_reason(
47854763
CompilerDesugaringKind::QuestionMark,
47864764
try_span,
47874765
Some(vec![
@@ -5566,12 +5544,12 @@ impl<'a> LoweringContext<'a> {
55665544
);
55675545
self.sess.abort_if_errors();
55685546
}
5569-
let span = self.mark_span_with_reason(
5547+
let span = self.sess.source_map().mark_span_with_reason(
55705548
CompilerDesugaringKind::Await,
55715549
await_span,
55725550
None,
55735551
);
5574-
let gen_future_span = self.mark_span_with_reason(
5552+
let gen_future_span = self.sess.source_map().mark_span_with_reason(
55755553
CompilerDesugaringKind::Await,
55765554
await_span,
55775555
Some(vec![Symbol::intern("gen_future")].into()),

0 commit comments

Comments
 (0)