Commit Graph

106077 Commits

Author SHA1 Message Date
Dylan MacKenzie
0ac4ba0eed Parse ?const ?Trait 2020-01-20 01:28:10 -08:00
Dylan MacKenzie
3b1a9d35c8 Ignore filelength for astconv 2020-01-20 01:28:10 -08:00
Dylan MacKenzie
adbd01e84a Track constness while lowering bounds 2020-01-20 01:28:10 -08:00
Dylan MacKenzie
d2aefbb286 Add ConstnessAnd that implements ToPredicate 2020-01-20 00:00:08 -08:00
Dylan MacKenzie
ab3081a70e Add constness field to ty::Predicate::Trait 2020-01-20 00:00:08 -08:00
Dylan MacKenzie
1a3bd5775f Revert "Add a constness field to ast::TraitRef"
This reverts commit fd4a6a1213.
2020-01-20 00:00:08 -08:00
Dylan MacKenzie
eb60346cc9 Add MaybeConst variant to {ast,hir}::TraitBoundModifier 2020-01-20 00:00:08 -08:00
Jorge Aparicio
a3a0776100
Merge branch 'master' into bare-metal-cortex-a 2020-01-20 07:50:32 +00:00
Dylan MacKenzie
958b0bc8d2 Store impl const in ItemKind::Impl 2020-01-19 23:41:44 -08:00
Dylan MacKenzie
a790f9bb2d Add constness field to hir::ItemKind::Impl 2020-01-19 23:41:44 -08:00
Dylan MacKenzie
01cbe506f9 Add constness field to ast::ItemKind::Impl 2020-01-19 23:41:42 -08:00
bors
900811e430 Auto merge of #68380 - Dylan-DPC:rollup-a7moqmr, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #68326 (rustdoc: Catch fatal errors when syntax highlighting)
 - #68335 (Remove real_drop_in_place)
 - #68353 (Remove `rustc_error_codes` deps except in `rustc_driver`)
 - #68357 (rustdoc: Fix handling of compile errors when running `rustdoc --test`)
 - #68365 (Clean up error codes)

Failed merges:

r? @ghost
2020-01-20 05:56:53 +00:00
Dylan DPC
0259c10385
Rollup merge of #68365 - GuillaumeGomez:clean-up-err-codes-2, r=Dylan-DPC
Clean up error codes

r? @Dylan-DPC
2020-01-20 11:14:51 +05:30
Dylan DPC
cd4652a195
Rollup merge of #68357 - ollie27:rustdoc_test_errors, r=GuillaumeGomez
rustdoc: Fix handling of compile errors when running `rustdoc --test`

 * Call `abort_if_errors` so all errors actually stop rustdoc.
* Don't panic with "compiler aborted in rustdoc!", instead just exit to avoid the ugly panic message.
* Use rlib as the crate type when searching for doctests matching what is used for doc generation so `#[no_std]` crates don't create "no global memory allocator" errors.

Fixes #52243
Fixes #54010

r? @GuillaumeGomez
2020-01-20 11:14:49 +05:30
Dylan DPC
fb86b820bb
Rollup merge of #68353 - Centril:code-liberation, r=petrochenkov
Remove `rustc_error_codes` deps except in `rustc_driver`

Remove dependencies on `rustc_error_codes` in all crates except for `rustc_driver`.

This has some benefits:

1. Adding a new error code when hacking on the compiler only requires rebuilding at most `rustc_error_codes`, `rustc_driver`, and the reflexive & transitive closure of the crate where the new error code is being added and its reverse dependencies. This improves time-to-UI-tests (TTUT).

2. Adding an error description to an error code only requires rebuilding `rustc_error_codes` and `rustc_driver`. This should substantially improve TTUT.

r? @petrochenkov
cc @rust-lang/wg-diagnostics
2020-01-20 11:14:48 +05:30
Dylan DPC
5d8edc99aa
Rollup merge of #68335 - RalfJung:drop-in-place, r=Mark-Simulacrum
Remove real_drop_in_place

In af9b057156, I added `real_drop_in_place` because Stacked Borrows at the time couldn't handle transmuting of mutable references to raw pointers and back. Stacked Borrows 2, however, doesn't have any issue with these transmutes, so it is time to remove this hack again.
2020-01-20 11:14:46 +05:30
Dylan DPC
0dc2557c12
Rollup merge of #68326 - ollie27:rustdoc_hightlight_fatal_errors, r=GuillaumeGomez
rustdoc: Catch fatal errors when syntax highlighting

For some errors the lexer will unwind so we need to handle that in addition to handling `token::Unknown`.

Fixes #56885

