Skip to content

Rollup of 4 pull requests #28258

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

Merged
merged 31 commits into from
Sep 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a88659d
middle: use filter_map instead of flat_map with Option iters
birkenfeld Aug 30, 2015
52417d5
Implement `Borrow` for fixed-size arrays
petrochenkov Sep 3, 2015
b8dad48
Fix multiple mutable autoderefs with `Box`
apasel422 Sep 3, 2015
2548e2e
Fixes minor formatting inconsistencies
id4ho Sep 4, 2015
f44fbf0
Capitalize circle reference
id4ho Sep 4, 2015
f86c853
Fix escaping in msvc builds
Diggsey Aug 27, 2015
2f77a59
Auto merge of #28201 - apasel422:issue-26205, r=nikomatsakis
bors Sep 4, 2015
d12135a
Add support for pointers to generator.py.
huonw Sep 2, 2015
add0430
Support non-return value references in platform intrinsic generator.
huonw Sep 2, 2015
62e346a
Support void in platform intrinsic generator.
huonw Sep 2, 2015
2b45a9a
Support bitcasts in platform intrinsic generator.
huonw Sep 3, 2015
c19e7b6
Add various pointer & void-using x86 intrinsics.
huonw Sep 3, 2015
7241ae9
Support return aggregates in platform intrinsics.
huonw Sep 4, 2015
67aa4c7
Add some fancier AArch64 load/store instructions.
huonw Sep 4, 2015
62c45f4
Auto merge of #28227 - birkenfeld:use_filter_map, r=alexcrichton
bors Sep 4, 2015
668dac4
Auto merge of #28035 - Diggsey:msvc-escaping, r=alexcrichton
bors Sep 4, 2015
8175dce
Add long diagnostics for E0247
AlisdairO Sep 4, 2015
1110f1e
Auto merge of #28197 - petrochenkov:borrow, r=alexcrichton
bors Sep 4, 2015
0f0c48b
rustbook: Fix relative links on the Introduction page
nhowell Sep 4, 2015
edca8f7
rustfmt librustc_trans/save
nrc Sep 2, 2015
6a127e9
fixup
nrc Sep 2, 2015
779b2a9
Auto merge of #28161 - nrc:fmt, r=brson
bors Sep 4, 2015
9a83842
Add line numbers to MSVC backtrace
Diggsey Sep 4, 2015
7ee876c
Auto merge of #28221 - huonw:simd, r=alexcrichton
bors Sep 5, 2015
973da4f
Auto merge of #28240 - nhowell:master, r=steveklabnik
bors Sep 5, 2015
f7ffd50
Fix typo in prelude docs
murarth Sep 5, 2015
6b36e92
Auto merge of #28242 - Diggsey:msvc-backtrace, r=alexcrichton
bors Sep 5, 2015
3610c73
Rollup merge of #28225 - jackwilsonv:patch-3, r=steveklabnik
Manishearth Sep 5, 2015
6ed1c59
Rollup merge of #28231 - GuillaumeGomez:help_note, r=Manishearth
Manishearth Sep 5, 2015
d7afefc
Rollup merge of #28234 - AlisdairO:diagnostics247, r=Manishearth
Manishearth Sep 5, 2015
1bf060f
Rollup merge of #28253 - murarth:prelude-typo, r=steveklabnik
Manishearth Sep 5, 2015
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
19 changes: 15 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -1180,16 +1180,27 @@ do
# MSVC requires cmake because that's how we're going to build LLVM
probe_need CFG_CMAKE cmake

# There are three builds of cmake on windows: MSVC, MinGW and Cygwin
# The Cygwin build does not have generators for Visual Studio, so
# detect that here and error.
if ! "$CFG_CMAKE" --help | sed -n '/^Generators/,$p' | grep 'Visual Studio' > /dev/null
then
err "cmake does not support Visual Studio generators.\n\n \
This is likely due to it being an msys/cygwin build of cmake, \
rather than the required windows version, built using MinGW \
or Visual Studio."
fi

