]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agolibrustc: Schedule cleanups properly when coercing to a &Trait.
Luqman Aden [Fri, 27 Jun 2014 20:54:18 +0000 (16:54 -0400)]
librustc: Schedule cleanups properly when coercing to a &Trait.

10 years agoauto merge of #15212 : huonw/rust/struct-paren-lint, r=alexcrichton
bors [Fri, 27 Jun 2014 17:56:26 +0000 (17:56 +0000)]
auto merge of #15212 : huonw/rust/struct-paren-lint, r=alexcrichton

rustc: update the unnecessary parens lint for struct literals.

Things like `match X { x: 1 } { ... }` now need to be written with
parentheses, so the lint should avoid warning in cases like that.

10 years agoauto merge of #15213 : Sawyer47/rust/issue-11677, r=huonw
bors [Fri, 27 Jun 2014 13:11:24 +0000 (13:11 +0000)]
auto merge of #15213 : Sawyer47/rust/issue-11677, r=huonw

This code used to cause an ICE

Closes #11677

10 years agoauto merge of #15211 : steveklabnik/rust/guide_skeleton, r=huonw
bors [Fri, 27 Jun 2014 11:26:25 +0000 (11:26 +0000)]
auto merge of #15211 : steveklabnik/rust/guide_skeleton, r=huonw

This diff will look better once bors takes care of https://github.com/rust-lang/rust/pull/15183

@brson and I talked about it, and, if I commit this skeleton, I can submit PRs for each portion, without doing this silly "builds on previous PRs" stuff, and it shouldn't cause conflicts.

This lays out what I think the guide should cover, and in what order.  I haven't picked a cohesive project yet that shows all this off, but I think this progression of concepts is appropriate.

10 years agoauto merge of #15166 : zookoatleastauthoritycom/rust/13570-add-see-below-to-a-referen...
bors [Fri, 27 Jun 2014 09:41:27 +0000 (09:41 +0000)]
auto merge of #15166 : zookoatleastauthoritycom/rust/13570-add-see-below-to-a-reference-to-a-new-concept-2, r=huonw

This is the same patch as submitted to https://github.com/rust-lang/rust/issues/13570 and https://github.com/rust-lang/rust/pull/14124, but with @pnkfelix's comment (https://github.com/rust-lang/rust/pull/14124#issuecomment-42797536) addressed, and with reflow as a separate commit. I'm submitting it in case @steveklabnik hasn't yet merged a rewrite of the tutorial (https://github.com/rust-lang/rust/issues/13570#issuecomment-46864789), in which case this patch might as well be merged into the old tutorial.

10 years agoAdd test for #11677
Piotr Jawniak [Fri, 27 Jun 2014 09:30:51 +0000 (11:30 +0200)]
Add test for #11677

This code used to cause an ICE

Closes #11677

10 years agoSkeleton outline of the guide.
Steve Klabnik [Fri, 27 Jun 2014 00:46:12 +0000 (20:46 -0400)]
Skeleton outline of the guide.

10 years agorustc: update the unnecessary parens lint for struct literals.
Huon Wilson [Tue, 24 Jun 2014 23:00:46 +0000 (09:00 +1000)]
rustc: update the unnecessary parens lint for struct literals.

Things like `match X { x: 1 } { ... }` now need to be written with
parentheses, so the lint should avoid warning in cases like that.

10 years agoauto merge of #15183 : steveklabnik/rust/hello_cargo, r=huonw
bors [Fri, 27 Jun 2014 02:41:24 +0000 (02:41 +0000)]
auto merge of #15183 : steveklabnik/rust/hello_cargo, r=huonw

Built on top of https://github.com/rust-lang/rust/pull/15181. https://github.com/steveklabnik/rust/commit/e52719291183d7b4f691a1997c69fd75b8101b07 is the only new commit, you may want to review that separately.

I'm not sure if the car analogy is too glib.

10 years agoAdd one more ignore.
Steve Klabnik [Fri, 27 Jun 2014 01:57:46 +0000 (21:57 -0400)]
Add one more ignore.

Thanks @huonw

10 years agoFix windows run instructions
Steve Klabnik [Fri, 27 Jun 2014 00:49:27 +0000 (20:49 -0400)]
Fix windows run instructions

Thank you, @stormbrew!

10 years agoauto merge of #15206 : omasanori/rust/use-reexported, r=alexcrichton
bors [Fri, 27 Jun 2014 00:21:24 +0000 (00:21 +0000)]
auto merge of #15206 : omasanori/rust/use-reexported, r=alexcrichton

