From 95a94e3d3d43e0df87e2d80e6f2a2e0e5c355dca Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 8 May 2017 14:25:01 +0200 Subject: [PATCH 1/7] Add markdown-[before|after]-content options --- src/librustdoc/externalfiles.rs | 12 +++++++++++- src/librustdoc/lib.rs | 13 ++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/librustdoc/externalfiles.rs b/src/librustdoc/externalfiles.rs index d78f00497ca55..111ae4ede277a 100644 --- a/src/librustdoc/externalfiles.rs +++ b/src/librustdoc/externalfiles.rs @@ -13,6 +13,7 @@ use std::io::prelude::*; use std::io; use std::path::Path; use std::str; +use html::markdown::{Markdown, RenderType}; #[derive(Clone)] pub struct ExternalHtml{ @@ -28,17 +29,26 @@ pub struct ExternalHtml{ } impl ExternalHtml { - pub fn load(in_header: &[String], before_content: &[String], after_content: &[String]) + pub fn load(in_header: &[String], before_content: &[String], after_content: &[String], + md_before_content: &[String], md_after_content: &[String], render: RenderType) -> Option { load_external_files(in_header) .and_then(|ih| load_external_files(before_content) .map(|bc| (ih, bc)) ) + .and_then(|(ih, bc)| + load_external_files(md_before_content) + .map(|m_bc| (ih, format!("{}{}", bc, Markdown(&m_bc, render)))) + ) .and_then(|(ih, bc)| load_external_files(after_content) .map(|ac| (ih, bc, ac)) ) + .and_then(|(ih, bc, ac)| + load_external_files(md_after_content) + .map(|m_ac| (ih, bc, format!("{}{}", ac, Markdown(&m_ac, render)))) + ) .map(|(ih, bc, ac)| ExternalHtml { in_header: ih, diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 1156fadf8c02c..45c9c7127305e 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -159,6 +159,14 @@ pub fn opts() -> Vec { "files to include inline between the content and of a rendered \ Markdown file or generated documentation", "FILES")), + unstable(optmulti("", "markdown-before-content", + "files to include inline between and the content of a rendered \ + Markdown file or generated documentation", + "FILES")), + unstable(optmulti("", "markdown-after-content", + "files to include inline between the content and of a rendered \ + Markdown file or generated documentation", + "FILES")), stable(optopt("", "markdown-playground-url", "URL to send code snippets to", "URL")), stable(optflag("", "markdown-no-toc", "don't include table of contents")), @@ -274,7 +282,10 @@ pub fn main_args(args: &[String]) -> isize { let external_html = match ExternalHtml::load( &matches.opt_strs("html-in-header"), &matches.opt_strs("html-before-content"), - &matches.opt_strs("html-after-content")) { + &matches.opt_strs("html-after-content"), + &matches.opt_strs("markdown-before-content"), + &matches.opt_strs("markdown-after-content"), + render_type) { Some(eh) => eh, None => return 3, }; From a2a9d1965b1aba9363f1876de3ed67c0662a294d Mon Sep 17 00:00:00 2001 From: mandeep Date: Fri, 28 Apr 2017 13:16:49 -0500 Subject: [PATCH 2/7] Added generic example of std::ops::Add in doc comments Added blank lines around example Added comment to Add example referencing the Output type Removed whitespace from lines 272 and 273 Removed Debug derivation from Add examples Added Debug derivation --- src/libcore/ops.rs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs index 175b3a5a69ac1..03cfdf5378301 100644 --- a/src/libcore/ops.rs +++ b/src/libcore/ops.rs @@ -235,6 +235,42 @@ pub trait Drop { /// } /// ``` /// +/// Here is an example of the same `Point` struct implementing the `Add` trait +/// using generics. +/// +/// ``` +/// use std::ops::Add; +/// +/// #[derive(Debug)] +/// struct Point { +/// x: T, +/// y: T, +/// } +/// +/// // Notice that the implementation uses the `Output` associated type +/// impl> Add for Point { +/// type Output = Point; +/// +/// fn add(self, other: Point) -> Point { +/// Point { +/// x: self.x + other.x, +/// y: self.y + other.y, +/// } +/// } +/// } +/// +/// impl PartialEq for Point { +/// fn eq(&self, other: &Self) -> bool { +/// self.x == other.x && self.y == other.y +/// } +/// } +/// +/// fn main() { +/// assert_eq!(Point { x: 1, y: 0 } + Point { x: 2, y: 3 }, +/// Point { x: 3, y: 3 }); +/// } +/// ``` +/// /// Note that `RHS = Self` by default, but this is not mandatory. For example, /// [std::time::SystemTime] implements `Add`, which permits /// operations of the form `SystemTime = SystemTime + Duration`. From 7b535e1096b8a1f0d076d4b6f6aac623adb7d23f Mon Sep 17 00:00:00 2001 From: Masaki Hara Date: Fri, 12 May 2017 22:00:06 +0900 Subject: [PATCH 3/7] Disallow ._ in float literal. --- src/libsyntax/parse/lexer/mod.rs | 4 +--- .../parse-fail/underscore-suffix-for-float.rs | 13 +++++++++++++ .../underscore-method-after-integer.rs | 19 +++++++++++++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 src/test/parse-fail/underscore-suffix-for-float.rs create mode 100644 src/test/run-pass/underscore-method-after-integer.rs diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index ded1f0b599a61..a83b19c7334e7 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -754,9 +754,7 @@ impl<'a> StringReader<'a> { // integer literal followed by field/method access or a range pattern // (`0..2` and `12.foo()`) if self.ch_is('.') && !self.nextch_is('.') && - !self.nextch() - .unwrap_or('\0') - .is_xid_start() { + !ident_start(self.nextch()) { // might have stuff after the ., and if it does, it needs to start // with a number self.bump(); diff --git a/src/test/parse-fail/underscore-suffix-for-float.rs b/src/test/parse-fail/underscore-suffix-for-float.rs new file mode 100644 index 0000000000000..df7d9aa374dce --- /dev/null +++ b/src/test/parse-fail/underscore-suffix-for-float.rs @@ -0,0 +1,13 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let a = 42._; //~ ERROR unexpected token: `_` +} diff --git a/src/test/run-pass/underscore-method-after-integer.rs b/src/test/run-pass/underscore-method-after-integer.rs new file mode 100644 index 0000000000000..af91256421101 --- /dev/null +++ b/src/test/run-pass/underscore-method-after-integer.rs @@ -0,0 +1,19 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Tr : Sized { + fn _method_on_numbers(self) {} +} + +impl Tr for i32 {} + +fn main() { + 42._method_on_numbers(); +} From b09a19b7c73e83a64c8b0020827a0f8fb01550bf Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 12 May 2017 15:31:43 +0200 Subject: [PATCH 4/7] Fix anchor invalid redirection to search --- src/librustdoc/html/static/main.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index fbc7615588eed..c115a6ccba609 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -943,9 +943,9 @@ if (hasClass(main, 'content')) { removeClass(main, 'hidden'); } - var search = document.getElementById('search'); - if (hasClass(main, 'content')) { - addClass(main, 'hidden'); + var search_c = document.getElementById('search'); + if (hasClass(search_c, 'content')) { + addClass(search_c, 'hidden'); } } // Revert to the previous title manually since the History @@ -959,7 +959,11 @@ // perform the search. This will empty the bar if there's // nothing there, which lets you really go back to a // previous state with nothing in the bar. - document.getElementsByClassName('search-input')[0].value = params.search; + if (params.search) { + document.getElementsByClassName('search-input')[0].value = params.search; + } else { + document.getElementsByClassName('search-input')[0].value = ''; + } // Some browsers fire 'onpopstate' for every page load // (Chrome), while others fire the event only when actually // popping a state (Firefox), which is why search() is From dc7ffbeca452e870c18354d59300562bf6536dd3 Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Fri, 21 Apr 2017 17:10:22 +0300 Subject: [PATCH 5/7] rustc_resolve: don't deny outer type parameters in embedded constants. --- src/librustc_resolve/diagnostics.rs | 15 +++--- src/librustc_resolve/lib.rs | 53 +++++++++---------- src/test/compile-fail/E0435.rs | 2 +- ...ssociated-const-type-parameter-arrays-2.rs | 2 +- .../associated-const-type-parameter-arrays.rs | 2 +- .../inner-static-type-parameter.rs | 2 +- src/test/compile-fail/issue-27433.rs | 2 +- src/test/compile-fail/issue-3521-2.rs | 2 +- src/test/compile-fail/issue-3668-2.rs | 2 +- src/test/compile-fail/issue-3668.rs | 2 +- src/test/compile-fail/issue-39559-2.rs | 28 ++++++++++ src/test/compile-fail/issue-39559.rs | 9 +--- .../associated-const-type-parameters.rs | 4 ++ 13 files changed, 74 insertions(+), 51 deletions(-) create mode 100644 src/test/compile-fail/issue-39559-2.rs diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index 2c2babf0a6653..368fb7a88685b 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -1222,27 +1222,26 @@ fn foo() { "##, E0435: r##" -A non-constant value was used to initialise a constant. +A non-constant value was used in a constant expression. Erroneous code example: ```compile_fail,E0435 -let foo = 42u32; -const FOO : u32 = foo; // error: attempt to use a non-constant value in a - // constant +let foo = 42; +let a: [u8; foo]; // error: attempt to use a non-constant value in a constant ``` To fix this error, please replace the value with a constant. Example: ``` -const FOO : u32 = 42u32; // ok! +let a: [u8; 42]; // ok! ``` Or: ``` -const OTHER_FOO : u32 = 42u32; -const FOO : u32 = OTHER_FOO; // ok! +const FOO: usize = 42; +let a: [u8; FOO]; // ok! ``` "##, @@ -1560,7 +1559,7 @@ register_diagnostics! { // E0157, unused error code // E0257, // E0258, - E0402, // cannot use an outer type parameter in this context +// E0402, // cannot use an outer type parameter in this context // E0406, merged into 420 // E0410, merged into 408 // E0413, merged into 530 diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index c4512cb38c4e2..774e84de36638 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -127,8 +127,6 @@ impl Ord for BindingError { enum ResolutionError<'a> { /// error E0401: can't use type parameters from outer function TypeParametersFromOuterFunction, - /// error E0402: cannot use an outer type parameter in this context - OuterTypeParameterContext, /// error E0403: the name is already used for a type parameter in this type parameter list NameAlreadyUsedInTypeParameterList(Name, &'a Span), /// error E0407: method is not a member of trait @@ -187,12 +185,6 @@ fn resolve_struct_error<'sess, 'a>(resolver: &'sess Resolver, err.span_label(span, "use of type variable from outer function"); err } - ResolutionError::OuterTypeParameterContext => { - struct_span_err!(resolver.session, - span, - E0402, - "cannot use an outer type parameter in this context") - } ResolutionError::NameAlreadyUsedInTypeParameterList(name, first_use_span) => { let mut err = struct_span_err!(resolver.session, span, @@ -1671,16 +1663,16 @@ impl<'a> Resolver<'a> { this.check_proc_macro_attrs(&trait_item.attrs); match trait_item.node { - TraitItemKind::Const(_, ref default) => { + TraitItemKind::Const(ref ty, ref default) => { + this.visit_ty(ty); + // Only impose the restrictions of - // ConstRibKind if there's an actual constant + // ConstRibKind for an actual constant // expression in a provided default. - if default.is_some() { + if let Some(ref expr) = *default{ this.with_constant_rib(|this| { - visit::walk_trait_item(this, trait_item) + this.visit_expr(expr); }); - } else { - visit::walk_trait_item(this, trait_item) } } TraitItemKind::Method(ref sig, _) => { @@ -1709,9 +1701,13 @@ impl<'a> Resolver<'a> { }); } - ItemKind::Const(..) | ItemKind::Static(..) => { - self.with_constant_rib(|this| { - visit::walk_item(this, item); + ItemKind::Static(ref ty, _, ref expr) | + ItemKind::Const(ref ty, ref expr) => { + self.with_item_rib(|this| { + this.visit_ty(ty); + this.with_constant_rib(|this| { + this.visit_expr(expr); + }); }); } @@ -1782,13 +1778,21 @@ impl<'a> Resolver<'a> { self.label_ribs.pop(); } + fn with_item_rib(&mut self, f: F) + where F: FnOnce(&mut Resolver) + { + self.ribs[ValueNS].push(Rib::new(ItemRibKind)); + self.ribs[TypeNS].push(Rib::new(ItemRibKind)); + f(self); + self.ribs[TypeNS].pop(); + self.ribs[ValueNS].pop(); + } + fn with_constant_rib(&mut self, f: F) where F: FnOnce(&mut Resolver) { self.ribs[ValueNS].push(Rib::new(ConstantItemRibKind)); - self.ribs[TypeNS].push(Rib::new(ConstantItemRibKind)); f(self); - self.ribs[TypeNS].pop(); self.ribs[ValueNS].pop(); } @@ -2755,7 +2759,8 @@ impl<'a> Resolver<'a> { for rib in ribs { match rib.kind { NormalRibKind | MethodRibKind(_) | ClosureRibKind(..) | - ModuleRibKind(..) | MacroDefinition(..) | ForwardTyParamBanRibKind => { + ModuleRibKind(..) | MacroDefinition(..) | ForwardTyParamBanRibKind | + ConstantItemRibKind => { // Nothing to do. Continue. } ItemRibKind => { @@ -2767,14 +2772,6 @@ impl<'a> Resolver<'a> { } return Def::Err; } - ConstantItemRibKind => { - // see #9186 - if record_used { - resolve_error(self, span, - ResolutionError::OuterTypeParameterContext); - } - return Def::Err; - } } } } diff --git a/src/test/compile-fail/E0435.rs b/src/test/compile-fail/E0435.rs index f687633d34d86..b15bf44fbd063 100644 --- a/src/test/compile-fail/E0435.rs +++ b/src/test/compile-fail/E0435.rs @@ -10,6 +10,6 @@ fn main () { let foo = 42u32; - const FOO : u32 = foo; //~ ERROR E0435 + let _: [u8; foo]; //~ ERROR E0435 //~| NOTE non-constant used with constant } diff --git a/src/test/compile-fail/associated-const-type-parameter-arrays-2.rs b/src/test/compile-fail/associated-const-type-parameter-arrays-2.rs index 7fd9605ef2cdc..e284a61eb2daa 100644 --- a/src/test/compile-fail/associated-const-type-parameter-arrays-2.rs +++ b/src/test/compile-fail/associated-const-type-parameter-arrays-2.rs @@ -26,7 +26,7 @@ impl Foo for Def { pub fn test() { let _array = [4; ::Y]; - //~^ ERROR cannot use an outer type parameter in this context [E0402] + //~^ ERROR the trait bound `A: Foo` is not satisfied [E0277] } fn main() { diff --git a/src/test/compile-fail/associated-const-type-parameter-arrays.rs b/src/test/compile-fail/associated-const-type-parameter-arrays.rs index 71c7a3965ec3c..848ea65a9cfd1 100644 --- a/src/test/compile-fail/associated-const-type-parameter-arrays.rs +++ b/src/test/compile-fail/associated-const-type-parameter-arrays.rs @@ -26,7 +26,7 @@ impl Foo for Def { pub fn test() { let _array: [u32; ::Y]; - //~^ ERROR cannot use an outer type parameter in this context [E0402] + //~^ ERROR the trait bound `A: Foo` is not satisfied [E0277] } fn main() { diff --git a/src/test/compile-fail/inner-static-type-parameter.rs b/src/test/compile-fail/inner-static-type-parameter.rs index a6a3319845836..6fb497092d217 100644 --- a/src/test/compile-fail/inner-static-type-parameter.rs +++ b/src/test/compile-fail/inner-static-type-parameter.rs @@ -14,7 +14,7 @@ enum Bar { What } //~ ERROR parameter `T` is never used fn foo() { static a: Bar = Bar::What; - //~^ ERROR cannot use an outer type parameter in this context +//~^ ERROR can't use type parameters from outer function; try using a local type parameter instead } fn main() { diff --git a/src/test/compile-fail/issue-27433.rs b/src/test/compile-fail/issue-27433.rs index 78d96398b9587..782b205743871 100644 --- a/src/test/compile-fail/issue-27433.rs +++ b/src/test/compile-fail/issue-27433.rs @@ -11,5 +11,5 @@ fn main() { let foo = 42u32; const FOO : u32 = foo; - //~^ ERROR attempt to use a non-constant value in a constant + //~^ ERROR can't capture dynamic environment } diff --git a/src/test/compile-fail/issue-3521-2.rs b/src/test/compile-fail/issue-3521-2.rs index 6cd2c02c417ea..1742cb4fb7214 100644 --- a/src/test/compile-fail/issue-3521-2.rs +++ b/src/test/compile-fail/issue-3521-2.rs @@ -12,7 +12,7 @@ fn main() { let foo = 100; static y: isize = foo + 1; - //~^ ERROR attempt to use a non-constant value in a constant + //~^ ERROR can't capture dynamic environment println!("{}", y); } diff --git a/src/test/compile-fail/issue-3668-2.rs b/src/test/compile-fail/issue-3668-2.rs index 16fb2f68133f2..fe46877e8d340 100644 --- a/src/test/compile-fail/issue-3668-2.rs +++ b/src/test/compile-fail/issue-3668-2.rs @@ -10,7 +10,7 @@ fn f(x:isize) { static child: isize = x + 1; - //~^ ERROR attempt to use a non-constant value in a constant + //~^ ERROR can't capture dynamic environment } fn main() {} diff --git a/src/test/compile-fail/issue-3668.rs b/src/test/compile-fail/issue-3668.rs index 9c31dc1e38ef8..00f64414a9e72 100644 --- a/src/test/compile-fail/issue-3668.rs +++ b/src/test/compile-fail/issue-3668.rs @@ -16,7 +16,7 @@ trait PTrait { impl PTrait for P { fn getChildOption(&self) -> Option> { static childVal: Box

