From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vs1-f49.google.com (mail-vs1-f49.google.com [209.85.217.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5015472 for ; Thu, 8 Jul 2021 14:34:00 +0000 (UTC) Received: by mail-vs1-f49.google.com with SMTP id h18so3719447vsj.2 for ; Thu, 08 Jul 2021 07:34:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6Aw6+wOSpEBTOQmf2v8zIVoHZ9gWqXZZDgzXue8OGdo=; b=bY5iXz2I7UHdWZihN4weOJQUBwcgL+pTrdI9uIS1x57ksLdiQ1AZUEJPclD7QfnjRk r9TJoP1LkxTFjFx/48kfty+wwKjBXOCcqqO77n3k2It1xJNYkcXyLZ8bueZ0PwKvrTZg mzaLnpjhkqlMD22ASjYDzZq2GgQnXquG2Y9/LmZqK2GbQBqnggc7Y/uS0F9Qz43FtUd0 DQcdJvaYjGcrj26Nlv8e0MkWgfbbehuWpxACQdOsBf0xBvnF8DqVAuXNa9Hi+rHkoNve FOouXGGGUoe0NIQgpmYHjmVJbmM3Chi2RGtY1ALTfMPhBihR3Z4FTyw5q+UDuXcxvVpL ugSQ== X-Gm-Message-State: AOAM532UbhzHiFbzOQsEkW1YdIGHppyAyHph3w9JHxx66f4sOHyW7P63 i7JprE2V7SJhi4dnjc+s4WuwNQY7qB8bwUuM+NA= X-Google-Smtp-Source: ABdhPJzacLYftKFNpqsApc/xcMBjcopP2t0lmRE/Wv7pkbZRqiaHGaWbWB19CL7PRhwzBNOFG6rfxJ89N5Z4XxBT4Zk= X-Received: by 2002:a67:d012:: with SMTP id r18mr20760051vsi.3.1625754839423; Thu, 08 Jul 2021 07:33:59 -0700 (PDT) Precedence: bulk X-Mailing-List: ksummit@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <1f2a62c19845e4602817c2130d47bbea02d04d1d.camel@HansenPartnership.com> <20210707203827.GI18396@quack2.suse.cz> In-Reply-To: From: Geert Uytterhoeven Date: Thu, 8 Jul 2021 16:33:48 +0200 Message-ID: Subject: Re: [TECH TOPIC] Rust for Linux To: Miguel Ojeda Cc: Wedson Almeida Filho , Jan Kara , Greg KH , James Bottomley , Julia Lawall , Laurent Pinchart , Linus Walleij , Roland Dreier , ksummit@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Hi Miguel, On Thu, Jul 8, 2021 at 4:28 PM Miguel Ojeda wrote: > On Thu, Jul 8, 2021 at 4:18 PM Geert Uytterhoeven wrote: > > Let's assume the caller access a member of the object regardless. > > What happens? > > That is the key: they cannot access it to begin with because the > returned `Option` is empty, so there is not even an object you can > "access", thus asking "what happens?" does not have a meaning. > > In code: > > pub fn f(weak: Weak) { > let strong = weak.upgrade(); > > if let Some(content) = strong { > println!("{}", content); > } > > // There is no `content` here, so you cannot do anything with it What if I would ignore that? I.e. let Some(content) = strong; println!("{}", content); ? Please forgive my silly questions, I'm a Rust newbie ;-) > } Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds