Commit Graph

107692 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
7017058e6b ast: add Defaultness to Item, making AssocItem an alias. 2020-02-24 00:59:38 +01:00
Mazdak Farrokhzad
d41fc138bf parse_defaultness: avoid hardcoded list of keywords. 2020-02-24 00:59:38 +01:00
Mazdak Farrokhzad
fa2a792491 add Span to ast::Defaultness::Default. 2020-02-24 00:59:38 +01:00
Ralf Jung
9b62d60db1 fmt 2020-02-23 22:39:57 +01:00
Jakub Kądziołka
b3e0d272af
docs: Stdin::read_line: mention the appending 2020-02-23 21:19:25 +01:00
bors
6d0e58bff8 Auto merge of #69393 - Dylan-DPC:rollup-rxbd1zg, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #69336 (Do not ping the infrastructure team on toolstate changes)
 - #69351 (Improve external MinGW detection)
 - #69361 (parse: allow `type Foo: Ord` syntactically)
 - #69375 (Rename CodeMap to SourceMap follow up)
 - #69376 (parser: Cleanup `Parser::bump_with` and its uses)

Failed merges:

r? @ghost
2020-02-23 19:26:35 +00:00
Ralf Jung
01d9329347 canonicalize alloc ID before calling tag_static_base_pointer 2020-02-23 19:50:34 +01:00
XAMPPRocky
e7a344fb74
Update RELEASES.md
Co-Authored-By: Jonas Schievink <jonasschievink@gmail.com>
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2020-02-23 18:04:48 +01:00
Ralf Jung
5da393970d miri/machine: add canonical_alloc_id hook to replace find_foreign_static 2020-02-23 17:45:44 +01:00
bors
b1f395de64 Auto merge of #69084 - yaahc:delayed-doc-lint, r=petrochenkov
Split non macro portion of unused_doc_comment from macro part into two passes/lints

## Motivation

