Skip to content

Rollup of 9 pull requests #42345

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

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
fa62a0c
Introduce 'run-pass' header to 'ui' tests in compiletest. Fix issue #…
kennytm May 13, 2017
15edf4f
compiletest: Force directive to be first complete word in header comm…
kennytm May 24, 2017
ecde1e1
Lower `?` to `Try` instead of `Carrier`
scottmcm May 7, 2017
eeebfd6
Add RLS to .exe and .msi installers
efyang May 30, 2017
7c36273
Add RLS to .pkg installer
efyang May 30, 2017
f3b29d3
Fix formatting issues in Distribution.xml
efyang May 30, 2017
4450807
ARMv5 needs +strict-align
jannic May 30, 2017
068a3ba
Support VS 2017
brson May 24, 2017
594f597
wip
brson May 26, 2017
a333be7
Add new error code
GuillaumeGomez May 29, 2017
62989c1
associated_consts: check trait obligations and regionck for associate…
seanmonstar May 31, 2017
7a87469
Give the `try_trait` feature its own tracking issue
scottmcm May 31, 2017
3119e63
Add some try_trait ramblings to the unstable book
scottmcm May 31, 2017
e5e664f
Upgrade ProjectionTy's Name to a DefId
tbg May 31, 2017
86ea93e
rustdoc: Cleanup associated const value rendering
ollie27 May 31, 2017
9c6d6d8
Rollup merge of #41968 - kennytm:fix-unreadable-json-test-output-3651…
frewsxcv Jun 1, 2017
0e8b9a8
Rollup merge of #42225 - brson:vs2017, r=brson
frewsxcv Jun 1, 2017
90cbfa3
Rollup merge of #42275 - scottmcm:try-trait, r=nikomatsakis
frewsxcv Jun 1, 2017
675454a
Rollup merge of #42286 - ollie27:rustdoc_assoc_const, r=GuillaumeGomez
frewsxcv Jun 1, 2017
b3947f8
Rollup merge of #42297 - tschottdorf:proj-ty, r=nikomatsakis
frewsxcv Jun 1, 2017
0381fc7
Rollup merge of #42302 - GuillaumeGomez:new-error-codes-next, r=Susurrus
frewsxcv Jun 1, 2017
b517eb0
Rollup merge of #42306 - efyang:rls-packaging, r=alexcrichton
frewsxcv Jun 1, 2017
1f4fc76
Rollup merge of #42314 - jannic:patch-1, r=japaric
frewsxcv Jun 1, 2017
bf4e146
Rollup merge of #42324 - seanmonstar:41323-compare_const_impl, r=niko…
frewsxcv Jun 1, 2017
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
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ script:
stamp src/ci/docker/run.sh $IMAGE;
fi
fi
- sleep 300000

after_success:
- >
Expand Down
42 changes: 25 additions & 17 deletions src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ debug-assertions = false

[replace]
"https://github.com/rust-lang/cargo#0.20.0" = { path = "tools/cargo" }
"gcc:0.3.49" = { git = "https://github.com/brson/gcc-rs", branch = "vs2017" }
2 changes: 1 addition & 1 deletion src/bootstrap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ num_cpus = "1.0"
toml = "0.1"
getopts = "0.2"
rustc-serialize = "0.3"
gcc = "0.3.46"
gcc = "0.3.49"
libc = "0.2"
46 changes: 46 additions & 0 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
t!(fs::create_dir_all(pkg.join("cargo")));
t!(fs::create_dir_all(pkg.join("rust-docs")));
t!(fs::create_dir_all(pkg.join("rust-std")));
t!(fs::create_dir_all(pkg.join("rls")));
t!(fs::create_dir_all(pkg.join("rust-analysis")));

cp_r(&work.join(&format!("{}-{}", pkgname(build, "rustc"), target)),
&pkg.join("rustc"));
Expand All @@ -923,11 +925,17 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
&pkg.join("rust-docs"));
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rust-std"), target)),
&pkg.join("rust-std"));
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rls"), target)),
&pkg.join("rls"));
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rust-analysis"), target)),
&pkg.join("rust-analysis"));