r? @GuillaumeGomez
2020-01-20 11:14:42 +05:30
Dylan MacKenzie
7b4dca282a Document all methods 2020-01-19 19:09:13 -08:00
Dylan MacKenzie
2ce7b61995 Explain motivation for GenKill trait 2020-01-19 18:33:19 -08:00
Esteban Küber
03d7fed165 review comments 2020-01-19 17:59:01 -08:00
Esteban Küber
0a6b5538ad Deal with stabilization of feature(slice_patterns) 2020-01-19 17:31:34 -08:00
Esteban Küber
12ff4d0bd6 review comments: use closures 2020-01-19 17:31:34 -08:00
Esteban Küber
2102723887 review comments 2020-01-19 17:31:34 -08:00
Esteban Küber
78d3ea5484 When encountering an expected named lifetime and none are present, suggest adding one 2020-01-19 17:31:33 -08:00
Esteban Küber
6ba08755df When encountering an undefined named lifetime, point to where it can be
This doesn't mention that using an existing lifetime is possible, but
that would hopefully be clear as always being an option. The intention
of this is to teach newcomers what the lifetime syntax is.
2020-01-19 17:31:33 -08:00
bors
29b854fb74 Auto merge of #68057 - Aaron1011:fix/marker-trait-selection, r=matthewjasper
Don't discard marker trait impls when inference variables are present

Fixes #61651

Previously, we would unconditionally discard impl candidates for marker
traits during trait selection. However, if the predicate had inference
variables, this could have the effect of constrainting inference
variables (due to a successful trait selection) when we would have
otherwise failed due to mutliple applicable impls,

This commit prevents marker trait impls from being discarded while the
obligation predicate has any inference variables, ensuring that
discarding impls will never cause us to incorrectly constraint inference
variables.
2020-01-20 00:10:48 +00:00
Yuki Okushi
0017f49578 Replace walk_callee with consume_expr 2020-01-20 07:38:05 +09:00
Adam Perry
72dffac6cf Test that ReifyShim + caller_location return the def site. 2020-01-19 14:26:28 -08:00
Eduard-Mihai Burtescu
19d8527890 rustc_mir: don't require a self argument for ReifyShim. 2020-01-19 14:26:28 -08:00
Adam Perry
0ee922123f InstanceDef::requires_caller_location limited to items. 2020-01-19 14:26:28 -08:00
Adam Perry
fd90e56120 Add failing #[track_caller] test with fn pointers. 2020-01-19 14:26:28 -08:00
Yuki Okushi
2ecc48ffa1 Fix ICE #68025 2020-01-20 07:06:27 +09:00
bors
7da653f669 Auto merge of #68343 - matthiaskrgr:submodule_upd, r=oli-obk
submodules: update clippy from a8d90f6a to 7ae24429

Changes:
````
Downgrade range_plus_one to pedantic
Rustup to rust-lang/rust#68204
Add lifetimes to `LateLintPass`
Fix rustc lint import paths generated by `new_lint`
Add lint for default lint description
Update documentation for adding new lints
Generate new lints easily
````
Fixes #68331
2020-01-19 20:37:44 +00:00
Tianjiao Huang
d336e593cc
Fix invalid link to C++ Exception Handling ABI documentation 2020-01-19 12:16:29 -08:00
Ralf Jung
95934937bb fix real_drop_in_place in comments 2020-01-19 10:11:16 -06:00
Ralf Jung
b77a7997a8 adjust codegen-units tests 2020-01-19 10:09:52 -06:00
Guillaume Gomez
a9aa2dfe84 clean up E0204 explanation 2020-01-19 15:35:55 +01:00
Guillaume Gomez
0c7f40f3b2 clean up E0201 explanation 2020-01-19 15:35:44 +01:00
bors
c0e02ad724 Auto merge of #68363 - Dylan-DPC:rollup-33enndv, r=Dylan-DPC
Rollup of 3 pull requests

Successful merges:

 - #67682 ([const-prop] Remove useless typedef)
 - #68247 (Clean up err codes)
 - #68348 (Make iter::Empty<T> Send and Sync for any T)

Failed merges:

r? @ghost
2020-01-19 14:06:57 +00:00
Matthias Krüger
188f0bbe7f submodules: update clippy from a8d90f6a to fd0428f6
Changes:
````
Treat more strange pattern
Split up `if_same_then_else` ui test
Apply review comments
Run `update_lints`
Reduce span range
Rename `ok_if_let` to `if_let_some_result`
Apply review comments
Add suggestion in `if_let_some_result`
rustup https://github.com/rust-lang/rust/pull/67712
Allow `unused_self` lint at the function level
Downgrade range_plus_one to pedantic
Rustup to rust-lang/rust#68204
Add lifetimes to `LateLintPass`
Fix rustc lint import paths generated by `new_lint`
Add lint for default lint description
Update documentation for adding new lints
Generate new lints easily
Split up `booleans` ui test
Fix the ordering on `nonminimal_bool`
````
2020-01-19 14:01:52 +01:00
Dylan DPC
d276e6942e
Rollup merge of #68348 - xfix:patch-14, r=nagisa
Make iter::Empty<T> Send and Sync for any T

Continuing from #57682

It's quite funny, when I initially submitted this pull request, I said "Likely nobody will be using that property of `iter::empty`", but then a year later I got a compilation error because it wasn't `Send` and `Sync`.

