Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp655634pxb; Fri, 16 Apr 2021 15:00:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwzzlAJ166LOfL0HQG6tdYxmn1GMHs6OhPSZK1gkixRdtIlM7bRC3PjBpPMLwsKD7mOpUl X-Received: by 2002:a17:90b:88f:: with SMTP id bj15mr12009513pjb.147.1618610446096; Fri, 16 Apr 2021 15:00:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618610446; cv=none; d=google.com; s=arc-20160816; b=culqQm9C9zCZvJNOkJMBW9CTh9oVo8m6zS/LuRJrP8JbKxAPpUBKeDQqBVsOqxGb/Y RViLQKQMVLFmqnhBQpDbPWRP08aowNC0I1XK7nWsgUaJjtXowtsGy6/gs+WU3Jf9aK77 96KJ1Qxsx7hV2kdH+CP4H78AQPI/uWapM+GFhHfvaUwwsXdpgRpcX2AuhiIJznCGjq+4 K/eI3ZHUZ+bXjbkaFi0JbN2eWSnnGxFIW+I/nAXCdV6A891vN6ArnDwpGLEWm1cQr1su w8htHvNJYLQpCdZNW4UCEObbBRfXRQFNC4NnO6c+Ono1hvOEzPgrJxU8DQCAUh2BhCxo /KpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=cnQ1WYK1Q/fzVZJP5dTDD7O6rnfjXe0Zb86HEbMOmAg=; b=KoaJ+URygfrxGbX7/9l3DcSa0XKhVxETjrSj4r6h1FJ9Nd2BGolEKRbqFiGQYL5KJF 8uHlwiIGWTUSbqZ1Dzybz6V5Qrhr71bBPB2YE4kyGQQHfVSNop8BuLPPm3ZjnG7Eowhg DOuqCZV2d8EyazIWWIvA5Dd+vMJNGK/f2IPuCKXSKW/JjrVnV0cxyAfbsnKFQUTcp3ad IDBH0papS/A9Lc7ZNEEAliCy8NUFOhaPL0irr+vea/AkZXWPztaMCN91wQSwlGhib3L5 VpBt+w6wjb1XY73HU/j9PwYgqWOZysgoW+hBHGbwjR4VMs43ZSFGUx8mJrQnB3DjWspV AB1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=E628u2pW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d21si411685pfv.143.2021.04.16.15.00.34; Fri, 16 Apr 2021 15:00:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=E628u2pW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343549AbhDPUfW (ORCPT + 99 others); Fri, 16 Apr 2021 16:35:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:54910 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343509AbhDPUfW (ORCPT ); Fri, 16 Apr 2021 16:35:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618605296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cnQ1WYK1Q/fzVZJP5dTDD7O6rnfjXe0Zb86HEbMOmAg=; b=E628u2pWL3sHBsPhpu04Pq8htTzbljPYFYunrFBs2C1RVE/LckwTQFF7uFDzO/C4nqYvWq HtE1Hzhf74VXRrdmOBClEwR1CpmEplP6Y7F2vT0xp7akT61qsZ7gfjyLMY2r8dpomvv/UR xNBIAALROvwMrp5BhiSrzbBAf6UzvXo= Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-314-JAAQf8rROv6zZbi-RCe4mg-1; Fri, 16 Apr 2021 16:34:53 -0400 X-MC-Unique: JAAQf8rROv6zZbi-RCe4mg-1 Received: by mail-ot1-f71.google.com with SMTP id i19-20020a0568300113b02902907bfc618fso1807911otp.8 for ; Fri, 16 Apr 2021 13:34:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=cnQ1WYK1Q/fzVZJP5dTDD7O6rnfjXe0Zb86HEbMOmAg=; b=mS5ojYcrkKEY42tRXCxDSdVsR53jhKCbOfNTpcpak+4ILEkG5sQRZ4/tQ2aUnI41B9 7+rbQnz1rHEPceKtd3yYUB0k32vvDaHd0t/bKHlflLgDZHT36uaNcM46Ade8O72De4A5 wxsg+nV7rlmAqeQXJsFVU+ZsX+5RVjgcY1jmxvf7XrvHCWQTzPND4wW8yssM6vRdJ3zn XB3NBZ9reZJom1rrDU6EF90Ly/UsIZhiqJelI4aavGkLhi4edct6kd2gUmSu/DbS8VUn lSD0TM8SPj+gKbCquNtsZl8QtFhkqAUA42iBk+ZbbGL8QJd8dhUjqWKgbXVVY0ZaV47K 3Qnw== X-Gm-Message-State: AOAM530Y7KvdixFMv8+mIC56v0BQCjdmYy3fdCL2BykVFI17m9OO5saZ u561FbtK147hmGqgYH+EIlrx8Zak2OsM/9PB+UkojvMxGdr0uDFG87x5+GHezcQQaPskxZZteb2 KaXFjk8qs+qnkfbmLUcIxDBer X-Received: by 2002:a05:6808:c7:: with SMTP id t7mr1055081oic.43.1618605292401; Fri, 16 Apr 2021 13:34:52 -0700 (PDT) X-Received: by 2002:a05:6808:c7:: with SMTP id t7mr1055071oic.43.1618605292143; Fri, 16 Apr 2021 13:34:52 -0700 (PDT) Received: from [192.168.0.173] (ip68-103-222-6.ks.ok.cox.net. [68.103.222.6]) by smtp.gmail.com with ESMTPSA id c21sm1431581ooa.48.2021.04.16.13.34.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 16 Apr 2021 13:34:51 -0700 (PDT) Subject: Re: [PATCH 04/13] Kbuild: Rust support To: Willy Tarreau , Miguel Ojeda Cc: Al Viro , Linus Torvalds , Peter Zijlstra , Miguel Ojeda , Greg Kroah-Hartman , rust-for-linux@vger.kernel.org, Linux Kbuild mailing list , "open list:DOCUMENTATION" , Linux Kernel Mailing List , Alex Gaynor , Geoffrey Thomas , Finn Behrens , Adam Bratschi-Kaye , Wedson Almeida Filho , Michael Ellerman References: <20210414184604.23473-1-ojeda@kernel.org> <20210414184604.23473-5-ojeda@kernel.org> <20210416202215.GA11236@1wt.eu> From: Connor Kuehl Message-ID: Date: Fri, 16 Apr 2021 15:34:50 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210416202215.GA11236@1wt.eu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/16/21 3:22 PM, Willy Tarreau wrote: > So it simply does the equivalent of: > > #define EINVAL -1234 > > struct result { > int status; > int error; > }; Result and Option types are more like a union with a tag that describes which variant it is. struct foo_result { /* if ok, then access foo_or_err.successful_foo * else, access foo_or_err.error */ bool ok; union { struct foo successful_foo; int error; } foo_or_err; }; > [..] > > So it simply returns a pair of values instead of a single one, which It will only return 1 value.