Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
PramodBisht committed Mar 2, 2018
1 parent b1f8e6f commit 4989e53
Show file tree
Hide file tree
Showing 1,572 changed files with 16,252 additions and 12,102 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ For people new to Rust, and just starting to contribute, or even for
more seasoned developers, some useful places to look for information
are:

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

[rustc guide]: https://rust-lang-nursery.github.io/rustc-guide/about-this-guide.html
[gdfrustc]: http://manishearth.github.io/rust-internals-docs/rustc/
[gsearchdocs]: https://www.google.com/search?q=site:doc.rust-lang.org+your+query+here
[rif]: http://internals.rust-lang.org
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,13 @@ variety of channels on Mozilla's IRC network, irc.mozilla.org. The
most popular channel is [#rust], a venue for general discussion about
Rust. And a good place to ask for help would be [#rust-beginners].

Also, the [rustc guide] might be a good place to start if you want to
find out how various parts of the compiler work.

[IRC]: https://en.wikipedia.org/wiki/Internet_Relay_Chat
[#rust]: irc://irc.mozilla.org/rust
[#rust-beginners]: irc://irc.mozilla.org/rust-beginners
[rustc-guide]: https://rust-lang-nursery.github.io/rustc-guide/about-this-guide.html

## License
[license]: #license
Expand Down
8 changes: 7 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ environment:
# SourceForge is notoriously flaky, so we mirror it on our own infrastructure.
- MSYS_BITS: 32
RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu
SCRIPT: python x.py test
SCRIPT: python x.py test --exclude src/test/run-pass --exclude src/test/compile-fail
MINGW_URL: https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror
MINGW_ARCHIVE: i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z
MINGW_DIR: mingw32
- MSYS_BITS: 32
RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu
SCRIPT: python x.py test src/test/run-pass src/test/compile-fail
MINGW_URL: https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror
MINGW_ARCHIVE: i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z
MINGW_DIR: mingw32
Expand Down
114 changes: 91 additions & 23 deletions src/Cargo.lock

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions src/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
This directory contains the source code of the rust project, including:
- `rustc` and its tests
- `libstd`
- Various submodules for tools, like rustdoc, rls, etc.

For more information on how various parts of the compiler work, see the [rustc guide].

Their is also useful content in the following READMEs, which are gradually being moved over to the guide:
- https://github.com/rust-lang/rust/tree/master/src/librustc/ty/maps
- https://github.com/rust-lang/rust/tree/master/src/librustc/dep_graph
- https://github.com/rust-lang/rust/blob/master/src/librustc/infer/region_constraints
- https://github.com/rust-lang/rust/tree/master/src/librustc/infer/higher_ranked
- https://github.com/rust-lang/rust/tree/master/src/librustc/infer/lexical_region_resolve

[rustc guide]: https://rust-lang-nursery.github.io/rustc-guide/about-this-guide.html
5 changes: 5 additions & 0 deletions src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ fn main() {
args.remove(n);
}

if let Some(s) = env::var_os("RUSTC_ERROR_FORMAT") {
args.push("--error-format".into());
args.push(s);
}

// Detect whether or not we're a build script depending on whether --target
// is passed (a bit janky...)
let target = args.windows(2)
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def default_build_triple():
raise ValueError('unknown byteorder: {}'.format(sys.byteorder))
# only the n64 ABI is supported, indicate it
ostype += 'abi64'
elif cputype == 'sparcv9' or cputype == 'sparc64':
elif cputype == 'sparc' or cputype == 'sparcv9' or cputype == 'sparc64':
pass
else:
err = "unknown cpu type: {}".format(cputype)
Expand Down
10 changes: 7 additions & 3 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,11 @@ impl<'a> Builder<'a> {

fn run(self, builder: &Builder) -> Interned<PathBuf> {
let compiler = self.compiler;
let lib = if compiler.stage >= 1 && builder.build.config.libdir.is_some() {
builder.build.config.libdir.clone().unwrap()
let config = &builder.build.config;
let lib = if compiler.stage >= 1 && config.libdir_relative().is_some() {
builder.build.config.libdir_relative().unwrap()
} else {
PathBuf::from("lib")
Path::new("lib")
};
let sysroot = builder.sysroot(self.compiler).join(lib)
.join("rustlib").join(self.target).join("lib");
Expand Down Expand Up @@ -598,6 +599,9 @@ impl<'a> Builder<'a> {
if let Some(target_linker) = self.build.linker(target) {
cargo.env("RUSTC_TARGET_LINKER", target_linker);
}
if let Some(ref error_format) = self.config.rustc_error_format {
cargo.env("RUSTC_ERROR_FORMAT", error_format);
}
if cmd != "build" && cmd != "check" {
cargo.env("RUSTDOC_LIBDIR", self.rustc_libdir(self.compiler(2, self.build.build)));
}
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use Build;
use config::Config;

// The version number
pub const CFG_RELEASE_NUM: &str = "1.25.0";
pub const CFG_RELEASE_NUM: &str = "1.26.0";

pub struct GitInfo {
inner: Option<Info>,
Expand Down
7 changes: 5 additions & 2 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,7 @@ fn rustc_cargo_env(build: &Build, cargo: &mut Command) {
.env("CFG_VERSION", build.rust_version())
.env("CFG_PREFIX", build.config.prefix.clone().unwrap_or_default());

let libdir_relative =
build.config.libdir.clone().unwrap_or(PathBuf::from("lib"));
let libdir_relative = build.config.libdir_relative().unwrap_or(Path::new("lib"));
cargo.env("CFG_LIBDIR_RELATIVE", libdir_relative);

// If we're not building a compiler with debugging information then remove
Expand Down Expand Up @@ -1008,6 +1007,10 @@ pub fn run_cargo(build: &Build, cargo: &mut Command, stamp: &Path, is_check: boo
continue
};
if json["reason"].as_str() != Some("compiler-artifact") {
if build.config.rustc_error_format.as_ref().map_or(false, |e| e == "json") {
// most likely not a cargo message, so let's send it out as well
println!("{}", line);
}
continue
}
for filename in json["filenames"].as_array().unwrap() {
Expand Down
15 changes: 14 additions & 1 deletion src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use std::collections::{HashMap, HashSet};
use std::env;
use std::fs::File;
use std::io::prelude::*;
use std::path::PathBuf;
use std::path::{Path, PathBuf};
use std::process;
use std::cmp;

Expand Down Expand Up @@ -57,6 +57,7 @@ pub struct Config {
pub profiler: bool,
pub ignore_git: bool,
pub exclude: Vec<PathBuf>,
pub rustc_error_format: Option<String>,

pub run_host_only: bool,

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

config.rustc_error_format = flags.rustc_error_format;
config.on_fail = flags.on_fail;
config.stage = flags.stage;
config.src = flags.src;
Expand Down Expand Up @@ -564,6 +566,17 @@ impl Config {
config
}

/// Try to find the relative path of `libdir`.
pub fn libdir_relative(&self) -> Option<&Path> {
let libdir = self.libdir.as_ref()?;
if libdir.is_relative() {
Some(libdir)
} else {
// Try to make it relative to the prefix.
libdir.strip_prefix(self.prefix.as_ref()?).ok()
}
}

pub fn verbose(&self) -> bool {
self.verbose > 0
}
Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ pub struct Flags {
pub cmd: Subcommand,
pub incremental: bool,
pub exclude: Vec<PathBuf>,
pub rustc_error_format: Option<String>,
}

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

// fn usage()
let usage = |exit_code: i32, opts: &Options, subcommand_help: &str, extra_help: &str| -> ! {
Expand Down Expand Up @@ -370,6 +372,7 @@ Arguments:
verbose: matches.opt_count("verbose"),
stage,
on_fail: matches.opt_str("on-fail"),
rustc_error_format: matches.opt_str("error-format"),
keep_stage: matches.opt_str("keep-stage").map(|j| j.parse().unwrap()),
build: matches.opt_str("build").map(|s| INTERNER.intern_string(s)),
host: split(matches.opt_strs("host"))
Expand Down
10 changes: 7 additions & 3 deletions src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ impl Step for TestHelpers {
type Output = ();

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

fn make_run(run: RunConfig) {
Expand All @@ -326,7 +326,7 @@ impl Step for TestHelpers {
let build = builder.build;
let target = self.target;
let dst = build.test_helpers_out(target);
let src = build.src.join("src/rt/rust_test_helpers.c");
let src = build.src.join("src/test/auxiliary/rust_test_helpers.c");
if up_to_date(&src, &dst.join("librust_test_helpers.a")) {
return
}
Expand All @@ -353,7 +353,7 @@ impl Step for TestHelpers {
.opt_level(0)
.warnings(false)
.debug(false)
.file(build.src.join("src/rt/rust_test_helpers.c"))
.file(build.src.join("src/test/auxiliary/rust_test_helpers.c"))
.compile("rust_test_helpers");
}
}
Expand Down Expand Up @@ -480,16 +480,20 @@ impl Step for Openssl {
"mips64el-unknown-linux-gnuabi64" => "linux64-mips64",
"mipsel-unknown-linux-gnu" => "linux-mips32",
"powerpc-unknown-linux-gnu" => "linux-ppc",
"powerpc-unknown-linux-gnuspe" => "linux-ppc",
"powerpc-unknown-netbsd" => "BSD-generic32",
"powerpc64-unknown-linux-gnu" => "linux-ppc64",
"powerpc64le-unknown-linux-gnu" => "linux-ppc64le",
"s390x-unknown-linux-gnu" => "linux64-s390x",
"sparc-unknown-linux-gnu" => "linux-sparcv9",
"sparc64-unknown-linux-gnu" => "linux64-sparcv9",
"sparc64-unknown-netbsd" => "BSD-sparc64",
"x86_64-apple-darwin" => "darwin64-x86_64-cc",
"x86_64-linux-android" => "linux-x86_64",
"x86_64-unknown-freebsd" => "BSD-x86_64",
"x86_64-unknown-dragonfly" => "BSD-x86_64",
"x86_64-unknown-linux-gnu" => "linux-x86_64",
"x86_64-unknown-linux-gnux32" => "linux-x32",
"x86_64-unknown-linux-musl" => "linux-x86_64",
"x86_64-unknown-netbsd" => "BSD-x86_64",
_ => panic!("don't know how to configure OpenSSL for {}", target),
Expand Down
2 changes: 1 addition & 1 deletion src/doc/book
Submodule book updated 31 files
+1 −1 .travis.yml
+3 −0 first-edition/book.toml
+56 −0 first-edition/src/theme/first-edition.css
+27 −0 first-edition/src/theme/header.hbs
+22 −8 index.md
+2 −2 redirects/getting-started.md
+1 −1 redirects/release-channels.md
+1 −0 second-edition/dictionary.txt
+208 −536 second-edition/nostarch/chapter01.md
+1 −1 second-edition/nostarch/chapter10.md
+875 −941 second-edition/nostarch/chapter20.md
+169 −0 second-edition/nostarch/introduction.md
+7 −7 second-edition/src/SUMMARY.md
+1 −1 second-edition/src/appendix-05-translation.md
+10 −32 second-edition/src/appendix-07-nightly-rust.md
+39 −3 second-edition/src/ch00-00-introduction.md
+12 −0 second-edition/src/ch01-00-getting-started.md
+55 −50 second-edition/src/ch01-01-installation.md
+50 −302 second-edition/src/ch01-02-hello-world.md
+265 −0 second-edition/src/ch01-03-hello-cargo.md
+1 −1 second-edition/src/ch02-00-guessing-game-tutorial.md
+2 −2 second-edition/src/ch10-02-traits.md
+22 −19 second-edition/src/ch20-00-final-project-a-web-server.md
+273 −227 second-edition/src/ch20-01-single-threaded.md
+1,230 −0 second-edition/src/ch20-02-multithreaded.md
+0 −110 second-edition/src/ch20-02-slow-requests.md
+0 −284 second-edition/src/ch20-03-designing-the-interface.md
+128 −124 second-edition/src/ch20-03-graceful-shutdown-and-cleanup.md
+0 −248 second-edition/src/ch20-04-storing-threads.md
+0 −516 second-edition/src/ch20-05-sending-requests-via-channels.md
+0 −276 second-edition/theme/index.hbs
10 changes: 10 additions & 0 deletions src/doc/man/rustc.1
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,16 @@ Print version info and exit.
\fB\-v\fR, \fB\-\-verbose\fR
Use verbose output.
.TP
\fB\-\-remap\-path\-prefix\fR \fIfrom\fR=\fIto\fR
Remap source path prefixes in all output, including compiler diagnostics, debug information,
macro expansions, etc. The \fIfrom\fR=\fIto\fR parameter is scanned from right to left, so \fIfrom\fR
may contain '=', but \fIto\fR may not.

This is useful for normalizing build products, for example by removing the current directory out of
pathnames emitted into the object files. The replacement is purely textual, with no consideration of
the current system's pathname syntax. For example \fI\-\-remap\-path\-prefix foo=bar\fR will
match \fBfoo/lib.rs\fR but not \fB./foo/lib.rs\fR.
.TP
\fB\-\-extern\fR \fINAME\fR=\fIPATH\fR
Specify where an external rust library is located. These should match
\fIextern\fR declarations in the crate's source code.
Expand Down
37 changes: 0 additions & 37 deletions src/doc/unstable-book/src/compiler-flags/remap-path-prefix.md

This file was deleted.

77 changes: 0 additions & 77 deletions src/doc/unstable-book/src/library-features/entry-and-modify.md

This file was deleted.

1 change: 0 additions & 1 deletion src/liballoc/benches/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#![feature(i128_type)]
#![feature(rand)]
#![feature(repr_simd)]
#![feature(slice_rotate)]
#![feature(test)]

extern crate rand;
Expand Down
Loading

0 comments on commit 4989e53

Please sign in to comment.