This change is motivated by the needs of the [spandoc library](https://github.com/yaahc/spandoc). The specific use case is that my macro is removing doc comments when an attribute is applied to a fn with doc comments, but I would like the lint to still appear when I forget to add the `#[spandoc]` attribute to a fn, so I don't want to have to silence the lint globally.

## Approach

This change splits the `unused _doc_comment` lint into two lints, `unused_macro_doc_comment` and `unused_doc_comment`. The non macro portion is moved into an `early_lint_pass` rather than a pre_expansion_pass. This allows proc macros to silence `unused_doc_comment` warnings by either adding an attribute to silence it or by removing the doc comment before the early_pass runs.

The `unused_macro_doc_comment` lint however will still be impossible for proc-macros to silence, but the only alternative that I can see is to remove this lint entirely, which I don't think is acceptable / is a decision I'm not comfortable making personally, so instead I opted to split the macro portion of the check into a separate lint so that it can be silenced globally with an attribute if necessary without needing to globally silence the `unused_doc_comment` lint as well, which is still desireable.

fixes https://github.com/rust-lang/rust/issues/67838
2020-02-23 16:09:41 +00:00
Vadim Petrochenkov
e355a33077 Deduplicate identifier printing a bit 2020-02-23 17:35:48 +03:00
Tomasz Miąsko
598b187e27 bootstrap: Remove commit hash from LLVM version suffix to avoid rebuilds
The custom LLVM version suffix was introduced to avoid unintentional
library names conflicts. By default it included the LLVM submodule
commit hash. Changing the version suffix requires the complete LLVM
rebuild, and since then every change to the submodules required it as
well.

Remove the commit hash from version suffix to avoid complete rebuilds,
while leaving the `rust` string, the release number and release channel
to disambiguate the library name.
2020-02-23 15:20:37 +01:00
bors
87b0d83745 Auto merge of #69351 - mati865:mingw-ultimate-fix, r=cramertj
Improve external MinGW detection

Fixes #68872
2020-02-23 12:52:48 +00:00
Michael Morehouse
c103a16f3a
Update links
Formatting fixes

Now that I can actually run `python x.py test src/tools/tidy` locally
... my god it takes a long time to compile when you're on a cellular
connection.

Removing unnecessary whitespaces

Updates src/test/ui/json-short.stderr golden test file

Fixes test failure by updating the golden file for changes
in src/librustc_error_codes/error_codes/E0601.md

Update src/librustc_error_codes/error_codes/E0080.md

Co-Authored-By: varkor <github@varkor.com>

Update src/librustc_error_codes/error_codes/E0080.md

Co-Authored-By: varkor <github@varkor.com>

Update src/librustc_error_codes/error_codes/E0080.md

Co-Authored-By: varkor <github@varkor.com>

Update src/librustc_error_codes/error_codes/E0154.md

Co-Authored-By: varkor <github@varkor.com>

Update src/librustc_error_codes/error_codes/E0154.md

Co-Authored-By: varkor <github@varkor.com>

Update src/librustc_error_codes/error_codes/E0661.md

Co-Authored-By: varkor <github@varkor.com>

Update src/librustc_error_codes/error_codes/E0662.md

Co-Authored-By: varkor <github@varkor.com>

Update src/librustc_error_codes/error_codes/E0663.md

Co-Authored-By: varkor <github@varkor.com>

Update src/librustc_error_codes/error_codes/E0664.md

Co-Authored-By: varkor <github@varkor.com>

Update src/test/ui/json-short.stderr

Co-Authored-By: varkor <github@varkor.com>

Update src/librustc_error_codes/error_codes/E0260.md

Co-Authored-By: varkor <github@varkor.com>

Update src/librustc_error_codes/error_codes/E0154.md

Co-Authored-By: varkor <github@varkor.com>

Update src/librustc_error_codes/error_codes/E0260.md

Co-Authored-By: varkor <github@varkor.com>

Apply suggestions from code review

Co-Authored-By: varkor <github@varkor.com>

Fixing 1 character over 80 cascade
2020-02-23 12:22:44 +00:00
Guillaume Gomez
78e4bd1c75 Clean up E0367 explanation 2020-02-23 12:02:32 +01:00
bors
9c230f39c1 Auto merge of #69336 - Mark-Simulacrum:no-infra-toolstate, r=Dylan-DPC
Do not ping the infrastructure team on toolstate changes

To my knowledge, there is essentially never any particular action that the infra team needs to take on these pings, and they are currently relatively annoying.

cc rust-lang/infra -- does anyone *want* these notifications?
2020-02-23 09:40:18 +00:00
Dylan DPC
d6414f5f8c
Rollup merge of #69376 - petrochenkov:bumpwith, r=Centril
parser: Cleanup `Parser::bump_with` and its uses

Follow-up to https://github.com/rust-lang/rust/pull/69006.
r? @Centril
2020-02-23 09:57:45 +01:00
Dylan DPC
bdd275de2a
Rollup merge of #69375 - Menschenkindlein:master, r=Dylan-DPC
Rename CodeMap to SourceMap follow up

See https://github.com/rust-lang/rust/issues/51574
2020-02-23 09:57:44 +01:00
Dylan DPC
ae50725dc3
Rollup merge of #69361 - Centril:free-ty-alias, r=petrochenkov
parse: allow `type Foo: Ord` syntactically

This addresses:
> (Work still remains to fuse this with free type aliases, but this can be done later.)

in https://github.com/rust-lang/rust/pull/69194.

r? @petrochenkov
2020-02-23 09:57:43 +01:00
Dylan DPC
cec00033a7
Rollup merge of #69351 - mati865:mingw-ultimate-fix, r=cramertj
Improve external MinGW detection

Fixes #68872
2020-02-23 09:57:40 +01:00
Dylan DPC
b76099429b
Rollup merge of #69336 - Mark-Simulacrum:no-infra-toolstate, r=Dylan-DPC
Do not ping the infrastructure team on toolstate changes

To my knowledge, there is essentially never any particular action that the infra team needs to take on these pings, and they are currently relatively annoying.

cc rust-lang/infra -- does anyone *want* these notifications?
2020-02-23 09:57:38 +01:00
bors
1484196358 Auto merge of #69334 - Centril:nested-item-vis-def, r=petrochenkov
print vis & defaultness for nested items

Fixes https://github.com/rust-lang/rust/issues/69315 which was injected by https://github.com/rust-lang/rust/pull/69194.

r? @petrochenkov
cc @alexcrichton
2020-02-23 06:27:07 +00:00
memoryruins
ad47bf50f6 Add rustdoc aliases to ptr::copy and ptr::copy_nonoverlapping 2020-02-22 22:25:47 -05:00
Tomasz Miąsko
d78b22f35e Mark attributes consumed by check_mod_attrs as normal
Take advantage of the fact that `check_mod_attrs` marks attributes as
used and change their type to normal, so that any remaining uses will be
warned about by the unused attribute lint.
2020-02-23 00:00:00 +00:00
Jane Lusby
09bc5e3d96 rustfmt darnit 2020-02-22 15:29:03 -08:00
Jane Lusby
40c67221e2 make doc comments regular comments 2020-02-22 15:13:22 -08:00
Daniel Henry-Mantilla
2cf339aeda Fix doc example for MaybeUninit::get_mut()
Suggested by @ametisf in https://github.com/rust-lang/rust/pull/65948#issuecomment-589988183

Co-Authored-By: Frantisek Fladung <fladufra@fel.cvut.cz>
2020-02-22 23:19:05 +01:00
Mark Mansi
9434d6b67f update some tests 2020-02-22 16:14:14 -06:00
ridiculousfish
9e41c4b682 Relax str::get_unchecked precondition to permit empty slicing
Prior to this commit, `str` documented that `get_unchecked` had
the precondition that "`begin` must come before `end`". This would appear
to prohibit empty slices (i.e. begin == end).

In practice, get_unchecked is called often with empty slices. Let's relax
the precondition so as to allow them.
2020-02-22 13:30:54 -08:00
John Ericson
03ca0e2706 Allow getting no_std from the config file
Currently, it is only set correctly in the sanity checking implicit
default fallback code. Having a config file at all will for force
`no_std = false`.
2020-02-22 15:23:15 -05:00
mark
7a6361f465 remove unneeded fn 2020-02-22 13:17:04 -06:00
mark
9207a13bfc get rid of lazy 2020-02-22 13:17:04 -06:00
mark
74360571e9 address some review comments/bugs 2020-02-22 13:17:04 -06:00
Mark Mansi
c6781037eb article and descr for closures 2020-02-22 13:17:04 -06:00
Mark Mansi
66500effea add generator_kind query 2020-02-22 13:17:03 -06:00
Mark Mansi
245062cdcd some fixes 2020-02-22 13:11:15 -06:00
Mark Mansi
4d22e757cd minor cleanup 2020-02-22 13:11:15 -06:00
Mark Mansi
7f7709e3d4 Generalized article_and_description 2020-02-22 13:11:15 -06:00
bors
436494b8f8 Auto merge of #69358 - ehuss:update-cargo, r=ehuss
Update cargo

11 commits in e02974078a692d7484f510eaec0e88d1b6cc0203..e57bd02999c9f40d52116e0beca7d1dccb0643de
2020-02-18 15:24:43 +0000 to 2020-02-21 20:20:10 +0000
- fix most remaining clippy findings (mostly redundant imports) (rust-lang/cargo#7912)
- Add -Zfeatures tracking issues. (rust-lang/cargo#7917)
- Use rust-lang/rust linkchecker on CI. (rust-lang/cargo#7913)
- Clean up code mostly based on clippy suggestions (rust-lang/cargo#7911)
- Add an option to include crate versions to the generated docs (rust-lang/cargo#7903)
- Better support for license-file. (rust-lang/cargo#7905)
- Add new feature resolver. (rust-lang/cargo#7820)
- Switch azure to macOS 10.15. (rust-lang/cargo#7906)
- Modified the help information of cargo-rustc (rust-lang/cargo#7892)
- Update for nightly rustfmt. (rust-lang/cargo#7904)
- Support `--config path_to_config.toml` cli syntax. (rust-lang/cargo#7901)
2020-02-22 18:07:03 +00:00
Jane Lusby
494dd0b719 Remove trait 2020-02-22 08:28:56 -08:00
jumbatm
a796af7a76 Fail on multiple declarations of main.
Previously, when inserting the entry function, we only checked for
duplicate _definitions_ of `main`.  However, it's possible to cause
problems even only having a duplicate _declaration_. For example,
shadowing `main` using an extern block isn't caught by the current
check, and causes an assertion failure down the line in in LLVM code.
2020-02-23 02:06:11 +10:00
bors
3eeefc21f1 Auto merge of #69374 - Dylan-DPC:rollup-x7mjd5z, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #68984 (Make `u8::is_ascii` a stable `const fn`)
 - #69339 (Add test for #69312)
 - #69346 (Clean up E0323, E0324, E0325 and E0326 explanations)
 - #69348 (Wrong error message for move_ref_pattern)
 - #69349 (MIR is not an experiment anymore)
 - #69354 (Test `Duration::new` panics on overflow)
 - #69370 (move const_eval.rs into the module folder)

Failed merges:

r? @ghost
2020-02-22 14:36:14 +00:00
Vadim Petrochenkov
4356d18e4a parser: Cleanup Parser::bump_with and its uses 2020-02-22 17:28:10 +03:00
Maxim Zholobak
20c9a40fec Rename CodeMap to SourceMap follow up 2020-02-22 16:17:31 +02:00
Dylan DPC
e5fb1291a0
Rollup merge of #69370 - RalfJung:const-eval-mod, r=oli-obk
move const_eval.rs into the module folder

This groups the file together with the other `const_eval` files in editors, diff views, etc.

r? @oli-obk
2020-02-22 18:43:08 +05:30
Dylan DPC
4f71270d7b
Rollup merge of #69354 - MichaelMcDonnell:duration_overflow_test, r=Centril
Test `Duration::new` panics on overflow

A `Duration` is created from a second and nanoseconds variable. The
documentation says: "This constructor will panic if the carry from the
nanoseconds overflows the seconds counter". This was, however, not tested
in the tests. I doubt the behavior will ever regress, but it is usually a
good idea to test all documented behavior.
2020-02-22 18:43:07 +05:30
Dylan DPC
541b407c14
Rollup merge of #69349 - spastorino:mir-not-an-experiment, r=Dylan-DPC
MIR is not an experiment anymore

At least I hope is not 😝

r? @oli-obk
2020-02-22 18:43:05 +05:30
Dylan DPC
8ab4060057
Rollup merge of #69348 - LeSeulArtichaut:patch-1, r=Centril
Wrong error message for move_ref_pattern

The current error message states that move occurs *because of `Copy`*:
```Rust
"move occurs because `{}` has type `{}` which does implement the `Copy` trait."
```
I found this randomly when surfing through the sources. This means, I don't have any context and might be completely wrong.

r? @Centril
2020-02-22 18:43:04 +05:30
Dylan DPC
1cb9fb5e16
Rollup merge of #69346 - GuillaumeGomez:clean-up-e032x-explanations, r=Dylan-DPC
Clean up E0323, E0324, E0325 and E0326 explanations

r? @Dylan-DPC
2020-02-22 18:43:03 +05:30
Dylan DPC
3d9b68a5c3
Rollup merge of #69339 - wesleywiser:test_for_69312, r=Centril
Add test for #69312

This bug was fixed by #67501.

Closes #69312
2020-02-22 18:43:01 +05:30