profile
viewpoint
Tamir Duberstein tamird @google New York, NY

lib/pq 6174

Pure Go Postgres driver for database/sql

grpc/grpc-web 4865

gRPC for Web Clients

mperham/connection_pool 1269

Generic connection pooling for Ruby

jawspeak/ruby-docx-templater 141

A Ruby library to template Microsoft Word .docx files. Generates new Word .docx files based on a template file. Does templating entirely in memory.

tamird/cockroach 6

A Scalable, Geo-Replicated, Transactional Datastore

tamird/CS212 5

Udacity CS212 April 2012 Exam Solutions

tamird/pcap 1

Rust language pcap library

issue closedgoogle/gvisor

Support setting the SO_LINGER socket option

This is would be useful to better manage the behavior of sockets on close or shutdown, whether we want to wait for a timeout or force a reset by turning linger off and closing the socket.

From the man page: When enabled, a close or shutdown will not return until all queued messages for the socket have been successfully sent or the linger timeout has been reached.

Get SO_LINGER is already supported.

closed time in a day

RyanHeacock

issue commentgoogle/gvisor

Support setting the SO_LINGER socket option

Fixed (again) in b6d165fe98b908a7aa97e3fadd61ddd3731be915.

RyanHeacock

comment created time in a day

issue openedgoogle/gvisor

Add support for ipv4 DAD and gratuitous ARP

These are needed to correctly support DHCP clients.

Both can be either automatic or exposed such that a client can trigger the behaviors.

cc @ghanan94 @puradox

created time in 11 days

pull request commenttiny-http/tiny-http

Add unblock method for graceful shutdown

This unblocks the server, but doesn't prevent the thread pool from leaking. In other words, it doesn't solve what https://github.com/tomaka/rouille/pull/219 attempts to solve.

rawler

comment created time in 14 days

issue openedgolang/go

x/net/ipv4: PacketConn.MulticastInterface is implemented incorrectly on Linux

Per the man page:

       IP_MULTICAST_IF (since Linux 1.2)
              Set the local device for a multicast socket.  The argument for
              setsockopt(2) is an ip_mreqn or (since Linux 3.5) ip_mreq
              structure similar to IP_ADD_MEMBERSHIP, or an in_addr struc‐
              ture.  (The kernel determines which structure is being passed
              based on the size passed in optlen.)  For getsockopt(2), the
              argument is an in_addr structure.

However, the implementation uses the wrong type for retrieval:

https://github.com/golang/net/blob/a7d1128ccaa05167332a625f69773af1a0c6b39c/ipv4/dgramopt.go#L41

https://github.com/golang/net/blob/a7d1128ccaa05167332a625f69773af1a0c6b39c/ipv4/sys_linux.go#L27

https://github.com/golang/net/blob/a7d1128ccaa05167332a625f69773af1a0c6b39c/ipv4/sockopt_posix.go#L17

Oddly, the default case in getMulticastInterface would do the right thing.

This looks to have been broken in https://github.com/golang/net/commit/353547e1a251be1f5463f9621cce3bdb2a8cde35

created time in 20 days

push eventtamird/rust

Tamir Duberstein

commit sha a093957f43703555d02aaa2b8fd64ea686e1cd88

Avoid unused return

view details

Tamir Duberstein

commit sha 49ade22bd990f5ad9165431a4c974e5d8b0e8732

Parse SocketAddrV6::scope_id

view details

push time in 21 days

Pull request review commentrust-lang/rust

