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 13 pull requests #51448

Merged
merged 48 commits into from
Jun 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
0fd8cb4
Update outdated comment for split_auto_traits private fn
Havvy May 30, 2018
11c283c
Prohibit duplicate `macro_export`s
petrochenkov Apr 21, 2018
c1df62a
Add closing bracket expectation to sequences, modified appropriate te…
Crazycolorz5 Jun 1, 2018
a771580
Modified another test case to expect a closing delimiter.
Crazycolorz5 Jun 1, 2018
bfdd90c
Modified test case again.
Crazycolorz5 Jun 1, 2018
86ff9fa
Dedup auto traits in trait objects
Havvy Jun 1, 2018
b78457f
Stabilize unit tests with non-`()` return type
Dylan-DPC Jun 2, 2018
bc74162
fixed feature gate to right place
Dylan-DPC Jun 2, 2018
72f2f19
Merge branch 'master' into stabilise/termination-test
Dylan-DPC Jun 4, 2018
377cf44
Suggest braces when a struct literal needs them
estebank Jun 5, 2018
14e4a42
Changed a few tests, and changed the folder of a few of them.
Crazycolorz5 Jun 5, 2018
4cbf400
flag changed to none
Dylan-DPC Jun 5, 2018
e8fd74a
remove redundant match branch
Dylan-DPC Jun 5, 2018
1048ae2
append unused variables with _
Dylan-DPC Jun 6, 2018
5c36e01
Use scope tree depths to speed up `nearest_common_ancestor`.
nnethercote Jun 6, 2018
5c7ca77
Make the size of Option<NonZero*> a documented guarantee.
SimonSapin Jun 6, 2018
8ecbd35
fix stderrs
Dylan-DPC Jun 6, 2018
507dfd2
Use spans pointing at the inside of a rustdoc attribute
estebank Jun 6, 2018
7d0b6b7
When unable to sinthesize link span, fallback to previous behavior
estebank Jun 6, 2018
36381fa
Warn on `repr` without hints
estebank Jun 6, 2018
2c7099b
Expand output and suggestions, fix tests
estebank Jun 6, 2018
3580de8
Turn warning into lint
estebank Jun 6, 2018
48e45ee
Add `transparent` as valid `repr` hint
estebank Jun 6, 2018
451eb66
Expand (fix) u* and i* `repr` hints
estebank Jun 6, 2018
9a80c2b
Change repr documentation link
estebank Jun 6, 2018
b3810f6
Add i/u size
estebank Jun 6, 2018
3cc09c8
Use consistent span for repr attr suggestion
estebank Jun 6, 2018
0e3f19d
Do not account for inner/outer attr
estebank Jun 7, 2018
eccd2ed
Use Ord::cmp for auto traits since stable sort not needed
Havvy Jun 7, 2018
31bb50b
Use `from_inner_byte_pos` for cleaner code
estebank Jun 7, 2018
b0440d3
Avoid useless Vec clones in pending_obligations().
nnethercote Apr 19, 2018
ec08622
compiletest: autoremove duplicate .nll.* files (#51204)
FelixMcFelix Jun 7, 2018
721f2e7
Do not require stage 2 compiler for rustdoc
Mark-Simulacrum Jun 8, 2018
c28145d
rustbuild: generate full list of dependencies for metadata
est31 Jun 8, 2018
df0c6a9
Built, corrected, and run tests. Added expected stderr files.
Crazycolorz5 Jun 8, 2018
91b6842
Rollup merge of #50143 - petrochenkov:mexuniq, r=nikomatsakis
Mark-Simulacrum Jun 8, 2018
71865fb
Rollup merge of #51099 - Crazycolorz5:expectedcloseparen, r=estebank
Mark-Simulacrum Jun 8, 2018
b370f0e
Rollup merge of #51276 - Havvy:dyn-trait-send-send, r=nikomatsakis
Mark-Simulacrum Jun 8, 2018
d68098a
Rollup merge of #51298 - Dylan-DPC:stabilise/termination-test, r=niko…
Mark-Simulacrum Jun 8, 2018
4b176b2
Rollup merge of #51360 - estebank:braces-around-literal-structs, r=ni…
Mark-Simulacrum Jun 8, 2018
32ed5ac
Rollup merge of #51391 - estebank:docspan, r=GuillaumeGomez
Mark-Simulacrum Jun 8, 2018
6abaf4e
Rollup merge of #51394 - nnethercote:NCA-depths, r=nikomatsakis
Mark-Simulacrum Jun 8, 2018
b1a6db2
Rollup merge of #51396 - SimonSapin:option-nonzero-layout, r=SimonSapin
Mark-Simulacrum Jun 8, 2018
898bb78
Rollup merge of #51401 - estebank:warn-repr, r=cramertj
Mark-Simulacrum Jun 8, 2018
8ac351c
Rollup merge of #51412 - nnethercote:pending_obligations, r=estebank
Mark-Simulacrum Jun 8, 2018
4a2c1c2
Rollup merge of #51427 - FelixMcFelix:nll-stderr-remover, r=oli-obk
Mark-Simulacrum Jun 8, 2018
efb30d7
Rollup merge of #51436 - Mark-Simulacrum:doc-stage1, r=QuietMisdreavus
Mark-Simulacrum Jun 8, 2018
8c5002d
Rollup merge of #51437 - est31:rustbuild_metadata, r=Mark-Simulacrum
Mark-Simulacrum Jun 8, 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
5 changes: 1 addition & 4 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -800,10 +800,7 @@ impl<'a> Builder<'a> {
cargo.env("RUSTC_ERROR_FORMAT", error_format);
}
if cmd != "build" && cmd != "check" && want_rustdoc {
cargo.env(
"RUSTDOC_LIBDIR",
self.rustc_libdir(self.compiler(2, self.config.build)),
);
cargo.env("RUSTDOC_LIBDIR", self.sysroot_libdir(compiler, self.config.build));
}

if mode.is_tool() {
Expand Down
3 changes: 2 additions & 1 deletion src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ pub struct Build {
struct Crate {
name: Interned<String>,
version: String,
deps: Vec<Interned<String>>,
deps: HashSet<Interned<String>>,
id: String,
path: PathBuf,
doc_step: String,
build_step: String,
Expand Down
54 changes: 31 additions & 23 deletions src/bootstrap/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use std::collections::HashMap;
use std::process::Command;
use std::path::PathBuf;
use std::collections::HashSet;

use build_helper::output;
use serde_json;
Expand Down Expand Up @@ -45,12 +46,34 @@ struct ResolveNode {
}

pub fn build(build: &mut Build) {
build_krate(build, "src/libstd");
build_krate(build, "src/libtest");
build_krate(build, "src/rustc");
let mut resolves = Vec::new();
build_krate(&build.std_features(), build, &mut resolves, "src/libstd");
build_krate("", build, &mut resolves, "src/libtest");
build_krate(&build.rustc_features(), build, &mut resolves, "src/rustc");

let mut id2name = HashMap::new();
for (name, krate) in build.crates.iter() {
id2name.insert(krate.id.clone(), name.clone());
}

for node in resolves {
let name = match id2name.get(&node.id) {
Some(name) => name,
None => continue,
};

let krate = build.crates.get_mut(name).unwrap();
for dep in node.dependencies.iter() {
let dep = match id2name.get(dep) {
Some(dep) => dep,
None => continue,
};
krate.deps.insert(*dep);
}
}
}

fn build_krate(build: &mut Build, krate: &str) {
fn build_krate(features: &str, build: &mut Build, resolves: &mut Vec<ResolveNode>, krate: &str) {
// Run `cargo metadata` to figure out what crates we're testing.
//
// Down below we're going to call `cargo test`, but to test the right set
Expand All @@ -60,14 +83,13 @@ fn build_krate(build: &mut Build, krate: &str) {
let mut cargo = Command::new(&build.initial_cargo);
cargo.arg("metadata")
.arg("--format-version").arg("1")
.arg("--features").arg(features)
.arg("--manifest-path").arg(build.src.join(krate).join("Cargo.toml"));
let output = output(&mut cargo);
let output: Output = serde_json::from_str(&output).unwrap();
let mut id2name = HashMap::new();
for package in output.packages {
if package.source.is_none() {
let name = INTERNER.intern_string(package.name);
id2name.insert(package.id, name);
let mut path = PathBuf::from(package.manifest_path);
path.pop();
build.crates.insert(name, Crate {
Expand All @@ -77,25 +99,11 @@ fn build_krate(build: &mut Build, krate: &str) {
bench_step: format!("bench-crate-{}", name),
name,
version: package.version,
deps: Vec::new(),
id: package.id,
deps: HashSet::new(),
path,
});
}
}

for node in output.resolve.nodes {
let name = match id2name.get(&node.id) {
Some(name) => name,
None => continue,
};

let krate = build.crates.get_mut(name).unwrap();
for dep in node.dependencies.iter() {
let dep = match id2name.get(dep) {
Some(dep) => dep,
None => continue,
};
krate.deps.push(*dep);
}
}
resolves.extend(output.resolve.nodes);
}
4 changes: 2 additions & 2 deletions src/libcore/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ macro_rules! nonzero_integers {
$(
/// An integer that is known not to equal zero.
///
/// This may enable some memory layout optimization such as:
/// This enables some memory layout optimization.
/// For example, `Option<NonZeroU32>` is the same size as `u32`:
///
/// ```rust
/// # #![feature(nonzero)]
/// use std::mem::size_of;
/// assert_eq!(size_of::<Option<std::num::NonZeroU32>>(), size_of::<u32>());
/// ```
Expand Down
19 changes: 19 additions & 0 deletions src/librustc/lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use errors::{Applicability, DiagnosticBuilder};
use lint::{LintPass, LateLintPass, LintArray};
use session::Session;
use syntax::ast;
use syntax::codemap::Span;

declare_lint! {
Expand Down Expand Up @@ -206,6 +207,12 @@ declare_lint! {
"potentially-conflicting impls were erroneously allowed"
}

declare_lint! {
pub BAD_REPR,
Warn,
"detects incorrect use of `repr` attribute"
}

declare_lint! {
pub DEPRECATED,
Warn,
Expand Down Expand Up @@ -285,6 +292,12 @@ declare_lint! {
"warns about duplicate associated type bindings in generics"
}

declare_lint! {
pub DUPLICATE_MACRO_EXPORTS,
Deny,
"detects duplicate macro exports"
}

/// Does nothing as a lint pass, but registers some `Lint`s
/// which are used by other parts of the compiler.
#[derive(Copy, Clone)]
Expand Down Expand Up @@ -337,6 +350,7 @@ impl LintPass for HardwiredLints {
ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE,
UNSTABLE_NAME_COLLISIONS,
DUPLICATE_ASSOCIATED_TYPE_BINDINGS,
DUPLICATE_MACRO_EXPORTS,
)
}
}
Expand All @@ -348,6 +362,7 @@ pub enum BuiltinLintDiagnostics {
Normal,
BareTraitObject(Span, /* is_global */ bool),
AbsPathWithModule(Span),
DuplicatedMacroExports(ast::Ident, Span, Span),
}

impl BuiltinLintDiagnostics {
Expand Down Expand Up @@ -380,6 +395,10 @@ impl BuiltinLintDiagnostics {
};
db.span_suggestion_with_applicability(span, "use `crate`", sugg, app);
}
BuiltinLintDiagnostics::DuplicatedMacroExports(ident, earlier_span, later_span) => {
db.span_label(later_span, format!("`{}` already exported", ident));
db.span_note(earlier_span, "previous macro export is now shadowed");
}
}
}
}
Expand Down
Loading