install(&etc.join("pkg/postinstall"), &pkg.join("rustc"), 0o755);
install(&etc.join("pkg/postinstall"), &pkg.join("cargo"), 0o755);
install(&etc.join("pkg/postinstall"), &pkg.join("rust-docs"), 0o755);
install(&etc.join("pkg/postinstall"), &pkg.join("rust-std"), 0o755);
install(&etc.join("pkg/postinstall"), &pkg.join("rls"), 0o755);
install(&etc.join("pkg/postinstall"), &pkg.join("rust-analysis"), 0o755);

let pkgbuild = |component: &str| {
let mut cmd = Command::new("pkgbuild");
Expand All @@ -941,6 +949,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
pkgbuild("cargo");
pkgbuild("rust-docs");
pkgbuild("rust-std");
pkgbuild("rls");
pkgbuild("rust-analysis");

// create an 'uninstall' package
install(&etc.join("pkg/postinstall"), &pkg.join("uninstall"), 0o755);
Expand All @@ -964,6 +974,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
let _ = fs::remove_dir_all(&exe);
t!(fs::create_dir_all(exe.join("rustc")));
t!(fs::create_dir_all(exe.join("cargo")));
t!(fs::create_dir_all(exe.join("rls")));
t!(fs::create_dir_all(exe.join("rust-analysis")));
t!(fs::create_dir_all(exe.join("rust-docs")));
t!(fs::create_dir_all(exe.join("rust-std")));
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rustc"), target))
Expand All @@ -978,11 +990,19 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rust-std"), target))
.join(format!("rust-std-{}", target)),
&exe.join("rust-std"));
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rls"), target))
.join("rls"),
&exe.join("rls"));
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rust-analysis"), target))
.join(format!("rust-analysis-{}", target)),
&exe.join("rust-analysis"));

t!(fs::remove_file(exe.join("rustc/manifest.in")));
t!(fs::remove_file(exe.join("cargo/manifest.in")));
t!(fs::remove_file(exe.join("rust-docs/manifest.in")));
t!(fs::remove_file(exe.join("rust-std/manifest.in")));
t!(fs::remove_file(exe.join("rls/manifest.in")));
t!(fs::remove_file(exe.join("rust-analysis/manifest.in")));