= self.child.get(); - //~^ ERROR attempt to use a non-constant value in a constant + //~^ ERROR can't capture dynamic environment panic!(); } } diff --git a/src/test/compile-fail/issue-39559-2.rs b/src/test/compile-fail/issue-39559-2.rs new file mode 100644 index 0000000000000..aa0750230649d --- /dev/null +++ b/src/test/compile-fail/issue-39559-2.rs @@ -0,0 +1,28 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Dim { + fn dim() -> usize; +} + +enum Dim3 {} + +impl Dim for Dim3 { + fn dim() -> usize { + 3 + } +} + +fn main() { + let array: [usize; Dim3::dim()] + //~^ ERROR calls in constants are limited to constant functions + = [0; Dim3::dim()]; + //~^ ERROR calls in constants are limited to constant functions +} diff --git a/src/test/compile-fail/issue-39559.rs b/src/test/compile-fail/issue-39559.rs index b7f767f109c0c..871ecf269ceec 100644 --- a/src/test/compile-fail/issue-39559.rs +++ b/src/test/compile-fail/issue-39559.rs @@ -22,12 +22,7 @@ impl Dim for Dim3 { pub struct Vector { entries: [T; D::dim()] - //~^ ERROR cannot use an outer type parameter in this context + //~^ ERROR no associated item named `dim` found for type `D` in the current scope } -fn main() { - let array: [usize; Dim3::dim()] - //~^ ERROR calls in constants are limited to constant functions - = [0; Dim3::dim()]; - //~^ ERROR calls in constants are limited to constant functions -} +fn main() {} diff --git a/src/test/run-pass/associated-const-type-parameters.rs b/src/test/run-pass/associated-const-type-parameters.rs index b276589f0c47b..df2083530646e 100644 --- a/src/test/run-pass/associated-const-type-parameters.rs +++ b/src/test/run-pass/associated-const-type-parameters.rs @@ -37,6 +37,10 @@ fn sub() -> i32 { A::X - B::X } +trait Bar: Foo { + const Y: i32 = Self::X; +} + fn main() { assert_eq!(11, Abc::X); assert_eq!(97, Def::X); From 1163f2cc23c6858473faee89e3ba38c66ccb8b79 Mon Sep 17 00:00:00 2001 From: Liran Ringel Date: Sat, 13 May 2017 17:12:19 +0200 Subject: [PATCH 6/7] Pass static crt to llvm cmake configuration --- src/Cargo.lock | 34 +++++++++++++++++----------------- src/bootstrap/Cargo.toml | 4 ++-- src/bootstrap/native.rs | 1 + 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/Cargo.lock b/src/Cargo.lock index 3dd8231a49f69..776a268aa8de1 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -27,7 +27,7 @@ version = "0.0.0" dependencies = [ "build_helper 0.1.0", "core 0.0.0", - "gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.46 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.0.0", ] @@ -73,9 +73,9 @@ name = "bootstrap" version = "0.0.0" dependencies = [ "build_helper 0.1.0", - "cmake 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "cmake 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.46 (registry+https://github.com/rust-lang/crates.io-index)", "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -119,10 +119,10 @@ dependencies = [ [[package]] name = "cmake" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.46 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -140,7 +140,7 @@ version = "0.0.0" dependencies = [ "build_helper 0.1.0", "core 0.0.0", - "gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.46 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -194,7 +194,7 @@ name = "flate" version = "0.0.0" dependencies = [ "build_helper 0.1.0", - "gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.46 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -203,7 +203,7 @@ version = "0.0.0" [[package]] name = "gcc" -version = "0.3.45" +version = "0.3.46" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -473,7 +473,7 @@ version = "0.0.0" dependencies = [ "alloc_system 0.0.0", "build_helper 0.1.0", - "cmake 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "cmake 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "core 0.0.0", ] @@ -606,7 +606,7 @@ name = "rustc_llvm" version = "0.0.0" dependencies = [ "build_helper 0.1.0", - "gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.46 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_bitflags 0.0.0", ] @@ -616,7 +616,7 @@ version = "0.0.0" dependencies = [ "alloc_system 0.0.0", "build_helper 0.1.0", - "cmake 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "cmake 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "core 0.0.0", ] @@ -660,7 +660,7 @@ version = "0.0.0" dependencies = [ "alloc_system 0.0.0", "build_helper 0.1.0", - "cmake 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "cmake 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "core 0.0.0", ] @@ -754,7 +754,7 @@ version = "0.0.0" dependencies = [ "alloc_system 0.0.0", "build_helper 0.1.0", - "cmake 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "cmake 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "core 0.0.0", ] @@ -782,7 +782,7 @@ dependencies = [ "arena 0.0.0", "build_helper 0.1.0", "env_logger 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.46 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "pulldown-cmark 0.0.14 (registry+https://github.com/rust-lang/crates.io-index)", "rustc 0.0.0", @@ -831,7 +831,7 @@ dependencies = [ "collections 0.0.0", "compiler_builtins 0.0.0", "core 0.0.0", - "gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.46 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.0.0", "panic_abort 0.0.0", "panic_unwind 0.0.0", @@ -997,12 +997,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4f67931368edf3a9a51d29886d245f1c3db2f1ef0dcc9e35ff70341b78c10d23" "checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4" "checksum clap 2.22.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e17a4a72ffea176f77d6e2db609c6c919ef221f23862c9915e687fb54d833485" -"checksum cmake 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "d18d68987ed4c516dcc3e7913659bfa4076f5182eea4a7e0038bb060953e76ac" +"checksum cmake 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)" = "92278eb79412c8f75cfc89e707a1bb3a6490b68f7f2e78d15c774f30fe701122" "checksum diff 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0a515461b6c8c08419850ced27bc29e86166dcdcde8fbe76f8b1f0589bb49472" "checksum dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "80c8b71fd71146990a9742fc06dcbbde19161a267e0ad4e572c35162f4578c90" "checksum env_logger 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e3856f1697098606fc6cb97a93de88ca3f3bc35bb878c725920e6e82ecf05e83" "checksum filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "5363ab8e4139b8568a6237db5248646e5a8a2f89bd5ccb02092182b11fd3e922" -"checksum gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)" = "40899336fb50db0c78710f53e87afc54d8c7266fb76262fecc78ca1a7f09deae" +"checksum gcc 0.3.46 (registry+https://github.com/rust-lang/crates.io-index)" = "181e3cebba1d663bd92eb90e2da787e10597e027eb00de8d742b260a7850948f" "checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685" "checksum handlebars 0.25.2 (registry+https://github.com/rust-lang/crates.io-index)" = "663e1728d8037fb0d4e13bcd1b1909fb5d913690a9929eb385922df157c2ff8f" "checksum itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eb2f404fbc66fd9aac13e998248505e7ecb2ad8e44ab6388684c5fb11c6c251c" diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml index 1088067c2de57..cc560e0172e3a 100644 --- a/src/bootstrap/Cargo.toml +++ b/src/bootstrap/Cargo.toml @@ -30,11 +30,11 @@ test = false [dependencies] build_helper = { path = "../build_helper" } -cmake = "0.1.17" +cmake = "0.1.23" filetime = "0.1" num_cpus = "1.0" toml = "0.1" getopts = "0.2" rustc-serialize = "0.3" -gcc = "0.3.38" +gcc = "0.3.46" libc = "0.2" diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index 67edd70a1565a..6cb1d1fc4bf05 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -108,6 +108,7 @@ pub fn llvm(build: &Build, target: &str) { cfg.define("LLVM_USE_CRT_DEBUG", "MT"); cfg.define("LLVM_USE_CRT_RELEASE", "MT"); cfg.define("LLVM_USE_CRT_RELWITHDEBINFO", "MT"); + cfg.static_crt(true); } if target.starts_with("i686") { From 51cebb3e63b8740bdf96b933b02f0c32901c9f6e Mon Sep 17 00:00:00 2001 From: Vadzim Dambrouski Date: Sat, 13 May 2017 01:37:43 +0300 Subject: [PATCH 7/7] LLVM: Add support for EABI-compliant libcalls on MSP430. This change will allow rust code to have proper support for division and multiplication using libgcc libcalls. --- src/llvm | 2 +- src/rustllvm/llvm-rebuild-trigger | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/llvm b/src/llvm index cf85b5a8da785..1ef3b9128e1ba 160000 --- a/src/llvm +++ b/src/llvm @@ -1 +1 @@ -Subproject commit cf85b5a8da7853c4de5cc57766da8b7988c06461 +Subproject commit 1ef3b9128e1baaed61b42d5b0de79dee100acf17 diff --git a/src/rustllvm/llvm-rebuild-trigger b/src/rustllvm/llvm-rebuild-trigger index d73d1c25e5bdb..70663f30e8f9e 100644 --- a/src/rustllvm/llvm-rebuild-trigger +++ b/src/rustllvm/llvm-rebuild-trigger @@ -1,4 +1,4 @@ # If this file is modified, then llvm will be (optionally) cleaned and then rebuilt. # The actual contents of this file do not matter, but to trigger a change on the # build bots then the contents should be changed so git updates the mtime. -2017-05-06 +2017-05-13