We use re-exported pathes (e.g. std::io::Command) and original ones
(e.g. std::io::process::Command) together in examples now. Using
re-exported ones consistently avoids confusion.

10 years agoauto merge of #15190 : pcwalton/rust/proc-upvars, r=alexcrichton
bors [Thu, 26 Jun 2014 22:21:23 +0000 (22:21 +0000)]
auto merge of #15190 : pcwalton/rust/proc-upvars, r=alexcrichton

Since procs do not have lifetime bounds, we must do this to maintain
safety.

This can break code that incorrectly captured references in procedure
types. Change such code to not do this, perhaps with a trait object
instead.

Closes #14036.

[breaking-change]

r? @alexcrichton

10 years agolibrustc: Ensure that proc upvars have static lifetime.
Patrick Walton [Thu, 26 Jun 2014 01:10:50 +0000 (18:10 -0700)]
librustc: Ensure that proc upvars have static lifetime.

Since procs do not have lifetime bounds, we must do this to maintain
safety.

This can break code that incorrectly captured references in procedure
types. Change such code to not do this, perhaps with a trait object
instead.

A better solution would be to add higher-rank lifetime support to procs.
However, this would be a lot of work for a feature we want to remove in
favor of unboxed closures. The corresponding "real fix" is #15067.

Closes #14036.

[breaking-change]

10 years agostd::io: Use re-exported pathes in examples.
OGINO Masanori [Thu, 26 Jun 2014 20:22:26 +0000 (05:22 +0900)]
std::io: Use re-exported pathes in examples.

We use re-exported pathes (e.g. std::io::Command) and original ones
(e.g. std::io::process::Command) together in examples now. Using
re-exported ones consistently avoids confusion.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
10 years agoC macros, not C++ templates.
Steve Klabnik [Thu, 26 Jun 2014 20:58:20 +0000 (16:58 -0400)]
C macros, not C++ templates.

@cmr rightfully points out that C macros are worse, and share the
same name.

10 years agoFix missing word and some grammar
Steve Klabnik [Thu, 26 Jun 2014 19:46:36 +0000 (15:46 -0400)]
Fix missing word and some grammar

Thanks @chris-morgan and @P1start! :heart:

10 years agoauto merge of #14886 : alexcrichton/rust/rt-improvements, r=brson
bors [Thu, 26 Jun 2014 19:46:25 +0000 (19:46 +0000)]
auto merge of #14886 : alexcrichton/rust/rt-improvements, r=brson

Most of the comments are available on the Task structure itself, but this commit
is aimed at making FFI-style usage of Rust tasks a little nicer.

Primarily, this commit enables re-use of tasks across multiple invocations. The
method `run` will no longer unconditionally destroy the task itself. Rather, the
task will be internally re-usable if the closure specified did not fail. Once a
task has failed once it is considered poisoned and it can never be used again.

Along the way I tried to document shortcomings of the current method of tearing
down a task, opening a few issues as well. For now none of the behavior is a
showstopper, but it's useful to acknowledge it. Also along the way I attempted
to remove as much `unsafe` code as possible, opting for safer abstractions.

10 years agoNote that macros != templates
Steve Klabnik [Thu, 26 Jun 2014 19:44:29 +0000 (15:44 -0400)]
Note that macros != templates

Good call, @chris-morgan and @cmr!

10 years agoClarify which curly is being referred to
Steve Klabnik [Thu, 26 Jun 2014 19:41:46 +0000 (15:41 -0400)]
Clarify which curly is being referred to

Thanks @chris-morgan

10 years agoTIL PATHEXT
Steve Klabnik [Thu, 26 Jun 2014 19:40:52 +0000 (15:40 -0400)]
TIL PATHEXT

Thanks @chris-morgan :heart:

10 years agorustrt: Reorganize task usage
Alex Crichton [Fri, 13 Jun 2014 23:03:41 +0000 (16:03 -0700)]
rustrt: Reorganize task usage

Most of the comments are available on the Task structure itself, but this commit
is aimed at making FFI-style usage of Rust tasks a little nicer.

Primarily, this commit enables re-use of tasks across multiple invocations. The
method `run` will no longer unconditionally destroy the task itself. Rather, the
task will be internally re-usable if the closure specified did not fail. Once a
task has failed once it is considered poisoned and it can never be used again.

Along the way I tried to document shortcomings of the current method of tearing
down a task, opening a few issues as well. For now none of the behavior is a
showstopper, but it's useful to acknowledge it. Also along the way I attempted
to remove as much `unsafe` code as possible, opting for safer abstractions.