Parse SocketAddrV6::scope_id

 impl<'a> Parser<'a> {     {         self.read_atomically(move |p| {             if index > 0 {-                let _ = p.read_given_char(sep)?;+                let () = p.read_given_char(sep)?;

You're the boss. Done.

tamird

comment created time in 21 days

PullRequestReviewEvent

Pull request review commentrust-lang/rust

Parse SocketAddrV6::scope_id

 impl<'a> Parser<'a> {     {         self.read_atomically(move |p| {             if index > 0 {-                let _ = p.read_given_char(sep)?;+                let () = p.read_given_char(sep)?;

These are intentional; without them, a missing ? at the end of the line would go unnoticed. See https://github.com/rust-lang/rust-clippy/issues/3915

tamird

comment created time in 21 days

PullRequestReviewEvent

PR opened rust-lang/rust

Parse SocketAddrV6::scope_id

r? @dtolnay

+25 -12

0 comment

2 changed files

pr created time in 21 days

create barnchtamird/rust

branch : parse-scope-id

created branch time in 21 days

delete branch tamird/rust

delete branch : sockaddr-scope-id

delete time in 23 days

push eventtamird/rust

Tamir Duberstein

commit sha f78a7ade61c1c218eead76854abb7d83bb6c6f75

Inline "eof" methods

view details

push time in 24 days

push eventtamird/rust

Tamir Duberstein

commit sha 9601724b11bbd9081b1bee6f7e478a5d2b9ace41

Avoid unchecked casts in net parser

view details

push time in 24 days

Pull request review commentrust-lang/rust

Avoid unchecked casts in net parser

 impl<'a> Parser<'a> {         })     } -    // Read a single digit in the given radix. For instance, 0-9 in radix 10;-    // 0-9A-F in radix 16.-    fn read_digit(&mut self, radix: u32) -> Option<u32> {-        self.read_atomically(move |p| p.read_char()?.to_digit(radix))-    }-     // Read a number off the front of the input in the given radix, stopping-    // at the first non-digit character or eof. Fails if the number has more-    // digits than max_digits, or the value is >= upto, or if there is no number.-    fn read_number(&mut self, radix: u32, max_digits: u32, upto: u32) -> Option<u32> {+    // at the first non-digit character or eof.+    fn read_number<T: ReadNumberHelper>(&mut self, radix: u32) -> Option<T> {         self.read_atomically(move |p| {-            let mut result = 0;-            let mut digit_count = 0;--            while let Some(digit) = p.read_digit(radix) {-                result = (result * radix) + digit;-                digit_count += 1;-                if digit_count > max_digits || result >= upto {-                    return None;-                }+            let mut result = T::ZERO;+            let mut parsed = false;++            while let Some(digit) = p.read_atomically(|p| p.read_char()?.to_digit(radix)) {

Yes, because if the next thing we read is not a digit, we want to rewind the parser.

tamird

comment created time in 24 days

PullRequestReviewEvent

push eventtamird/rust

Tamir Duberstein

commit sha f36a7ab01e79d2560b2983e8f28be01b65122e19

Avoid unchecked casts in net parser

view details

push time in 24 days

PR opened rust-lang/rust

Avoid unchecked casts in net parser

Once this and #77426 are in, I'll send another PR adding scope id parsing.

r? @dtolnay

+44 -28

0 comment

1 changed file

pr created time in 24 days

create barnchtamird/rust

branch : avoid-cast-net-parser

created branch time in 24 days

push eventtamird/rust

Tamir Duberstein

commit sha 4585c22818abb87cb87cbdc5163b702f6d7ed8ca

Include scope id in SocketAddrV6::Display

view details

push time in 24 days

push eventtamird/rust

Tamir Duberstein

commit sha 190b138d1080a72d16dcdd09e33526fd63de05ae

Include scope id in SocketAddrV6::Display

view details

push time in 24 days

pull request commentrust-lang/rust

Include scope id in SocketAddrV6::Display

Added tests.

tamird

comment created time in 24 days

push eventtamird/rust

Nazım Can Altınova

commit sha a313abe3ba989ba4b6c041627c903488886f8559

Manually implement Debug for BTreeMap::{IntoKeys,IntoValues} structs

view details

Nazım Can Altınova

commit sha 456738e3d1ad7dadffaed287d3055ca38b5fa375

Only print values in the Debug of HashMap::ValuesMut struct

view details

Nazım Can Altınova

commit sha c346e89db8a57e15111daa35685a2542d3be7c77

Manually implement Debug for BTreeMap::ValuesMut struct Deriving debug prints all the values including keys. But ValuesMut struct should only print the values.

view details

Nazım Can Altınova

commit sha 8faf550e5f7211188bc9560ae459c155fb1aafdf

Remove the unused bounds from Debug impl of HashMap::{IntoKeys,IntoValues}

view details

CAD97

commit sha 728938346b02a9688c44253c19b15baa7551fd80

Adjust rc::Weak::from_raw to support unsized T

view details

CAD97

commit sha 0c61ce2cf0560577923abafab2e5bfce14516525

?Sized bounds for rc::Weak::as_ptr and friends

view details

CAD97

commit sha 5e7406c9569dce75a042ce079918cf03cfca842a

Adjust sync::Weak::from_raw to support unsized T

view details

CAD97

commit sha 9d9903c5a50bb1f5b5fc3045b86172279eff7d30

Allow Weak::as_ptr and friends for unsized T

view details

CAD97

commit sha 3d07108d3600dff50e564f57dd390337dbe14d55

Add tests for weak into/from raw

view details

Jubilee Young

commit sha 247b73939a619ea4dcb2affbe1c285d20d93a0b8

Move Wrapping<T> ui tests into library

view details

Jubilee Young

commit sha 797cb9526a627c37b9bb9f6be6d3b54789b67c26

Fix to libstd test

view details

Jubilee Young

commit sha ac96f5b39ca7d9fad8571595c476c2db0bce8438

Test and reject out-of-bounds shuffle vectors

view details

Mara Bos

commit sha 84ef603c8400db203fefd714de963c88e5523424

Fix 'FIXME' about using NonZeroU32 instead of u32. It was blocked by #58732 (const fn NonZeroU32::new), which is fixed now.

view details

Guillaume Gomez

commit sha 980e1ff40f51b6b4b86ee70809d0a0055e6f9cc6

Add missing examples for Fd traits

view details

Mara Bos

commit sha f289468045c248e3543f2b0cd50cc37ecd3fd717

Stabilize slice_ptr_range. Closes #65807.

view details

Eric Huss

commit sha c297e20e03452c659b6d3f026ce4beee42ed8738

Add accessors to Command.

view details

Mara Bos

commit sha 6f6336b4a187b03312b978703496ea0ee9020ec9

Split sys_common::Mutex in StaticMutex and MovableMutex. The (unsafe) Mutex from sys_common had a rather complicated interface. You were supposed to call init() manually, unless you could guarantee it was neither moved nor used reentrantly. Calling `destroy()` was also optional, although it was unclear if 1) resources might be leaked or not, and 2) if destroy() should only be called when `init()` was called. This allowed for a number of interesting (confusing?) different ways to use this Mutex, all captured in a single type. In practice, this type was only ever used in two ways: 1. As a static variable. In this case, neither init() nor destroy() are called. The variable is never moved, and it is never used reentrantly. It is only ever locked using the LockGuard, never with raw_lock. 2. As a Boxed variable. In this case, both init() and destroy() are called, it will be moved and possibly used reentrantly. No other combinations are used anywhere in `std`. This change simplifies things by splitting this Mutex type into two types matching the two use cases: StaticMutex and MovableMutex. The interface of both new types is now both safer and simpler. The first one does not call nor expose init/destroy, and the second one calls those automatically in its new() and Drop functions. Also, the locking functions of MovableMutex are no longer unsafe.

view details

Mara Bos

commit sha 825dda80601bdb34ef21065052a8866df0fe0838

Fix ui test. This test checks if the compiler complains about accesing a private field before complaining (or crashing) about the private function on it not marked as stable/unstable. The interface of the internal type (sys_common's Mutex) used for this was changed. With this change, it uses another function to test for the same issue.

view details

Dániel Buga

commit sha 89b8a97aead4aa366eb2587ffdcfa7df39f3815a

Refactor memchr to allow optimization

view details

Mara Bos

commit sha 07fd17f7014de6dc209c7dc4de159a2a5acea173

Only use LOCAL_{STDOUT,STDERR} when set_{print/panic} is used. The thread local LOCAL_STDOUT and LOCAL_STDERR are only used by the test crate to capture output from tests when running them in the same process in differen threads. However, every program will check these variables on every print, even outside of testing. This involves allocating a thread local key, and registering a thread local destructor. This can be somewhat expensive. This change keeps a global flag (LOCAL_STREAMS) which will be set to true when either of these local streams is used. (So, effectively only in test and benchmark runs.) When this flag is off, these thread locals are not even looked at and therefore will not be initialized on the first output on every thread, which also means no thread local destructors will be registered.

view details

push time in 24 days

push eventtamird/rust

Tamir Duberstein

commit sha 9575f5e0cd8145a6fd68317e66ce26f3def14ba9

Include scope id in SocketAddrV6::Display

view details

push time in a month

create barnchtamird/rust

branch : sockaddr-scope-id

created branch time in a month

PR opened rust-lang/rust

Include scope id in SocketAddrV6::Display

r? @tmandry

I couldn't find any unit tests for these functions.

cc @ghanan94 @brunowonka

+14 -4

0 comment

1 changed file

pr created time in a month

pull request commentnix-rust/nix

Add fuchsia support

@posborne CI support is something we'd like to have, but Fuchsia does not yet provide tools for external CI.

We're OK with taking on the burden of fixing regressions.

amanda-tait

comment created time in a month

pull request commentrust-lang/rust

Separate projection bounds and predicates

The pathological compilation-time cases addressed by this PR are blocking us over in Fuchsia. How can we help get this reviewed?

matthewjasper

comment created time in a month

issue commentgoogle/gvisor

Test SO_BINDTODEVICE behavior after the bound device is removed

@brunowonka can we do this by creating a TAP device using netlink?

eyalsoha

comment created time in a month

issue commentgoogle/gvisor

Implement silly window syndrome prevention on receive side

Sounds related to https://github.com/google/gvisor/issues/1509#issuecomment-694852634.

majek

comment created time in a month

issue commentgoogle/gvisor

tcpip.Payloader is a reimplementation of io.Reader

We may need a deeper rethink of the tcpip.Endpoint API to address longstanding integration issues with Fuchsia. In particular, Fuchsia currently uses a pair of loops to shuttle bytes and signals between a zircon socket and the tcpip.Endpoint. This is necessary because networking is implemented in userspace in Fuchisa, meaning the networking implementation cannot read applications' memory:

+-------------+     +-----------------------+     +----------+
| Application | --- | Kernel-managed socket | --- | Netstack |
+-------------+     +-----------------------+     +----------+

This results in odd behaviour such as certain errors being first observed and consumed by these loops (e.g. ECONNRESET), preventing retrieval by getsockopt(..., SO_ERROR) without addition work to cache those errors in the integrator. It would be better to teach tcpip.Endpoint (stream endpoints in particular) about externally furnished buffers, which would address this problem.

cc @ghanan94

tamird

comment created time in a month

issue openedgoogle/gvisor

incoming multicast is filtered only at the NIC

This bug seems to have existed since multicast support was added.

When an endpoint joins a multicast group, it adds the multicast address to the NIC's list of permanent addresses: https://github.com/google/gvisor/blob/b6ca96b9b9e71ba57653cf9d3ef0767771949378/pkg/tcpip/transport/udp/endpoint.go#L761-L763

However, when a multicast packet is delivered to the NIC, no per-endpoint filtering occurs: https://github.com/google/gvisor/blob/b6ca96b9b9e71ba57653cf9d3ef0767771949378/pkg/tcpip/stack/transport_demuxer.go#L166-L172

This has two disasterous implications:

  1. any endpoint bound to a NIC that has any endpoints which belong to a multicast group will receive those groups' traffic
  2. any endpoint that sends outbound multicast traffic will also receive it, regardless of its membership and regardless of the NIC's membership in the group. this is due to the PacketLoop optimization: https://github.com/google/gvisor/blob/b6ca96b9b9e71ba57653cf9d3ef0767771949378/pkg/tcpip/network/ipv4/ipv4.go#L256-L260 which circumvents NIC address checking.

cc @iangudger in case you have a good solution. I was able to fix this with this bandaid patch:

diff --git a/pkg/tcpip/transport/udp/endpoint.go b/pkg/tcpip/transport/udp/endpoint.go
index 0a9d3c6c..f15d28e8 100644
--- a/pkg/tcpip/transport/udp/endpoint.go
+++ b/pkg/tcpip/transport/udp/endpoint.go
@@ -1403,6 +1403,20 @@ func (e *endpoint) HandlePacket(r *stack.Route, id stack.TransportEndpointID, pk
                return
        }
 
+       if header.IsV4MulticastAddress(id.LocalAddress) ||
+                       header.IsV6MulticastAddress(id.LocalAddress) {
+               var found bool
+               for _, mem := range e.multicastMemberships {
+                       if mem.multicastAddr == id.LocalAddress {
+                               found = true
+                               break
+                       }
+               }
+               if !found {
+                       return
+               }
+       }
+
        if !verifyChecksum(r, hdr, pkt) {
                // Checksum Error.
                e.stack.Stats().UDP.ChecksumErrors.Increment()

however I think a more appropriate fix is to avoid these endpoints in this call to findAllEndpointsLocked: https://github.com/google/gvisor/blob/b6ca96b9b9e71ba57653cf9d3ef0767771949378/pkg/tcpip/stack/transport_demuxer.go#L531

Discovered via https://bugs.chromium.org/p/chromium/issues/detail?id=1127298.

created time in a month

issue openedgoogle/gvisor

sniffer doesn't recognize router solicitations

With the sniffer enabled, I see logs like:

recv fe80::447f:e5ff:fe4f:fa92 -> ff02::16 unknown transport protocol: 0

a bit of searching finds the destination adress is header.IPv6AllRoutersMulticastAddress which is used in (*stack.ndpState).startSolicitingRouters.

We should figure out why the sniffer can't parse this packet (hopefully we're not crafting it incorrectly).

created time in a month

issue commentgoogle/gvisor

bind to multicast address fails unless group membership is present

cc @ghanan94

tamird

comment created time in 2 months

issue openedgoogle/gvisor

bind to multicast address fails unless group membership is present

Failing snippet:

  struct sockaddr_in addr = {
      .sin_family = AF_INET,
      .sin_addr.s_addr = htonl(INADDR_LOOPBACK),
  };

#if defined(__Fuchsia__) // stand-in for gvisor
  fbl::unique_fd s;
#endif
  if (multicast) {
    int n = inet_pton(addr.sin_family, "224.0.2.1", &addr.sin_addr);
    ASSERT_GE(n, 0) << strerror(errno);
    ASSERT_EQ(n, 1);

#if defined(__Fuchsia__)
    ASSERT_TRUE(s = fbl::unique_fd(socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP))) << strerror(errno);
    ip_mreqn param = {
        .imr_multiaddr = addr.sin_addr,
        .imr_address.s_addr = htonl(INADDR_ANY),
        .imr_ifindex = 1,
    };
    ASSERT_EQ(setsockopt(s.get(), SOL_IP, IP_ADD_MEMBERSHIP, &param, sizeof(param)), 0)
        << strerror(errno);
#endif
  }

  fbl::unique_fd s1;
  ASSERT_TRUE(s1 = fbl::unique_fd(socket(AF_INET, type, 0))) << strerror(errno);
  ASSERT_EQ(setsockopt(s1.get(), SOL_SOCKET, SO_REUSEPORT, &on, sizeof(on)), 0) << strerror(errno);
  ASSERT_EQ(bind(s1.get(), reinterpret_cast<const struct sockaddr*>(&addr), sizeof(addr)), 0)
      << strerror(errno); // this fails on gvisor without the `#if defined` above

@hbhasker for triage.

created time in 2 months

issue commentgoogle/gvisor

TestDiscardsUDPPacketsWithMcastSourceAddressV6 is flaky

Another kind of flake on the same test https://source.cloud.google.com/results/invocations/018807ef-5d7a-4612-aa54-157062acbc71/targets/bazel-testlogs%2Ftest%2Fpacketimpact%2Ftests%2Fudp_discard_mcast_source_addr_netstack_test/tests

=== RUN   TestOne
    TestOne: packetimpact_test.go:315: test error: process terminated with status: 1, expect failure: false

        ====== Begin of DUT Logs ======

        posix_server is starting.
        Got IP 0.0.0.0 and port 40000.
        Server listening on 0.0.0.0:40000


        ====== End of DUT Logs ======

        ====== Begin of Testbench Logs ======

        --- FAIL: TestDiscardsUDPPacketsWithMcastSourceAddressV6 (3.32s)
            --- FAIL: TestDiscardsUDPPacketsWithMcastSourceAddressV6/srcaddr=fe01::42 (0.04s)
                udp_discard_mcast_source_addr_test.go:90: Recv got unexpected result, ret=0, payload="", errno=errno 0
        FAIL


        ====== End of Testbench Logs ======
--- FAIL: TestOne (48.64s)
tamird

comment created time in 2 months

issue commentgoogle/gvisor

packet buffer headers should have protocol number associated.

cc @kkrakauer

jelischer

comment created time in 2 months

issue openedgoogle/gvisor

packetimpact cleanup on error is confused

On a recent test flake, I see these logs:

==================== Test output for //test/packetimpact/tests:udp_any_addr_recv_unicast_netstack_test:
=== RUN   TestOne
2020/08/28 11:40:11 dut: copy: /home/kbuilder/.cache/bazel/_bazel_kbuilder/57519ae3f2ee465392291af4c0b9f2ad/execroot/__main__/bazel-out/k8-fastbuild/bin/test/packetimpact/tests/udp_any_addr_recv_unicast_netstack_test-bench.runfiles/__main__/test/packetimpact/dut/posix_server -> /tmp/dut-G7YDIGYVU4L366UU5YTO7CJX3CIWVVLA194011297/posix_server
    TestOne: packetimpact_test.go:182: listing devices on dut-G7YDIGYVU4L366UU5YTO7CJX3CIWVVLA container: process terminated with status: 126
2020/08/28 11:40:14 dut: error removing container "dut-G7YDIGYVU4L366UU5YTO7CJX3CIWVVLA": Error response from daemon: removal of container dut-G7YDIGYVU4L366UU5YTO7CJX3CIWVVLA is already in progress
2020/08/28 11:40:14 dut: error removing container "dut-G7YDIGYVU4L366UU5YTO7CJX3CIWVVLA": Error response from daemon: removal of container dut-G7YDIGYVU4L366UU5YTO7CJX3CIWVVLA is already in progress
2020/08/28 11:40:14 dut: error killing container "dut-G7YDIGYVU4L366UU5YTO7CJX3CIWVVLA": Error response from daemon: Cannot kill container: b14957ddb8b4a0d3a523ae953bca87aa2f447cf079ee04395f823668f9cbb98b: No such container: b14957ddb8b4a0d3a523ae953bca87aa2f447cf079ee04395f823668f9cbb98b
2020/08/28 11:40:14 dut: error removing container "dut-G7YDIGYVU4L366UU5YTO7CJX3CIWVVLA": Error: No such container: dut-G7YDIGYVU4L366UU5YTO7CJX3CIWVVLA
--- FAIL: TestOne (33.16s)
FAIL

Notice that there are 3 errors logged for attempting to remove a container that is already being removed, and one for attempting to kill a container that doesn't exist. Seems that cleanup is not coherent.

@jayzhuang @amscanne

created time in 2 months

issue openedgoogle/gvisor

TestDiscardsUDPPacketsWithMcastSourceAddressV6 is flaky

See https://source.cloud.google.com/results/invocations/ac5955dc-c302-4db0-a5b1-08cc51eedbb5/targets/bazel-testlogs%2Ftest%2Fpacketimpact%2Ftests%2Fudp_discard_mcast_source_addr_netstack_test/tests, which happened on a totally unrelated change (https://github.com/google/gvisor/pull/3792).

=== RUN   TestOne
    TestOne: packetimpact_test.go:315: test error: process terminated with status: 1, expect failure: false

        ====== Begin of DUT Logs ======

        posix_server is starting.
        Got IP 0.0.0.0 and port 40000.
        Server listening on 0.0.0.0:40000


        ====== End of DUT Logs ======

        ====== Begin of Testbench Logs ======

        --- FAIL: TestDiscardsUDPPacketsWithMcastSourceAddressV6 (3.30s)
            --- FAIL: TestDiscardsUDPPacketsWithMcastSourceAddressV6/srcaddr=fe01::42 (0.04s)
                udp_discard_mcast_source_addr_test.go:90: Recv got unexpected result, ret=0, payload="", errno=transport endpoint is not connected
        FAIL


        ====== End of Testbench Logs ======
--- FAIL: TestOne (47.20s)

Interestingly this happened on only one of the test cases. In any event, the error doesn't make any sense, and suggests that there's a bug in the test server (unsychronized access to errno?).

@jayzhuang can you take a look?

created time in 2 months

issue openedgoogle/gvisor

`accept` fails on a reset connection

  • create listener (socket, bind, listen)
  • create connector (socket)
  • connect connector to listener (connect)
  • disable linger on connector (setsockopt(<connector>, SOL_SOCKET, SO_LINGER, {l_onoff=1, l_linger=0}, ...))
  • send RST from connector (close)
  • accept the connection from listener (accept(<listener>, <non-null addr>, <non-zero len>)

Should succeed, but fails on gVisor with ENOTCONN.

created time in 2 months

issue closedgoogle/gvisor

Support setting the SO_LINGER socket option

This is would be useful to better manage the behavior of sockets on close or shutdown, whether we want to wait for a timeout or force a reset by turning linger off and closing the socket.

From the man page: When enabled, a close or shutdown will not return until all queued messages for the socket have been successfully sent or the linger timeout has been reached.

Get SO_LINGER is already supported.

closed time in 2 months

RyanHeacock

issue commentgoogle/gvisor

Support setting the SO_LINGER socket option

Done in b26f7503b545e106ea0934d2153aed54ee4374d3.

RyanHeacock

comment created time in 2 months

issue commentgolang/go

runtime/pprof: panic in appendLocsForStack on fuchsia-arm64

I haven't been able to reproduce locally, but the issue only appears on arm64. The previous file I provided was the amd64 binary; here's the arm64: https://gofile.io/d/xPjFh3.

tamird

comment created time in 2 months

issue commentgolang/go

runtime/pprof: panic in appendLocsForStack on fuchsia-arm64

https://gofile.io/d/hlPlJh

tamird

comment created time in 2 months

issue commentgolang/go

runtime/pprof: panic in appendLocsForStack on fuchsia-arm64

With the change above applied, here's what we see:

=== RUN   TestCPUProfileMultithreaded
stk:#   0xde474a80eb    runtime.nanotime1+0x10b /b/s/w/ir/x/w/fuchsia/out/not-default/host-tools/goroot/src/runtime/os_fuchsia.go:478
#       0xde474b1f83    runtime._System+0x3     /b/s/w/ir/x/w/fuchsia/out/not-default/host-tools/goroot/src/runtime/proc.go:3911
l.pcs:# 0xde474a80eb    runtime.nanotime1+0x10b /b/s/w/ir/x/w/fuchsia/out/not-default/host-tools/goroot/src/runtime/os_fuchsia.go:478
#       0xde474a80e4    runtime.nanotime+0x104  /b/s/w/ir/x/w/fuchsia/out/not-default/host-tools/goroot/src/runtime/time_nofake.go:19
#       0xde474a8050    runtime.suspendG+0x70   /b/s/w/ir/x/w/fuchsia/out/not-default/host-tools/goroot/src/runtime/preempt.go:252
panic: runtime error: slice bounds out of range [3:2]

goroutine 6 [running]:
runtime/pprof.(*profileBuilder).appendLocsForStack(0x1fd1c0b3340, 0x1fd1c130840, 0x0, 0x8, 0x1fd1c216130, 0x2, 0x2, 0x0, 0x6, 0x8) 
/b/s/w/ir/x/w/fuchsia/out/not-default/host-tools/goroot/src/runtime/pprof/proto.go:415 +0x640
runtime/pprof.(*profileBuilder).build(0x1fd1c0b3340)
/b/s/w/ir/x/w/fuchsia/out/not-default/host-tools/goroot/src/runtime/pprof/proto.go:366 +0xf4
runtime/pprof.profileWriter(0xde4768f8c0, 0x1fd1c10a120)
/b/s/w/ir/x/w/fuchsia/out/not-default/host-tools/goroot/src/runtime/pprof/pprof.go:813 +0xd4
created by runtime/pprof.StartCPUProfile
/b/s/w/ir/x/w/fuchsia/out/not-default/host-tools/goroot/src/runtime/pprof/pprof.go:784 +0x114
tamird

comment created time in 2 months

issue openedgoogle/gvisor

Improve type safety for socket options

Currently {G,S}etSockOpt take arguments of type interface{}, which means the compiler is not able to do any type checking of arguments.

We should introduce a public interface with a single private method (i.e.a marker interface) and implement it for all socket options - this will ensure that invalid types are caught at compile time.

Note that the interface should be implemented by pointers, not values, as implementing an interface on values also implements it on the value's pointer type, defeating type safety again.

cc @brunowonka @ghanan94 @hbhasker @amscanne

created time in 2 months

issue commentgolang/go

runtime/pprof: panic in appendLocsForStack on fuchsia-arm64

Yes, there were earlier bugs; sorry to have mislead you!

https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=44718 was filed on January 24 https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=47563 was filed on March 3

tamird

comment created time in 2 months

issue openedgolang/go

runtime/pprof: panic in appendLocsForStack on fuchsia-arm64

We've been seeing this issue for a while; filing this bug now that we've upgraded to go1.15. (See https://fxbug.dev/52575).

This happens sometimes when running the runtime/pprof tests:

panic: runtime error: slice bounds out of range [3:2]

goroutine 6 [running]:
runtime/pprof.(*profileBuilder).appendLocsForStack(0x3e93c15c160, 0x3e93c130840, 0x0, 0x8, 0x3e93c0560b0, 0x2, 0x2, 0x0, 0x2, 0x8) 
/b/s/w/ir/x/w/fuchsia/out/not-default/host-tools/goroot/src/runtime/pprof/proto.go:410 +0x5d4
runtime/pprof.(*profileBuilder).build(0x3e93c15c160)
/b/s/w/ir/x/w/fuchsia/out/not-default/host-tools/goroot/src/runtime/pprof/proto.go:365 +0xf4
runtime/pprof.profileWriter(0xb4050418c0, 0x3e93c386030)
/b/s/w/ir/x/w/fuchsia/out/not-default/host-tools/goroot/src/runtime/pprof/pprof.go:813 +0xd4
created by runtime/pprof.StartCPUProfile
/b/s/w/ir/x/w/fuchsia/out/not-default/host-tools/goroot/src/runtime/pprof/pprof.go:784 +0x114

There's no diff between Fuchsia's fork and go1.15 in src/runtime/pprof. See https://fuchsia.googlesource.com/third_party/go/+diff/go1.15..master.

Possibly a regression of #35538, related to #37446 and its fix in https://golang.org/cl/221577.

@prattmic

created time in 2 months

delete branch tamird/intellij-rust

delete branch : warnings

delete time in 3 months

issue openedgoogle/argh

support flattening

structopt supports "flattening", which allows one struct to be embedded in another "transparently". This is useful as documented in structopt, but also useful when two commands have the same arguments and the author does not wish to duplicate the code.

https://docs.rs/structopt/0.3.16/structopt/#flattening

created time in 3 months

delete branch tamird/rand

delete branch : typo

delete time in 3 months

PR opened rust-random/rand

Correctly spell "implementation"
+1 -1

0 comment

1 changed file

pr created time in 3 months

create barnchtamird/rand

branch : typo

created branch time in 3 months

fork tamird/rand

A Rust library for random number generation.

https://crates.io/crates/rand

fork in 3 months

delete branch tamird/backtrace-rs

delete branch : dedup

delete time in 3 months

Pull request review commentintellij-rust/intellij-rust

Fix compiler warnings

 import org.rust.lang.utils.evaluation.evaluate class RsErrorAnnotator : AnnotatorBase(), HighlightRangeExtension {     override fun isForceHighlightParents(file: PsiFile): Boolean = file is RsFile -    override fun annotateInternal(element: PsiElement, rawHolder: AnnotationHolder) {-        val holder = RsAnnotationHolder(rawHolder)-        val visitor = object : RsVisitor() {-            override fun visitBaseType(o: RsBaseType) = checkBaseType(holder, o)-            override fun visitCondition(o: RsCondition) = checkCondition(holder, o)-            override fun visitConstant(o: RsConstant) = checkConstant(holder, o)-            override fun visitTypeArgumentList(o: RsTypeArgumentList) = checkTypeArgumentList(holder, o)-            override fun visitValueParameterList(o: RsValueParameterList) = checkValueParameterList(holder, o)-            override fun visitValueArgumentList(o: RsValueArgumentList) = checkValueArgumentList(holder, o)-            override fun visitStructItem(o: RsStructItem) = checkDuplicates(holder, o)-            override fun visitEnumItem(o: RsEnumItem) = checkEnumItem(holder, o)-            override fun visitEnumVariant(o: RsEnumVariant) = checkEnumVariant(holder, o)-            override fun visitFunction(o: RsFunction) = checkFunction(holder, o)-            override fun visitImplItem(o: RsImplItem) = checkImpl(holder, o)-            override fun visitLabel(o: RsLabel) = checkLabel(holder, o)-            override fun visitLifetime(o: RsLifetime) = checkLifetime(holder, o)-            override fun visitModDeclItem(o: RsModDeclItem) = checkModDecl(holder, o)-            override fun visitModItem(o: RsModItem) = checkDuplicates(holder, o)-            override fun visitUseSpeck(o: RsUseSpeck) = checkUseSpeck(holder, o)-            override fun visitPatBox(o: RsPatBox) = checkPatBox(holder, o)-            override fun visitPatField(o: RsPatField) = checkPatField(holder, o)-            override fun visitPatBinding(o: RsPatBinding) = checkPatBinding(holder, o)-            override fun visitPatRest(o: RsPatRest) = checkPatRest(holder, o)-            override fun visitOrPat(o: RsOrPat) = checkOrPat(holder, o)-            override fun visitPath(o: RsPath) = checkPath(holder, o)-            override fun visitNamedFieldDecl(o: RsNamedFieldDecl) = checkDuplicates(holder, o)-            override fun visitRetExpr(o: RsRetExpr) = checkRetExpr(holder, o)-            override fun visitTraitItem(o: RsTraitItem) = checkDuplicates(holder, o)-            override fun visitTypeAlias(o: RsTypeAlias) = checkTypeAlias(holder, o)-            override fun visitTypeParameter(o: RsTypeParameter) = checkDuplicates(holder, o)-            override fun visitConstParameter(o: RsConstParameter) = checkConstParameter(holder, o)-            override fun visitLifetimeParameter(o: RsLifetimeParameter) = checkLifetimeParameter(holder, o)-            override fun visitVis(o: RsVis) = checkVis(holder, o)-            override fun visitVisRestriction(o: RsVisRestriction) = checkVisRestriction(holder, o)-            override fun visitUnaryExpr(o: RsUnaryExpr) = checkUnary(holder, o)-            override fun visitBinaryExpr(o: RsBinaryExpr) = checkBinary(holder, o)-            override fun visitExternCrateItem(o: RsExternCrateItem) = checkExternCrate(holder, o)-            override fun visitDotExpr(o: RsDotExpr) = checkDotExpr(holder, o)-            override fun visitYieldExpr(o: RsYieldExpr) = checkYieldExpr(holder, o)-            override fun visitArrayType(o: RsArrayType) = checkArrayType(holder, o)-            override fun visitArrayExpr(o: RsArrayExpr) = checkArrayExpr(holder, o)-            override fun visitVariantDiscriminant(o: RsVariantDiscriminant) = collectDiagnostics(holder, o)-            override fun visitPolybound(o: RsPolybound) = checkPolybound(holder, o)-            override fun visitTraitRef(o: RsTraitRef) = checkTraitRef(holder, o)-            override fun visitCallExpr(o: RsCallExpr) = checkCallExpr(holder, o)-            override fun visitBlockExpr(o: RsBlockExpr) = checkBlockExpr(holder, o)-            override fun visitBreakExpr(o: RsBreakExpr) = checkBreakExpr(holder, o)-            override fun visitContExpr(o: RsContExpr) = checkContExpr(holder, o)-            override fun visitAttr(o: RsAttr) = checkAttr(holder, o)-            override fun visitRangeExpr(o: RsRangeExpr) = checkRangeExpr(holder, o)-            override fun visitTraitType(o: RsTraitType) = checkTraitType(holder, o)-            override fun visitSelfParameter(o: RsSelfParameter) = checkParamAttrs(holder, o)-            override fun visitValueParameter(o: RsValueParameter) = checkParamAttrs(holder, o)-            override fun visitVariadic(o: RsVariadic) = checkParamAttrs(holder, o)-            override fun visitPatStruct(o: RsPatStruct) = checkRsPatStruct(holder, o)-            override fun visitPatTupleStruct(o: RsPatTupleStruct) = checkRsPatTupleStruct(holder, o)-            override fun visitStructLiteralField(o: RsStructLiteralField) = checkReferenceIsPublic(o, o, holder)-        }--        element.accept(visitor)+    override fun annotateInternal(element: PsiElement, holder: AnnotationHolder) {+        RsAnnotationHolder(holder).let {+            object : RsVisitor() {+                override fun visitBaseType(o: RsBaseType) = checkBaseType(it, o)+                override fun visitCondition(o: RsCondition) = checkCondition(it, o)+                override fun visitConstant(o: RsConstant) = checkConstant(it, o)+                override fun visitTypeArgumentList(o: RsTypeArgumentList) = checkTypeArgumentList(it, o)+                override fun visitValueParameterList(o: RsValueParameterList) = checkValueParameterList(it, o)+                override fun visitValueArgumentList(o: RsValueArgumentList) = checkValueArgumentList(it, o)+                override fun visitStructItem(o: RsStructItem) = checkDuplicates(it, o)+                override fun visitEnumItem(o: RsEnumItem) = checkEnumItem(it, o)+                override fun visitEnumVariant(o: RsEnumVariant) = checkEnumVariant(it, o)+                override fun visitFunction(o: RsFunction) = checkFunction(it, o)+                override fun visitImplItem(o: RsImplItem) = checkImpl(it, o)+                override fun visitLabel(o: RsLabel) = checkLabel(it, o)+                override fun visitLifetime(o: RsLifetime) = checkLifetime(it, o)+                override fun visitModDeclItem(o: RsModDeclItem) = checkModDecl(it, o)+                override fun visitModItem(o: RsModItem) = checkDuplicates(it, o)+                override fun visitUseSpeck(o: RsUseSpeck) = checkUseSpeck(it, o)+                override fun visitPatBox(o: RsPatBox) = checkPatBox(it, o)+                override fun visitPatField(o: RsPatField) = checkPatField(it, o)+                override fun visitPatBinding(o: RsPatBinding) = checkPatBinding(it, o)+                override fun visitPatRest(o: RsPatRest) = checkPatRest(it, o)+                override fun visitOrPat(o: RsOrPat) = checkOrPat(it, o)+                override fun visitPath(o: RsPath) = checkPath(it, o)+                override fun visitNamedFieldDecl(o: RsNamedFieldDecl) = checkDuplicates(it, o)+                override fun visitRetExpr(o: RsRetExpr) = checkRetExpr(it, o)+                override fun visitTraitItem(o: RsTraitItem) = checkDuplicates(it, o)+                override fun visitTypeAlias(o: RsTypeAlias) = checkTypeAlias(it, o)+                override fun visitTypeParameter(o: RsTypeParameter) = checkDuplicates(it, o)+                override fun visitConstParameter(o: RsConstParameter) = checkConstParameter(it, o)+                override fun visitLifetimeParameter(o: RsLifetimeParameter) = checkLifetimeParameter(it, o)+                override fun visitVis(o: RsVis) = checkVis(it, o)+                override fun visitVisRestriction(o: RsVisRestriction) = checkVisRestriction(it, o)+                override fun visitUnaryExpr(o: RsUnaryExpr) = checkUnary(it, o)+                override fun visitBinaryExpr(o: RsBinaryExpr) = checkBinary(it, o)+                override fun visitExternCrateItem(o: RsExternCrateItem) = checkExternCrate(it, o)+                override fun visitDotExpr(o: RsDotExpr) = checkDotExpr(it, o)+                override fun visitYieldExpr(o: RsYieldExpr) = checkYieldExpr(it, o)+                override fun visitArrayType(o: RsArrayType) = checkArrayType(it, o)+                override fun visitArrayExpr(o: RsArrayExpr) = checkArrayExpr(it, o)+                override fun visitVariantDiscriminant(o: RsVariantDiscriminant) = collectDiagnostics(it, o)+                override fun visitPolybound(o: RsPolybound) = checkPolybound(it, o)+                override fun visitTraitRef(o: RsTraitRef) = checkTraitRef(it, o)+                override fun visitCallExpr(o: RsCallExpr) = checkCallExpr(it, o)+                override fun visitBlockExpr(o: RsBlockExpr) = checkBlockExpr(it, o)+                override fun visitBreakExpr(o: RsBreakExpr) = checkBreakExpr(it, o)+                override fun visitContExpr(o: RsContExpr) = checkContExpr(it, o)+                override fun visitAttr(o: RsAttr) = checkAttr(it, o)+                override fun visitRangeExpr(o: RsRangeExpr) = checkRangeExpr(it, o)+                override fun visitTraitType(o: RsTraitType) = checkTraitType(it, o)+                override fun visitSelfParameter(o: RsSelfParameter) = checkParamAttrs(it, o)+                override fun visitValueParameter(o: RsValueParameter) = checkParamAttrs(it, o)+                override fun visitVariadic(o: RsVariadic) = checkParamAttrs(it, o)+                override fun visitPatStruct(o: RsPatStruct) = checkRsPatStruct(it, o)+                override fun visitPatTupleStruct(o: RsPatTupleStruct) = checkRsPatTupleStruct(it, o)+                override fun visitStructLiteralField(o: RsStructLiteralField) = checkReferenceIsPublic(o, o, it)+            }+        }.let(element::accept)

OK, done.

tamird

comment created time in 3 months

Pull request review commentintellij-rust/intellij-rust

Fix compiler warnings

 class SourceFile(         checkIsSmartMode(project)          val isExpansionFile = MacroExpansionManager.isExpansionFile(file)-        val isIndexedFile = file.isValid && (-            FileBasedIndexScanRunnableCollector.getInstance(project).shouldCollect(file) || isExpansionFile)+        val isIndexedFile = file.isValid && (isExpansionFile || ProjectFileIndex.getInstance(project).let {

OK, done.

tamird

comment created time in 3 months

push eventtamird/intellij-rust

vlad20012

commit sha 2c03275e9561724192b5f23637b84f90ff74619c

HINT: don't show a hint for single lambda param If `Show only smart hints` option is enabled, don't show parameter hints for lambda argument if it is the only argument of the function. This works for `Iterator.map()` method

view details

vlad20012

commit sha bb10084778760a0dc87a9b75caeff74cb42d722a

Fix navigation to derive items in 202

view details

Arseniy Pendryak

commit sha ed7dcca45ea3610125cf36f9c28ddd0519b8bd26

#5460: bind doc comment to macro expansion context

view details

Jakub Beránek

commit sha 39f3ddb7ec3bffa6f802d060d1b9a057f9e00ffc

COMP: prefer trait methods before private inherent methods

view details

Jakub Beránek

commit sha 236580ab87add7be6eb9d682769da591ec6be215

INT: add intention to substitute an associated type

view details

Jakub Beránek

commit sha 9d6a43825a49d27dbf49445280bfaa3d7b5e4180

REF: find occurrences for introduce constant/variable outside functions

view details

bors[bot]

commit sha c4368d1add2f869c8496edd3e1d136bbdbd4d1b5

Merge #5661 5661: COMP: prefer trait methods before private inherent methods r=vlad20012 a=Kobzol Name resolution filters items by their visibility, however in the case of the mentioned issue, it is too late. Trait methods are filtered too deeply if an inherent method exists with the same name. This PR changes it so that inherent methods are not preferred if they are not visible, thus fixing the previously given false positive. Fixes: https://github.com/intellij-rust/intellij-rust/issues/3436 Co-authored-by: Jakub Beránek <berykubik@gmail.com>

view details

bors[bot]

commit sha b263ab3f891f93fbba560682cd53588571d9a38b

Merge #5643 5643: INT: add intention to substitute an associated type r=mchernyavsky a=Kobzol This PR adds an intention to substitute an associated type with its value. Fixes: https://github.com/intellij-rust/intellij-rust/issues/2766 Co-authored-by: Jakub Beránek <berykubik@gmail.com>

view details

bors[bot]

commit sha bb172df82ca222878bb6e4e983d805f3212e3c67

Merge #5857 5857: REF: find occurrences for introduce constant/variable outside functions r=mchernyavsky a=Kobzol This PR modifies `findOccurrences` in `extraxtExpressionUtils.kt` so that it can find a corresponding context even if the extracted item is outside a function. Fixes: https://github.com/intellij-rust/intellij-rust/issues/5844 Co-authored-by: Jakub Beránek <berykubik@gmail.com>

view details

Jakub Beránek

commit sha 6b9faa94adaa5174a11fda2b379e92c052f46363

NAV: allow navigation from RsAbstractable to its implementations

view details

bors[bot]

commit sha cda7a18c5ad03e473f301d3dde2a37fb72b57243

Merge #5842 5842: HINT: don't show a hint for single lambda param r=ortem a=vlad20012 If `Show only smart hints` option is enabled, don't show parameter hints for lambda argument if it is the only argument of the function. This works for `Iterator.map()` method, i.e. no such artifacts anymore: ![image](https://user-images.githubusercontent.com/3221931/89030570-6a67b700-d339-11ea-9d34-c6eee818dabe.png) Co-authored-by: vlad20012 <beskvlad@gmail.com>

view details

Dmitry Murzin

commit sha cf78ac6e1e4850071fbb300cd62c18a0aa4f096a

REF: Update references in move items refactoring

view details

bors[bot]

commit sha 4736b08be5931276e57ed346d974afdba1309d0a

Merge #5736 5736: REF: Update references in move items refactoring r=ortem a=dima74 Update references in [move items refactoring](https://github.com/intellij-rust/intellij-rust/issues/3531#issuecomment-643142894): * Inside references (to moved items - both from old mod and from other mods) * Outside references (from moved items - both to old mod and to other mods) --- Please see comment for `RsMoveCommonProcessor` for detailed description I will add tests later (after merging #5665), but anyway all existing tests can be found [here](https://github.com/intellij-rust/intellij-rust/blob/diralik/move/src/test/kotlin/org/rust/ide/refactoring/move/RsMoveTopLevelItemsTest.kt) Co-authored-by: Dmitry Murzin <diralik@yandex.ru>

view details

vlad20012

commit sha bcdc01d9d48f7ab1150b94f743c530a77a95e2b8

RES: fix private reexport with `crate::` path

view details

bors[bot]

commit sha b143ebc41ae0e1b74730b455acdf5f3d18c61671

Merge #5801 #5853 5801: Fix navigation to derive items in 2020.2 r=undin a=vlad20012 Fixes #5531 The old hack doesn't work anymore, I invented a new one 5853: RES: fix private reexport with `crate::` path r=vlad20012 a=vlad20012 Fixes #4664 Co-authored-by: vlad20012 <beskvlad@gmail.com>

view details

vlad20012

commit sha 88aee297f3a0002a48bc2a784b94d1e53ba2d8f3

Fix ArrayIndexOutOfBoundsException ... in macro completion

view details

vlad20012

commit sha cf8850bb2fcb698a7710fb61a4a442585c2f3552

Fix `invalidate caches / restart` on 203

view details

Arseniy Pendryak

commit sha ec3b6819329667e422bafcceb620df9404ed1a32

#5460: don't skip doc comments provided by macro definition

view details

bors[bot]

commit sha d935eb0de0ce4764ff33feeb0c67c96460e0897f

Merge #5862 #5863 5862: Fix ArrayIndexOutOfBoundsException in macro completion r=vlad20012 a=vlad20012 Possibly fixes this exception during macro completion: <details> <summary>Stacktrace</summary> ``` java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 256 at gnu.trove.TIntArrayList.get(TIntArrayList.java:234) at com.intellij.lang.impl.MarkerProduction.getStartMarkerAt(MarkerProduction.java:122) at com.intellij.lang.impl.PsiBuilderImpl.error(PsiBuilderImpl.java:889) at com.intellij.lang.impl.PsiBuilderAdapter.error(PsiBuilderAdapter.java:100) at com.intellij.lang.parser.GeneratedParserUtilBase.reportError(GeneratedParserUtilBase.java:807) at com.intellij.lang.parser.GeneratedParserUtilBase.reportFrameError(GeneratedParserUtilBase.java:825) at com.intellij.lang.parser.GeneratedParserUtilBase.enter_section_(GeneratedParserUtilBase.java:462) at com.intellij.lang.parser.GeneratedParserUtilBase.enter_section_(GeneratedParserUtilBase.java:454) at org.rust.lang.core.parser.RustParser.Expr(RustParser.java:6892) at org.rust.lang.core.macros.FragmentKind.parse(FragmentKind.kt:39) at org.rust.lang.core.macros.MacroGraphWalker.processMatcher(MacroGraphWalker.kt:99) at org.rust.lang.core.macros.MacroGraphWalker.run(MacroGraphWalker.kt:61) at org.rust.lang.core.completion.RsPartialMacroArgumentCompletionProvider.addCompletions(RsPartialMacroArgumentCompletionProvider.kt:55) at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:32) at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:155) at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:76) at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:154) at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:146) at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:142) at com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor$1.addCompletions(LiveTemplateCompletionContributor.java:88) at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:32) at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:155) at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:76) at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:59) at com.intellij.codeInsight.completion.CompletionService.performCompletion(CompletionService.java:132) at com.intellij.codeInsight.completion.BaseCompletionService.performCompletion(BaseCompletionService.java:36) at com.intellij.codeInsight.completion.CompletionProgressIndicator.lambda$calculateItems$10(CompletionProgressIndicator.java:854) at com.intellij.util.indexing.FileBasedIndex.lambda$ignoreDumbMode$0(FileBasedIndex.java:149) at com.intellij.util.indexing.FileBasedIndexImpl.ignoreDumbMode(FileBasedIndexImpl.java:650) at com.intellij.util.indexing.FileBasedIndex.ignoreDumbMode(FileBasedIndex.java:148) at com.intellij.codeInsight.completion.CompletionProgressIndicator.calculateItems(CompletionProgressIndicator.java:850) at com.intellij.codeInsight.completion.CompletionProgressIndicator.runContributors(CompletionProgressIndicator.java:838) at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.lambda$startContributorThread$6(CodeCompletionHandlerBase.java:352) at com.intellij.codeInsight.completion.AsyncCompletion.lambda$tryReadOrCancel$5(CompletionThreading.java:172) at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1110) at com.intellij.codeInsight.completion.AsyncCompletion.tryReadOrCancel(CompletionThreading.java:170) at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.lambda$startContributorThread$7(CodeCompletionHandlerBase.java:344) at com.intellij.codeInsight.completion.AsyncCompletion.lambda$startThread$0(CompletionThreading.java:95) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:170) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:629) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:581) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:157) at com.intellij.codeInsight.completion.AsyncCompletion.lambda$startThread$1(CompletionThreading.java:91) at com.intellij.util.RunnableCallable.call(RunnableCallable.java:20) at com.intellij.util.RunnableCallable.call(RunnableCallable.java:11) at com.intellij.openapi.application.impl.ApplicationImpl$1.call(ApplicationImpl.java:268) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665) at java.base/java.lang.Thread.run(Thread.java:834) ``` </details> 5863: Fix `invalidate caches / restart` on 203 r=vlad20012 a=vlad20012 Fixes this exception: <details> <summary>Stacktrace</summary> ``` java.lang.NoSuchMethodError: 'void com.intellij.util.io.PathKt.createFile(java.nio.file.Path)' at org.rust.lang.core.macros.MacroExpansionManager$Companion.invalidateCaches(MacroExpansionManager.kt:92) at org.rust.lang.core.macros.RsMacroExpansionCachesInvalidator.invalidateCaches(RsMacroExpansionCachesInvalidator.kt:13) at com.intellij.ide.actions.InvalidateCachesAction.actionPerformed(InvalidateCachesAction.java:91) at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:282) at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.lambda$actionPerformed$0(ActionMenuItem.java:311) at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:281) at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:77) at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:300) at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967) at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$0(ActionMenuItem.java:113) at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94) at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:113) at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:514) at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:36) at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:544) at java.desktop/java.awt.Component.processMouseEvent(Component.java:6654) at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345) at java.desktop/java.awt.Component.processEvent(Component.java:6419) at java.desktop/java.awt.Container.processEvent(Container.java:2263) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5029) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2773) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:973) at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:908) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:840) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:454) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:768) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:453) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:803) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:507) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) ``` </details> // do not mention in changelog since it's 203-related Co-authored-by: vlad20012 <beskvlad@gmail.com>

view details

Aleksei Trifonov

commit sha d8b18f7b954a449b3006fa38badf235fbb231bec

PRJ: Implement project generation with cargo-generate

view details

push time in 3 months

PR opened rust-lang/backtrace-rs

Delegate, don't duplicate

Duplication introduced in 4b8f2be2.

r? @alexcrichton cc @eggyal

+1 -10

0 comment

1 changed file

pr created time in 3 months

create barnchtamird/backtrace-rs

branch : dedup

created branch time in 3 months

Pull request review commentintellij-rust/intellij-rust

Fix compiler warnings

 class SourceFile(         checkIsSmartMode(project)          val isExpansionFile = MacroExpansionManager.isExpansionFile(file)-        val isIndexedFile = file.isValid && (-            FileBasedIndexScanRunnableCollector.getInstance(project).shouldCollect(file) || isExpansionFile)+        val isIndexedFile = file.isValid && (isExpansionFile || ProjectFileIndex.getInstance(project).let {

What's so bad about let? FWIW I'm not really sure the logic here is correct; I just copied what was being done in FileBasedIndexScanRunnableCollector.

tamird

comment created time in 3 months

Pull request review commentintellij-rust/intellij-rust

Fix compiler warnings

 import org.rust.lang.utils.evaluation.evaluate class RsErrorAnnotator : AnnotatorBase(), HighlightRangeExtension {     override fun isForceHighlightParents(file: PsiFile): Boolean = file is RsFile -    override fun annotateInternal(element: PsiElement, rawHolder: AnnotationHolder) {-        val holder = RsAnnotationHolder(rawHolder)-        val visitor = object : RsVisitor() {-            override fun visitBaseType(o: RsBaseType) = checkBaseType(holder, o)-            override fun visitCondition(o: RsCondition) = checkCondition(holder, o)-            override fun visitConstant(o: RsConstant) = checkConstant(holder, o)-            override fun visitTypeArgumentList(o: RsTypeArgumentList) = checkTypeArgumentList(holder, o)-            override fun visitValueParameterList(o: RsValueParameterList) = checkValueParameterList(holder, o)-            override fun visitValueArgumentList(o: RsValueArgumentList) = checkValueArgumentList(holder, o)-            override fun visitStructItem(o: RsStructItem) = checkDuplicates(holder, o)-            override fun visitEnumItem(o: RsEnumItem) = checkEnumItem(holder, o)-            override fun visitEnumVariant(o: RsEnumVariant) = checkEnumVariant(holder, o)-            override fun visitFunction(o: RsFunction) = checkFunction(holder, o)-            override fun visitImplItem(o: RsImplItem) = checkImpl(holder, o)-            override fun visitLabel(o: RsLabel) = checkLabel(holder, o)-            override fun visitLifetime(o: RsLifetime) = checkLifetime(holder, o)-            override fun visitModDeclItem(o: RsModDeclItem) = checkModDecl(holder, o)-            override fun visitModItem(o: RsModItem) = checkDuplicates(holder, o)-            override fun visitUseSpeck(o: RsUseSpeck) = checkUseSpeck(holder, o)-            override fun visitPatBox(o: RsPatBox) = checkPatBox(holder, o)-            override fun visitPatField(o: RsPatField) = checkPatField(holder, o)-            override fun visitPatBinding(o: RsPatBinding) = checkPatBinding(holder, o)-            override fun visitPatRest(o: RsPatRest) = checkPatRest(holder, o)-            override fun visitOrPat(o: RsOrPat) = checkOrPat(holder, o)-            override fun visitPath(o: RsPath) = checkPath(holder, o)-            override fun visitNamedFieldDecl(o: RsNamedFieldDecl) = checkDuplicates(holder, o)-            override fun visitRetExpr(o: RsRetExpr) = checkRetExpr(holder, o)-            override fun visitTraitItem(o: RsTraitItem) = checkDuplicates(holder, o)-            override fun visitTypeAlias(o: RsTypeAlias) = checkTypeAlias(holder, o)-            override fun visitTypeParameter(o: RsTypeParameter) = checkDuplicates(holder, o)-            override fun visitConstParameter(o: RsConstParameter) = checkConstParameter(holder, o)-            override fun visitLifetimeParameter(o: RsLifetimeParameter) = checkLifetimeParameter(holder, o)-            override fun visitVis(o: RsVis) = checkVis(holder, o)-            override fun visitVisRestriction(o: RsVisRestriction) = checkVisRestriction(holder, o)-            override fun visitUnaryExpr(o: RsUnaryExpr) = checkUnary(holder, o)-            override fun visitBinaryExpr(o: RsBinaryExpr) = checkBinary(holder, o)-            override fun visitExternCrateItem(o: RsExternCrateItem) = checkExternCrate(holder, o)-            override fun visitDotExpr(o: RsDotExpr) = checkDotExpr(holder, o)-            override fun visitYieldExpr(o: RsYieldExpr) = checkYieldExpr(holder, o)-            override fun visitArrayType(o: RsArrayType) = checkArrayType(holder, o)-            override fun visitArrayExpr(o: RsArrayExpr) = checkArrayExpr(holder, o)-            override fun visitVariantDiscriminant(o: RsVariantDiscriminant) = collectDiagnostics(holder, o)-            override fun visitPolybound(o: RsPolybound) = checkPolybound(holder, o)-            override fun visitTraitRef(o: RsTraitRef) = checkTraitRef(holder, o)-            override fun visitCallExpr(o: RsCallExpr) = checkCallExpr(holder, o)-            override fun visitBlockExpr(o: RsBlockExpr) = checkBlockExpr(holder, o)-            override fun visitBreakExpr(o: RsBreakExpr) = checkBreakExpr(holder, o)-            override fun visitContExpr(o: RsContExpr) = checkContExpr(holder, o)-            override fun visitAttr(o: RsAttr) = checkAttr(holder, o)-            override fun visitRangeExpr(o: RsRangeExpr) = checkRangeExpr(holder, o)-            override fun visitTraitType(o: RsTraitType) = checkTraitType(holder, o)-            override fun visitSelfParameter(o: RsSelfParameter) = checkParamAttrs(holder, o)-            override fun visitValueParameter(o: RsValueParameter) = checkParamAttrs(holder, o)-            override fun visitVariadic(o: RsVariadic) = checkParamAttrs(holder, o)-            override fun visitPatStruct(o: RsPatStruct) = checkRsPatStruct(holder, o)-            override fun visitPatTupleStruct(o: RsPatTupleStruct) = checkRsPatTupleStruct(holder, o)-            override fun visitStructLiteralField(o: RsStructLiteralField) = checkReferenceIsPublic(o, o, holder)-        }--        element.accept(visitor)+    override fun annotateInternal(element: PsiElement, holder: AnnotationHolder) {+        RsAnnotationHolder(holder).let {+            object : RsVisitor() {+                override fun visitBaseType(o: RsBaseType) = checkBaseType(it, o)+                override fun visitCondition(o: RsCondition) = checkCondition(it, o)+                override fun visitConstant(o: RsConstant) = checkConstant(it, o)+                override fun visitTypeArgumentList(o: RsTypeArgumentList) = checkTypeArgumentList(it, o)+                override fun visitValueParameterList(o: RsValueParameterList) = checkValueParameterList(it, o)+                override fun visitValueArgumentList(o: RsValueArgumentList) = checkValueArgumentList(it, o)+                override fun visitStructItem(o: RsStructItem) = checkDuplicates(it, o)+                override fun visitEnumItem(o: RsEnumItem) = checkEnumItem(it, o)+                override fun visitEnumVariant(o: RsEnumVariant) = checkEnumVariant(it, o)+                override fun visitFunction(o: RsFunction) = checkFunction(it, o)+                override fun visitImplItem(o: RsImplItem) = checkImpl(it, o)+                override fun visitLabel(o: RsLabel) = checkLabel(it, o)+                override fun visitLifetime(o: RsLifetime) = checkLifetime(it, o)+                override fun visitModDeclItem(o: RsModDeclItem) = checkModDecl(it, o)+                override fun visitModItem(o: RsModItem) = checkDuplicates(it, o)+                override fun visitUseSpeck(o: RsUseSpeck) = checkUseSpeck(it, o)+                override fun visitPatBox(o: RsPatBox) = checkPatBox(it, o)+                override fun visitPatField(o: RsPatField) = checkPatField(it, o)+                override fun visitPatBinding(o: RsPatBinding) = checkPatBinding(it, o)+                override fun visitPatRest(o: RsPatRest) = checkPatRest(it, o)+                override fun visitOrPat(o: RsOrPat) = checkOrPat(it, o)+                override fun visitPath(o: RsPath) = checkPath(it, o)+                override fun visitNamedFieldDecl(o: RsNamedFieldDecl) = checkDuplicates(it, o)+                override fun visitRetExpr(o: RsRetExpr) = checkRetExpr(it, o)+                override fun visitTraitItem(o: RsTraitItem) = checkDuplicates(it, o)+                override fun visitTypeAlias(o: RsTypeAlias) = checkTypeAlias(it, o)+                override fun visitTypeParameter(o: RsTypeParameter) = checkDuplicates(it, o)+                override fun visitConstParameter(o: RsConstParameter) = checkConstParameter(it, o)+                override fun visitLifetimeParameter(o: RsLifetimeParameter) = checkLifetimeParameter(it, o)+                override fun visitVis(o: RsVis) = checkVis(it, o)+                override fun visitVisRestriction(o: RsVisRestriction) = checkVisRestriction(it, o)+                override fun visitUnaryExpr(o: RsUnaryExpr) = checkUnary(it, o)+                override fun visitBinaryExpr(o: RsBinaryExpr) = checkBinary(it, o)+                override fun visitExternCrateItem(o: RsExternCrateItem) = checkExternCrate(it, o)+                override fun visitDotExpr(o: RsDotExpr) = checkDotExpr(it, o)+                override fun visitYieldExpr(o: RsYieldExpr) = checkYieldExpr(it, o)+                override fun visitArrayType(o: RsArrayType) = checkArrayType(it, o)+                override fun visitArrayExpr(o: RsArrayExpr) = checkArrayExpr(it, o)+                override fun visitVariantDiscriminant(o: RsVariantDiscriminant) = collectDiagnostics(it, o)+                override fun visitPolybound(o: RsPolybound) = checkPolybound(it, o)+                override fun visitTraitRef(o: RsTraitRef) = checkTraitRef(it, o)+                override fun visitCallExpr(o: RsCallExpr) = checkCallExpr(it, o)+                override fun visitBlockExpr(o: RsBlockExpr) = checkBlockExpr(it, o)+                override fun visitBreakExpr(o: RsBreakExpr) = checkBreakExpr(it, o)+                override fun visitContExpr(o: RsContExpr) = checkContExpr(it, o)+                override fun visitAttr(o: RsAttr) = checkAttr(it, o)+                override fun visitRangeExpr(o: RsRangeExpr) = checkRangeExpr(it, o)+                override fun visitTraitType(o: RsTraitType) = checkTraitType(it, o)+                override fun visitSelfParameter(o: RsSelfParameter) = checkParamAttrs(it, o)+                override fun visitValueParameter(o: RsValueParameter) = checkParamAttrs(it, o)+                override fun visitVariadic(o: RsVariadic) = checkParamAttrs(it, o)+                override fun visitPatStruct(o: RsPatStruct) = checkRsPatStruct(it, o)+                override fun visitPatTupleStruct(o: RsPatTupleStruct) = checkRsPatTupleStruct(it, o)+                override fun visitStructLiteralField(o: RsStructLiteralField) = checkReferenceIsPublic(o, o, it)+            }+        }.let(element::accept)

Well, initially I had a local variable here, but I ran into some version of this bug: https://youtrack.jetbrains.com/issue/KT-29595

The only way I could make it work was using this let form.

tamird

comment created time in 3 months

pull request commentintellij-rust/intellij-rust

Fix compiler warnings

(fixed now to stay compatible with 201)

tamird

comment created time in 3 months

push eventtamird/intellij-rust

Tamir Duberstein

commit sha 9ccf19b27e65ab624361b58d03cebb2da7d9cccf

Avoid deprecated DigestUtil function w: src/main/kotlin/org/rust/lang/core/macros/VfsInternals.kt: (45, 43): 'calculateContentHash(MessageDigest, ByteArray): ByteArray' is deprecated. Current implementation is very specific: it mixes length of the array to the hash. In general, it is enough to hash only bytes of the array. Implement the hashing yourself. Also make sure that you create new or reset the MessageDigest

view details

push time in 3 months

push eventtamird/intellij-rust

Tamir Duberstein

commit sha 7896fafd956ec999311a8c39409b1b8bed8ccf0e

Match supertype parameter names w: src/main/kotlin/org/rust/ide/annotator/RsErrorAnnotator.kt: (51, 56): The corresponding parameter in the supertype 'AnnotatorBase' is named 'holder'. This may cause problems when calling this function with named arguments. w: src/main/kotlin/org/rust/ide/spelling/RsSpellCheckerDictionaryGenerator.kt: (22, 39): The corresponding parameter in the supertype 'RsRecursiveVisitor' is named 'o'. This may cause problems when calling this function with named arguments.

view details

Tamir Duberstein

commit sha df5aa38fd016aebecddc32862bb62b6b7664c1ea

Avoid FileBasedIndexScanRunnableCollector w: src/main/kotlin/org/rust/lang/core/macros/ExpandedMacroStorage.kt: (25, 35): 'FileBasedIndexScanRunnableCollector' is deprecated. Deprecated in Java w: src/main/kotlin/org/rust/lang/core/macros/ExpandedMacroStorage.kt: (503, 13): 'FileBasedIndexScanRunnableCollector' is deprecated. Deprecated in Java w: src/main/kotlin/org/rust/lang/core/macros/ExpandedMacroStorage.kt: (503, 70): 'shouldCollect(VirtualFile): Boolean' is deprecated. Deprecated in Java

view details

push time in 3 months

push eventtamird/intellij-rust

Tamir Duberstein

commit sha adbde0b990da28e8f803f1e72842052d1d3add83

Avoid deprecated DigestUtil function w: src/main/kotlin/org/rust/lang/core/macros/VfsInternals.kt: (45, 43): 'calculateContentHash(MessageDigest, ByteArray): ByteArray' is deprecated. Current implementation is very specific: it mixes length of the array to the hash. In general, it is enough to hash only bytes of the array. Implement the hashing yourself. Also make sure that you create new or reset the MessageDigest

view details

Tamir Duberstein

commit sha 8cfe46ad7280f648d392d5834019bb7503bf1da9

Avoid FileBasedIndexScanRunnableCollector w: src/main/kotlin/org/rust/lang/core/macros/ExpandedMacroStorage.kt: (25, 35): 'FileBasedIndexScanRunnableCollector' is deprecated. Deprecated in Java w: src/main/kotlin/org/rust/lang/core/macros/ExpandedMacroStorage.kt: (503, 13): 'FileBasedIndexScanRunnableCollector' is deprecated. Deprecated in Java w: src/main/kotlin/org/rust/lang/core/macros/ExpandedMacroStorage.kt: (503, 70): 'shouldCollect(VirtualFile): Boolean' is deprecated. Deprecated in Java

view details

Tamir Duberstein

commit sha 3f4d280effb2ea795651f473d5a201147937b682

Match supertype parameter names w: src/main/kotlin/org/rust/ide/annotator/RsErrorAnnotator.kt: (51, 56): The corresponding parameter in the supertype 'AnnotatorBase' is named 'holder'. This may cause problems when calling this function with named arguments. w: src/main/kotlin/org/rust/ide/spelling/RsSpellCheckerDictionaryGenerator.kt: (22, 39): The corresponding parameter in the supertype 'RsRecursiveVisitor' is named 'o'. This may cause problems when calling this function with named arguments.

view details

push time in 3 months

push eventtamird/intellij-rust

vlad20012

commit sha 44e3375d83b2230e0a01e34587352a9a6211e859

TY: infer type parameters from assoc type bindings E.g. correctly infer `B` from `A: Foo` in this case: ``` trait Foo { type Item; } fn foo<A, B>(a: A) -> B where A: Foo<Item = B> ``` This fixes type inference for `Iterator.cloned()`

view details

bors[bot]

commit sha cf1fef617fbe6e91832a220561460fd3f0f97042

Merge #5841 5841: TY: infer type parameters from assoc type bindings r=mchernyavsky a=vlad20012 E.g. correctly infer `B` from `A: Foo` in this case: ```rust trait Foo { type Item; } fn foo<A, B>(a: A) -> B where A: Foo<Item = B> ``` Fixes #4505 type inference for `Iterator.cloned()` Co-authored-by: vlad20012 <beskvlad@gmail.com>

view details

Arseniy Pendryak

commit sha bf7a1f6ce2dccccd374b9dc4c233d9f6670919da

#5551: properly extract text from lifetimes for spellchecker

view details

Arseniy Pendryak

commit sha b35b2cef87f4bc6f9a308d1aebafcf6002b3aa50

T: use `RsInspectionsTestBase` for spell checker tests

view details

bors[bot]

commit sha 2d6ca5c974d8b3ced59af0e57b1923ed2ed753d0

Merge #5856 5856: Properly check spelling in lifetimes r=mchernyavsky a=Undin These changes fix text extraction from lifetime identifiers for spell checking and fix false-positive typo annotations in lifetimes like `'static` Fixes #5551 Co-authored-by: Arseniy Pendryak <a.pendryak@yandex.ru>

view details

Jakub Beránek

commit sha 1feac4e4afa39dc62f4615e56828f0d06d48e425

RUN: fold external stack traces

view details

bors[bot]

commit sha 74cdb9b1dfad8390e94b8051ba79cb147221a8f4

Merge #5747 5747: RUN: fold external stack traces r=undin a=Kobzol This PR adds folding for non-project related stacktraces: ![image](https://user-images.githubusercontent.com/4539057/87586389-c2b77b80-c6e0-11ea-9e98-9bc8f7b89801.png) The implementation needs some refactoring, I first wanted to do a sanity check if you think that this approach is valid. The console folder is a non-dynamic extension, is there a dynamic alternative? Related issue: https://github.com/intellij-rust/intellij-rust/issues/4514 Co-authored-by: Jakub Beránek <berykubik@gmail.com>

view details

Tamir Duberstein

commit sha 6e23ffc5823314b58e6d03118d0d821f50065b42

Match supertype parameter names w: src/main/kotlin/org/rust/ide/annotator/RsErrorAnnotator.kt: (51, 56): The corresponding parameter in the supertype 'AnnotatorBase' is named 'holder'. This may cause problems when calling this function with named arguments. w: src/main/kotlin/org/rust/ide/spelling/RsSpellCheckerDictionaryGenerator.kt: (22, 39): The corresponding parameter in the supertype 'RsRecursiveVisitor' is named 'o'. This may cause problems when calling this function with named arguments.

view details

Tamir Duberstein

commit sha 5ae004ed3e3fedd43552bb2b1c36ed3b092c5d29

Avoid deprecated DigestUtil function w: src/main/kotlin/org/rust/lang/core/macros/VfsInternals.kt: (45, 43): 'calculateContentHash(MessageDigest, ByteArray): ByteArray' is deprecated. Current implementation is very specific: it mixes length of the array to the hash. In general, it is enough to hash only bytes of the array. Implement the hashing yourself. Also make sure that you create new or reset the MessageDigest

view details

Tamir Duberstein

commit sha c1e16bc22c8a45c71586b3dfdc0849507aaef385

Avoid FileBasedIndexScanRunnableCollector w: src/main/kotlin/org/rust/lang/core/macros/ExpandedMacroStorage.kt: (25, 35): 'FileBasedIndexScanRunnableCollector' is deprecated. Deprecated in Java w: src/main/kotlin/org/rust/lang/core/macros/ExpandedMacroStorage.kt: (503, 13): 'FileBasedIndexScanRunnableCollector' is deprecated. Deprecated in Java w: src/main/kotlin/org/rust/lang/core/macros/ExpandedMacroStorage.kt: (503, 70): 'shouldCollect(VirtualFile): Boolean' is deprecated. Deprecated in Java

view details

push time in 3 months

delete branch tamird/intellij-rust

delete branch : deprecations

delete time in 3 months

PR opened intellij-rust/intellij-rust

Fix compiler warnings

Best to review commit-by-commit, since they each fix different issues.

With these changes, it is almost possible to set allWarningsAsErrors = true. Remaining warnings I didn't know how to fix:

w: src/main/kotlin/org/rust/ide/inspections/RsRedundantElseInspection.kt: (62, 24): 'patList: List<RsPat>?' is deprecated. Support `RsOrPat`
w: src/main/kotlin/org/rust/ide/inspections/checkMatch/CheckMatchUtils.kt: (46, 26): 'patList: List<RsPat>' is deprecated. Support `RsOrPat`
w: src/main/kotlin/org/rust/ide/inspections/checkMatch/RsMatchCheckInspection.kt: (53, 43): 'patList: List<RsPat>' is deprecated. Support `RsOrPat`
w: src/main/kotlin/org/rust/ide/inspections/checkMatch/RsMatchCheckInspection.kt: (62, 31): 'patList: List<RsPat>' is deprecated. Support `RsOrPat`
w: src/main/kotlin/org/rust/lang/core/cfg/CFGBuilder.kt: (175, 31): 'patList: List<RsPat>?' is deprecated. Support `RsOrPat`
w: src/main/kotlin/org/rust/lang/core/cfg/CFGBuilder.kt: (594, 17): 'patList: List<RsPat>' is deprecated. Support `RsOrPat`
w: src/main/kotlin/org/rust/lang/core/types/borrowck/ExprUseWalker.kt: (385, 31): 'patList: List<RsPat>?' is deprecated. Support `RsOrPat`
w: src/main/kotlin/org/rust/lang/core/types/borrowck/ExprUseWalker.kt: (447, 13): 'patList: List<RsPat>' is deprecated. Support `RsOrPat`
w: src/main/kotlin/org/rust/lang/core/types/borrowck/ExprUseWalker.kt: (452, 13): 'patList: List<RsPat>' is deprecated. Support `RsOrPat`

cc @Undin who introduced this (and fixed many instances) in d30be52fb5ca1ceddb907deb55ee8593948ccd89.

+81 -72

0 comment

7 changed files

pr created time in 3 months

create barnchtamird/intellij-rust

branch : warnings

created branch time in 3 months

create barnchtamird/intellij-rust

branch : deprecations

created branch time in 3 months

delete branch tamird/intellij-rust

delete branch : rustc-path-cargo

delete time in 3 months

delete branch tamird/intellij-rust

delete branch : kt-warning

delete time in 3 months

Pull request review commentintellij-rust/intellij-rust

[CARGO] Include RUSTC in environment

 class CargoTest : RsTestBase() {     fun `test run arguments preserved`() = checkCommandLine(         cargo.toColoredCommandLine(project, CargoCommandLine("run", wd, listOf("--bin", "parity", "--", "--prune", "archive"))), """         cmd: /usr/bin/cargo run --color=always --bin parity -- --prune archive-        env: RUST_BACKTRACE=short, TERM=ansi+        env: RUSTC=/usr/bin/rustc, RUST_BACKTRACE=short, TERM=ansi         """, """         cmd: C:/usr/bin/cargo.exe run --color=always --bin parity -- --prune archive-        env: RUST_BACKTRACE=short, TERM=ansi+        env: RUSTC=/usr/bin/rustc, RUST_BACKTRACE=short, TERM=ansi

Done, thanks!

tamird

comment created time in 3 months

push eventtamird/intellij-rust

Tamir Duberstein

commit sha c5119f72f6de4a1d6245e2cdc15cfae783b22394

[CARGO] Silence always-false condition warning w: intellij-rust/src/main/kotlin/org/rust/cargo/toolchain/Cargo.kt: (142, 13): Condition 'workspaceRoot == null' is always 'false'

view details

bors[bot]

commit sha f7735715f6fdc4552d693ea001336874d8dbc54b

Merge #5848 5848: [CARGO] Silence always-false condition warning r=mchernyavsky a=tamird w: intellij-rust/src/main/kotlin/org/rust/cargo/toolchain/Cargo.kt: (142, 13): Condition 'workspaceRoot == null' is always 'false' Co-authored-by: Tamir Duberstein <tamird@gmail.com>

view details

Tamir Duberstein

commit sha 5c372a72655f784daeb98ba5bbd71582cb99ba47

[CARGO] Include RUSTC in environment Fixes #5843.

view details

push time in 3 months

issue commentintellij-rust/intellij-rust

toolchain location not included in PATH passed to cargo

@Kobzol thanks. I've sent a PR to try to solve this more generally.

tamird

comment created time in 3 months

PR opened intellij-rust/intellij-rust

[CARGO] Include RUSTC in environment

Fixes #5843.

+21 -20

0 comment

4 changed files

pr created time in 3 months

PR opened intellij-rust/intellij-rust

[CARGO] Silence always-false condition warning

w: intellij-rust/src/main/kotlin/org/rust/cargo/toolchain/Cargo.kt: (142, 13): Condition 'workspaceRoot == null' is always 'false'

+2 -1

0 comment

2 changed files

pr created time in 3 months

push eventtamird/intellij-rust

Tamir Duberstein

commit sha 11f527d535383fa980348aa8422f1358b2e9a4d9

[CARGO] Include RUSTC in environment Fixes #5843.

view details

push time in 3 months

push eventtamird/intellij-rust

Tamir Duberstein

commit sha c5119f72f6de4a1d6245e2cdc15cfae783b22394

[CARGO] Silence always-false condition warning w: intellij-rust/src/main/kotlin/org/rust/cargo/toolchain/Cargo.kt: (142, 13): Condition 'workspaceRoot == null' is always 'false'

view details

push time in 3 months

push eventtamird/intellij-rust

Tamir Duberstein

commit sha fc6ab6c6afe8d407be03689a8a5465671195838c

[CARGO] Silence always-false condition warning w: intellij-rust/src/main/kotlin/org/rust/cargo/toolchain/Cargo.kt: (142, 13): Condition 'workspaceRoot == null' is always 'false'

view details

push time in 3 months

push eventtamird/intellij-rust

Tamir Duberstein

commit sha a55ed9406470521f05fa7be7591dcf7f476d9f73

[CARGO] Include RUSTC in environment Fixes #5843.

view details

push time in 3 months

create barnchtamird/intellij-rust

branch : rustc-path-cargo

created branch time in 3 months

create barnchtamird/intellij-rust

branch : kt-warning

created branch time in 3 months

fork tamird/intellij-rust

Rust plugin for the IntelliJ Platform: https://intellij-rust.github.io/

fork in 3 months

issue commentintellij-rust/intellij-rust

toolchain location not included in PATH passed to cargo

@mchernyavsky thanks for the response! I think that setting only affects my configurations. This bug is about the plugin itself attempting to invoke cargo and failing. My event log still shows:

6:58 PM	Cargo project update failed:
							Execution failed (exit code 101).
							        /usr/local/google/home/tamird/src/fuchsia/prebuilt/third_party/rust/linux-x64/bin/cargo metadata --verbose --format-version 1 --all-features
							        stdout : error: could not execute process `rustc -vV` (never executed)
							
							Caused by:
							  No such file or directory (os error 2)
							
							        stderr : 

tamird

comment created time in 3 months

issue openedintellij-rust/intellij-rust

toolchain location not included in PATH passed to cargo

Hello! We are big fans of this plugin in Fuchsia.

In Fuchsia, we use self-contained rust toolchains, which means that our cargo, rustc, etc. are not usually in our PATH. This seems to be a problem for this plugin because cargo is executed with intellij's PATH, and is then unable to find rustc.

Would it be possible to execute cargo with the toolchain location (specified in the plugin's settings) appended to PATH?

cc @brunowonka

created time in 3 months

more