Skip to content

Commit 3e41d19

Browse files
committed
---
yaml --- r: 236176 b: refs/heads/stable c: 6beaeda h: refs/heads/master v: v3
1 parent b43b0c5 commit 3e41d19

File tree

9 files changed

+60
-16
lines changed

9 files changed

+60
-16
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 6109d0567d5b72c70762e5bac00497ed30adf1b9
32+
refs/heads/stable: 6beaedaa5f9e93e0f6a1eafb485db1fd26a0e210
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/src/doc/tarpl/repr-rust.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ type's size is a multiple of its alignment. For instance:
3131
```rust
3232
struct A {
3333
a: u8,
34-
c: u32,
35-
b: u16,
34+
b: u32,
35+
c: u16,
3636
}
3737
```
3838

branches/stable/src/liblibc/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ pub mod types {
10021002
}
10031003
pub mod posix01 {
10041004
use types::common::c95::{c_void};
1005-
use types::common::c99::{uint8_t, uint32_t, int32_t};
1005+
use types::common::c99::{uint32_t, int32_t};
10061006
use types::os::arch::c95::{c_long, time_t};
10071007
use types::os::arch::posix88::{dev_t, gid_t, ino_t};
10081008
use types::os::arch::posix88::{mode_t, off_t};
@@ -1096,7 +1096,7 @@ pub mod types {
10961096
}
10971097
pub mod posix01 {
10981098
use types::common::c95::{c_void};
1099-
use types::common::c99::{uint8_t, uint32_t, int32_t};
1099+
use types::common::c99::{uint32_t, int32_t};
11001100
use types::os::arch::c95::{c_long, time_t};
11011101
use types::os::arch::posix88::{dev_t, gid_t, ino_t};
11021102
use types::os::arch::posix88::{mode_t, off_t};

branches/stable/src/librustc_trans/back/msvc/mod.rs

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ pub fn link_exe_cmd(sess: &Session) -> Command {
206206
return max_key
207207
}
208208

209-
fn get_windows_sdk_path() -> Option<(PathBuf, usize)> {
209+
fn get_windows_sdk_path() -> Option<(PathBuf, usize, Option<OsString>)> {
210210
let key = r"SOFTWARE\Microsoft\Microsoft SDKs\Windows";
211211
let key = LOCAL_MACHINE.open(key.as_ref());
212212
let (n, k) = match key.ok().as_ref().and_then(max_version) {
@@ -217,28 +217,29 @@ pub fn link_exe_cmd(sess: &Session) -> Command {
217217
let major = parts.next().unwrap().parse::<usize>().unwrap();
218218
let _minor = parts.next().unwrap().parse::<usize>().unwrap();
219219
k.query_str("InstallationFolder").ok().map(|folder| {
220-
(PathBuf::from(folder), major)
220+
let ver = k.query_str("ProductVersion");
221+
(PathBuf::from(folder), major, ver.ok())
221222
})
222223
}
223224

224225
fn get_windows_sdk_lib_path(sess: &Session) -> Option<PathBuf> {
225-
let (mut path, major) = match get_windows_sdk_path() {
226+
let (mut path, major, ver) = match get_windows_sdk_path() {
226227
Some(p) => p,
227228
None => return None,
228229
};
229230
path.push("Lib");
230231
if major <= 7 {
231232
// In Windows SDK 7.x, x86 libraries are directly in the Lib folder,
232-
// x64 libraries are inside, and it's not necessary to link agains
233+
// x64 libraries are inside, and it's not necessary to link against
233234
// the SDK 7.x when targeting ARM or other architectures.
234235
let x86 = match &sess.target.target.arch[..] {
235236
"x86" => true,
236237
"x86_64" => false,
237238
_ => return None,
238239
};
239240
Some(if x86 {path} else {path.join("x64")})
240-
} else {
241-
// Windows SDK 8.x installes libraries in a folder whose names
241+
} else if major <= 8 {
242+
// Windows SDK 8.x installs libraries in a folder whose names
242243
// depend on the version of the OS you're targeting. By default
243244
// choose the newest, which usually corresponds to the version of
244245
// the OS you've installed the SDK on.
@@ -251,7 +252,25 @@ pub fn link_exe_cmd(sess: &Session) -> Command {
251252
}).map(|path| {
252253
path.join("um").join(extra)
253254
})
254-
}
255+
} else if let Some(mut ver) = ver {
256+
// Windows SDK 10 splits the libraries into architectures the same
257+
// as Windows SDK 8.x, except for the addition of arm64.
258+
// Additionally, the SDK 10 is split by Windows 10 build numbers
259+
// rather than the OS version like the SDK 8.x does.
260+
let extra = match windows_sdk_v10_subdir(sess) {
261+
Some(e) => e,
262+
None => return None,
263+
};
264+
// To get the correct directory we need to get the Windows SDK 10
265+
// version, and so far it looks like the "ProductVersion" of the SDK
266+
// corresponds to the folder name that the libraries are located in
267+
// except that the folder contains an extra ".0". For now just
268+
// append a ".0" to look for find the directory we're in. This logic
269+
// will likely want to be refactored one day.
270+
ver.push(".0");
271+
let p = path.join(ver).join("um").join(extra);
272+
fs::metadata(&p).ok().map(|_| p)
273+
} else { None }
255274
}
256275

257276
fn windows_sdk_v8_subdir(sess: &Session) -> Option<&'static str> {
@@ -263,6 +282,16 @@ pub fn link_exe_cmd(sess: &Session) -> Command {
263282
}
264283
}
265284

285+
fn windows_sdk_v10_subdir(sess: &Session) -> Option<&'static str> {
286+
match &sess.target.target.arch[..] {
287+
"x86" => Some("x86"),
288+
"x86_64" => Some("x64"),
289+
"arm" => Some("arm"),
290+
"aarch64" => Some("arm64"), // FIXME - Check if aarch64 is correct
291+
_ => return None,
292+
}
293+
}
294+
266295
fn ucrt_install_dir(vs_install_dir: &Path) -> Option<(PathBuf, String)> {
267296
let is_vs_14 = vs_install_dir.iter().filter_map(|p| p.to_str()).any(|s| {
268297
s == "Microsoft Visual Studio 14.0"

branches/stable/src/libsyntax/parse/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4610,7 +4610,7 @@ impl<'a> Parser<'a> {
46104610
None
46114611
};
46124612

4613-
if try!(self.eat(&token::DotDot) ){
4613+
if opt_trait.is_some() && try!(self.eat(&token::DotDot) ){
46144614
if generics.is_parameterized() {
46154615
self.span_err(impl_span, "default trait implementations are not \
46164616
allowed to have generics");

branches/stable/src/test/parse-fail/empty-impl-semicolon.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010

1111
// compile-flags: -Z parse-only
1212

13-
impl Foo; //~ ERROR expected one of `(`, `+`, `..`, `::`, `<`, `for`, `where`, or `{`, found `;`
13+
impl Foo; //~ ERROR expected one of `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `;`
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// compile-flags: -Z parse-only
12+
13+
impl A .. {} //~ ERROR
14+
15+
fn main() {}

branches/stable/src/test/parse-fail/multitrait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ struct S {
1515
}
1616

1717
impl Cmp, ToString for S {
18-
//~^ ERROR: expected one of `(`, `+`, `..`, `::`, `<`, `for`, `where`, or `{`, found `,`
18+
//~^ ERROR: expected one of `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `,`
1919
fn eq(&&other: S) { false }
2020
fn to_string(&self) -> String { "hi".to_string() }
2121
}

branches/stable/src/test/parse-fail/trait-bounds-not-on-impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct Bar;
1717

1818
impl Foo + Owned for Bar {
1919
//~^ ERROR not a trait
20-
//~^^ ERROR expected one of `..`, `where`, or `{`, found `Bar`
20+
//~^^ ERROR expected one of `where` or `{`, found `Bar`
2121
}
2222

2323
fn main() { }

0 commit comments

Comments
 (0)