Unfortunately, `PhantomData<fn() -> T>` still errors out. Oh well. I proposed `
struct PhantomFnWorkaround<T>(fn() -> T);`, but dtolnay did not like it, so using explicit implementations.
2020-01-19 17:22:09 +05:30
Dylan DPC
a29ba00107
Rollup merge of #68247 - GuillaumeGomez:clean-up-err-codes, r=Dylan-DPC
Clean up err codes

r? @Dylan-DPC
2020-01-19 17:22:07 +05:30
Dylan DPC
cba48b8af3
Rollup merge of #67682 - wesleywiser:remove_opty_const_typedef, r=Dylan-DPC
[const-prop] Remove useless typedef

It's confusing because it conflicts with `ty::Const` and just isn't
generally useful.
2020-01-19 17:22:06 +05:30
Tobias Kortkamp
de38803255
Add -Wl,-znotext to default linker flags to link with lld 9 on FreeBSD 13.0-CURRENT i386
rust-nightly has been failing to link since 2019-12-10 with variations of
```
 = note: ld: error: relocation R_386_PC32 cannot be used against symbol __rust_probestack; recompile with -fPIC
          >>> defined in /wrkdirs/usr/ports/lang/rust-nightly/work/rustc-nightly-src/build/i686-unknown-freebsd/stage1/lib/rustlib/i686-unknown-freebsd/lib/libcompiler_builtins-6570a75fe85f0e1a.rlib(compiler_builtins-6570a75fe85f0e1a.compiler_builtins.2i519eqi-cgu.15.rcgu.o)
          >>> referenced by std.4xivr03c-cgu.14
          >>>               std-9bd70afd58e204b7.std.4xivr03c-cgu.14.rcgu.o:(_$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h1c78ed6e734a2bfc (.llvm.10122419023709863394)) in archive /wrkdirs/usr/ports/lang/rust-nightly/work/rustc-nightly-src/build/i686-unknown-freebsd/stage1/lib/rustlib/i686-unknown-freebsd/lib/libstd-9bd70afd58e204b7.rlib

          ld: error: relocation R_386_PC32 cannot be used against symbol __rust_probestack; recompile with -fPIC
          >>> defined in /wrkdirs/usr/ports/lang/rust-nightly/work/rustc-nightly-src/build/i686-unknown-freebsd/stage1/lib/rustlib/i686-unknown-freebsd/lib/libcompiler_builtins-6570a75fe85f0e1a.rlib(compiler_builtins-6570a75fe85f0e1a.compiler_builtins.2i519eqi-cgu.15.rcgu.o)
          >>> referenced by std.4xivr03c-cgu.14
          >>>               std-9bd70afd58e204b7.std.4xivr03c-cgu.14.rcgu.o:(std::io::util::copy::h9115f048f2203467) in archive /wrkdirs/usr/ports/lang/rust-nightly/work/rustc-nightly-src/build/i686-unknown-freebsd/stage1/lib/rustlib/i686-unknown-freebsd/lib/libstd-9bd70afd58e204b7.rlib
          clang-cpp: error: linker command failed with exit code 1 (use -v to see invocation)

error: aborting due to previous error

error: could not compile `rustc_macros`.
```
Full log: http://beefy17.nyi.freebsd.org/data/head-i386-default/p523508_s356869/logs/rust-nightly-1.42.0.20200118.log

AFAICT it stopped building after bumping compiler_builtins to 0.1.22
in https://github.com/rust-lang/rust/pull/67110.
2020-01-19 07:04:24 +01:00
csmoe
cd7b5edc2c update test ui for raw-ptr borrow inside generator 2020-01-19 13:22:41 +08:00
csmoe
42b6ed13be account temporary borrow by raw-ptr 2020-01-19 12:59:29 +08:00
bors
6250d56355 Auto merge of #67758 - ssomers:testing_range, r=Mark-Simulacrum
More thorough testing of BTreeMap::range

Test more of the paths in the `range_search` function in map.rs
2020-01-19 04:40:21 +00:00
bors
bb410add3a Auto merge of #68030 - cuviper:llvm-9.0.1, r=nikic
Rebase LLVM onto 9.0.1

While work on LLVM 10 is in progress in #67759, in the meantime we can do a smaller rebase to pick up fixes in 9.0.1, released December 19, 2019.

r? @nikic
2020-01-19 00:38:55 +00:00
Oliver Middleton
17f4cbc303 rustdoc: Fix handling of compile errors when running rustdoc --test
* Call `abort_if_errors` so all errors actually stop rustdoc.
* Don't panic with "compiler aborted in rustdoc!", instead just exit to avoid the ugly panic message.
* Use rlib as the crate type when searching for doctests matching what is used for doc generation so `#[no_std]` crates don't create "no global memory allocator" errors.
2020-01-18 23:51:06 +00:00
Wesley Wiser
a957f0d7ff [const-prop] Run x.py fmt 2020-01-18 18:45:14 -05:00