Michael Matloob
7afe17bbdb
[release-branch.go1.23] go/types, types2: use max(fileVersion, go1.21) if fileVersion present
...
Change the rules for how //go:build "file versions" are applied: instead
of considering whether a file version is an upgrade or downgrade from
the -lang version, always use max(fileVersion, go1.21). This prevents
file versions from downgrading the version below go1.21. Before Go 1.21
the //go:build version did not have the meaning of setting the file's
langage version.
This fixes an issue that was appearing in GOPATH builds: Go 1.23.0
started providing -lang versions to the compiler in GOPATH mode (among
other places) which it wasn't doing before, and it set -lang to the
toolchain version (1.23). Because the -lang version was greater than
go1.21, language version used to compile the file would be set to the
//go:build file version. //go:build file versions below 1.21 could cause
files that could previously build to stop building.
For example, take a Go file with a //go:build line specifying go1.10.
If that file used a 1.18 feature, that use would compile fine with a Go
1.22 toolchain. But it would produce an error when compiling with the
1.23.0 toolchain because it set the language version to 1.10 and
disallowed the 1.18 feature. This breaks backwards compatibility: when
the build tag was added, it did not have the meaning of restricting the
language version.
For #68658
Fixes #69094
Change-Id: I6cedda81a55bcccffaa3501eef9e2be6541b6ece
Reviewed-on: https://go-review.googlesource.com/c/go/+/607955
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Robert Griesemer <gri@google.com >
(cherry picked from commit aeac0b6cbf )
Reviewed-on: https://go-review.googlesource.com/c/go/+/608935
2024-08-28 15:43:17 +00:00
..
2022-09-27 21:10:19 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-11-20 18:09:45 +00:00
2023-01-09 15:34:31 +00:00
2022-11-08 21:26:09 +00:00
2022-11-17 18:31:28 +00:00
2023-02-09 15:21:37 +00:00
2023-03-01 20:26:10 +00:00
2023-05-05 21:04:28 +00:00
2023-06-23 14:29:16 +00:00
2023-09-11 16:02:11 +00:00
2024-02-28 05:32:14 +00:00
2023-03-28 18:13:13 +00:00
2023-03-28 14:28:33 +00:00
2023-03-28 18:13:13 +00:00
2023-03-28 18:13:13 +00:00
2023-03-28 18:13:13 +00:00
2023-03-28 18:13:13 +00:00
2023-03-28 18:13:13 +00:00
2023-03-28 14:28:33 +00:00
2023-03-28 18:13:13 +00:00
2022-09-29 14:21:33 +00:00
2022-09-23 20:27:09 +00:00
2023-10-19 23:33:25 +00:00
2023-03-27 18:59:51 +00:00
2023-03-28 14:28:33 +00:00
2022-09-27 21:59:19 +00:00
2023-10-19 23:33:25 +00:00
2022-09-27 21:10:19 +00:00
2023-10-19 23:33:25 +00:00
2024-04-09 16:41:23 +00:00
2022-09-28 22:28:39 +00:00
2023-12-19 04:39:56 +00:00
2022-09-23 20:27:09 +00:00
2022-09-27 21:10:19 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2023-10-19 23:33:25 +00:00
2023-06-21 21:30:46 +00:00
2023-10-20 03:00:06 +00:00
2023-10-20 03:00:06 +00:00
2022-09-23 20:27:09 +00:00
2023-10-19 23:33:25 +00:00
2022-09-23 20:27:09 +00:00
2022-09-28 22:28:39 +00:00
2023-03-27 18:59:51 +00:00
2023-10-19 23:33:25 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-29 14:21:33 +00:00
2022-09-29 14:21:33 +00:00
2022-09-29 14:21:33 +00:00
2022-09-29 14:21:33 +00:00
2022-09-29 14:21:33 +00:00
2023-09-14 19:43:26 +00:00
2022-09-29 14:21:33 +00:00
2023-05-24 21:55:14 +00:00
2023-10-19 23:33:25 +00:00
2023-03-28 14:28:33 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2024-05-30 19:19:55 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2022-09-27 21:10:19 +00:00
2022-09-27 21:10:19 +00:00
2023-09-08 18:50:24 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2024-03-27 18:39:06 +00:00
2023-10-19 23:33:25 +00:00
2023-12-19 04:39:56 +00:00
2023-10-19 23:33:25 +00:00
2022-09-27 21:59:09 +00:00
2022-09-28 22:28:39 +00:00
2023-01-11 22:29:34 +00:00
2022-09-27 21:59:19 +00:00
2022-09-27 21:10:19 +00:00
2023-03-28 22:22:08 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2022-09-27 21:59:09 +00:00
2023-10-19 23:33:25 +00:00
2023-04-11 20:56:32 +00:00
2022-09-27 21:10:19 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2024-05-30 19:19:55 +00:00
2024-05-30 19:19:55 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2024-02-07 16:41:56 +00:00
2022-09-23 20:27:09 +00:00
2022-09-23 20:27:09 +00:00
2022-09-27 21:10:19 +00:00
2022-09-27 21:10:19 +00:00
2024-05-30 19:19:55 +00:00
2023-10-19 23:33:25 +00:00
2022-09-29 14:21:33 +00:00
2023-10-19 23:33:25 +00:00
2022-09-27 21:59:09 +00:00
2023-08-17 19:36:58 +00:00
2023-10-19 23:33:25 +00:00
2024-02-07 16:41:56 +00:00
2023-10-19 23:33:25 +00:00
2022-09-28 22:28:41 +00:00
2024-05-30 19:19:55 +00:00
2023-10-19 23:33:25 +00:00
2024-05-30 19:19:55 +00:00
2023-04-19 14:07:00 +00:00
2023-04-19 14:07:00 +00:00
2023-10-19 23:33:25 +00:00
2023-08-17 19:37:04 +00:00
2023-04-14 16:55:22 +00:00
2024-02-28 02:54:13 +00:00
2023-12-14 17:22:18 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2024-05-30 19:19:55 +00:00
2023-10-19 23:33:25 +00:00
2023-11-20 15:12:49 +00:00
2023-11-20 15:12:49 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2022-09-29 14:21:33 +00:00
2023-10-19 23:33:25 +00:00
2023-01-25 21:16:32 +00:00
2023-10-19 23:33:25 +00:00
2023-10-19 23:33:25 +00:00
2022-09-29 14:21:33 +00:00
2023-03-28 14:28:33 +00:00
2023-03-28 18:13:13 +00:00
2022-09-24 17:04:15 +00:00
2023-03-27 18:59:51 +00:00
2023-09-11 20:12:05 +00:00
2023-10-19 23:33:25 +00:00
2024-02-09 17:21:38 +00:00
2023-10-18 16:32:07 +00:00
2022-09-23 20:27:09 +00:00
2023-05-25 21:37:01 +00:00
2023-01-25 21:16:32 +00:00
2023-01-28 04:29:02 +00:00
2024-07-03 13:03:08 +00:00
2022-09-30 20:04:54 +00:00
2023-03-28 20:27:13 +00:00
2022-11-03 20:35:31 +00:00
2022-11-21 20:15:23 +00:00
2022-10-10 21:39:15 +00:00
2022-10-10 21:47:48 +00:00
2022-10-12 00:12:53 +00:00
2022-10-20 21:52:09 +00:00
2022-11-08 21:26:09 +00:00
2022-11-15 17:35:03 +00:00
2022-11-17 19:55:28 +00:00
2022-11-18 13:26:33 +00:00
2023-04-14 17:57:36 +00:00
2023-12-14 17:22:18 +00:00
2022-11-30 17:46:51 +00:00
2022-11-30 17:46:51 +00:00
2022-12-09 21:38:33 +00:00
2022-12-14 20:37:17 +00:00
2023-01-17 22:13:42 +00:00
2023-01-18 01:27:21 +00:00
2023-01-17 18:21:06 +00:00
2023-06-01 19:29:08 +00:00
2023-02-08 22:31:12 +00:00
2023-02-09 09:33:47 +00:00
2023-02-06 20:39:54 +00:00
2023-02-06 20:39:54 +00:00
2023-03-03 16:35:00 +00:00
2023-03-03 16:35:00 +00:00
2023-02-08 02:44:20 +00:00
2023-02-09 15:21:37 +00:00
2023-02-13 21:28:54 +00:00
2023-02-07 20:59:40 +00:00
2023-04-14 17:57:36 +00:00
2023-03-01 20:26:10 +00:00
2023-02-17 03:59:20 +00:00
2023-05-18 00:35:53 +00:00
2023-03-07 21:29:30 +00:00
2023-03-22 18:56:30 +00:00
2023-03-22 16:43:10 +00:00
2023-03-27 16:52:49 +00:00
2023-03-28 19:55:43 +00:00
2023-03-31 23:25:07 +00:00
2023-05-03 22:12:27 +00:00
2023-04-07 21:11:29 +00:00
2023-04-05 17:48:15 +00:00
2023-04-07 15:07:18 +00:00
2023-04-07 15:07:18 +00:00
2023-04-08 05:25:04 +00:00
2023-04-12 19:28:47 +00:00
2023-04-12 19:28:47 +00:00
2023-05-05 21:04:28 +00:00
2023-05-05 21:04:38 +00:00
2023-05-05 21:04:28 +00:00
2023-06-05 03:11:36 +00:00
2023-06-15 18:41:09 +00:00
2023-06-23 14:29:16 +00:00
2023-06-28 16:07:47 +00:00
2023-06-27 18:18:23 +00:00
2023-06-26 17:08:05 +00:00
2023-07-10 16:31:54 +00:00
2023-07-10 16:29:42 +00:00
2023-08-07 03:12:29 +00:00
2023-08-09 16:43:33 +00:00
2023-08-09 19:30:45 +00:00
2023-08-16 15:40:52 +00:00
2023-08-25 16:10:03 +00:00
2023-08-28 14:32:14 +00:00
2023-08-30 15:15:28 +00:00
2023-09-07 15:14:39 +00:00
2023-09-11 16:02:11 +00:00
2023-09-11 20:48:07 +00:00
2023-10-05 19:44:52 +00:00
2023-10-08 23:15:25 +00:00
2023-10-09 22:23:06 +00:00
2024-08-28 15:43:17 +00:00
2024-08-28 15:43:17 +00:00
2023-10-10 16:50:46 +00:00
2023-10-12 00:48:31 +00:00
2023-10-31 20:45:54 +00:00
2023-11-07 17:37:47 +00:00
2023-12-05 22:06:07 +00:00
2023-12-05 22:06:07 +00:00
2023-12-08 00:29:01 +00:00
2023-12-15 19:35:21 +00:00
2023-12-15 19:35:21 +00:00
2023-12-21 00:15:58 +00:00
2024-07-16 16:43:30 +00:00
2024-02-20 22:29:14 +00:00
2024-02-27 21:07:10 +00:00
2024-03-01 01:40:00 +00:00
2024-03-02 14:01:52 +00:00
2024-05-16 01:45:48 +00:00
2024-02-28 05:32:14 +00:00
2024-02-29 18:30:40 +00:00
2024-03-12 19:38:41 +00:00
2024-03-20 17:35:29 +00:00
2024-03-08 02:00:33 +00:00
2024-03-14 22:47:28 +00:00
2024-03-28 22:06:51 +00:00
2024-03-28 22:06:51 +00:00
2024-04-02 17:16:14 +00:00
2024-07-16 16:43:30 +00:00
2024-05-15 15:09:14 +00:00
2024-05-20 20:44:21 +00:00
2024-05-06 15:34:04 +00:00
2024-07-03 18:07:19 +00:00
2024-05-08 17:09:06 +00:00
2024-06-20 16:46:54 +00:00
2024-06-28 15:25:43 +00:00
2024-07-05 10:45:32 +00:00
2024-07-10 03:19:58 +00:00
2024-07-22 15:45:09 +00:00
2024-07-19 19:51:57 +00:00
2024-07-26 16:35:29 +00:00