# Use the REG program to figure out where VS is installed
# We need to figure out where cl.exe and link.exe are, so we do some
# munging and some probing here. We also look for the default
# INCLUDE and LIB variables for MSVC so we can set those in the
# build system as well.
install=$(reg QUERY \
install=$(cmd //c reg QUERY \
'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0' \
-v InstallDir)
if [ -z "$install" ]; then
install=$(reg QUERY \
install=$(cmd //c reg QUERY \
'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0' \
-v InstallDir)
fi
Expand Down Expand Up @@ -1222,9 +1233,9 @@ do
eval CFG_MSVC_LINK_$bits="\"$bindir/link.exe\""

vcvarsall="${CFG_MSVC_ROOT}/VC/vcvarsall.bat"
include_path=$(cmd /c "\"$vcvarsall\" $msvc_part && cmd /c echo %INCLUDE%")
include_path=$(cmd //V:ON //c "$vcvarsall" $msvc_part \& echo !INCLUDE!)
need_ok "failed to learn about MSVC's INCLUDE"
lib_path=$(cmd /c "\"$vcvarsall\" $msvc_part && cmd /c echo %LIB%")
lib_path=$(cmd //V:ON //c "$vcvarsall" $msvc_part \& echo !LIB!)
need_ok "failed to learn about MSVC's LIB"

eval CFG_MSVC_INCLUDE_PATH_${bits}="\"$include_path\""
Expand Down
16 changes: 8 additions & 8 deletions src/doc/trpl/method-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ can be awkward. Consider this code:
baz(bar(foo));
```

We would read this left-to right, and so we see ‘baz bar foo’. But this isn’t the
We would read this left-to-right, and so we see ‘baz bar foo’. But this isn’t the
order that the functions would get called in, that’s inside-out: ‘foo bar baz’.
Wouldn’t it be nice if we could do this instead?

Expand Down Expand Up @@ -45,17 +45,17 @@ This will print `12.566371`.



We’ve made a struct that represents a circle. We then write an `impl` block,
We’ve made a `struct` that represents a circle. We then write an `impl` block,
and inside it, define a method, `area`.

Methods take a special first parameter, of which there are three variants:
Methods take a special first parameter, of which there are three variants:
`self`, `&self`, and `&mut self`. You can think of this first parameter as
being the `foo` in `foo.bar()`. The three variants correspond to the three
kinds of things `foo` could be: `self` if it’s just a value on the stack,
`&self` if it’s a reference, and `&mut self` if it’s a mutable reference.
Because we took the `&self` parameter to `area`, we can use it just like any
other parameter. Because we know it’s a `Circle`, we can access the `radius`
just like we would with any other struct.
just like we would with any other `struct`.

We should default to using `&self`, as you should prefer borrowing over taking
ownership, as well as taking immutable references over mutable ones. Here’s an
Expand Down Expand Up @@ -120,12 +120,12 @@ Check the return type:
```rust
# struct Circle;
# impl Circle {
fn grow(&self) -> Circle {
fn grow(&self, increment: f64) -> Circle {
# Circle } }
```

We just say we’re returning a `Circle`. With this method, we can grow a new
circle to any arbitrary size.
`Circle` to any arbitrary size.

# Associated functions

Expand Down Expand Up @@ -161,7 +161,7 @@ methods’.

# Builder Pattern

Let’s say that we want our users to be able to create Circles, but we will
Let’s say that we want our users to be able to create `Circle`s, but we will
allow them to only set the properties they care about. Otherwise, the `x`
and `y` attributes will be `0.0`, and the `radius` will be `1.0`. Rust doesn’t
have method overloading, named arguments, or variable arguments. We employ
Expand Down Expand Up @@ -224,7 +224,7 @@ fn main() {
}
```

What we’ve done here is make another struct, `CircleBuilder`. We’ve defined our
What we’ve done here is make another `struct`, `CircleBuilder`. We’ve defined our
builder methods on it. We’ve also defined our `area()` method on `Circle`. We
also made one more method on `CircleBuilder`: `finalize()`. This method creates
our final `Circle` from the builder. Now, we’ve used the type system to enforce
Expand Down
42 changes: 42 additions & 0 deletions src/etc/platform-intrinsics/aarch64.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,48 @@
"ret": "i8",
"args": ["0"]
},
{
"intrinsic": "ld2{0[0].width}_{0[0].data_type}",
"width": [64, 128],
"llvm": "ld2.{0[0].llvm_name}.{1.llvm_name}",
"ret": ["[i(8-64);2]","[f(32-64);2]"],
"args": ["0.0SPc/0.0"]
},
{
"intrinsic": "ld3{0[0].width}_{0[0].data_type}",
"width": [64, 128],
"llvm": "ld3.{0[0].llvm_name}.{1.llvm_name}",
"ret": ["[i(8-64);3]","[f(32-64);3]"],
"args": ["0.0SPc/0.0"]
},
{
"intrinsic": "ld4{0[0].width}_{0[0].data_type}",
"width": [64, 128],
"llvm": "ld4.{0[0].llvm_name}.{1.llvm_name}",
"ret": ["[i(8-64);4]","[f(32-64);4]"],
"args": ["0.0SPc/0.0"]
},
{
"intrinsic": "ld2{0[0].width}_dup_{0[0].data_type}",
"width": [64, 128],
"llvm": "ld2.{0[0].llvm_name}.{1.llvm_name}",
"ret": ["[i(8-64);2]","[f(32-64);2]"],
"args": ["0.0SPc"]
},
{
"intrinsic": "ld3{0[0].width}_dup_{0[0].data_type}",
"width": [64, 128],
"llvm": "ld3.{0[0].llvm_name}.{1.llvm_name}",
"ret": ["[i(8-64);3]","[f(32-64);3]"],
"args": ["0.0SPc"]
},
{
"intrinsic": "ld4{0[0].width}_dup_{0[0].data_type}",
"width": [64, 128],
"llvm": "ld4.{0[0].llvm_name}.{1.llvm_name}",
"ret": ["[i(8-64);4]","[f(32-64);4]"],
"args": ["0.0SPc"]
},
{
"intrinsic": "padd{0.width}_{0.data_type}",
"width": [64, 128],
Expand Down
Loading