10 years agoMove note about $ up
Steve Klabnik [Thu, 26 Jun 2014 19:39:30 +0000 (15:39 -0400)]
Move note about $ up

Thanks @chris-morgan :heart:

10 years agoFixing link to subreddit.
Steve Klabnik [Thu, 26 Jun 2014 19:37:57 +0000 (15:37 -0400)]
Fixing link to subreddit.

Thanks @chris-morgan :heart:

10 years agoStackOverflow -> Stack Overflow
Steve Klabnik [Thu, 26 Jun 2014 19:36:57 +0000 (15:36 -0400)]
StackOverflow -> Stack Overflow

Thanks @chris-morgan

10 years agoFix IRC linkage.
Steve Klabnik [Thu, 26 Jun 2014 19:35:56 +0000 (15:35 -0400)]
Fix IRC linkage.

Death to `here`!

Thanks @chris-morgan :heart:

10 years agostaticly -> statically
Steve Klabnik [Thu, 26 Jun 2014 19:34:15 +0000 (15:34 -0400)]
staticly -> statically

What's funny about this one is that spellcheck caught it, but for
some reason didn't give me the right suggestion, so I assumed that it
wasn't in my dictionary. Oh well.

Thanks @P1start! :heart:

10 years agoall/some
Steve Klabnik [Thu, 26 Jun 2014 19:32:35 +0000 (15:32 -0400)]
all/some

How could I forsake `rustdoc`? :sweat_smile:

Thanks @huonw.

10 years agotha -> than
Steve Klabnik [Thu, 26 Jun 2014 19:31:41 +0000 (15:31 -0400)]
tha -> than

Thanks @huonw :heart:

10 years agoFix capitalization of Issue.
Steve Klabnik [Thu, 26 Jun 2014 19:30:44 +0000 (15:30 -0400)]
Fix capitalization of Issue.

@chris-morgan and @huonw pointed out that even though the feature
is a proper noun, we're using it in a more generic sense here.

10 years agoAdd a note that this requires `git`.
Steve Klabnik [Thu, 26 Jun 2014 19:30:06 +0000 (15:30 -0400)]
Add a note that this requires `git`.

10 years agoGuide: Hello, cargo
Steve Klabnik [Wed, 25 Jun 2014 20:09:45 +0000 (16:09 -0400)]
Guide: Hello, cargo

10 years agoauto merge of #15197 : omasanori/rust/doc-fix, r=alexcrichton
bors [Thu, 26 Jun 2014 17:16:26 +0000 (17:16 +0000)]
auto merge of #15197 : omasanori/rust/doc-fix, r=alexcrichton

10 years agoauto merge of #15192 : mrec/rust/json-nan, r=alexcrichton
bors [Thu, 26 Jun 2014 14:32:30 +0000 (14:32 +0000)]
auto merge of #15192 : mrec/rust/json-nan, r=alexcrichton

The JSON spec requires that these special values be serialized as "null"; the current serialization breaks any conformant JSON parser. So encoding needs to output "null",  `to_json` on floating-point types can return `Null` as well as `Number` values, and reading a `Null` value when specifically expecting a number should be interpreted as NaN. There's no way to round-trip Infinity through JSON.