if target.contains("windows-gnu") {
t!(fs::create_dir_all(exe.join("rust-mingw")));
Expand Down Expand Up @@ -1056,6 +1076,26 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
.arg("-dr").arg("Std")
.arg("-var").arg("var.StdDir")
.arg("-out").arg(exe.join("StdGroup.wxs")));
build.run(Command::new(&heat)
.current_dir(&exe)
.arg("dir")
.arg("rls")
.args(&heat_flags)
.arg("-cg").arg("RlsGroup")
.arg("-dr").arg("Rls")
.arg("-var").arg("var.RlsDir")
.arg("-out").arg(exe.join("RlsGroup.wxs"))
.arg("-t").arg(etc.join("msi/remove-duplicates.xsl")));
build.run(Command::new(&heat)
.current_dir(&exe)
.arg("dir")
.arg("rust-analysis")
.args(&heat_flags)
.arg("-cg").arg("AnalysisGroup")
.arg("-dr").arg("Analysis")
.arg("-var").arg("var.AnalysisDir")
.arg("-out").arg(exe.join("AnalysisGroup.wxs"))
.arg("-t").arg(etc.join("msi/remove-duplicates.xsl")));
if target.contains("windows-gnu") {
build.run(Command::new(&heat)
.current_dir(&exe)
Expand All @@ -1079,6 +1119,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
.arg("-dDocsDir=rust-docs")
.arg("-dCargoDir=cargo")
.arg("-dStdDir=rust-std")
.arg("-dRlsDir=rls")
.arg("-dAnalysisDir=rust-analysis")
.arg("-arch").arg(&arch)
.arg("-out").arg(&output)
.arg(&input);
Expand All @@ -1096,6 +1138,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
candle("DocsGroup.wxs".as_ref());
candle("CargoGroup.wxs".as_ref());
candle("StdGroup.wxs".as_ref());
candle("RlsGroup.wxs".as_ref());
candle("AnalysisGroup.wxs".as_ref());

if target.contains("windows-gnu") {
candle("GccGroup.wxs".as_ref());
Expand All @@ -1118,6 +1162,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
.arg("DocsGroup.wixobj")
.arg("CargoGroup.wixobj")
.arg("StdGroup.wixobj")
.arg("RlsGroup.wixobj")
.arg("AnalysisGroup.wixobj")
.current_dir(&exe);

if target.contains("windows-gnu") {
Expand Down
1 change: 1 addition & 0 deletions src/doc/unstable-book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
- [toowned_clone_into](library-features/toowned-clone-into.md)
- [trusted_len](library-features/trusted-len.md)
- [try_from](library-features/try-from.md)
- [try_trait](library-features/try-trait.md)
- [unicode](library-features/unicode.md)
- [unique](library-features/unique.md)
- [unsize](library-features/unsize.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ The tracking issue for this feature is: [#31436]
[#31436]: https://github.com/rust-lang/rust/issues/31436

------------------------

This feature has been superseded by [`try_trait`][try_trait].

It exists only in stage0 for bootstrapping.

[try_trait]: library-features/try-trait.html
50 changes: 50 additions & 0 deletions src/doc/unstable-book/src/library-features/try-trait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# `try_trait`

The tracking issue for this feature is: [#42327]

[#42327]: https://github.com/rust-lang/rust/issues/42327

------------------------

This introduces a new trait `Try` for extending the `?` operator to types
other than `Result` (a part of [RFC 1859]). The trait provides the canonical
way to _view_ a type in terms of a success/failure dichotomy. This will
allow `?` to supplant the `try_opt!` macro on `Option` and the `try_ready!`
macro on `Poll`, among other things.

[RFC 1859]: https://github.com/rust-lang/rfcs/pull/1859

Here's an example implementation of the trait:

```rust,ignore
/// A distinct type to represent the `None` value of an `Option`.
///
/// This enables using the `?` operator on `Option`; it's rarely useful alone.
#[derive(Debug)]
#[unstable(feature = "try_trait", issue = "42327")]
pub struct None { _priv: () }

#[unstable(feature = "try_trait", issue = "42327")]
impl<T> ops::Try for Option<T> {
type Ok = T;
type Error = None;

fn into_result(self) -> Result<T, None> {
self.ok_or(None { _priv: () })
}

fn from_ok(v: T) -> Self {
Some(v)
}

fn from_error(_: None) -> Self {
None
}
}
```

Note the `Error` associated type here is a new marker. The `?` operator
allows interconversion between different `Try` implementers only when
the error type can be converted `Into` the error type of the enclosing
function (or catch block). Having a distinct error type (as opposed to
just `()`, or similar) restricts this to where it's semantically meaningful.
3 changes: 3 additions & 0 deletions src/etc/installer/exe/rust.iss
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Name: gcc; Description: "Linker and platform libraries"; Types: full
Name: docs; Description: "HTML documentation"; Types: full
Name: cargo; Description: "Cargo, the Rust package manager"; Types: full
Name: std; Description: "The Rust Standard Library"; Types: full
Name: rls; Description: "RLS, the Rust Language Server"

[Files]
Source: "rustc/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: rust
Expand All @@ -55,6 +56,8 @@ Source: "rust-mingw/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs;
Source: "rust-docs/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: docs
Source: "cargo/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: cargo
Source: "rust-std/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: std
Source: "rls/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: rls
Source: "rust-analysis/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: rls

[Code]
const
Expand Down
Loading