Skip to content

Commit 4989e53

Browse files
committed
1 parent b1f8e6f commit 4989e53

File tree

1,572 files changed

+16252
-12102
lines changed

Some content is hidden

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

1,572 files changed

+16252
-12102
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,7 @@ For people new to Rust, and just starting to contribute, or even for
623623
more seasoned developers, some useful places to look for information
624624
are:
625625

626+
* The [rustc guide] contains information about how various parts of the compiler work
626627
* [Rust Forge][rustforge] contains additional documentation, including write-ups of how to achieve common tasks
627628
* The [Rust Internals forum][rif], a place to ask questions and
628629
discuss Rust's internals
@@ -635,6 +636,7 @@ are:
635636
* **Google!** ([search only in Rust Documentation][gsearchdocs] to find types, traits, etc. quickly)
636637
* Don't be afraid to ask! The Rust community is friendly and helpful.
637638

639+
[rustc guide]: https://rust-lang-nursery.github.io/rustc-guide/about-this-guide.html
638640
[gdfrustc]: http://manishearth.github.io/rust-internals-docs/rustc/
639641
[gsearchdocs]: https://www.google.com/search?q=site:doc.rust-lang.org+your+query+here
640642
[rif]: http://internals.rust-lang.org

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,13 @@ variety of channels on Mozilla's IRC network, irc.mozilla.org. The
227227
most popular channel is [#rust], a venue for general discussion about
228228
Rust. And a good place to ask for help would be [#rust-beginners].
229229

230+
Also, the [rustc guide] might be a good place to start if you want to
231+
find out how various parts of the compiler work.
232+
230233
[IRC]: https://en.wikipedia.org/wiki/Internet_Relay_Chat
231234
[#rust]: irc://irc.mozilla.org/rust
232235
[#rust-beginners]: irc://irc.mozilla.org/rust-beginners
236+
[rustc-guide]: https://rust-lang-nursery.github.io/rustc-guide/about-this-guide.html
233237

234238
## License
235239
[license]: #license

appveyor.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,13 @@ environment:
4747
# SourceForge is notoriously flaky, so we mirror it on our own infrastructure.
4848
- MSYS_BITS: 32
4949
RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu
50-
SCRIPT: python x.py test
50+
SCRIPT: python x.py test --exclude src/test/run-pass --exclude src/test/compile-fail
51+
MINGW_URL: https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror
52+
MINGW_ARCHIVE: i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z
53+
MINGW_DIR: mingw32
54+
- MSYS_BITS: 32
55+
RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu
56+
SCRIPT: python x.py test src/test/run-pass src/test/compile-fail
5157
MINGW_URL: https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror
5258
MINGW_ARCHIVE: i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z
5359
MINGW_DIR: mingw32

src/Cargo.lock

Lines changed: 91 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
This directory contains the source code of the rust project, including:
2+
- `rustc` and its tests
3+
- `libstd`
4+
- Various submodules for tools, like rustdoc, rls, etc.
5+
6+
For more information on how various parts of the compiler work, see the [rustc guide].
7+
8+
Their is also useful content in the following READMEs, which are gradually being moved over to the guide:
9+
- https://github.com/rust-lang/rust/tree/master/src/librustc/ty/maps
10+
- https://github.com/rust-lang/rust/tree/master/src/librustc/dep_graph
11+
- https://github.com/rust-lang/rust/blob/master/src/librustc/infer/region_constraints
12+
- https://github.com/rust-lang/rust/tree/master/src/librustc/infer/higher_ranked
13+
- https://github.com/rust-lang/rust/tree/master/src/librustc/infer/lexical_region_resolve
14+
15+
[rustc guide]: https://rust-lang-nursery.github.io/rustc-guide/about-this-guide.html

src/bootstrap/bin/rustc.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ fn main() {
6161
args.remove(n);
6262
}
6363

64+
if let Some(s) = env::var_os("RUSTC_ERROR_FORMAT") {
65+
args.push("--error-format".into());
66+
args.push(s);
67+
}
68+
6469
// Detect whether or not we're a build script depending on whether --target
6570
// is passed (a bit janky...)
6671
let target = args.windows(2)

src/bootstrap/bootstrap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def default_build_triple():
294294
raise ValueError('unknown byteorder: {}'.format(sys.byteorder))
295295
# only the n64 ABI is supported, indicate it
296296
ostype += 'abi64'
297-
elif cputype == 'sparcv9' or cputype == 'sparc64':
297+
elif cputype == 'sparc' or cputype == 'sparcv9' or cputype == 'sparc64':
298298
pass
299299
else:
300300
err = "unknown cpu type: {}".format(cputype)

src/bootstrap/builder.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,10 +444,11 @@ impl<'a> Builder<'a> {
444444

445445
fn run(self, builder: &Builder) -> Interned<PathBuf> {
446446
let compiler = self.compiler;
447-
let lib = if compiler.stage >= 1 && builder.build.config.libdir.is_some() {
448-
builder.build.config.libdir.clone().unwrap()
447+
let config = &builder.build.config;
448+
let lib = if compiler.stage >= 1 && config.libdir_relative().is_some() {
449+
builder.build.config.libdir_relative().unwrap()
449450
} else {
450-
PathBuf::from("lib")
451+
Path::new("lib")
451452
};
452453
let sysroot = builder.sysroot(self.compiler).join(lib)
453454
.join("rustlib").join(self.target).join("lib");
@@ -598,6 +599,9 @@ impl<'a> Builder<'a> {
598599
if let Some(target_linker) = self.build.linker(target) {
599600
cargo.env("RUSTC_TARGET_LINKER", target_linker);
600601
}
602+
if let Some(ref error_format) = self.config.rustc_error_format {
603+
cargo.env("RUSTC_ERROR_FORMAT", error_format);
604+
}
601605
if cmd != "build" && cmd != "check" {
602606
cargo.env("RUSTDOC_LIBDIR", self.rustc_libdir(self.compiler(2, self.build.build)));
603607
}

src/bootstrap/channel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use Build;
2424
use config::Config;
2525

2626
// The version number
27-
pub const CFG_RELEASE_NUM: &str = "1.25.0";
27+
pub const CFG_RELEASE_NUM: &str = "1.26.0";
2828

2929
pub struct GitInfo {
3030
inner: Option<Info>,

src/bootstrap/compile.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,7 @@ fn rustc_cargo_env(build: &Build, cargo: &mut Command) {
516516
.env("CFG_VERSION", build.rust_version())
517517
.env("CFG_PREFIX", build.config.prefix.clone().unwrap_or_default());
518518

519-
let libdir_relative =
520-
build.config.libdir.clone().unwrap_or(PathBuf::from("lib"));
519+
let libdir_relative = build.config.libdir_relative().unwrap_or(Path::new("lib"));
521520
cargo.env("CFG_LIBDIR_RELATIVE", libdir_relative);
522521

523522
// If we're not building a compiler with debugging information then remove
@@ -1008,6 +1007,10 @@ pub fn run_cargo(build: &Build, cargo: &mut Command, stamp: &Path, is_check: boo
10081007
continue
10091008
};
10101009
if json["reason"].as_str() != Some("compiler-artifact") {
1010+
if build.config.rustc_error_format.as_ref().map_or(false, |e| e == "json") {
1011+
// most likely not a cargo message, so let's send it out as well
1012+
println!("{}", line);
1013+
}
10111014
continue
10121015
}
10131016
for filename in json["filenames"].as_array().unwrap() {

src/bootstrap/config.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use std::collections::{HashMap, HashSet};
1717
use std::env;
1818
use std::fs::File;
1919
use std::io::prelude::*;
20-
use std::path::PathBuf;
20+
use std::path::{Path, PathBuf};
2121
use std::process;
2222
use std::cmp;
2323

@@ -57,6 +57,7 @@ pub struct Config {
5757
pub profiler: bool,
5858
pub ignore_git: bool,
5959
pub exclude: Vec<PathBuf>,
60+
pub rustc_error_format: Option<String>,
6061

6162
pub run_host_only: bool,
6263

@@ -330,6 +331,7 @@ impl Config {
330331
config.test_miri = false;
331332
config.rust_codegen_backends = vec![INTERNER.intern_str("llvm")];
332333

334+
config.rustc_error_format = flags.rustc_error_format;
333335
config.on_fail = flags.on_fail;
334336
config.stage = flags.stage;
335337
config.src = flags.src;
@@ -564,6 +566,17 @@ impl Config {
564566
config
565567
}
566568

569+
/// Try to find the relative path of `libdir`.
570+
pub fn libdir_relative(&self) -> Option<&Path> {
571+
let libdir = self.libdir.as_ref()?;
572+
if libdir.is_relative() {
573+
Some(libdir)
574+
} else {
575+
// Try to make it relative to the prefix.
576+
libdir.strip_prefix(self.prefix.as_ref()?).ok()
577+
}
578+
}
579+
567580
pub fn verbose(&self) -> bool {
568581
self.verbose > 0
569582
}

src/bootstrap/flags.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ pub struct Flags {
4343
pub cmd: Subcommand,
4444
pub incremental: bool,
4545
pub exclude: Vec<PathBuf>,
46+
pub rustc_error_format: Option<String>,
4647
}
4748

4849
pub enum Subcommand {
@@ -118,6 +119,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`");
118119
opts.optopt("", "src", "path to the root of the rust checkout", "DIR");
119120
opts.optopt("j", "jobs", "number of jobs to run in parallel", "JOBS");
120121
opts.optflag("h", "help", "print this help message");
122+
opts.optopt("", "error-format", "rustc error format", "FORMAT");
121123

122124
// fn usage()
123125
let usage = |exit_code: i32, opts: &Options, subcommand_help: &str, extra_help: &str| -> ! {
@@ -370,6 +372,7 @@ Arguments:
370372
verbose: matches.opt_count("verbose"),
371373
stage,
372374
on_fail: matches.opt_str("on-fail"),
375+
rustc_error_format: matches.opt_str("error-format"),
373376
keep_stage: matches.opt_str("keep-stage").map(|j| j.parse().unwrap()),
374377
build: matches.opt_str("build").map(|s| INTERNER.intern_string(s)),
375378
host: split(matches.opt_strs("host"))

src/bootstrap/native.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ impl Step for TestHelpers {
313313
type Output = ();
314314

315315
fn should_run(run: ShouldRun) -> ShouldRun {
316-
run.path("src/rt/rust_test_helpers.c")
316+
run.path("src/test/auxiliary/rust_test_helpers.c")
317317
}
318318

319319
fn make_run(run: RunConfig) {
@@ -326,7 +326,7 @@ impl Step for TestHelpers {
326326
let build = builder.build;
327327
let target = self.target;
328328
let dst = build.test_helpers_out(target);
329-
let src = build.src.join("src/rt/rust_test_helpers.c");
329+
let src = build.src.join("src/test/auxiliary/rust_test_helpers.c");
330330
if up_to_date(&src, &dst.join("librust_test_helpers.a")) {
331331
return
332332
}
@@ -353,7 +353,7 @@ impl Step for TestHelpers {
353353
.opt_level(0)
354354
.warnings(false)
355355
.debug(false)
356-
.file(build.src.join("src/rt/rust_test_helpers.c"))
356+
.file(build.src.join("src/test/auxiliary/rust_test_helpers.c"))
357357
.compile("rust_test_helpers");
358358
}
359359
}
@@ -480,16 +480,20 @@ impl Step for Openssl {
480480
"mips64el-unknown-linux-gnuabi64" => "linux64-mips64",
481481
"mipsel-unknown-linux-gnu" => "linux-mips32",
482482
"powerpc-unknown-linux-gnu" => "linux-ppc",
483+
"powerpc-unknown-linux-gnuspe" => "linux-ppc",
484+
"powerpc-unknown-netbsd" => "BSD-generic32",
483485
"powerpc64-unknown-linux-gnu" => "linux-ppc64",
484486
"powerpc64le-unknown-linux-gnu" => "linux-ppc64le",
485487
"s390x-unknown-linux-gnu" => "linux64-s390x",
488+
"sparc-unknown-linux-gnu" => "linux-sparcv9",
486489
"sparc64-unknown-linux-gnu" => "linux64-sparcv9",
487490
"sparc64-unknown-netbsd" => "BSD-sparc64",
488491
"x86_64-apple-darwin" => "darwin64-x86_64-cc",
489492
"x86_64-linux-android" => "linux-x86_64",
490493
"x86_64-unknown-freebsd" => "BSD-x86_64",
491494
"x86_64-unknown-dragonfly" => "BSD-x86_64",
492495
"x86_64-unknown-linux-gnu" => "linux-x86_64",
496+
"x86_64-unknown-linux-gnux32" => "linux-x32",
493497
"x86_64-unknown-linux-musl" => "linux-x86_64",
494498
"x86_64-unknown-netbsd" => "BSD-x86_64",
495499
_ => panic!("don't know how to configure OpenSSL for {}", target),

src/doc/man/rustc.1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,16 @@ Print version info and exit.
125125
\fB\-v\fR, \fB\-\-verbose\fR
126126
Use verbose output.
127127
.TP
128+
\fB\-\-remap\-path\-prefix\fR \fIfrom\fR=\fIto\fR
129+
Remap source path prefixes in all output, including compiler diagnostics, debug information,
130+
macro expansions, etc. The \fIfrom\fR=\fIto\fR parameter is scanned from right to left, so \fIfrom\fR
131+
may contain '=', but \fIto\fR may not.
132+
133+
This is useful for normalizing build products, for example by removing the current directory out of
134+
pathnames emitted into the object files. The replacement is purely textual, with no consideration of
135+
the current system's pathname syntax. For example \fI\-\-remap\-path\-prefix foo=bar\fR will
136+
match \fBfoo/lib.rs\fR but not \fB./foo/lib.rs\fR.
137+
.TP
128138
\fB\-\-extern\fR \fINAME\fR=\fIPATH\fR
129139
Specify where an external rust library is located. These should match
130140
\fIextern\fR declarations in the crate's source code.

src/doc/unstable-book/src/compiler-flags/remap-path-prefix.md

Lines changed: 0 additions & 37 deletions
This file was deleted.

src/doc/unstable-book/src/library-features/entry-and-modify.md

Lines changed: 0 additions & 77 deletions
This file was deleted.

src/liballoc/benches/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#![feature(i128_type)]
1414
#![feature(rand)]
1515
#![feature(repr_simd)]
16-
#![feature(slice_rotate)]
1716
#![feature(test)]
1817

1918
extern crate rand;

0 commit comments

Comments
 (0)