This is my first attempt at both writing Rust and opening pull requests, so please dial your derp detector up to eleven when reviewing. A `rustc --test lib.rs` in `libserialize` passes all tests; a `make check` of the whole tree fails with the error below, but it doesn't look obviously related and the docs say that `make check` is known to be flaky on Windows.

    ---- [compile-fail] compile-fail/svh-change-significant-cfg.rs stdout ----
            task '[compile-fail] compile-fail/svh-change-significant-cfg.rs' failed at 'called `Result::
    unwrap()` on an `Err` value: couldn't create file (end of file (unknown error); path=i686-pc-mingw32
    \test\compile-fail\svh-a-base.err; mode=truncate; access=write)', C:\msys\home\Mike\rust\src\libcore
    \result.rs:545

Incidentally, it may just be my lack of familiarity with the language and its idioms, but the duplication between `Encoder`/`PrettyEncoder` had a distinct code smell to it. The size of the file (~3500 lines) also made it a bit hard to navigate. Has there been any discussion of refactoring and/or breaking it up? I couldn't find anything in Issues except the ancient #9028.

10 years agoauto merge of #15194 : Sawyer47/rust/to-string-cleanup, r=alexcrichton
bors [Thu, 26 Jun 2014 12:46:25 +0000 (12:46 +0000)]
auto merge of #15194 : Sawyer47/rust/to-string-cleanup, r=alexcrichton

This commit removes superfluous to_string calls from various places

10 years agoFix a typo and a small syntactic error.
OGINO Masanori [Thu, 26 Jun 2014 12:43:47 +0000 (21:43 +0900)]
Fix a typo and a small syntactic error.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
10 years agoauto merge of #15181 : steveklabnik/rust/hello_world, r=brson
bors [Thu, 26 Jun 2014 07:11:23 +0000 (07:11 +0000)]
auto merge of #15181 : steveklabnik/rust/hello_world, r=brson

This is built on top of https://github.com/rust-lang/rust/pull/15162 . https://github.com/steveklabnik/rust/commit/cccae83d922f5aade2b7cca96579521cc35ced59 is the only new commit, you may want to look at that rather than the whole diff.

Writing our first Rust program together. This is the most crucial step, so I go to a fairly deep level of detail. Future sections will move more quickly.

10 years agoRemove unnecessary to_string calls
Piotr Jawniak [Thu, 26 Jun 2014 06:15:14 +0000 (08:15 +0200)]
Remove unnecessary to_string calls

This commit removes superfluous to_string calls from various places

10 years agoauto merge of #15162 : steveklabnik/rust/install_instructions, r=brson
bors [Thu, 26 Jun 2014 04:21:27 +0000 (04:21 +0000)]
auto merge of #15162 : steveklabnik/rust/install_instructions, r=brson

This has my voice *very strongly*. I'm not sure if it's too much. I'd find it okay if I had to tone it back, and I don't want it to be _too strong_, but clinical docs are boring.

10 years agoauto merge of #15184 : jbclements/rust/for-loop-hygiene-etc, r=jbclements
bors [Thu, 26 Jun 2014 02:21:28 +0000 (02:21 +0000)]
auto merge of #15184 : jbclements/rust/for-loop-hygiene-etc, r=jbclements

It turns out that bindings introduced by 'for' loops were not treated hygienically. The fix for this is to make the 'for' expansion more like a macro; rather than expanding sub-pieces and then assembling them, we need to rewrite the for and then call expand again on the whole thing.

This PR includes a test and the fix.

It also contains a number of other things:
- unit tests for other forms of hygiene (currently ignored)
- a fix for the isaac.rs macro that (it turned out) was relying on capturing
- other miscellaneous cleanup and comments

10 years agomore loops to be ignored by pretty-rpass
John Clements [Thu, 26 Jun 2014 02:15:06 +0000 (19:15 -0700)]
more loops to be ignored by pretty-rpass

10 years agojson: Fix handling of NaN/Infinity
mrec [Thu, 26 Jun 2014 01:26:41 +0000 (02:26 +0100)]
json: Fix handling of NaN/Infinity

The JSON spec requires that these special values be serialized as null; the current serialization breaks any conformant JSON parser. So encoding needs to output "null",  to_json on floating-point types can return Null as well as Number, and reading null when specifically expecting a number should be interpreted as NaN. There's no way to round-trip Infinity.

10 years agowork around 15189 in test cases
John Clements [Thu, 26 Jun 2014 00:08:08 +0000 (17:08 -0700)]
work around 15189 in test cases

10 years agomake macros hygienic
John Clements [Wed, 25 Jun 2014 01:57:00 +0000 (18:57 -0700)]
make macros hygienic

10 years agoadded compile-fail test for 15167
John Clements [Wed, 25 Jun 2014 01:49:19 +0000 (18:49 -0700)]
added compile-fail test for 15167

10 years agodon't expand subexprs of for loop, just re-expand whole thing.
John Clements [Wed, 25 Jun 2014 00:58:56 +0000 (17:58 -0700)]
don't expand subexprs of for loop, just re-expand whole thing.

Fixes #15167

10 years agoremove misleading and unnecessary underscores
John Clements [Wed, 25 Jun 2014 00:30:53 +0000 (17:30 -0700)]
remove misleading and unnecessary underscores

10 years agoremove unneccessary pubs, shorten names
John Clements [Wed, 25 Jun 2014 00:03:49 +0000 (17:03 -0700)]
remove unneccessary pubs, shorten names

10 years agoremove unneeded visit_ty methods
John Clements [Tue, 24 Jun 2014 23:50:06 +0000 (16:50 -0700)]
remove unneeded visit_ty methods

10 years agoadd unit test for match var hygiene
John Clements [Tue, 24 Jun 2014 23:34:03 +0000 (16:34 -0700)]
add unit test for match var hygiene

10 years agoenrich and rename crate_idents test case
John Clements [Tue, 24 Jun 2014 23:33:44 +0000 (16:33 -0700)]
enrich and rename crate_idents test case

10 years agocomments only
John Clements [Tue, 24 Jun 2014 01:45:51 +0000 (18:45 -0700)]
comments only

10 years agorevive old commented-out test cases as ignored test cases for hygiene
John Clements [Tue, 12 Nov 2013 01:35:25 +0000 (17:35 -0800)]
revive old commented-out test cases as ignored test cases for hygiene

10 years agotidy macro just a bit
John Clements [Tue, 4 Feb 2014 00:44:47 +0000 (16:44 -0800)]
tidy macro just a bit

10 years agoAdd extra ignore directives.
Steve Klabnik [Wed, 25 Jun 2014 20:12:40 +0000 (16:12 -0400)]
Add extra ignore directives.

10 years agoauto merge of #15171 : pcwalton/rust/remove-cross-borrowing, r=brson
bors [Wed, 25 Jun 2014 18:51:21 +0000 (18:51 +0000)]
auto merge of #15171 : pcwalton/rust/remove-cross-borrowing, r=brson

This will break code like:

    fn f(x: &mut int) {}

    let mut a = box 1i;
    f(a);

Change it to:

    fn f(x: &mut int) {}

    let mut a = box 1i;
    f(&mut *a);

RFC 33; issue #10504.

[breaking-change]

r? @brson

10 years agoGuide: Hello, world!
Steve Klabnik [Wed, 25 Jun 2014 18:26:14 +0000 (14:26 -0400)]
Guide: Hello, world!

Let's write our first Rust program!

10 years agoauto merge of #15173 : Sawyer47/rust/de-to-string, r=alexcrichton
bors [Wed, 25 Jun 2014 17:06:17 +0000 (17:06 +0000)]
auto merge of #15173 : Sawyer47/rust/de-to-string, r=alexcrichton

10 years agoauto merge of #15121 : steveklabnik/rust/matching_docs, r=alexcrichton
bors [Wed, 25 Jun 2014 15:21:26 +0000 (15:21 +0000)]
auto merge of #15121 : steveklabnik/rust/matching_docs, r=alexcrichton

Fixes #11113.

10 years agothanks @sfackler
Steve Klabnik [Wed, 25 Jun 2014 15:01:17 +0000 (11:01 -0400)]
thanks @sfackler

10 years agofix feedback from @huonw
Steve Klabnik [Wed, 25 Jun 2014 14:58:09 +0000 (10:58 -0400)]
fix feedback from @huonw

10 years agoGuide: install instructions
Steve Klabnik [Wed, 25 Jun 2014 00:35:05 +0000 (20:35 -0400)]
Guide: install instructions

10 years agoMake an example more clear with sample code.
Steve Klabnik [Mon, 23 Jun 2014 18:02:42 +0000 (14:02 -0400)]
Make an example more clear with sample code.

Fixes #11113.

10 years agoauto merge of #15174 : alco/rust/patch-1, r=alexcrichton
bors [Wed, 25 Jun 2014 13:36:21 +0000 (13:36 +0000)]
auto merge of #15174 : alco/rust/patch-1, r=alexcrichton

10 years agoFix wrong type name: IoError<()> -> IoResult<()>
Alexei Sholik [Wed, 25 Jun 2014 09:12:28 +0000 (12:12 +0300)]
Fix wrong type name: IoError<()> -> IoResult<()>

10 years agoFix a typo in fmt.rs
Alexei Sholik [Wed, 25 Jun 2014 08:29:28 +0000 (11:29 +0300)]
Fix a typo in fmt.rs

10 years agoauto merge of #15164 : pcwalton/rust/vector-cast-weirdness, r=alexcrichton
bors [Wed, 25 Jun 2014 08:06:21 +0000 (08:06 +0000)]
auto merge of #15164 : pcwalton/rust/vector-cast-weirdness, r=alexcrichton

vector-reference-to-unsafe-pointer-to-element cast if the type to be
casted to is not fully specified.

This is a conservative change to fix the user-visible symptoms of the
issue. A more flexible treatment would delay cast checks to after
function typechecking.

This can break code that did:

    let x: *u8 = &([0, 0]) as *_;

Change this code to:

    let x: *u8 = &([0, 0]) as *u8;

Closes #14893.

[breaking-change]

r? @alexcrichton

10 years agolibrustc: Don't try to perform the magical
Patrick Walton [Wed, 25 Jun 2014 01:22:21 +0000 (18:22 -0700)]
librustc: Don't try to perform the magical
vector-reference-to-unsafe-pointer-to-element cast if the type to be
casted to is not fully specified.

This is a conservative change to fix the user-visible symptoms of the
issue. A more flexible treatment would delay cast checks to after
function typechecking.

This can break code that did:

    let x: *u8 = &([0, 0]) as *_;

Change this code to:

    let x: *u8 = &([0, 0]) as *u8;

Closes #14893.

[breaking-change]

10 years agoauto merge of #15165 : zookoatleastauthoritycom/rust/14148-Optimize-out-exhortations...
bors [Wed, 25 Jun 2014 06:21:20 +0000 (06:21 +0000)]
auto merge of #15165 : zookoatleastauthoritycom/rust/14148-Optimize-out-exhortations-about-being-careful-2, r=huonw

Yes, it is important to be careful, but repeated emphasis about it is probably
not helpful — it starts to sound like you came for a tutorial but found a
finger-wagging lecture.

Even after I removed a few of these comments, there are still several left in
the text. That's probably fine! A couple of mentions of how this is dangerous
and you ought to be careful may be a good reminder to the reader.

After making the edits, I reflowed the paragraphs that I had touched, using
emacs's "M-x fill-paragraph", with fill-column equal to 70.

10 years agolibrustc: Remove cross borrowing from mutable `Box`es to `&mut`.
Patrick Walton [Wed, 25 Jun 2014 06:11:57 +0000 (23:11 -0700)]
librustc: Remove cross borrowing from mutable `Box`es to `&mut`.

This will break code like:

    fn f(x: &mut int) {}

    let mut a = box 1i;
    f(a);

Change it to:

    fn f(x: &mut int) {}

    let mut a = box 1i;
    f(&mut *a);

RFC 33; issue #10504.

[breaking-change]

10 years agocompiletest: Remove superfluous to_string calls
Piotr Jawniak [Wed, 25 Jun 2014 05:35:54 +0000 (07:35 +0200)]
compiletest: Remove superfluous to_string calls

10 years agoauto merge of #15160 : alexcrichton/rust/remove-f128, r=brson
bors [Wed, 25 Jun 2014 04:31:19 +0000 (04:31 +0000)]
auto merge of #15160 : alexcrichton/rust/remove-f128, r=brson

The f128 type has very little support in the compiler and the feature is
basically unusable today. Supporting half-baked features in the compiler can be
detrimental to the long-term development of the compiler, and hence this feature
is being removed.

10 years agoauto merge of #15163 : alexcrichton/rust/rollup, r=alexcrichton
bors [Wed, 25 Jun 2014 02:02:00 +0000 (02:02 +0000)]
auto merge of #15163 : alexcrichton/rust/rollup, r=alexcrichton

10 years agoTest fixes from the rollup
Alex Crichton [Wed, 25 Jun 2014 00:51:02 +0000 (17:51 -0700)]
Test fixes from the rollup

Closes #14482 (std: Bring back half of Add on String)
Closes #15026 (librustc: Remove the fallback to `int` from typechecking.)
Closes #15119 (Add more description to c_str::unwrap().)
Closes #15120 (Add tests for #12470 and #14285)
Closes #15122 (Remove the cheat sheet.)
Closes #15126 (rustc: Always include the morestack library)
Closes #15127 (Improve ambiguous pronoun.)
Closes #15130 (Fix #15129)
Closes #15131 (Add the Guide, add warning to tutorial.)
Closes #15134 (Xfailed tests for hygiene, etc.)
Closes #15135 (core: Add stability attributes to Clone)
Closes #15136 (Some minor improvements to core::bool)
Closes #15137 (std: Add stability attributes to primitive numeric modules)
Closes #15141 (Fix grammar in tutorial)
Closes #15143 (Remove few FIXMEs)
Closes #15145 (Avoid unnecessary temporary on assignments)
Closes #15147 (Small improvements for metaprogramming)
Closes #15153 (librustc: Check function argument patterns for legality of by-move)
Closes #15154 (test: Add a test for regions, traits, and variance.)
Closes #15159 (rustc: Don't register syntax crates twice)
Closes #13816 (Stabilize version output for rustc and rustdoc)

10 years agoreflow with emacs fill-paragraph (fill-column 71)
Zooko Wilcox-O'Hearn [Wed, 25 Jun 2014 01:35:50 +0000 (01:35 +0000)]
reflow with emacs fill-paragraph (fill-column 71)

10 years agoadd "(see below)" to a reference to a new concept
Zooko Wilcox-O'Hearn [Wed, 25 Jun 2014 01:34:24 +0000 (01:34 +0000)]
add "(see below)" to a reference to a new concept

This is because I observed someone reading the tutorial who thought they'd
missed something when they got to the mention of variable bindings.

This patch doesn't reflow the paragraphs so that you can see the semantic
change that I made, and a subsequent patch will reflow this paragraph.

Fixes https://github.com/rust-lang/rust/issues/13570.

10 years agoOptimize out exhortations about being careful.
Zooko Wilcox-O'Hearn [Wed, 25 Jun 2014 01:25:10 +0000 (01:25 +0000)]
Optimize out exhortations about being careful.

Yes, it is important to be careful, but repeated emphasis about it is probably
not helpful — it starts to sound like you came for a tutorial but found a
finger-wagging lecture.

Even after I removed a few of these comments, there are still several left in
the text. That's probably fine! A couple of mentions of how this is dangerous
and you ought to be careful may be a good reminder to the reader.

After making the edits, I reflowed the paragraphs that I had touched, using
emacs's "M-x fill-paragraph", with fill-column equal to 70.

10 years agoStabilize version output for rustc and rustdoc
Robert Buonpastore [Mon, 19 May 2014 03:37:07 +0000 (23:37 -0400)]
Stabilize version output for rustc and rustdoc

10 years agorustc: Don't register syntax crates twice
Alex Crichton [Tue, 24 Jun 2014 23:29:15 +0000 (16:29 -0700)]
rustc: Don't register syntax crates twice

We only need to register them once, and once they're registered twice warnings
will start being spewed or worse may happen!

Closes #14330

10 years agotest: Add a test for regions, traits, and variance.
Patrick Walton [Tue, 24 Jun 2014 21:51:12 +0000 (14:51 -0700)]
test: Add a test for regions, traits, and variance.

Closes #12470.

10 years agolibrustc: Check function argument patterns for legality of by-move
Patrick Walton [Tue, 24 Jun 2014 20:41:42 +0000 (13:41 -0700)]
librustc: Check function argument patterns for legality of by-move
bindings.

This will break code that incorrectly did things like:

    fn f(a @ box b: Box<String>) {}

Fix such code to not rely on undefined behavior.

Closes #12534.

[breaking-change]

10 years agoMake parse_expr_res public
Keegan McAllister [Tue, 24 Jun 2014 00:50:40 +0000 (17:50 -0700)]
Make parse_expr_res public

10 years agoAllow splicing more things in quotes
Keegan McAllister [Sat, 21 Jun 2014 01:36:21 +0000 (18:36 -0700)]
Allow splicing more things in quotes

10 years agoUse macros to implement syntax::ext::quote::ToSource
Keegan McAllister [Sat, 21 Jun 2014 01:14:47 +0000 (18:14 -0700)]
Use macros to implement syntax::ext::quote::ToSource

This code deserves a bigger refactor, but here's a local improvement.

10 years agoAvoid unnecessary temporary on assignments
Björn Steinbrink [Sun, 22 Jun 2014 13:32:55 +0000 (15:32 +0200)]
Avoid unnecessary temporary on assignments

We only need the temporary when the type needs to be dropped, for other
types, we can use trans_into to directly place the value into the
destination.

10 years agoRemove few FIXMEs
Piotr Jawniak [Mon, 23 Jun 2014 17:01:14 +0000 (19:01 +0200)]
Remove few FIXMEs

This commit removes FIXMEs of few closed issues.

Closes #13992

10 years agoFix grammar in tutorial
Michael Zhou [Tue, 24 Jun 2014 04:11:19 +0000 (00:11 -0400)]
Fix grammar in tutorial

"as this document" should be "than this document"

10 years agostd: Add stability attributes to primitive numeric modules
Brian Anderson [Mon, 23 Jun 2014 23:44:41 +0000 (23:44 +0000)]
std: Add stability attributes to primitive numeric modules

The following are unstable:

- core::int, i8, i16, i32, i64
- core::uint, u8, u16, u32, u64
- core::int::{BITS, BYTES, MIN, MAX}, etc.
- std::int, i8, i16, i32, i64
- std::uint, u8, u16, u32, u64

The following are experimental:
- std::from_str::FromStr and impls - may need to return Result instead of Option
- std::int::parse_bytes, etc. - ditto
- std::num::FromStrRadix and impls - ditto
- std::num::from_str_radix - ditto

The following are deprecated:
- std::num::ToStrRadix and imples - Wrapper around fmt::radix. Wrong name (Str vs String)

See https://github.com/rust-lang/rust/wiki/Meeting-API-review-2014-06-23#uint

10 years agoMove core::bool tests to run-pass
Brian Anderson [Mon, 23 Jun 2014 23:41:23 +0000 (23:41 +0000)]
Move core::bool tests to run-pass

These are closer to language tests than library.

10 years agocore: Remove bool::to_bit
Brian Anderson [Mon, 23 Jun 2014 22:58:01 +0000 (22:58 +0000)]
core: Remove bool::to_bit

This is an unused one-liner.

10 years agocore: Add stability attributes to Clone
Brian Anderson [Mon, 23 Jun 2014 23:34:29 +0000 (16:34 -0700)]
core: Add stability attributes to Clone

The following are tagged 'unstable'

- core::clone
- Clone
- Clone::clone
- impl Clone for Arc
- impl Clone for arc::Weak
- impl Clone for Rc
- impl Clone for rc::Weak
- impl Clone for Vec
- impl Clone for Cell
- impl Clone for RefCell
- impl Clone for small tuples

The following are tagged 'experimental'

- Clone::clone_from - may not provide enough utility
- impls for various extern "Rust" fns - may not handle lifetimes correctly

See https://github.com/rust-lang/rust/wiki/Meeting-API-review-2014-06-23#clone

10 years agoadded xfailed test for issue 9737
John Clements [Fri, 22 Nov 2013 21:43:22 +0000 (13:43 -0800)]
added xfailed test for issue 9737

10 years agoadded xfailed tests for two other flavors of var hygiene
John Clements [Sat, 21 Sep 2013 06:37:19 +0000 (23:37 -0700)]
added xfailed tests for two other flavors of var hygiene

10 years agoAdd the Guide, add warning to tutorial.
Steve Klabnik [Mon, 23 Jun 2014 22:19:16 +0000 (18:19 -0400)]
Add the Guide, add warning to tutorial.

In line with what @brson, @cmr, @nikomatsakis and I discussed this morning, my
redux of the tutorial will be implemented as the Guide. This way, I can work in
small iterations, rather than dropping a huge PR, which is hard to review.  In
addition, the community can observe my work as I'm doing it.

This adds a note in line with [this comment][reddit] that clarifies the state
of the tutorial, and the community's involvement with it.

[reddit]: http://www.reddit.com/r/rust/comments/28bew8/rusts_documentation_is_about_to_drastically/ci9c98k

10 years agoFix #15129
Jakub Wieczorek [Mon, 23 Jun 2014 22:12:17 +0000 (00:12 +0200)]
Fix #15129

Add support for unit literals to const_eval.

10 years agoImprove ambiguous pronoun.
Steve Klabnik [Mon, 23 Jun 2014 20:11:19 +0000 (16:11 -0400)]
Improve ambiguous pronoun.

Fixes #14806

10 years agorustc: Always include the morestack library
Alex Crichton [Mon, 23 Jun 2014 19:54:56 +0000 (12:54 -0700)]
rustc: Always include the morestack library

It was previously assumed that the object file generated by LLVM would always
require the __morestack function, but that assumption appears to be incorrect,
as outlined in #15108. This commit forcibly tells the linker to include the
entire archive, regardless of whether it's currently necessary or not.

Closes #15108

10 years agoRemove the cheat sheet.
Steve Klabnik [Mon, 23 Jun 2014 18:04:54 +0000 (14:04 -0400)]
Remove the cheat sheet.

Rust by Example is far better.

Fixes #14380.

10 years agoAdd tests for #12470 and #14285
Edward Wang [Mon, 23 Jun 2014 17:42:13 +0000 (01:42 +0800)]
Add tests for #12470 and #14285

The #14869 removed `TraitStore` from `ty_trait` and represented trait
reference as regular `ty_rptr`. An old bug of the missing constraint
upon lifetime parameter of trait reference then is fixed as a side
effect. Adds tests for affected bugs and closes them.

Closes #12470.
Closes #14285.

10 years agoAdd more description to c_str::unwrap().
Steve Klabnik [Mon, 23 Jun 2014 16:52:28 +0000 (12:52 -0400)]
Add more description to c_str::unwrap().

It's unclear what you are supposed to do with this memory.
Let's make that more clear.